Assignment 1 – Grocery Store Simulation
posted!<标题> (See the unit test file for details.)
Grocery stores often have a difficult task: they must determine how many employees to hire to staff checkout lines during varying levels of customers throughout the day. Too few open lines means customers spend time angrily waiting; too many, and the store loses money paying its employees. It’s also important to get the right mix of regular and express checkout lines, and perhaps even self-serve lines. Which combination is best depends on what kind of customers the store has.
In this assignment, you’ll build an event-driven simulation<标题> for a grocery store, which will model customers using different types of checkout
This semester you will be writing a program that models elements of recognizing and creating characters. is an important area of research that allows photographs or printed documents to be digitized; by doing so, these documents are made available for machine-based searching. On the flip side, is a system for differentiating between humans and computers: the goal here is to generate a non-machine readable image that a human could identify. CAPTCHA helps reduce the amount of spam on the Internet.
<标题>We will implement a highly limited type of image matching, processing, and creation this semester. Rather than write this project at once, we will break the project down into
<标题>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
Implement a program that shall recursively draw a “tree” in a Tkinter Canvas.
The program shall consist of a non-resizable 500×500 px canvas in a non-resizable window and a menu bar. The menu bar shall have one pull-down menu named “Draw” with two items named “Repaint” and “Exit”.
The “Exit” menu item, when selected, shall gracefully terminate the program.
<标题>The “Repaint” menu item, when selected, shall clear the canvas and draw a recursive tree at random position growing “up” (in the direction 90°). The initial length of the stem shall be 128 px. The tree shall have the number of cascades selected uniformly at random between 3 and 7, inclusive.
One cascade of the tree of length L, growing from the position (X,Y) in the direction D, shall consist of (see the attached file):
- the stem represented as a black line segment of length L originating at (X,Y) and forming the angle D degrees with the horizonta axis, and
- two trees of length L*0.8, growing from the end of the stem in the directions