Skip to content

andrea-maille-frankie-wang-project-four/guess-the-price

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hello! This is a price guess game made by Andrea Maille and Frankie Wang. 
The game app works as below : 
    1. Users select a category from 3 options. An event listener is attached to the category-selecting submit button and passes users' input to ajax,  so the app makes an API call to Walmart open API based on users' choice. (If users submit an empty form, an alert will prompt them to choose on category.)
    2.After API returns data with 25 items in it, the app will filter out those products without the salePrice property, and randomly select 3 products, stores them in an array. Meanwhile, prices of these 3 products will be stored in an array. Afterwards, the app will load a game interface with the information of the selected products.
    (If API call fails, an informing alert will be rendered for users instead)
    3.For the price-guessing part, Users need to type price in numbers for all 3 products, otherwise they cannot submit their guess and an alert will pop up. An event listener on the price-guessing form gets Users' inputs and store them in an array. Then, app compares users' input with the corresponding product sale price. App will render different feedback according to the the difference between users' guess and the actual price.
    4. If users wants to play the game again, they can click the replay button that is rendered together with the game results, which will scroll back to the category selection part and clear the game interface.

We think it's necessary to mention the instability of the Walmart API that we use in this game app. It is unclear what is the reason for it but we only got to see that API calls failed a few times on the night of May 25 (Saturday) when we were finishing our project coding. We were quite confused by the failure of API calls because the API worked well since the day we started our project. We decided to continue using the Walmart API for several reasons: First, it is the most ideal public API that meets our data demands for our app; Second, we only had one day before the project due date, so we were unable to make a new app from scratch. We're sorry for any inconvenience caused by the API instability. If the API call fails, please try to refresh it after a while or on another day. From our experience with the API, we roughly guess that the API might be on maintenance on weekends.

Thank you very much for reviewing our app!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published