You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
726 B

1 year ago
  1. #include <stdbool.h>
  2. #include <stdio.h>
  3. #include "Moving.h"
  4. #include "Schachbrett.h"
  5. #include "Spieler.h"
  6. bool king_alive(char** brett) {
  7. bool white_king_found = false;
  8. bool black_king_found = false;
  9. for(int i = 0; i < 8; i++) {
  10. for(int j = 0; j < 8; j++) {
  11. if(brett[i][j] == 'K') {
  12. white_king_found = true;
  13. } else if(brett[i][j] == 'k') {
  14. black_king_found = true;
  15. }
  16. }
  17. }
  18. return white_king_found && black_king_found;
  19. }
  20. void spiel(char** brett) {
  21. if(king_alive(brett)) {
  22. // spiel läuft noch
  23. } else {
  24. // Spielende
  25. }
  26. }
  27. // Während der Laufzeit des Spiels neue Features hinzufügen