Browse Source

Current State added

+
small changes in header files
remotes/origin/Saba
Saba Fazlali 11 months ago
parent
commit
d0cf9a6ff0
  1. 2
      CMakeLists.txt
  2. 6
      src/main/c/Hangman/currentState.c
  3. 4
      src/main/c/Hangman/currentState.h
  4. 2
      src/main/c/Hangman/drawHangman.c
  5. 6
      src/main/c/Hangman/drawHangman.h
  6. 5
      src/main/c/Hangman/initializeHangman.c
  7. 8
      src/main/c/Hangman/initializeHangman.h
  8. 1
      src/main/c/Hangman/rules.c
  9. 6
      src/main/c/Hangman/rules.h
  10. 4
      src/main/c/Hangman/word_selector.c
  11. 4
      src/main/c/Hangman/word_selector.h

2
CMakeLists.txt

@ -19,4 +19,6 @@ add_executable(pmuw_projekt_notebinder
src/main/c/Hangman/rules.h
src/main/c/Hangman/initializeHangman.c
src/main/c/Hangman/initializeHangman.h
src/main/c/Hangman/currentState.c
src/main/c/Hangman/currentState.h
)

6
src/main/c/Hangman/currentState.c

@ -0,0 +1,6 @@
#include "currentState.h"
void currentState(char *currentGuess, int mistakes) {
printf("Current Word: %s \n", currentGuess);
printf("Mistakes Made: %d/6 \n", mistakes);
}

4
src/main/c/Hangman/currentState.h

@ -0,0 +1,4 @@
#ifndef PMUW_PROJEKT_NOTEBINDER_CURRENTSTATE_H
#define PMUW_PROJEKT_NOTEBINDER_CURRENTSTATE_H
#include <stdio.h>
#endif //PMUW_PROJEKT_NOTEBINDER_CURRENTSTATE_H

2
src/main/c/Hangman/drawHangman.c

@ -1,4 +1,4 @@
#include <stdio.h>
#include "drawHangman.h"
void drawHangman(int incorrectGuesses) {

6
src/main/c/Hangman/drawHangman.h

@ -1,8 +1,6 @@
//
// Created by Saba Fazlali on 29.01.24.
//
#ifndef PMUW_PROJEKT_NOTEBINDER_DRAWHANGMAN_H
#define PMUW_PROJEKT_NOTEBINDER_DRAWHANGMAN_H
#include <stdio.h>
#endif //PMUW_PROJEKT_NOTEBINDER_DRAWHANGMAN_H

5
src/main/c/Hangman/initializeHangman.c

@ -1,7 +1,4 @@
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "initializeHangman.h"
void initializeHangman(char *wordToGuess, char *currentGuess) {
int wordLength = strlen(wordToGuess);

8
src/main/c/Hangman/initializeHangman.h

@ -1,8 +1,6 @@
//
// Created by Saba Fazlali on 31.01.24.
//
#ifndef PMUW_PROJEKT_NOTEBINDER_INITIALIZEHANGMAN_H
#define PMUW_PROJEKT_NOTEBINDER_INITIALIZEHANGMAN_H
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#endif //PMUW_PROJEKT_NOTEBINDER_INITIALIZEHANGMAN_H

1
src/main/c/Hangman/rules.c

@ -1,5 +1,4 @@
#include "rules.h"
#include <stdio.h>
void printRules(){
printf("Rules: \n");

6
src/main/c/Hangman/rules.h

@ -1,8 +1,4 @@
//
// Created by Saba Fazlali on 29.01.24.
//
#ifndef PMUW_PROJEKT_NOTEBINDER_RULES_H
#define PMUW_PROJEKT_NOTEBINDER_RULES_H
#include <stdio.h>
#endif //PMUW_PROJEKT_NOTEBINDER_RULES_H

4
src/main/c/Hangman/word_selector.c

@ -1,7 +1,3 @@
//
// Created by Saba Fazlali on 22.01.24.
//
#include "word_selector.h"
const char wordsList[NUM_WORDS][MAX_WORD_LENGTH + 1] = {

4
src/main/c/Hangman/word_selector.h

@ -1,7 +1,3 @@
//
// Created by Saba Fazlali on 24.01.24.
//
#ifndef PMUW_PROJEKT_NOTEBINDER_WORD_SELECTOR_H
#define PMUW_PROJEKT_NOTEBINDER_WORD_SELECTOR_H

Loading…
Cancel
Save