python 程序輔導

game Battleship python implementation

4.1 Overview

Computer games are nearly as old as electronic computers themselves. The first tic-tac-toe game was programmed on an EDSAC vacuum-tube computer. Your job will be to expand the Battleship program started in earlier labs into a fully-playable game.

4.2 The game of Battleship

Wikipedia has a thorough description of the origins of the game of?. For purposes of this assignment, follow the following rules.

<标题>1.The game is played between two players (one human and one computer for your program).

2.Each player has an identical set of ships. Each ship has a length, a name (e.g., “submarine”), and a symbol (a letter, e.g., “S”).

3.Each player has a grid, called the “battle board”,? which is mostly hidden from the other player. The grid is used for marking the locations of the pl

python Three-card Poker

4.1 Overview

Gambling has a long (and sordid) history on the internet. The history of computer games, however, is

<标题>quite a bit older than the internet. For this program, you will develop and code a game ofthree-card

poker. The computer (the?Dealer) will play against a single human player (the?Player). Your program

should present the game as described below.

<标题>4.2 Rules of Three-card Poker

The Player starts with a?stake: some pre-determined amount of money ($100 in your program). A

game of Poker consists of a set of sub-games. Before beginning a sub-game, the Player must be able

<标题>to bet the?ante, a pre-determined amount of money ($10 in your program). In each sub-games, both

the?Player?and?Dealer?is dealt a?hand?of three cards. Each can see their own cards, but not the others.

After seeing the hand, the Player must determine whether he will?play?or?fold. If the Player folds, he

forfeits the?ante: his?stake?is reduced by the?ante?amount. If the Player elects to?play, then the Dealer

must either?play?or?