This Python application is a personality test deriving from Japanese culture, and this link inspired this application. Terminal runs on Heroku, a container-based cloud Platform as a Service (PaaS).
The image of the Welcome page
As user is describing and probably using spaces, the applicaton allows for commas/dots/other symbols as inputs to make it more personalized for users. Only at description inputs. Steps are as follows:
- Welcome is displayed, user is asked for a name to start. The welcome page is presenting the test, without too many details, asking for the name. It is part of the mystery, so curiosity is sparkled.
- After user enters the name, users are greeted back and encouraged to be creative and take time to describe objects. As the name contains a word 'test', I wanted to assure the users mentioning that all answers are right, so they feel free to describe in greater details.
- Choosing 'a' to start, 'b' to read about, and 'q' to quit. If chosen 'q', users exit the application with appropriate 'Goodbye' message, if chosen to see informations about the test, users can read a bit more, and after reading about the application, users are asked to try the test or not; if not, the users exit the test with appropriate message displayed. If chosen to try it, user starts with first object, the cube.
- Describing the objects - 5 different objects, starting from the cube, to be described, then a horse, then the flowers and lastly, a thunderstorm. Users are asked to describe in detail what do they imagine, what kind of setting they imagine, position and the relation between objects if there is any.
- After describing every object, user is offered to read about the interpretation of every object. If not wanting to read at that moment, user can choose 'n' to exit or read about every object and what does it represent, also after reading interpretations, user can start the test again by entering 'y' or exit by just pressing 'Enter'.
- I want the User to easily understand and navigate through the test
- I want the User to be able to start/quit the app and get information about the game
- I want the User to be able to write the description of objects
- I want User to have the responses displayed after the user input
- I want User to be notified when the empty space that he inputs is not supported and prompted with an appropriate message
- I want the User to be given another chance to put information for description if nothing entered
- I want the User to be able to stop the test from asking, and exit with a greeting
- I want the User to have fun, get personal and have a positive experience
- To entertain users by inspiring them to know themselves better
- To offer user a display of their description
- To be able to guide users and collect their descriptions and a name
- To be able to display a personality test in a fun way to users
- To inspire people to love themselves more by paying more attention to their thoughts
Display of the starting idea flowchart for this application
Choosing option 'b' it displays some information about this test, to sparkle imagination
Entered test - First object - user is asked to describe
Second object - Ladder - user is asked to describe
Third object - Horse - user is asked to describe
Fourth object - Flowers - user is asked to describe
Fifth object - Thunderstorm - user is asked to describe
After writing out descriptions, user can see the interpretations of their objects one by one, navigating by pressing 'Enter' Interpretation - Cube
Interpretation - Ladder
Interpretation - Horse
Interpretation - Flowers
Interpretation - Thunderstorm
Goodbye message
I was trying using global variables for storing user_answer_first/second/third/fourth/fifth and placing them inside another function using conditional if/else
for checking existence. Then, declaring certain input as True
and call the belonging variable to print it out within a formatted text containing that variable. However, it kept returning 'user_answer_first - variable not defined',so I tried putting it in snake case and/or capital case and/or mentioning keyword global
in a couple of places and combinations. It kept displaying the error so at the moment, this was put aside as a future feature.
I would also like this app to be able to generate the whole separate document with answers and interpretations together for users so they could print it and keep a hard copy if they would like. When doing this test periodically users can compare how they evolve according to their answers in different stages of life. More work on graphic display for the future features, also an idea.
Pure Python and python libraries as os
and sys
are used to create this application. It is made for a user to interact by writing down user name, descriptions and navigate using keyboard, mostly 'y/n' options.
The flow of functions is relevant as the goal is for the user to control to start playing this test or exit the test.
ASCII visual display is used in a print() function with r
(raw) before triple quotes, as well as conditionals, nested conditionals, a for
loop, checking input by calling lower()
for to be accepted any letter, regardless of capitalization.
At the name input, it is checked with a function isalpha()
, accepting one word only. It is created to be entertaining and practical for users to use.
I have manually tested this application by doing the following:
- Passed the code through PEP8 linter and confirmed there is no issues
- Given empty space as input, when characters are expected
- Given wrong letter when specific letter is expected
- Tested in my local terminal and the Code Institute Heroku terminal
The link to images and more details on all testing is here
- GitHub - used for secure storage of code online
- Git - used for version control
- Python - Python is used for creating this application
In order to make a local copy of this project, you can clone it using the following link in an IDE terminal of your choice:
git clone https://github.com/totalnoMartina/cube-discovery.git
Alternatively, if using Gitpod, you can click below to create your own workspace using this repository.
This project was deployed using Code Institute's Python mock terminal for Heroku
The steps are as follows:
- If not having a 'Heroku' account, create one by clicking here and follow instructions until you confirm with your email that the account is created
- Create a new app, by clicking 'New' in the top right section of the welcome page
- Choose a name for your new application and select your region
- Go to 'Deploy' tab and select 'GitHub' as deployment method
- Locate your repository on 'Github', then select 'connect repository'
- Enable automatic deployments, then go to the Settings_ tab, and add two buildpacks in this exact order;
heroku/python
heroku/nodejs
A new Config Var was also added and named PORT
, set to 8000
, before clicking the deploy branch, so this is also a requirement to be able to view your site live.
The italics code were found in this link
The code for prompt asking user for a name is found here
The ladder have special characters and were found here
Most of the art, like the horse, comes from this webpage here
The ascii art for the frame of the 'about' text is found here
The code for clearing the screen before moving on to next object is here
The help to find a list of functions is found on this link
The frame for interpretations are found here
Code Institute mentor, Tim Nelson is huge help and guidance, helping me and directing my ideas toward real goal to be accomplished through creating this app. I was unsure on how to start and I had perfect guidance. My friends tested the app a few times, Slack channel for #peer-review-code also helped with feedbacks.