i've got an assignment to write a program that simulates a game of snaps in python but don't know how to get started, your help would be appreciated! Here is the question:

Write a program to allow the simulation of a game of Snap. Assume two humans will play, but the computer
prints out the two cards turned over in each round. Input for each round should be ”Enter” to turn the next
cards. ”exit” to quit the game, or a ”1” or a ”2” to indicate if player one or two called Snap first.
Design your program with three Classes. Use the following classes. A Card, Deck and Hand class. Pointers to
help you write the classes and game will be given in the Practical classes.

Recommended Answers

All 3 Replies

You could start writing the sequence of actions and loops that the computer should do, like "create a deck", "shuffle the deck", "get input", "if input is Enter", etc. Write a flow chart on a sheet of paper. (Also what will your program do if the user enters "Ebter" or "ENTER" ?).

Iv just been given a question just like this to do, feeling really confused and dont know where to go from here. Iv defined all three of my classes but now dont know how to actually play the game?

commented: So what, not your thread! -3
commented: Don't bump old threads!!! Start your own! -1
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.