Giter VIP home page Giter VIP logo

soconne338-project3's Introduction

Story Vault - A Selection of stories for your Enjoyment

View the live project here

responsive image

This image is from Am I responsive

Intro

This Story-Vault is a command-line based application which allows the user to choose from a selection of stories using the input keyboard. The app was created so the user can use a variety of different nouns and verbs to create a story. The story is extremely user friendly and is aimed at adults and children who are able to read (6 years +)

UX

The program was created with simplicity in mind. the only thing the user has to do is input their name, numbers 1-4 and yes/no. This means that it 's user friendly to anyone who can read and type English.

Ideal Client

The ideal client for this program is:

  1. Someone who is English speaking with full literacy skills
  2. Someone who likes to read
  3. Someone who enjoys an interactive experience
  4. Someone young

User Stories

  1. 38F - I found the program quite interesting and I liked the selection of stories available.
  2. 9M - I would love to have an option to create a game by choosing the words. The jokes were funny
  3. 60F - I loved using the program and it left a smile on my face. Nice and easy to use and the jokes were hillarious

Skeleton

The program was outputted as a terminal therefore it's a single page application. Python was used to generate the data and stories. I have included a flow-chart to illustrate the program's process.

flowchart of python program

Scope

To achieve the goal of the project I included the following:

  1. A list of 3 stories and a selection of jokes
  2. A personal greeting at the beginning
  3. The user can choose another story after choosing variables for the current story
  4. The option to end the program at any time.

Main Design

The program features a variety of python functions that make up each story. Eg. for the Hero story, the Christmas Story and the Sporting Story. Also the jokes are containing within its own python function. There is a also a python function to ask for the user's name. To recall any of the functions, I created a main_function() The conditional ststement decides which function is called or in this case which story is chosen.

To avoid having to repeat code, a dictionary function. This function takes 3 input; the name of the list, the title message and the input message. This function also checks for any index error and value error using a try and catch statement.

Overall the program uses quite a simple design and the output text is clear and concise. There is no ambiguity for the user.

Technologies Used

For this project I used the following software:

  • Github
  • Sketch ( To create the flowchart)
  • VSCode Desktop (to create the initial code)
  • Python tutor
  • Heroku (To show the python program as a web app)
  • MacOSX on MacbookPro 13

Deployment

This project was deployed as a web application using Heroku. The project was also pushed to GitHub by using GitPod and Git commands.

To deploy this page to Heroku from GitHub, do the following:

  1. Create an account on Heroku
  2. Click ‘Create new App’ from the top menu
  3. Choose a name for the app and then choose the region as Europe
  4. In settings, add a build pack for Python and Node.js
  5. Click on Config Vars and add ‘Port’ for key and ‘8000’ for value
  6. Click save changes 7 . Click on the deploy tab and then click connect to GitHub
  7. Search for repository name and then once this is done, click connect.
  8. Deploys can be done manually or automatically. For this project, click ‘automatic deploys’
  9. After the project has been successfully deployed, click on ‘open app’ at the top of the page to open the newly created web app.

Testing

Starting the program brings up an input message asking to input your name. This value is taken as a string so both letters and numbers can be inputted. After the name is inputted the program says 'Hello Name' welcome to the story vault.

After this all of the story options are printed with the corresponding number proceeding it

testing image 1

The user is requested to input the value next to the story. As soon as this is done the program lists the variables for each list as part of the story. Again the user is requested to input corresponding number next to the variable.

testing image 2

The program asks for many different variables for the story.

The user can create the story exactly how they want it. rf

testing image 3

Eventually after the user inputs the values for each variable from each list the story prints with the variables.

testing image 3

If the user inputs a value greater than the index or provides a value that can't be cast to an integer, then the code will return a invalid error. The exception for ValueError and IndexError are thrown in this case.

Testing image shows error handling

After each story the program asks the user if they would like another story. This was created using the function item_selecttion() and a list of possible options was passed into the function.

testing image 4

Option 4 brings up a list of jokes that the user can choose. After the user has chosen the chosen joke the program asks if they would like another joke which executes joke_selection() function if the user says yes.

joke testing image 1

If the user chooses not to display another joke the program then asks if the user would like to read another story. In this case the code executes main_function().

joke testing image 2

The program runs efficiently with no issues. The testing confirms this

Main issues/ bugs

The biggest problem faced for this project was deciding how to deal with users who inputted a non-integer value. I asked for help from my fellow classmates on Slack and then my mentor. Both suggested that I use a 'while' loop and then inside this loop use 'try' and 'catch' method. I experimented with a number of variations of this code before getting something that worked efficiently.

I had to find a way to truncate the number of characters in each line before the program passed the pep8 validation. I searched Google and discovered that putting a \ allows you to carriage return to the next line without upsetting the syntax.

Other than those listed above I found the code to be quite simple.

Validation

The code has been fully validated with Pep8online and this returned a result of no issues.

Credits

  • I would like to thank my mentor Guido Cecilio for his guidance throughout the whole project
  • I found out the enumerate code from the following link: Stackoverflow Code
  • I used Youtube as a help for this project

soconne338-project3's People

Contributors

soconne339 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.