0% found this document useful (0 votes)
13 views34 pages

Énoncé Projet 2023-2024 en

The document describes a longest word game where a computer randomly generates letters and the player tries to find the longest valid word that can be formed from those letters. The summary provides the rules and options for single-player and two-player modes.

Uploaded by

trojette moetez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views34 pages

Énoncé Projet 2023-2024 en

The document describes a longest word game where a computer randomly generates letters and the player tries to find the longest valid word that can be formed from those letters. The summary provides the rules and options for single-player and two-player modes.

Uploaded by

trojette moetez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

Subscribe to DeepL Pro to translate larger documents.

Visit www.DeepL.com/pro for more information.

Algorithms and Programming I

Project

The order of letters

Academic year 2023/2024 - Semester 1

1
Report content

o Binomial data sheet

o Listing of source files

o A Google Drive link to the project, which includes


all source files and a clear, detailed report

o The presentation of the project will be taken into


account

o The pair must be from the same group

Due on 05/12/2023
2
Statement

Program the longest word game. Principle of

the game:

The player is asked to find the longest valid word from a set of
randomly chosen alphabetical letters, after a finite number of
attempts. A word is valid if it belongs to a list of words entered
in advance from a text file representing the French dictionary.

3
Game rules (1)
1. The user chooses the number of letters in the game (7, 8 or
9 letters) when playing against the computer, and chooses
an even number of letters when playing against a second
player.

2. For each letter, the user chooses the type of letter in the
alphabet (consonant or vowel) and the computer randomly
outputs a consonant or vowel.

3. Only uppercase alphabetical letters are used in the game.


Alphabetic letters with accents are not considered.
Examples: The word window is spelled WINDOW.
The word châteaux becomes
CHATEAUX. The word famous
becomes CELEBRATE.
4
Game rules (2)
4. From the letters given by the computer, the player (user) has
to find the longest word, made up of these letters, from the
list of valid words.

5. The longest word may not include all the letters generated by
the machine. Example: the longest words obtained from the
set {T, Z, I, R, O, X, O} are "ROTI" and "TRIO" and have a
size equal to 4.

6. A given combination of randomly generated letters can


correspond to several words of the longest size, as shown in
the example above.

7. When the player fails to find the longest word, the computer
must display it or all possible words based on this
combination of letters.
5
Game options (1)
The game can be played by one or two players.
1. When we theplay à one, we a two degreesof
difficulty:

- The player chooses the size t of the longest word to be


and has t (7/8/9) attempts to do so.

- The player chooses the size t of the longest word to


find and has t (7/8/9) attempts to do so. Each attempt
is limited by time. The player has t seconds to type a
word, otherwise he misses a chance to find a
possible combination and moves on to the next trial
and so on.
6
Game options (2)

- During the game, when the player exceeds the total


time allowed, which is (t*t) seconds, he loses even if
he finds the longest word.

- As long as the game continues, a score equal to the


size of the best word attempted (in terms of length) is
awarded to the player.

- The game ends when the player manages to find one


of the longest words made up of alphabetical
characters randomly generated by the machine.

7
Game options (3)
2. When played by two:
- One of the of two players chooses the size t of
the word à
found.

- t should be even so that both players have the same


chance of finding the longest word. t should not exceed
26.

- Each player takes it in turns to type in a word that they feel


seems the longest.

- A score is awarded to each of the two players as long as


neither has found the longest word. The score is equal to
the size of the longest valid word typed by the player.
8
Game options (4)
- A player is not allowed to enter a valid word typed by
another player. If they do, the size of the word does
not count towards the player's score.

- The game ends when one of the two players finds the
longest word.

- When both players fail to find the longest word after t


attempts (t/2 attempts for each), the player with the
highest score wins the game.

- The game can be played over several rounds,


depending on player preference. 9
Interface

1- The display will be in text mode.

2- A graphical interface is not required.

10
Execution scenario (1)
The user has chosen to play against the computer but made a mistake b e f o r e
typing the right choice (Play to one).

11
Execution scenario (1)
The user was mistaken about the size of the longest word to be found and finally
chose to play with 8 characters.

12
Execution scenario (1)
The user chooses the type of each letter, and the machine generates them
randomly.

13
Execution scenario (1)
The player won on the first move because he found the longest word from the 8
characters proposed by the machine.

14
Execution scenario (2)
The player has chosen to play alone and has attempted the move 9 times
without finding the longest word. He is awarded a score corresponding to the
size of the best word attempted.

15
Execution scenario (2)
The player hasn't managed to find the longest word. The program still
displays the longest words he missed.

16
Execution scenario (3)
This time we want to play against the computer, but also against time. We've
chosen to play with eight characters.

17
Execution scenario (3)
We lost because we exceeded the total time allowed, which is equal to t*t
seconds; t here being equal to 8.

18
Execution scenario (4)
We lost because we exceeded the total time allowed, even though we found the
longest word. Here we choose the second option, which displays all the
possible words that can be obtained from these letters, including the longest.

19
Execution scenario (5)
Despite the time constraint, the player managed to find the longest word on the
fourth attempt, before the 64-second time limit had elapsed.

20
Execution scenario (6)
We've chosen to play in pairs. A first run starts with 8 characters and J1 plays first.

21
Execution scenario (6)
Neither player has found the longest word, but J1 and J2 get two scores
corresponding to their best attempt.

22
Execution scenario (6)
Players are shown the longest words and asked if they want to play another
round. They answer with 'Y' or 'o' if they do, and 'n' or 'N' if they don't.

23
Execution scenario (6)
In round 2, J2 starts first because J1 started first in round 1. J2 wins the round on
the second move by guessing the longest word.

24
Execution scenario (6)
Both players continue to play (they will play 4 rounds). In round 3, no player has
managed to find the correct words, and in round 4, J2 wins the round on the
first move by guessing the longest word.

25
Execution scenario (6)
After playing four rounds, players obtain their final score, which is the sum of the
scores obtained in the various rounds, and the program displays the winner.

26
Execution scenario (7)
Two players. Word size should be positive, non-zero, even and less than 26.

27
Execution scenario (7)
Round 1 is played. J1 and J2 have found some words but they are not the longest.

28
Execution scenario (7)
Round 2 is played. J2 wins because he found the longest word.

29
Execution scenario (7)
The program allows players to see all possible words, including the longest that
can be obtained from this combination of characters.

30
Execution scenario (7)
Round 3 is played. J1 wins, but not with the longest word.

31
Execution scenario (7)
Players can see all possible word combinations, including the longest ones.

32
Execution scenario (7)
The game ended in a draw after three rounds. A table showing all the scores and
the final result is displayed.

33
Good work!

34

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy