vortifuture.blogg.se

Python card game simulator
Python card game simulator















based on what kind of pet that the user inputs).

#PYTHON CARD GAME SIMULATOR SIMULATOR#

Parameter passing - This is where we pass different variables, values, or data structures.Ĭreate a simulator where you can “raise a pet.” This will involve looping through a menu, giving options to feed, and buying different things at a shop (e.g. By “validate”, this typically means that we check the user’s input against a set of possible values that we have. Input validation - To validate the inputs that the user gives us before trying to execute commands that rely on user input. User input - To make the program pause and wait for input from the user, and use that input for future steps of the program. įor example, if the above list had the name “names”, you could access the “Alex” value by using names. Lists also are indexed at 0 – that means that you can access the first value of a list by using. List - A data structure that keeps its items in sequential order – for example, may indicate that Alex is first, Ben is second, and Taylor is third. For example, “Hello world!” or “I read 3000 books!” String - This is a type of data that stores characters – such as letters from the alphabet, numbers, and symbols. Integer - This is a type of data that keeps whole numbers – such as 1, 0, -10, 10923. This defines what our program will need to be comprised of in order to make everything work together. Pseudocode - Logical, written steps of our program written in plain language - not code. Important Concepts to Review or Learn Beforehand Time: 1.5+ hr, but this varies by student and how much you add to the simulator! This is a relatively longer project great for practicing parameter passing and their associate scopes, functions, loops, and variables.Ĭore concepts: Functions, Loops, Taking input, Interactivity, Input validationĮst. In this project, Juni instructor Gabriel will be showing us how use Python to build a Pet Simulator! In the simulator, you can name, feed, and play with your very own virtual pet. Please note that there's a typo in line 24 in the video, where toyNum > len(petToys) should be toyNum >= len(petToys)!.

python card game simulator python card game simulator

Extending the project & Conclusion – 34:58















Python card game simulator