I can say that from my post work in making macros in Excel, the random number generator in that program uses a seed in the battery clock and I suspect the random number generator in Python works in the same manner.Īfter I imported the libraries I would need, I initialised the values that would be used in the program. Most of the websites say to use randint() but they don’t go into the basics of how it works. I researched how the random number generator in Python works but was unable to get the answer I was searching for. The random library is used to create random numbers and I needed to use the randint() function to make random integers. I am therefore a bit disappointed in Google Colab for having such an obvious deficiency in their program, so if anyone knows of another online Jupyter Notebook then please let me know.Īfter I created the Jupyter Notebook, I imported the libraries I would need, namely numpy, pandas and random. #PYTHON CARD GAME SIMULATOR CODE#One bad thing about Google Colab is the fact that it does not make back-up copies, so I ended up writing the code for the body of the program twice when Google Colab had a saving error. I created the program in Google Colab, which is a free online Jupyter Notebook that has Python and several relevant libraries already installed on it. With the rules of the game written down, I began my foray into games programming. If a player gets higher than 21 he loses.” The player that has the highest amount up to 21 wins. Keep adding cards until they total 21 or as high as you can get. “Take the Joker out of the pack and start with 2 cards. I therefore asked my partner if he knew of any really easy card games I could write a program on and he suggested the card game, 21. I therefore decided that in order to progress in my knowledge of data science and Python programming, I need to progress beyond the tabular competition questions that I have been working on and explore other types of programming. Even Kaggle, the popular website for data science enthusiasts, has several contests that are actually game simulations. Having spent most of my life working, I am not much of a games person, so I have to spend time researching and learning games before I can write programs to simulate them and then write about those games.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |