Project
Formulation - practicum 3 (25.-26.11)
This week you should start thinking about your individual project. At first, come up with an idea for the project and submit it (as a text file or pdf) before practical session 3.
The program itself has to be released by December th 10th at 19:00.
Project requirements
- The idea should be original - you should come up with it by yourself.
- The topic (subject) of the project should be interesting to you. This project can be a further development of your project from the course Introduction to Programming I.
- The workload is about 10h (trace the working hours on the project and submit it in a separate file together with the project).
- The program must have a simple graphical design (use tkinter, easygui etc.).
- The program must read data from a file or write data to a file.
- The program must contain a list, a dictionary, a tuple or a set (for getting maximum points, the program must contain a nested data structure).
- The program must contain a (nested) loop, a function, a conditional statement.
Try to come up with an idea which meets the requirements and does not sound very artificial. In a very special case, it is possible to substitute some requirements with alternatives (on approval of the instructor).
Before session 3, upload only the project formulation (a text file or pdf)! The formulation must contain a general idea and the purpose of the program. Also say some words about the data structures, files, functions, conditional statements and loops (where in the program they will be created and used). A complete project formulation should answer the following questions:
- What will the program do?
- How will GUI look like?
- What can be given as an input?
- What will be read/written from/to the file?
- Where will data structure be used?
- Where will functions be used?
- Where will loop (for/while) be used?
- Where will if-else be used?
Samples of project ideas
Here are some examples of the project (in complete absence of inspiration (which is unlikely), you can use them). These ideas contain only a description of the project; in the project formulation you also need to write where the data structures, files, functions, conditional statements and loops will be used. Be specific in the project formulation, e.g. how the program accesses the data - is it asked from the user? read from a file?
- Matches. At the beginning of the game, Python generates a random number. This number shows how many matches are on the table. The players take in turns one, two or three matches at a time. The player, who takes the last match, loses the game.
- Battle of the dragons. The program simulates a battle of two dragons.
- Calculator.
- Dice. The players throw a dice. During one turn, a player can throw the dice as many times as he wants; the points are summed. However, if the dice shows 1, player's all points are annulled, and the dice is immediately given to the second player. The winner is a player who first gets 91 points.
- Memory game.
A sample of a complete project formulation
Tic-Tac-Toe
1. What will the program do?
This is my implementation of the Tic Tac Toe game. The program asks the user for two names: the first person will play for X and the second for O. Players take turns placing their X or O. The player who succeeds in placing three of his marks in a horizontal, vertical, or diagonal row, wins the game, and the program shows a message about that. If the board is filled up and there is no winner, the game ends in a draw (the program shows a message about that as well). Once a game is over, the program makes a record into the file about the winner or a tie.
2. How will GUI look like?
A picture can be drawn in some program, for example, MS Paint.
There will be a graphical window with nine (3x3) buttons.
3. What can be given as an input?
The program will not read any data from file. The program will ask the user for two names.
4. What will be written to the file?
After every game, the program adds a record into the file about the winner or a tie.
5. Where will data structure be used?
There will be a matrix (a list of lists) to represent the status of one turn in the Tic Tac Toe game.
6. Where will functions be used?
- There will be a function with one parameter for a list. The list will contain three elements. The function will return True if there are three O-s or three X-s in the list.
- There can be more functions in the program if needed.
7. Where will loop (for/while) be used?
I will use a for loop for composing and checking each row, each column and each diagonal of the matrix.
8. Where will if-else be used?
- The function uses if-else to make sure if there are three O-s or three X-s in the list.
- Another if-else will be used inside the loops to invoke the function.