This repository holds the project for a digital hangman game using Digilent's Cora Z7 FPGA and various peripherals. Below is a detailed outline of the hardware and software aspects of the system:
- Digilent's Cora Z7
- 2-line/16 character I2C LCD display module
- Sparkfun 7-segment display (with I2C)
- FTDI USB to UART 5V/3.3V adapter
- PS/2 keyboard
- PS/2 socket
- Connect the PS2 keyboard to PMOD port JA on the Cora Z7 board.
- Implement logic for recognizing English alphabet keys (A-Z).
- Connect the LCD panel to PMOD port JB on the Cora Z7 board.
- Upon power-up, initialize the LCD to display a single cursor (underline) at the left side of the screen.
- Use a USB to UART adapter for communication with the remote PC.
- Set the serial port parameters to a minimum baud rate of 9600, parity none, data bits 8, and stop bits 1.
- Connect a 7-segment display to PMOD port JB to indicate the remaining guesses.
- Language Options: C++, C#, Python, JAVA, or any language. (Javascript and HTML/CSS was chosen for this project).
- GUI: Create a GUI to display the game's status and an image of a hangman's noose.
- Word File: Read a text file containing 50 words with variable lengths (not exceeding 16 letters per word).
- Display "New Game?" on the GUI and LCD.
- Wait for the player to press "Y" on the PS2 keyboard to start a new game.
- Randomly select a word from the text file.
- Display the positions of each letter using underscores on the LCD (left-justified).
- Allow the player to guess a letter using the PS2 keyboard.
- Display correct guesses in the word on the LCD.
- Update the hangman image and show the remaining guesses on the 7-segment display for incorrect guesses.
- Success: Display a congratulatory message on the LCD - “Well done! You have solved N puzzles out of M”.
- Failure: Show the correct word and a message indicating the number of puzzles solved - “Sorry! The correct word was XXXXX. You have solved N puzzles out of M”.
- Since these messages have more than 20 letters and spaces, they should appear at the right edge of the LCD display and scroll across the screen at a rate appropriate for reading the message.
- The system should then display: “New Game?”.
- The player can always request a new puzzle by typing “Y” unless all of the words from the text file have been used up.
- The player should be able to end the game by typing the letter “N”.
- The LCD should display the final message when the game ends: “GAME OVER”.
- Keep track of the number of puzzles solved.
- Display the final score on the LCD after the game ends.
- Display the final score ("X correct out of Y") on the LCD.
- After a short duration, show "GAME OVER" on the LCD.
Please take a look at the project concept diagram included in the repository for an idea of how each component connects.