f
Dependencies: mbed 4DGL-uLCD-SE MMA8452
keyboard.h@6:453dc852ac0f, 2022-04-12 (annotated)
- Committer:
- dfrausto3
- Date:
- Tue Apr 12 01:39:20 2022 +0000
- Revision:
- 6:453dc852ac0f
- Parent:
- 5:077b66dfe296
f
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lballard9 | 0:8e3b9bb1084a | 1 | |
lballard9 | 0:8e3b9bb1084a | 2 | #include "globals.h" |
lballard9 | 0:8e3b9bb1084a | 3 | #include "hardware.h" |
lballard9 | 0:8e3b9bb1084a | 4 | #include "graphics.h" |
lballard9 | 0:8e3b9bb1084a | 5 | #include "doubly_linked_list.h" |
lballard9 | 0:8e3b9bb1084a | 6 | /* |
lballard9 | 0:8e3b9bb1084a | 7 | * Function to implement comparisons of data in the DLL. |
lballard9 | 0:8e3b9bb1084a | 8 | * This function allows the comparisons of chars if you input |
lballard9 | 0:8e3b9bb1084a | 9 | * chars into the doubly_linked_list. If you want you can make |
lballard9 | 0:8e3b9bb1084a | 10 | * additional functions to compare different types of data. |
lballard9 | 0:8e3b9bb1084a | 11 | * |
lballard9 | 0:8e3b9bb1084a | 12 | * This function should be passed into the create_dLinkedList() |
lballard9 | 0:8e3b9bb1084a | 13 | * call. |
lballard9 | 0:8e3b9bb1084a | 14 | * |
lballard9 | 0:8e3b9bb1084a | 15 | */ |
lballard9 | 0:8e3b9bb1084a | 16 | int compareChar(void* input1, void* input2); |
lballard9 | 0:8e3b9bb1084a | 17 | |
lballard9 | 0:8e3b9bb1084a | 18 | /* |
lballard9 | 0:8e3b9bb1084a | 19 | * This function should intialize the keyboard and |
lballard9 | 0:8e3b9bb1084a | 20 | * select the goal word. To pick goal word, select a word |
lwills | 5:077b66dfe296 | 21 | * randomly from the dictionary you create in dictionary.h |
lwills | 5:077b66dfe296 | 22 | * (hint: the function rand() can be used to generate a random |
lwills | 5:077b66dfe296 | 23 | * number >=0). |
lballard9 | 0:8e3b9bb1084a | 24 | * To create the keyboard, initialize a DLL with all the nodes |
lwills | 5:077b66dfe296 | 25 | * being the letters of the alphabet. Display the visible part |
lwills | 5:077b66dfe296 | 26 | * of the keyboard at the start of the game (e.g., for baseline: |
lwills | 5:077b66dfe296 | 27 | * display the first letter of the alphabet). |
lballard9 | 0:8e3b9bb1084a | 28 | */ |
lballard9 | 0:8e3b9bb1084a | 29 | void init_keyboard(); |
lballard9 | 0:8e3b9bb1084a | 30 | |
lballard9 | 0:8e3b9bb1084a | 31 | /* |
lballard9 | 0:8e3b9bb1084a | 32 | * Scroll left on the keyboard. |
lballard9 | 0:8e3b9bb1084a | 33 | */ |
lballard9 | 0:8e3b9bb1084a | 34 | void moveleft(); |
lballard9 | 0:8e3b9bb1084a | 35 | |
lballard9 | 0:8e3b9bb1084a | 36 | /* |
lballard9 | 0:8e3b9bb1084a | 37 | * Scroll right on the keyboard. |
lballard9 | 0:8e3b9bb1084a | 38 | */ |
lballard9 | 0:8e3b9bb1084a | 39 | void moveright(); |
lballard9 | 0:8e3b9bb1084a | 40 | |
lballard9 | 0:8e3b9bb1084a | 41 | /* |
lballard9 | 0:8e3b9bb1084a | 42 | * Pick the current letter in the keyboard to use |
lballard9 | 0:8e3b9bb1084a | 43 | * in your guess. |
lballard9 | 0:8e3b9bb1084a | 44 | */ |
lballard9 | 0:8e3b9bb1084a | 45 | void select_letter(); |
lballard9 | 0:8e3b9bb1084a | 46 | |
lballard9 | 0:8e3b9bb1084a | 47 | /* |
lballard9 | 0:8e3b9bb1084a | 48 | * Removes letters from your guess that you no |
lballard9 | 0:8e3b9bb1084a | 49 | * longer want in your guess (Removes right to left). |
lballard9 | 0:8e3b9bb1084a | 50 | */ |
lballard9 | 0:8e3b9bb1084a | 51 | void remove_letter(); |
lballard9 | 0:8e3b9bb1084a | 52 | |
lballard9 | 0:8e3b9bb1084a | 53 | /* |
lballard9 | 0:8e3b9bb1084a | 54 | * This function compares your guess to the secret word. If |
lballard9 | 0:8e3b9bb1084a | 55 | * you guess the correct letter in the correct spot, keep the |
lballard9 | 0:8e3b9bb1084a | 56 | * letter displayed. If you guess the correct letter in the |
lballard9 | 0:8e3b9bb1084a | 57 | * incorrect spot, display that letter on the top of the screen. |
lballard9 | 0:8e3b9bb1084a | 58 | * Delete letters that are not in the secret word from the keyboard |
lballard9 | 0:8e3b9bb1084a | 59 | * DLL. Also should handle game winning and game losing. |
lballard9 | 0:8e3b9bb1084a | 60 | * |
lballard9 | 0:8e3b9bb1084a | 61 | */ |
lballard9 | 0:8e3b9bb1084a | 62 | void check_word(); |