Compare commits
	
		
			No commits in common. "main" and "pipes2game" have entirely different histories.
		
	
	
		
			main
			...
			pipes2game
		
	
		
							
								
								
									
										19
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								README.md
									
									
									
									
									
								
							@ -2,15 +2,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
Ein hilfreiches Tool für Photoniker
 | 
					Ein hilfreiches Tool für Photoniker
 | 
				
			||||||
 | 
					
 | 
				
			||||||

 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
--- 
 | 
					--- 
 | 
				
			||||||
## Anpassungen:
 | 
					 | 
				
			||||||
Um die Bedienung des Programms zu vereinfachen, wurden folgende Easter Eggs modifiziert:
 | 
					 | 
				
			||||||
- Bluescreen: wurde komplett deaktiviert
 | 
					 | 
				
			||||||
- Pfeiltasten: funktionieren ohne Passwort
 | 
					 | 
				
			||||||
- Bildschirmschoner: Die Aktivierungszeit wurde von 30s auf 60s erhöht.
 | 
					 | 
				
			||||||
---
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Installation
 | 
					## Installation
 | 
				
			||||||
### Linux
 | 
					### Linux
 | 
				
			||||||
@ -23,11 +15,10 @@ make
 | 
				
			|||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Windows
 | 
					### Windows
 | 
				
			||||||
Im Ordner [Releses](https://gitea.fhgr.ch/zwickethomas/Photonics-Helfer/releases) ist das Programm als `.exe` verfügbar und kann einfach heruntergeladen werden.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#### Selbst kompilieren
 | 
					 | 
				
			||||||
Mit dem aktuellen Makefile ist dies mit dem CMD nicht möglich. Wer es trotzdem unter Windows kompilieren möchte kann dies mit [Cygwin](https://www.cygwin.com/) tun. (Bei der Installation ist noch zu beachten, dass das Paket `make` mitinstalliert werden muss.)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Alternativ kann man auch WSL (Windows Subsystem für Linux) verwenden. Eine Anleitung dazu gibt es hier: [WSL](https://learn.microsoft.com/de-de/windows/wsl/install) 
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					1) Lade das Repository als zip-Datei herunter.
 | 
				
			||||||
 | 
					2) Entpacke die Datei.
 | 
				
			||||||
 | 
					3) Öffne das cmd und gehe in den Ordner `Photonics-Helper`.
 | 
				
			||||||
 | 
					4) Kompiliere das Programm mit `mingw32-make`.
 | 
				
			||||||
 | 
					5) Starte die Datei `Photonics-Helper.exe`.
 | 
				
			||||||
---
 | 
					---
 | 
				
			||||||
 | 
				
			|||||||
										
											Binary file not shown.
										
									
								
							| 
		 Before Width: | Height: | Size: 30 KiB  | 
							
								
								
									
										85
									
								
								makefile
									
									
									
									
									
								
							
							
						
						
									
										85
									
								
								makefile
									
									
									
									
									
								
							@ -1,24 +1,71 @@
 | 
				
			|||||||
CC = gcc
 | 
					 | 
				
			||||||
CPPFLAGS = -Iinclude -Isrc
 | 
					 | 
				
			||||||
CFLAGS = -Wall
 | 
					 | 
				
			||||||
LDLIBS = -lm
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
SRC = src
 | 
					#### Start of system configuration section. ####
 | 
				
			||||||
OBJ = obj
 | 
					 | 
				
			||||||
BIN = Photonics-Helfer
 | 
					 | 
				
			||||||
MKDIR = mkdir -p
 | 
					 | 
				
			||||||
SRCs := $(shell find $(SRC) -name "*.c")
 | 
					 | 
				
			||||||
OBJs := $(subst $(SRC), $(OBJ), $(SRCs:.c=.o))
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
all: $(BIN)
 | 
					VERSION := 2.00
 | 
				
			||||||
 | 
					CC      := gcc -O
 | 
				
			||||||
 | 
					CFLAGS  := -Wall -c
 | 
				
			||||||
 | 
					LDFLAGS := -g
 | 
				
			||||||
 | 
					LIBS = -lm
 | 
				
			||||||
 | 
					RM      := rm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$(BIN): $(OBJs)
 | 
					#### End of system configuration section. ####
 | 
				
			||||||
	$(CC) $(CFLAGS) $(CPPFLAGS) $(OBJs) -o $@ $(LDLIBS)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
$(OBJs): $(SRCs)
 | 
					.PHONY: all sort doc print clean
 | 
				
			||||||
	$(MKDIR) $(dir $@)
 | 
					 | 
				
			||||||
	$(CC) $(CFLAGS) $(CPPFLAGS) -c $(subst $(OBJ), $(SRC), $(@:.o=.c)) -o $@
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
clean:
 | 
					# TARGET.exe
 | 
				
			||||||
	$(RM) -R $(BIN)
 | 
					TARGET     = Photonics-Helfer
 | 
				
			||||||
	$(RM) -R $(OBJ)
 | 
					
 | 
				
			||||||
 | 
					# Path for .c , .h and .o Files 
 | 
				
			||||||
 | 
					SRC_DIR = ./src/
 | 
				
			||||||
 | 
					OBJ_DIR = ./obj/
 | 
				
			||||||
 | 
					DOX_DIR = ./doc/doxygen/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Files to compile
 | 
				
			||||||
 | 
					c_FILES := $(wildcard $(SRC_DIR)/*.c)
 | 
				
			||||||
 | 
					o_FILES := $(addprefix obj/,$(notdir $(c_FILES:.c=.o)))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#link all .o files
 | 
				
			||||||
 | 
					$(TARGET): $(o_FILES)
 | 
				
			||||||
 | 
						@echo [CC] link: $<
 | 
				
			||||||
 | 
						@$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#compile all .c Files 
 | 
				
			||||||
 | 
					obj/%.o: src/%.c
 | 
				
			||||||
 | 
						@echo [CC] compile: $<
 | 
				
			||||||
 | 
						@$(CC) $(CFLAGS) -o $@ $<
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
					#run TARGET.exe
 | 
				
			||||||
 | 
					run:
 | 
				
			||||||
 | 
						$(TARGET)
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
					#create folders and sort files
 | 
				
			||||||
 | 
					sort:
 | 
				
			||||||
 | 
						@-mkdir src obj
 | 
				
			||||||
 | 
						@-mv *.c *.h src
 | 
				
			||||||
 | 
						@-mv *.o obj
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
					#create folde "doc" then run doxygen
 | 
				
			||||||
 | 
					doc:
 | 
				
			||||||
 | 
						@echo need to start RunDoxy.bat manually
 | 
				
			||||||
 | 
					#	@-mkdir doc
 | 
				
			||||||
 | 
					#	@call $(DOX_DIR)RunDoxy.bat
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
					# Clean all the object files and the binary
 | 
				
			||||||
 | 
					clean:   
 | 
				
			||||||
 | 
						@echo "[Cleaning]"
 | 
				
			||||||
 | 
						@$(RM) -rfv $(OBJ_DIR)*
 | 
				
			||||||
 | 
						@$(RM) -rfv $(TARGET).exe
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					help:
 | 
				
			||||||
 | 
						@echo -e Version:   ' \t ' $(VERSION)
 | 
				
			||||||
 | 
						@echo -e CC:       ' \t \t '  $(CC)
 | 
				
			||||||
 | 
						@echo -e CFLAGS:   ' \t ' $(CFLAGS)
 | 
				
			||||||
 | 
						@echo -e LDFLAGS:  ' \t ' $(LDFLAGS) ' \n ' 
 | 
				
			||||||
 | 
						@echo    commands:
 | 
				
			||||||
 | 
						@echo -e sort  ' \t \t ' sort files
 | 
				
			||||||
 | 
						@echo -e run   ' \t \t ' run $(TARGET).exe
 | 
				
			||||||
 | 
						@echo -e doc   ' \t \t ' run doxygen
 | 
				
			||||||
 | 
						@echo -e clean ' \t \t ' clean all the .o
 | 
				
			||||||
 | 
						@echo -e type make -help for more
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
				
			|||||||
@ -1,6 +0,0 @@
 | 
				
			|||||||
Python/Numpy wurden speziell für den Unterricht an Schulen entwickelt. F
 | 
					 | 
				
			||||||
Python/Numpy ist die Abkürzung von “Numerical Python”. W
 | 
					 | 
				
			||||||
Python/Numpy ist eine Open-Source-Alternative von MATLAB. W
 | 
					 | 
				
			||||||
Python/Numpy ist ein CAS (Computer-Algebra-System). F
 | 
					 | 
				
			||||||
Die Kernkompetenzen von Python/Numpy sind Numerik, Datenverarbeitung und Datenvisualisierung. W
 | 
					 | 
				
			||||||
Python/Numpy ist für die gängigen Betriebssysteme Windows, Mac und Linux erhältlich. W
 | 
					 | 
				
			||||||
@ -4,6 +4,7 @@
 | 
				
			|||||||
// #ifndef _FILE_NAME_H_ 
 | 
					// #ifndef _FILE_NAME_H_ 
 | 
				
			||||||
// #define _FILE_NAME_H_ 
 | 
					// #define _FILE_NAME_H_ 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					   // extern int kbhit();
 | 
				
			||||||
   int Fehlenden_Elektronik_main();
 | 
					   int Fehlenden_Elektronik_main();
 | 
				
			||||||
   
 | 
					   
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
@ -1,206 +0,0 @@
 | 
				
			|||||||
#include "Funktion_Flugi.h"
 | 
					 | 
				
			||||||
#include <unistd.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
int quiz(char Question[][500], char Answer[], int zahl_h) {
 | 
					 | 
				
			||||||
    char repeat[zahl_h][500]; // Array, um falsche Fragen zu speichern
 | 
					 | 
				
			||||||
    char userAnswer;
 | 
					 | 
				
			||||||
    int incorrectIndices[zahl_h]; // Indizes der falschen Antworten
 | 
					 | 
				
			||||||
    int incorrectCount = 0;  // Anzahl falscher Antworten 
 | 
					 | 
				
			||||||
    srand(time(NULL)); //SL Zufallsgenerator initialisieren                  
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    int zufallszahl = 0;
 | 
					 | 
				
			||||||
    int i;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // Fragen durchgehen und Antworten überprüfen
 | 
					 | 
				
			||||||
    for (i = 0; i < zahl_h; i++) 
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        zufallszahl = rand() % zahl_h  ; // SL % 2 räpresentier die Obergrenze
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        printf("Frage %d: %s\n", i + 1, Question[zufallszahl]);//SL Zufallszahl durch i ersetzt
 | 
					 | 
				
			||||||
        scanf(" %c", &userAnswer); // wichtig lehrschlag vor %c
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (userAnswer == Answer[zufallszahl]) {
 | 
					 | 
				
			||||||
            printf("Korrekt!\n");
 | 
					 | 
				
			||||||
        } 
 | 
					 | 
				
			||||||
        else if (userAnswer != Answer[zufallszahl])
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            printf("Falsch!\n");
 | 
					 | 
				
			||||||
            strcpy(repeat[incorrectCount], Question[i]); // Frage speichern
 | 
					 | 
				
			||||||
            incorrectIndices[incorrectCount] = zufallszahl;        // Index speichern
 | 
					 | 
				
			||||||
            incorrectCount++;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // Überprüfen, ob es falsche Antworten gibt
 | 
					 | 
				
			||||||
    if (incorrectCount > 0) {
 | 
					 | 
				
			||||||
        char retry;
 | 
					 | 
				
			||||||
        printf("Du hast %d falsche Antworten. Willst du diese wiederholen? (j/n): ", incorrectCount);
 | 
					 | 
				
			||||||
        scanf(" %c", &retry);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (retry == 'j' || retry == 'J') {
 | 
					 | 
				
			||||||
            for (int i = 0; i < incorrectCount; i++) {
 | 
					 | 
				
			||||||
                printf("Wiederholung: %s\n", repeat[i]);
 | 
					 | 
				
			||||||
                scanf(" %c", &userAnswer);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                if (userAnswer == Answer[incorrectIndices[i]]) {
 | 
					 | 
				
			||||||
                    printf("Jetzt korrekt!\n");
 | 
					 | 
				
			||||||
                } else {
 | 
					 | 
				
			||||||
                    printf("Immer noch falsch.\n");
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    } else {
 | 
					 | 
				
			||||||
        printf("Alle Antworten waren korrekt!\n");
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return incorrectCount;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Funktion: Baum zeichnen
 | 
					 | 
				
			||||||
void draw_tree(int total , int wrong) {
 | 
					 | 
				
			||||||
    total++;
 | 
					 | 
				
			||||||
    for (int i = 0; i < total - 1; i++) {
 | 
					 | 
				
			||||||
        // Sterne einrücken
 | 
					 | 
				
			||||||
        for (int j = 0; j < total - i - 1; j++) {
 | 
					 | 
				
			||||||
            printf(" ");
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Sterne für diese Ebene zeichnen
 | 
					 | 
				
			||||||
        for (int y = 0; y < (2 * i + 1); y++) {
 | 
					 | 
				
			||||||
            if (wrong == 0 && i == 0) {
 | 
					 | 
				
			||||||
                // Besondere goldene Spitze, wenn alles richtig ist
 | 
					 | 
				
			||||||
                printf("\033[1;33m*\033[0m");
 | 
					 | 
				
			||||||
            } else if (i < wrong) {
 | 
					 | 
				
			||||||
                // Ebene gehört zu den falschen Fragen (Rot)
 | 
					 | 
				
			||||||
                printf("\033[1;31m*\033[0m"); // Rote Sterne
 | 
					 | 
				
			||||||
            } else {
 | 
					 | 
				
			||||||
                // Ebene gehört zu den richtigen Fragen (Grün)
 | 
					 | 
				
			||||||
                printf("\033[1;32m*\033[0m"); // Grüne Sterne
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        printf("\n");
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // Stamm zentrieren
 | 
					 | 
				
			||||||
    for (int i = 0; i < total - 1; i++) {
 | 
					 | 
				
			||||||
        printf(" ");
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    printf("|\n");
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Funktion: Ergebnisse ausgeben
 | 
					 | 
				
			||||||
void print_results(int total, int wrong) {
 | 
					 | 
				
			||||||
    printf("\n=== Ergebnis der Auswertung ===\n");
 | 
					 | 
				
			||||||
    printf("Gesamtfragen: %d\n", total);
 | 
					 | 
				
			||||||
    printf("Falsche Fragen: %d\n", wrong);
 | 
					 | 
				
			||||||
    printf("Richtige Fragen: %d\n", total - wrong);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // Besondere Nachricht, wenn alles richtig ist
 | 
					 | 
				
			||||||
    if (wrong == 0) {
 | 
					 | 
				
			||||||
        printf("\n Perfekt gemacht! Alle Fragen richtig beantwortet! \n");
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Hauptfunktion
 | 
					 | 
				
			||||||
int Flugi() {
 | 
					 | 
				
			||||||
    int zahl_h ; // Höhe des Baumes (Gesamtfragen)
 | 
					 | 
				
			||||||
    int wrong_questions; // Anzahl der falschen Fragen
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    FILE *file;                             // File-Pointer
 | 
					 | 
				
			||||||
    char filename[50] = "questions.txt" ;   // Filename
 | 
					 | 
				
			||||||
    int MaxLines = 500;
 | 
					 | 
				
			||||||
    int MaxLength = 500;
 | 
					 | 
				
			||||||
    char lines[MaxLines][MaxLength];        // Array for separate lines
 | 
					 | 
				
			||||||
    int line_count = 0;                     // Counter for number of lines
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    char Question[MaxLines][MaxLength];     // Array for questions
 | 
					 | 
				
			||||||
    char Answer[MaxLines];                  // Array for answer
 | 
					 | 
				
			||||||
    int qst = 0;
 | 
					 | 
				
			||||||
    int len = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // Open file
 | 
					 | 
				
			||||||
    file = fopen(filename, "r");
 | 
					 | 
				
			||||||
    if (file == NULL) {
 | 
					 | 
				
			||||||
        printf("Fehler: Datei \"%s\" konnte nicht geöffnet werden.\n", filename);
 | 
					 | 
				
			||||||
        return 1; // End program if file can't be opened
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // Read lines from the file
 | 
					 | 
				
			||||||
    while (fgets(lines[line_count], MaxLength, file) != NULL) {
 | 
					 | 
				
			||||||
        size_t len = strlen(lines[line_count]);
 | 
					 | 
				
			||||||
        if (len <= 0){
 | 
					 | 
				
			||||||
            continue;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        #ifdef _WIN32
 | 
					 | 
				
			||||||
            if (lines[line_count][len - 1] == '\n') {
 | 
					 | 
				
			||||||
                lines[line_count][len - 1] = '\0'; // Entferne das '\n'
 | 
					 | 
				
			||||||
                len--; 
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        #else
 | 
					 | 
				
			||||||
            if (lines[line_count][len - 1] == '\n') {
 | 
					 | 
				
			||||||
                lines[line_count][len - 1] = '\0'; // Entferne das '\n'
 | 
					 | 
				
			||||||
                len -= 3; 
 | 
					 | 
				
			||||||
            } else {
 | 
					 | 
				
			||||||
                len -= 1;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        #endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Frage und Antwort trennen
 | 
					 | 
				
			||||||
        if (1) { 
 | 
					 | 
				
			||||||
            Answer[line_count] = lines[line_count][len]; // Letztes Zeichen als Antwort
 | 
					 | 
				
			||||||
            lines[line_count][len - 2] = '\0';              // Kürze Frage um Antwortzeichen
 | 
					 | 
				
			||||||
            strcpy(Question[line_count], lines[line_count]);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        line_count++;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    zahl_h = line_count;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // close file
 | 
					 | 
				
			||||||
    fclose(file);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (0){
 | 
					 | 
				
			||||||
        // Output
 | 
					 | 
				
			||||||
        printf("\nDie Datei wurde in %d Zeilen eingelesen:\n", line_count);
 | 
					 | 
				
			||||||
        for (int i = 0; i < line_count; i++) {
 | 
					 | 
				
			||||||
            printf("Zeile %d: %s\n", i + 1, Question[i]);
 | 
					 | 
				
			||||||
            size_t len = strlen(lines[i]);
 | 
					 | 
				
			||||||
            printf("Antwort: %c\n", Answer[i]);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    //char question[2][50]; //= {"Schaffen wir das? (1 = Ja, 0 = Nein)", "Wie geht das? (1 = Einfach, 0 = Schwer)"};
 | 
					 | 
				
			||||||
    //int answer[2] = {1, 0};
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // Eingabebefehl
 | 
					 | 
				
			||||||
    printf("Für wahre Aussage: W, für falsch Ausage: F\n");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    int incorrectCount = quiz(Question, Answer, zahl_h);
 | 
					 | 
				
			||||||
    printf("Anzahl falscher Antworten: %d\n", incorrectCount);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    wrong_questions = incorrectCount;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // Baum zeichnen
 | 
					 | 
				
			||||||
    draw_tree(zahl_h, wrong_questions);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // Ergebnisse ausgeben
 | 
					 | 
				
			||||||
    print_results(zahl_h, wrong_questions);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    usleep(2000000);
 | 
					 | 
				
			||||||
    return 0;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
int main()
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    Flugi();
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
@ -1,30 +0,0 @@
 | 
				
			|||||||
/* Funktion_Flugi.h
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Autor: Simon Sommer, Simon Ladner, Lucas Defuns, Delia Schmid
 | 
					 | 
				
			||||||
Firma: FHGR
 | 
					 | 
				
			||||||
Version 1.0
 | 
					 | 
				
			||||||
Datum 16.12.2024
 | 
					 | 
				
			||||||
Aenderungen:
 | 
					 | 
				
			||||||
V 1.0 16.12.2024 Erste Version
 | 
					 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#ifndef Funktion_Flugi_H
 | 
					 | 
				
			||||||
#define Funktion_Flugi_H
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include <stdio.h>
 | 
					 | 
				
			||||||
#include <stdlib.h>
 | 
					 | 
				
			||||||
#include <string.h>
 | 
					 | 
				
			||||||
#include <time.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Konstanten für die Dateiverwaltung
 | 
					 | 
				
			||||||
#define MAX_LINES 500
 | 
					 | 
				
			||||||
#define MAX_LENGTH 500
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Funktionsprototypen
 | 
					 | 
				
			||||||
int quiz(char Question[][MAX_LENGTH], char Answer[], int zahl_h);
 | 
					 | 
				
			||||||
void draw_tree(int total, int wrong);
 | 
					 | 
				
			||||||
void print_results(int total, int wrong);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
int Flugi();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#endif // QUIZ_H
 | 
					 | 
				
			||||||
@ -1,148 +0,0 @@
 | 
				
			|||||||
#include <stdio.h>
 | 
					 | 
				
			||||||
#include <string.h>
 | 
					 | 
				
			||||||
#include <ctype.h>
 | 
					 | 
				
			||||||
#include <stdlib.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Funktion, um einen String in Kleinbuchstaben umzuwandeln
 | 
					 | 
				
			||||||
void zuKleinbuchstaben(char* str) {
 | 
					 | 
				
			||||||
    for (int i = 0; str[i]; i++) {
 | 
					 | 
				
			||||||
        str[i] = tolower(str[i]);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Funktion, um die Wellenlänge einer Farbe auszugeben
 | 
					 | 
				
			||||||
int value = 0;
 | 
					 | 
				
			||||||
int failcount = 0;
 | 
					 | 
				
			||||||
int returncode = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
int Wellenlaenge(const char* color) {
 | 
					 | 
				
			||||||
    if (strcmp(color, "rot") == 0) {
 | 
					 | 
				
			||||||
        printf("Die Wellenlänge von rotem Licht liegt im Bereich zwischen 620 und 750 nm.\n");
 | 
					 | 
				
			||||||
    } else if (strcmp(color, "orange") == 0) {
 | 
					 | 
				
			||||||
        printf("Die Wellenlänge von orangem Licht liegt im Bereich zwischen 590 und 620 nm.\n");
 | 
					 | 
				
			||||||
    } else if (strcmp(color, "gelb") == 0) {
 | 
					 | 
				
			||||||
        printf("Die Wellenlänge von gelbem Licht liegt im Bereich zwischen 570 und 590 nm.\n");
 | 
					 | 
				
			||||||
    } else if (strcmp(color, "grün") == 0 || strcmp(color, "gruen") == 0) {
 | 
					 | 
				
			||||||
        printf("Die Wellenlänge von grünem Licht liegt im Bereich zwischen 495 und 570 nm.\n");
 | 
					 | 
				
			||||||
    } else if (strcmp(color, "blau") == 0) {
 | 
					 | 
				
			||||||
        printf("Die Wellenlänge von blauem Licht liegt im Bereich zwischen 450 und 495 nm.\n");
 | 
					 | 
				
			||||||
    } else if (strcmp(color, "violett") == 0) {
 | 
					 | 
				
			||||||
        printf("Die Wellenlänge von violettem Licht liegt im Bereich zwischen 380 und 450 nm.\n");
 | 
					 | 
				
			||||||
    } else if (strcmp(color, "q") == 0) {
 | 
					 | 
				
			||||||
        return 10;
 | 
					 | 
				
			||||||
    } else if (failcount >= 5) {
 | 
					 | 
				
			||||||
        return 20;
 | 
					 | 
				
			||||||
    } else {
 | 
					 | 
				
			||||||
        printf("Oh nein! Diese Farbe kenne ich nicht. Bitte geben sie eine der 6 Grund- oder Komplementärfarben ein.\n");
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    failcount++;
 | 
					 | 
				
			||||||
    return 0;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Funktion, um die Farbe einer Wellenlänge auszugeben
 | 
					 | 
				
			||||||
int wavelength = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void printColor(int wavelength) {
 | 
					 | 
				
			||||||
    if (wavelength < 0){
 | 
					 | 
				
			||||||
        printf("Ich mag keine negativen Zahlen. Bitte eine positive Zahl eingeben!\n");
 | 
					 | 
				
			||||||
        return;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    switch (wavelength) {
 | 
					 | 
				
			||||||
        case 620 ... 750: // Bereich von rotem Licht
 | 
					 | 
				
			||||||
            printf("Das Licht dieser Wellenlänge ist Rot\n");
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
        case 590 ... 619: // Bereich von orangem Licht
 | 
					 | 
				
			||||||
            printf("Das Licht dieser Wellenlänge ist Orange\n");
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
        case 570 ... 589: // Bereich von gelbem Licht
 | 
					 | 
				
			||||||
            printf("Das Licht dieser Wellenlänge ist Gelb\n");
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
        case 495 ... 569: // Bereich von grünem Licht
 | 
					 | 
				
			||||||
            printf("Das Licht dieser Wellenlänge ist Grün\n");
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
        case 450 ... 494: // Bereich von blauem Licht
 | 
					 | 
				
			||||||
            printf("Das Licht dieser Wellenlänge ist Blau\n");
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
        case 380 ... 449: // Bereich von violettem Licht
 | 
					 | 
				
			||||||
            printf("Das Licht dieser Wellenlänge ist Violett\n");
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // nicht sichtbarer Bereich
 | 
					 | 
				
			||||||
        case 0 ... 379:
 | 
					 | 
				
			||||||
            printf("Diese Wellenlänge ist kürzer/kleiner als der Bereich des sichtbaren Lichts\n");
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
        default:
 | 
					 | 
				
			||||||
            printf("Diese Wellenlänge ist länger/grösser als der Bereich des sichtbaren Lichts\n");
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Main Programm
 | 
					 | 
				
			||||||
int Wellenlaengen_rechner_main() {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    printf("Guten Tag.\nSie mögen Farben? Dann sind Sie hier genau richtig, denn ich zeige Ihnen den Zusammenhang zwischen der Wellenlänge und der Farbe von Licht.\n");
 | 
					 | 
				
			||||||
    int modus = 0;
 | 
					 | 
				
			||||||
    int failcount = 0;
 | 
					 | 
				
			||||||
    int returncode = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    char auswahl[21] = {0};
 | 
					 | 
				
			||||||
    long wavelength = 0;
 | 
					 | 
				
			||||||
    char *endptr;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    while (1) {
 | 
					 | 
				
			||||||
        printf("\nFalls Sie die Lichtfarbe des emittierten Lichtes erfahren wollen, drücken Sie die Taste 1. Wenn Sie die Wellenlänge einer bestimmten Lichtfarbe interessiert, drücken Sie die Taste 2.\n");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        scanf("%20s", auswahl);
 | 
					 | 
				
			||||||
        modus = strtol((const char*)auswahl, &endptr, 10);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (*endptr != 0){
 | 
					 | 
				
			||||||
            modus = -1;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        if (*endptr == 'q'){
 | 
					 | 
				
			||||||
            return 10;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Ausgabe der Farbe
 | 
					 | 
				
			||||||
        if (modus==1) {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            printf("Bitte geben Sie eine Wellenlänge ein (in nm): ");
 | 
					 | 
				
			||||||
            scanf("%20s", auswahl);
 | 
					 | 
				
			||||||
            wavelength = strtol((const char*)auswahl, &endptr, 10);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            if (*endptr != 0){
 | 
					 | 
				
			||||||
                wavelength = -1;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            if (*endptr == 'q'){
 | 
					 | 
				
			||||||
                return 10;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            printColor(wavelength);
 | 
					 | 
				
			||||||
        } 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //Ausgabe der Wellenlänge
 | 
					 | 
				
			||||||
        else if (modus==2) {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            char color[50];
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            printf("Bitte geben Sie eine Farbe ein (z. B. Rot, Orange, Gelb, Grün, Blau, Violett): ");
 | 
					 | 
				
			||||||
            scanf("%49s", color);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            // Funktion für Eingabe in Kleinbuchstaben umwandeln abrufen
 | 
					 | 
				
			||||||
            zuKleinbuchstaben(color);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            // Funktion für Ausgabe der Wellenlänge abrufen
 | 
					 | 
				
			||||||
            returncode = Wellenlaenge(color);
 | 
					 | 
				
			||||||
            if (returncode == 10){
 | 
					 | 
				
			||||||
                return 10;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Ungültige Eingabe
 | 
					 | 
				
			||||||
        else {
 | 
					 | 
				
			||||||
            printf("Bitte geben Sie die Nummer eins (1) oder zwei (2) ein. Nichts anderes!!!");
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -1,7 +0,0 @@
 | 
				
			|||||||
#ifndef Rechner_Wellenlaenge2_H_ 
 | 
					 | 
				
			||||||
#define Rechner_Wellenlaenge2_H_ 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
   int Wellenlaengen_rechner_main();
 | 
					 | 
				
			||||||
   
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
@ -1,153 +0,0 @@
 | 
				
			|||||||
/* Haenchen_Drehmoment.c
 | 
					 | 
				
			||||||
Thema: Programm das einem das Rechnen mit Drehmomenten erleichtert.
 | 
					 | 
				
			||||||
Autoren: Glenn Robin Rahts & Jonas Michael Aufschläger
 | 
					 | 
				
			||||||
Firma: FHGR
 | 
					 | 
				
			||||||
Version: 0.1
 | 
					 | 
				
			||||||
Datum: 13.12.2024
 | 
					 | 
				
			||||||
Änderungen:
 | 
					 | 
				
			||||||
0.1: 13.12.2024 Erste Version
 | 
					 | 
				
			||||||
0.2: 16.12.2024 Fehlersuche und Code anpassungen
 | 
					 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Einbinden von Headerdateien der Programmbibliothek.
 | 
					 | 
				
			||||||
#include <stdio.h>
 | 
					 | 
				
			||||||
#include <stdlib.h>
 | 
					 | 
				
			||||||
#include <string.h>
 | 
					 | 
				
			||||||
#include <float.h>
 | 
					 | 
				
			||||||
#include <stdbool.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Mit main beginnt unser Programm.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
int Haenchen_Drehmoment_main() {
 | 
					 | 
				
			||||||
// Variablen
 | 
					 | 
				
			||||||
  char input_start[5]; // Inputvariable für Programmstart
 | 
					 | 
				
			||||||
  char input_loop[5]; // Inputvariable für Berechnungsart
 | 
					 | 
				
			||||||
  char input_t[20]; // Inputvariable Drehmoment
 | 
					 | 
				
			||||||
  char input_l[20]; // Inputvariable Wirkungslaenge
 | 
					 | 
				
			||||||
  char input_f[20]; // Inputvariable Kraft
 | 
					 | 
				
			||||||
  int var_return = 0; // Variable zum beenden
 | 
					 | 
				
			||||||
  float value_t = 0; // Umgewandelter Wert Drehmoment
 | 
					 | 
				
			||||||
  float value_l = 0; // Umgewandelter Wert Wirkungslaenge
 | 
					 | 
				
			||||||
  float value_f = 0; // Umgewandelter Wert Kraft
 | 
					 | 
				
			||||||
  float output_t = 0; // Outputvariable Drehmoment
 | 
					 | 
				
			||||||
  float output_l = 0; // Outputvariable Wirkungslaenge
 | 
					 | 
				
			||||||
  float output_f = 0; // Outputvariable Kraft
 | 
					 | 
				
			||||||
  
 | 
					 | 
				
			||||||
  // Legende zur Funktionsweise des Unterprogramms wird ausgegeben
 | 
					 | 
				
			||||||
  printf("Herzlich Willkommen zum DREHMOMENTRECHNER!\n");
 | 
					 | 
				
			||||||
  printf("Dieses Unterprogramm laesst sich jederzeit mit der 'Q'-Taste beenden.\n");
 | 
					 | 
				
			||||||
  printf("Willst du ein Drehmoment berechnen?\n Ja oder Nein:\n");
 | 
					 | 
				
			||||||
  scanf("%s", &input_start[0]);
 | 
					 | 
				
			||||||
  while (getchar() != '\n'); // Pufferspeicher leeren
 | 
					 | 
				
			||||||
  
 | 
					 | 
				
			||||||
  if (strcmp(input_start, "Ja") == 0) { // Drehmoment berchnen in While Schlaufe
 | 
					 | 
				
			||||||
  
 | 
					 | 
				
			||||||
   while (1) {
 | 
					 | 
				
			||||||
	  printf("Wenn du das Drehmoment aus Wirkungslaenge und Kraft berechnen willst gib ein: M\n");
 | 
					 | 
				
			||||||
	  printf("Wenn du die Wirkungslaenge aus Drehmoment und Kraft berechnen willst gib ein: l\n");
 | 
					 | 
				
			||||||
	  printf("Wenn du die kraft aus Drehmoment und Wirkungslaenge berechnen willst gib ein: F\n");
 | 
					 | 
				
			||||||
	  scanf("%s",&input_loop[0]);
 | 
					 | 
				
			||||||
	  while (getchar() != '\n'); // Pufferspeicher leeren
 | 
					 | 
				
			||||||
	  
 | 
					 | 
				
			||||||
	  if (strcmp(input_loop, "M") == 0) { // Drehmoment
 | 
					 | 
				
			||||||
		  printf("Deine Wirkungslaenge: \n");
 | 
					 | 
				
			||||||
		  scanf("%s", &input_l);
 | 
					 | 
				
			||||||
		  if (input_l[0] == 'q' || input_l[0] == 'Q') {
 | 
					 | 
				
			||||||
			  var_return = 10;
 | 
					 | 
				
			||||||
			  break;
 | 
					 | 
				
			||||||
		  }
 | 
					 | 
				
			||||||
		  printf("Deine Kraft: \n");
 | 
					 | 
				
			||||||
		  scanf("%s", &input_f);
 | 
					 | 
				
			||||||
		   if (input_f[0] == 'q' || input_f[0] == 'Q') {
 | 
					 | 
				
			||||||
			  var_return = 10;
 | 
					 | 
				
			||||||
			  break;
 | 
					 | 
				
			||||||
		  }
 | 
					 | 
				
			||||||
		  value_l = atof(input_l);
 | 
					 | 
				
			||||||
          value_f = atof(input_f);
 | 
					 | 
				
			||||||
          output_t = value_l * value_f;
 | 
					 | 
				
			||||||
          printf("Dein Drehmoment ist: %f\n", output_t);
 | 
					 | 
				
			||||||
		  printf("Wenn du kein Drehmoment mehr Berechnen willst gib ein: Genug\n");
 | 
					 | 
				
			||||||
		  
 | 
					 | 
				
			||||||
	  }
 | 
					 | 
				
			||||||
	  
 | 
					 | 
				
			||||||
	  else if (strcmp(input_loop, "l") == 0) { // Wirkungslaenge
 | 
					 | 
				
			||||||
		  printf("Dein Drehmoment: \n");
 | 
					 | 
				
			||||||
		  scanf("%s", &input_t);
 | 
					 | 
				
			||||||
		   if (input_t[0] == 'q' || input_t[0] == 'Q') {
 | 
					 | 
				
			||||||
			  var_return = 10;
 | 
					 | 
				
			||||||
			  break;
 | 
					 | 
				
			||||||
		  }
 | 
					 | 
				
			||||||
		  printf("Deine Kraft: \n");
 | 
					 | 
				
			||||||
		  scanf("%s", &input_f);
 | 
					 | 
				
			||||||
		   if (input_f[0] == 'q' || input_f[0] == 'Q') {
 | 
					 | 
				
			||||||
			  var_return = 10;
 | 
					 | 
				
			||||||
			  break;
 | 
					 | 
				
			||||||
		  }
 | 
					 | 
				
			||||||
		  value_t = atof(input_t);
 | 
					 | 
				
			||||||
          value_f = atof(input_f);
 | 
					 | 
				
			||||||
          output_l = value_t / value_f;
 | 
					 | 
				
			||||||
          printf("Deine Wirkungslaenge ist: %f\n", output_l);
 | 
					 | 
				
			||||||
		  printf("Wenn du kein Drehmoment mehr Berechnen willst gib ein: Genug\n");
 | 
					 | 
				
			||||||
		  
 | 
					 | 
				
			||||||
	  }
 | 
					 | 
				
			||||||
	  
 | 
					 | 
				
			||||||
	  else if (strcmp(input_loop, "F") == 0) { // Kraft
 | 
					 | 
				
			||||||
		  printf("Dein Drehmoment: \n");
 | 
					 | 
				
			||||||
		  scanf("%s", &input_t);
 | 
					 | 
				
			||||||
		   if (input_t[0] == 'q' || input_t[0] == 'Q') {
 | 
					 | 
				
			||||||
			  var_return = 10;
 | 
					 | 
				
			||||||
			  break;
 | 
					 | 
				
			||||||
		  }
 | 
					 | 
				
			||||||
		  printf("Deine Wirkungslaenge: \n");
 | 
					 | 
				
			||||||
		  scanf("%s", &input_l);
 | 
					 | 
				
			||||||
		   if (input_l[0] == 'q' || input_l[0] == 'Q') {
 | 
					 | 
				
			||||||
			  var_return = 10;
 | 
					 | 
				
			||||||
			  break;
 | 
					 | 
				
			||||||
		  }
 | 
					 | 
				
			||||||
		  value_t = atof(input_t);
 | 
					 | 
				
			||||||
          value_l = atof(input_l);
 | 
					 | 
				
			||||||
          output_f = value_t / value_l;
 | 
					 | 
				
			||||||
          printf("Deine Kraft ist: %f\n", output_f);
 | 
					 | 
				
			||||||
		  printf("Wenn du kein Drehmoment mehr Berechnen willst gib ein: Genug\n");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	  }
 | 
					 | 
				
			||||||
	  
 | 
					 | 
				
			||||||
      else if (input_loop[0] == 'q' || input_loop[0] == 'Q') { // Abbruch
 | 
					 | 
				
			||||||
		  var_return = 10;
 | 
					 | 
				
			||||||
		  break;
 | 
					 | 
				
			||||||
	  }
 | 
					 | 
				
			||||||
	  
 | 
					 | 
				
			||||||
	  else if (strcmp(input_loop, "Genug") == 0) { // Abbruch
 | 
					 | 
				
			||||||
		  var_return = 0;
 | 
					 | 
				
			||||||
		  break;
 | 
					 | 
				
			||||||
	  }
 | 
					 | 
				
			||||||
	  
 | 
					 | 
				
			||||||
	  else { // Falsche Eingabe
 | 
					 | 
				
			||||||
		  printf("Du huere sautubel du, aes hett gheisse: M,l,F / Genug!\n");
 | 
					 | 
				
			||||||
		  var_return = 20;
 | 
					 | 
				
			||||||
		  break;
 | 
					 | 
				
			||||||
	  }
 | 
					 | 
				
			||||||
   }
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
  
 | 
					 | 
				
			||||||
  else if (strcmp(input_start, "Nein") == 0) { //Beenden des Programms
 | 
					 | 
				
			||||||
	  var_return = 0;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
  
 | 
					 | 
				
			||||||
  else if (input_start[0] == 'q' || input_start[0] == 'Q') { // Abbruch
 | 
					 | 
				
			||||||
	  var_return = 10;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
  
 | 
					 | 
				
			||||||
  else { // Falsche Eingabe
 | 
					 | 
				
			||||||
	  printf("Du huere sautubel du, aes isch ae Ja/Nei frag!\n");
 | 
					 | 
				
			||||||
	  var_return = 20;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
  
 | 
					 | 
				
			||||||
  // Präprozessoranweisung (Linux oder Windows?)
 | 
					 | 
				
			||||||
  #ifndef __linux__ // Hält die Konsole offen.
 | 
					 | 
				
			||||||
  system("pause");
 | 
					 | 
				
			||||||
  #endif
 | 
					 | 
				
			||||||
  
 | 
					 | 
				
			||||||
  // Rückgabewert, dass das Programm erfolgreich beendet wurde.
 | 
					 | 
				
			||||||
  return var_return;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -1,7 +0,0 @@
 | 
				
			|||||||
#ifndef HAENCHEN_DREHMOMENT_H_ 
 | 
					 | 
				
			||||||
#define HAENCHEN_DREHMOMENT_H_ 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
   int Haenchen_Drehmoment_main();
 | 
					 | 
				
			||||||
   
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
@ -1,439 +0,0 @@
 | 
				
			|||||||
/* Ramen_Physik.c
 | 
					 | 
				
			||||||
Hier werden Physikaufgaben gelöst mit einem Spiel als Pause
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Autor: Jana Nieblas, Debora Semmler
 | 
					 | 
				
			||||||
Firma: FHGR
 | 
					 | 
				
			||||||
Version 1.0
 | 
					 | 
				
			||||||
Datum 11.12.2024
 | 
					 | 
				
			||||||
Aenderungen:
 | 
					 | 
				
			||||||
V 1.0 11.12.2024 Erste Version
 | 
					 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Einbindung Bibliotheken
 | 
					 | 
				
			||||||
#include <stdio.h>
 | 
					 | 
				
			||||||
#include <stdlib.h>
 | 
					 | 
				
			||||||
#include <time.h>
 | 
					 | 
				
			||||||
#include <string.h>
 | 
					 | 
				
			||||||
#include <unistd.h>
 | 
					 | 
				
			||||||
#ifdef _WIN32
 | 
					 | 
				
			||||||
#include <windows.h>
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Einbindung Dateien
 | 
					 | 
				
			||||||
#include "Tic_Tac_Toe.h"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
//Definitionen
 | 
					 | 
				
			||||||
#define max_anzahl_fehler 3
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Abfrage Antworten
 | 
					 | 
				
			||||||
int antwort (int loesung, int *falsche_antwort){
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    while (1)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        int eingabe;
 | 
					 | 
				
			||||||
        scanf("%d", &eingabe);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (eingabe == loesung)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            printf("Richtige Antwort \n");
 | 
					 | 
				
			||||||
            return 0;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        else {
 | 
					 | 
				
			||||||
            printf("Falsche antwort \n");
 | 
					 | 
				
			||||||
            *falsche_antwort += 1;
 | 
					 | 
				
			||||||
           if (*falsche_antwort >= max_anzahl_fehler) {
 | 
					 | 
				
			||||||
                printf("Zu viele ungültige Eingaben. Programm beendet.\n");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                fflush(stdout);
 | 
					 | 
				
			||||||
                //Sleep
 | 
					 | 
				
			||||||
                #ifdef __linux__
 | 
					 | 
				
			||||||
                    sleep(2);
 | 
					 | 
				
			||||||
                #elif _WIN32
 | 
					 | 
				
			||||||
                    // Sleep ist in Milisekunden
 | 
					 | 
				
			||||||
                    Sleep(2 * 1000);
 | 
					 | 
				
			||||||
                #endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                return 20;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }    
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Zufällige Ausgabe der Fragen
 | 
					 | 
				
			||||||
int zufaellig(int maximum){
 | 
					 | 
				
			||||||
    int n = rand() % maximum;
 | 
					 | 
				
			||||||
    return n;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
//einfache Fragen
 | 
					 | 
				
			||||||
int einfache_fragen(int *falsche_antwort){
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    //Variabeln
 | 
					 | 
				
			||||||
    const int anzahl_fragen = 8;
 | 
					 | 
				
			||||||
    int fragen[3] = {-1, -1,-1};
 | 
					 | 
				
			||||||
    int return_code = 0;
 | 
					 | 
				
			||||||
    int x = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    //Lösungseingabe
 | 
					 | 
				
			||||||
    printf("Gib '1' ein falls die Aussage wahr ist und '2' falls die Aussage falsch ist. \n \n");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    //abfragen der verwendeten Fragen
 | 
					 | 
				
			||||||
    for (int i = 0; i < 3; i++)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        
 | 
					 | 
				
			||||||
        while (1)      
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            x = zufaellig(anzahl_fragen);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            if (x != fragen[0] && x != fragen[1] && x != fragen[2])
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        
 | 
					 | 
				
			||||||
        fragen[i]=x;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //Fragen
 | 
					 | 
				
			||||||
        switch (x)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
        case 0 :
 | 
					 | 
				
			||||||
            printf("Der relative Fehler ist eine Grösse ohne Masseinheit. \n");
 | 
					 | 
				
			||||||
            return_code = antwort(1, falsche_antwort);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 1 :
 | 
					 | 
				
			||||||
            printf("Es gilt 10^-12 nm = 1 km  \n");
 | 
					 | 
				
			||||||
            return_code = antwort(2, falsche_antwort);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 2 :
 | 
					 | 
				
			||||||
            printf("Die Gewichtskraft eines Objektes steigt linear mit dessen Masse. \n");
 | 
					 | 
				
			||||||
            return_code = antwort(1, falsche_antwort);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 3 :
 | 
					 | 
				
			||||||
            printf("Ein Druck kann sowohl in Flüssigkeiten als auch in Gasen herrschen. \n");
 | 
					 | 
				
			||||||
            return_code = antwort(1, falsche_antwort);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 4 :
 | 
					 | 
				
			||||||
            printf("Der Luftdruck auf Meereshöhe beträgt ca. 10 bar.  \n");
 | 
					 | 
				
			||||||
            return_code = antwort(2, falsche_antwort);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 5 :
 | 
					 | 
				
			||||||
            printf("Die barometrische Höhenformel gilt unter der Annahme, dass die Luft in der Atmosphäre überall die gleiche Temperatur hat. \n");
 | 
					 | 
				
			||||||
            return_code = antwort(1, falsche_antwort);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 6 :
 | 
					 | 
				
			||||||
            printf("Es gilt ∆W = mg ∆h, wenn man Reibung und Luftwiderstand vernachlässigt. \n");
 | 
					 | 
				
			||||||
            return_code = antwort(1, falsche_antwort);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 7 :
 | 
					 | 
				
			||||||
            printf("Wird eine Kugel von einer an der Wand befestigten Feder horizontal weggeschleudert wird, dann wird die elastische Energie in kinetische Energie umgewandelt.  \n");
 | 
					 | 
				
			||||||
            return_code = antwort(1, falsche_antwort);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        default:
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (return_code == 20)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            return 20;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    return 10;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
//mittlere Fragen
 | 
					 | 
				
			||||||
int mittlere_fragen(int *falsche_antwort){
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    //Variabeln
 | 
					 | 
				
			||||||
    const int anzahl_fragen = 8;
 | 
					 | 
				
			||||||
    int fragen[3] = {-1, -1,-1};
 | 
					 | 
				
			||||||
    int return_code = 0;
 | 
					 | 
				
			||||||
    int x = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    //Lösungseingabe
 | 
					 | 
				
			||||||
    printf("Gib '1' ein falls die Aussage wahr ist und '2' falls die Aussage falsch ist. \n \n");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    //abfragen verwendeter Fragen
 | 
					 | 
				
			||||||
    for (int i = 0; i < 3; i++)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        
 | 
					 | 
				
			||||||
        while (1)      
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            x = zufaellig(anzahl_fragen);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            if (x != fragen[0] && x != fragen[1] && x != fragen[2])
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        
 | 
					 | 
				
			||||||
        fragen[i]=x;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //Fragen
 | 
					 | 
				
			||||||
        switch (x)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
        case 0 :
 | 
					 | 
				
			||||||
            printf("In der Physik sind weltweit ausschliesslich SI-Einheiten in Gebrauch. \n");
 | 
					 | 
				
			||||||
            return_code = antwort(2, falsche_antwort);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 1 :
 | 
					 | 
				
			||||||
            printf("Das Prinzip actio et reactio ist eine Folge des Impuls-Erhaltungssatzes. \n");
 | 
					 | 
				
			||||||
            return_code = antwort(1, falsche_antwort);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 2 :
 | 
					 | 
				
			||||||
            printf("Befindet sich ein Körper im Stillstand, dann wirkt überhaupt keine Kraft auf ihn. \n");
 | 
					 | 
				
			||||||
            return_code = antwort(2, falsche_antwort);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 3 :
 | 
					 | 
				
			||||||
            printf("Verdoppelt man den Steigungswinkel einer Rampe, dann verdoppelt man auch ihre Steigung.  \n");
 | 
					 | 
				
			||||||
            return_code = antwort(2, falsche_antwort);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 4 :
 | 
					 | 
				
			||||||
            printf("Die Ruhepunkt-Methode basiert auf dem Newton-Aktionsprinzip.  \n");
 | 
					 | 
				
			||||||
            return_code = antwort(1, falsche_antwort);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 5 :
 | 
					 | 
				
			||||||
            printf("Mit Hilfe der Ruhepunkt-Methode erkennt man, ob die berechneten Kräfte eine Belastung auf Zug oder Druck bedeuten.  \n");
 | 
					 | 
				
			||||||
            return_code = antwort(1, falsche_antwort);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 6 :
 | 
					 | 
				
			||||||
            printf("Für jede Bewegung ist die geleistete Arbeit gleich der Fläche im s-F-Diagramm zwischen dem Graphen von F(s) und der s-Achse \n");
 | 
					 | 
				
			||||||
            return_code = antwort(1, falsche_antwort);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 7 :
 | 
					 | 
				
			||||||
            printf("Die Leistung quantifiziert den Energiestrom, d.h. die übertragene Energie pro Zeiteinheit auf ein Objekt.  \n");
 | 
					 | 
				
			||||||
            return_code = antwort(1, falsche_antwort);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        default:
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (return_code == 20)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            return 20;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    return 10;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
//schwere Fragen
 | 
					 | 
				
			||||||
int schwere_fragen(int *falsche_antwort){
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    //Variabeln
 | 
					 | 
				
			||||||
    const int anzahl_fragen = 8;
 | 
					 | 
				
			||||||
    int fragen[3] = {-1, -1,-1};
 | 
					 | 
				
			||||||
    int return_code = 0;
 | 
					 | 
				
			||||||
    int x = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    //Lösungseingabe
 | 
					 | 
				
			||||||
    printf("Gib '1' ein falls die Aussage wahr ist und '2' falls die Aussage falsch ist. \n \n");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    //abfragen verwendeter Fragen
 | 
					 | 
				
			||||||
    for (int i = 0; i < 3; i++)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        
 | 
					 | 
				
			||||||
        while (1)      
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            x = zufaellig(anzahl_fragen);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            if (x != fragen[0] && x != fragen[1] && x != fragen[2])
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        
 | 
					 | 
				
			||||||
        fragen[i]=x;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //Fragen
 | 
					 | 
				
			||||||
        switch (x)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
        case 0 :
 | 
					 | 
				
			||||||
            printf("Die 7 SI-Basis-Einheiten orientieren sich an den Grössenordnungen der Menschen.  \n");
 | 
					 | 
				
			||||||
            return_code = antwort(1, falsche_antwort);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 1 :
 | 
					 | 
				
			||||||
            printf("Die Ursache des Impuls-Erhaltungssatzes ist die Zeitunabhängigkeit der physikalischen Gesetze.  \n");
 | 
					 | 
				
			||||||
            return_code = antwort(2, falsche_antwort);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 2 :
 | 
					 | 
				
			||||||
            printf("Der Begriff Kraft quantifiziert den Impulsstrom, d.h. den Impulsübertrag pro Zeiteinheit auf ein Objekt.  \n");
 | 
					 | 
				
			||||||
            return_code = antwort(1, falsche_antwort);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 3 :
 | 
					 | 
				
			||||||
            printf("Wirkt auf ein fahrendes Auto nur der turbulente Strömungswiderstand, dann wird es gleichförmig abgebremst. \n");
 | 
					 | 
				
			||||||
            return_code = antwort(2, falsche_antwort);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 4 :
 | 
					 | 
				
			||||||
            printf("Die Leistung eines Blitzschlages kann die Leistung eines Grosskraftwerkes weit übertreffen.  \n");
 | 
					 | 
				
			||||||
            return_code = antwort(1, falsche_antwort);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 5 :
 | 
					 | 
				
			||||||
            printf("Wird ein Körper von der Geschwindigkeit v0 < 0 mit konstanter Leistung P auf eine Geschwindigkeit vE < v0 beschleunigt, dann gilt P < 0. \n");
 | 
					 | 
				
			||||||
            return_code = antwort(2, falsche_antwort);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 6 :
 | 
					 | 
				
			||||||
            printf("Ist die Beschleunigungsfunktion eines Objektes strikt negativ, d.h. gilt a(t) < 0 zu jeder Zeit t ≥ t0, dann bewegt sich das Objekt zu jeder Zeit t ≥ t0 in Rückwärtsrichtung (negative Bewegungsrichtung). \n");
 | 
					 | 
				
			||||||
            return_code = antwort(2, falsche_antwort);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 7 :
 | 
					 | 
				
			||||||
            printf("Es seien ∆t = tE - t0, ∆s = sE - s0 und ∆v = vE - v0. Dann gilt für jede Bewegung v(t) = ∆s/∆t und a(t) = ∆v/∆t. \n");
 | 
					 | 
				
			||||||
            return_code = antwort(2, falsche_antwort);
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        default:
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (return_code == 20)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            return 20;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    return 10;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Hauptunktionen                                                            
 | 
					 | 
				
			||||||
int Ramen_Physik(){
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // Umlaute
 | 
					 | 
				
			||||||
    system("chcp 65001 >null");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // Zufallsgenerator initialisieren
 | 
					 | 
				
			||||||
    srand(time(NULL));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    //Variabeln
 | 
					 | 
				
			||||||
    char eingabe = '0';
 | 
					 | 
				
			||||||
    int return_code = 0;
 | 
					 | 
				
			||||||
    int falsche_antwort = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    while (1){
 | 
					 | 
				
			||||||
        //löschen der Konsole
 | 
					 | 
				
			||||||
        printf("\e[1;1H\e[2J");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //Auswahl der Schwierigkeitsstufe
 | 
					 | 
				
			||||||
        printf("1 \t einfache Fragen \n");
 | 
					 | 
				
			||||||
        printf("2 \t mittlere Fragen \n");
 | 
					 | 
				
			||||||
        printf("3 \t schwere Fragen \n");
 | 
					 | 
				
			||||||
        printf("q \t zurück zum Hauptmenu \n");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        scanf("%c", &eingabe);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        //Abfrage der Eingabe
 | 
					 | 
				
			||||||
        switch (eingabe){
 | 
					 | 
				
			||||||
            case '1':{
 | 
					 | 
				
			||||||
                printf("\neinfache Fragen\n");
 | 
					 | 
				
			||||||
                return_code = einfache_fragen(&falsche_antwort);
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            case '2':{
 | 
					 | 
				
			||||||
                printf("\nmittlere Fragen\n");
 | 
					 | 
				
			||||||
                return_code = mittlere_fragen(&falsche_antwort);
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            case '3':{
 | 
					 | 
				
			||||||
                printf("\nschwere Fragen\n");
 | 
					 | 
				
			||||||
                return_code = schwere_fragen(&falsche_antwort);
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            case '4':{
 | 
					 | 
				
			||||||
                Tic_Tac_Toe();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                fflush(stdout);
 | 
					 | 
				
			||||||
                //Sleep
 | 
					 | 
				
			||||||
                #ifdef __linux__
 | 
					 | 
				
			||||||
                    sleep(2);
 | 
					 | 
				
			||||||
                #elif _WIN32
 | 
					 | 
				
			||||||
                // Sleep ist in Milisekunden
 | 
					 | 
				
			||||||
                    Sleep(2 * 1000);
 | 
					 | 
				
			||||||
                #endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            case 'q':{
 | 
					 | 
				
			||||||
                printf("\nProgramm beendet \n");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                fflush(stdout);
 | 
					 | 
				
			||||||
                //Sleep
 | 
					 | 
				
			||||||
                #ifdef __linux__
 | 
					 | 
				
			||||||
                    // sleep(2);
 | 
					 | 
				
			||||||
                #elif _WIN32
 | 
					 | 
				
			||||||
                // Sleep ist in Milisekunden
 | 
					 | 
				
			||||||
                    Sleep(2 * 1000);
 | 
					 | 
				
			||||||
                #endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                return 10;
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            case '\n':{
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            default: {
 | 
					 | 
				
			||||||
                printf("Zu viele ungültige Eingaben. Programm beendet.\n");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                fflush(stdout);
 | 
					 | 
				
			||||||
                //Sleep
 | 
					 | 
				
			||||||
                #ifdef __linux__
 | 
					 | 
				
			||||||
                    sleep(2);
 | 
					 | 
				
			||||||
                #elif _WIN32
 | 
					 | 
				
			||||||
                    // Sleep ist in Milisekunden
 | 
					 | 
				
			||||||
                    Sleep(2 * 1000);
 | 
					 | 
				
			||||||
                #endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                return 20;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        switch (return_code){
 | 
					 | 
				
			||||||
          case 10: { 
 | 
					 | 
				
			||||||
            Tic_Tac_Toe(); 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            fflush(stdout);
 | 
					 | 
				
			||||||
            //Sleep
 | 
					 | 
				
			||||||
            #ifdef __linux__
 | 
					 | 
				
			||||||
                sleep(2);
 | 
					 | 
				
			||||||
            #elif _WIN32
 | 
					 | 
				
			||||||
                // Sleep ist in Milisekunden
 | 
					 | 
				
			||||||
                Sleep(2 * 1000);
 | 
					 | 
				
			||||||
            #endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            return_code = 0; 
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
          case 20: return 20; break; 
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    return 0;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -1,187 +0,0 @@
 | 
				
			|||||||
/* Tic Tac Toe
 | 
					 | 
				
			||||||
Ein einfaches Tic Tac Toe programm
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Autor: Debora Semmler
 | 
					 | 
				
			||||||
Firma: FHGR
 | 
					 | 
				
			||||||
Version: 1.0
 | 
					 | 
				
			||||||
Datum: 13.12.2024
 | 
					 | 
				
			||||||
Aenderungen:
 | 
					 | 
				
			||||||
V 1.0 13.12.2024 Erste Version
 | 
					 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Einbinden von Headerdateien der Programmbibliothek.
 | 
					 | 
				
			||||||
#include <stdio.h>
 | 
					 | 
				
			||||||
#include <stdlib.h>
 | 
					 | 
				
			||||||
#include <stdbool.h>
 | 
					 | 
				
			||||||
#include <time.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
//Definition von Spielfeld und Symbolen
 | 
					 | 
				
			||||||
char board[3][3];
 | 
					 | 
				
			||||||
const char PLAYER = 'O';
 | 
					 | 
				
			||||||
const char COMPUTER = 'X';
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
//Funktionsprototypen
 | 
					 | 
				
			||||||
void resetBoard();
 | 
					 | 
				
			||||||
void printBoard();
 | 
					 | 
				
			||||||
int checkFreeSpaces();
 | 
					 | 
				
			||||||
void playerMoves();
 | 
					 | 
				
			||||||
void computerMoves();
 | 
					 | 
				
			||||||
char checkWinner();
 | 
					 | 
				
			||||||
void printWinner(char);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
//Das Hauptprogramm
 | 
					 | 
				
			||||||
int Tic_Tac_Toe() 
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	printf("Du spielst mit O und der Computer mit X \n \n");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	char winner = ' ';
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	resetBoard();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	while(winner == ' ' && checkFreeSpaces() != 0)
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		printBoard();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		playerMoves();
 | 
					 | 
				
			||||||
		winner = checkWinner();
 | 
					 | 
				
			||||||
		if(winner != ' ' || checkFreeSpaces() == 0){
 | 
					 | 
				
			||||||
			break;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		computerMoves();
 | 
					 | 
				
			||||||
		winner = checkWinner();
 | 
					 | 
				
			||||||
		if(winner != ' ' || checkFreeSpaces() == 0){
 | 
					 | 
				
			||||||
			break;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	printBoard();
 | 
					 | 
				
			||||||
	printWinner(winner);
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	// Rückgabewert, dass das Programm erfolgreich beendet wurde.
 | 
					 | 
				
			||||||
	return 0;
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void resetBoard(){
 | 
					 | 
				
			||||||
	for(int i = 0; i<3; i++)
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		for(int j = 0; j<3; j++)
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			board[i][j]	= ' ';
 | 
					 | 
				
			||||||
		}	
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
//Gibt das Spielfeld aus
 | 
					 | 
				
			||||||
void printBoard(){
 | 
					 | 
				
			||||||
	printf("[ %c ][ %c ][ %c ]\n", board[0][0], board[0][1], board[0][2]);
 | 
					 | 
				
			||||||
	printf("[ %c ][ %c ][ %c ]\n", board[1][0], board[1][1], board[1][2]);
 | 
					 | 
				
			||||||
	printf("[ %c ][ %c ][ %c ]\n", board[2][0], board[2][1], board[2][2]);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
//Zählt die freien Felder auf dem Spielfeld
 | 
					 | 
				
			||||||
int checkFreeSpaces(){
 | 
					 | 
				
			||||||
	int freeSpaces = 9;	
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	for(int i = 0; i<3; i++)
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		for(int j = 0; j<3; j++)
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			if(board[i][j] != ' ')
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				freeSpaces--;
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	return freeSpaces;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
//Ernöglicht dem Spieler einen Zug zu machen
 | 
					 | 
				
			||||||
void playerMoves(){
 | 
					 | 
				
			||||||
	int x;
 | 
					 | 
				
			||||||
	int y;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	do
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		printf("Gibt die Horizontale ein (1-3): ");
 | 
					 | 
				
			||||||
		scanf("%d", &x);
 | 
					 | 
				
			||||||
		x--;
 | 
					 | 
				
			||||||
		printf("Gib die Vertikale ein (1-3): ");
 | 
					 | 
				
			||||||
		scanf("%d", &y);
 | 
					 | 
				
			||||||
		y--;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if(board[x][y] != ' ')
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			printf("Ungültig!\n");
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		else{
 | 
					 | 
				
			||||||
			board[x][y] = PLAYER;
 | 
					 | 
				
			||||||
			break;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	} while (board[x][y] != ' ');
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
//Der Computer macht einen Zufallszug
 | 
					 | 
				
			||||||
void computerMoves(){
 | 
					 | 
				
			||||||
	//Seed für Zufallszahlen
 | 
					 | 
				
			||||||
	srand(time(0));
 | 
					 | 
				
			||||||
	int x;
 | 
					 | 
				
			||||||
	int y;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if(checkFreeSpaces() > 0){
 | 
					 | 
				
			||||||
		do
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			x = rand() % 3;
 | 
					 | 
				
			||||||
			y = rand() % 3;
 | 
					 | 
				
			||||||
		} while (board[x][y] != ' ');
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		board[x][y] = COMPUTER;	
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	else{
 | 
					 | 
				
			||||||
		printWinner(' ');
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
//Überprüft die Gewinn bedingungen
 | 
					 | 
				
			||||||
char checkWinner(){
 | 
					 | 
				
			||||||
	//Prüft nach horizontalen Gewinnbedingungen
 | 
					 | 
				
			||||||
	for(int i = 0; i < 3; i ++){
 | 
					 | 
				
			||||||
		if(board[i][0] == board[i][1] && board[i][0] == board[i][2]){
 | 
					 | 
				
			||||||
			return board[i][0]; 
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	//Prüft nach vertikalen Gewinnbedingungen
 | 
					 | 
				
			||||||
	for(int i = 0; i < 3; i ++){
 | 
					 | 
				
			||||||
		if(board[0][i] == board[1][i] && board[0][i] == board[2][i]){
 | 
					 | 
				
			||||||
			return board[0][i]; 
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	//Prüft nach diagonalen Gewinnbedingungen
 | 
					 | 
				
			||||||
	if(board[0][0] == board[1][1] && board[0][0] == board[2][2]){
 | 
					 | 
				
			||||||
		return board[0][0]; 
 | 
					 | 
				
			||||||
	}	
 | 
					 | 
				
			||||||
	if(board[0][2] == board[1][1] && board[0][2] == board[2][0]){
 | 
					 | 
				
			||||||
		return board[0][2]; 
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	return ' ';
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
//Gibt das Ergebnis des Spieldurchgangs aus
 | 
					 | 
				
			||||||
void printWinner(char winner){
 | 
					 | 
				
			||||||
	if(winner == PLAYER){
 | 
					 | 
				
			||||||
		printf("DU HAST GEWONNEN!");
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	else if(winner == COMPUTER){
 | 
					 | 
				
			||||||
		printf("DU HAST VERLOREN!");
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	else{
 | 
					 | 
				
			||||||
		printf("ES IST EIN UNENTSCHIEDEN!");
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -1,18 +0,0 @@
 | 
				
			|||||||
/* Ramen_Physik.h
 | 
					 | 
				
			||||||
Hier wir das Spiel als Pause verknüpft
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Autor: Jana Nieblas
 | 
					 | 
				
			||||||
Firma: FHGR
 | 
					 | 
				
			||||||
Version 1.0
 | 
					 | 
				
			||||||
Datum 15.12.2024
 | 
					 | 
				
			||||||
Aenderungen:
 | 
					 | 
				
			||||||
V 1.0 15.12.2024 Erste Version
 | 
					 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#ifndef _FILE_NAME_H_ 
 | 
					 | 
				
			||||||
#define _FILE_NAME_H_ 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
   //extern Spiel; 
 | 
					 | 
				
			||||||
   extern int Tic_Tac_Toe();
 | 
					 | 
				
			||||||
   
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
							
								
								
									
										391
									
								
								src/Ramen_Physik.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										391
									
								
								src/Ramen_Physik.c
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,391 @@
 | 
				
			|||||||
 | 
					/* Ramen_Physik.c
 | 
				
			||||||
 | 
					Hier werden Physikaufgaben gelöst mit einem Spiel als Pause
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Autor: Jana Nieblas, Debora Semmler
 | 
				
			||||||
 | 
					Firma: FHGR
 | 
				
			||||||
 | 
					Version 1.0
 | 
				
			||||||
 | 
					Datum 11.12.2024
 | 
				
			||||||
 | 
					Aenderungen:
 | 
				
			||||||
 | 
					V 1.0 11.12.2024 Erste Version
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <stdio.h>
 | 
				
			||||||
 | 
					#include <stdlib.h>
 | 
				
			||||||
 | 
					#include <time.h>
 | 
				
			||||||
 | 
					#include <string.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//Definitionen
 | 
				
			||||||
 | 
					#define max_anzahl_fehler 3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Abfrage Antworten
 | 
				
			||||||
 | 
					int antwort (int loesung, int *falsche_antwort){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    while (1)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        int eingabe;
 | 
				
			||||||
 | 
					        scanf("%d", &eingabe);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (eingabe == loesung)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            printf("Richtige Antwort \n");
 | 
				
			||||||
 | 
					            return 0;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        else {
 | 
				
			||||||
 | 
					            printf("Falsche antwort \n");
 | 
				
			||||||
 | 
					            *falsche_antwort += 1;
 | 
				
			||||||
 | 
					           if (*falsche_antwort >= max_anzahl_fehler) {
 | 
				
			||||||
 | 
					                printf("Zu viele ungültige Eingaben. Programm beendet.\n");
 | 
				
			||||||
 | 
					                return 20;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }    
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Zufällige Ausgabe der Fragen
 | 
				
			||||||
 | 
					int zufaellig(int maximum){
 | 
				
			||||||
 | 
					    int n = rand() % maximum;
 | 
				
			||||||
 | 
					    return n;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//einfache Fragen
 | 
				
			||||||
 | 
					int einfache_fragen(int *falsche_antwort){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    //Variabeln
 | 
				
			||||||
 | 
					    const int anzahl_fragen = 10;
 | 
				
			||||||
 | 
					    int fragen[3] = {-1, -1,-1};
 | 
				
			||||||
 | 
					    int return_code = 0;
 | 
				
			||||||
 | 
					    int x = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    //abfragen der verwendeten Fragen
 | 
				
			||||||
 | 
					    for (int i = 0; i < 3; i++)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        while (1)      
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            x = zufaellig(anzahl_fragen);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (x != fragen[0] && x != fragen[1] && x != fragen[2])
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        fragen[i]=x;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //Fragen
 | 
				
			||||||
 | 
					        switch (x)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					        case 0 :
 | 
				
			||||||
 | 
					            printf("Frage 1 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case 1 :
 | 
				
			||||||
 | 
					            printf("Frage 2 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case 2 :
 | 
				
			||||||
 | 
					            printf("Frage 3 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case 3 :
 | 
				
			||||||
 | 
					            printf("Frage 4 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case 4 :
 | 
				
			||||||
 | 
					            printf("Frage 5 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case 5 :
 | 
				
			||||||
 | 
					            printf("Frage 6 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case 6 :
 | 
				
			||||||
 | 
					            printf("Frage 7 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case 7 :
 | 
				
			||||||
 | 
					            printf("Frage 8 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case 8 :
 | 
				
			||||||
 | 
					            printf("Frage 9 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case 9 :
 | 
				
			||||||
 | 
					            printf("Frage 10 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        default:
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (return_code == 20)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            return 20;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//mittlere Fragen
 | 
				
			||||||
 | 
					int mittlere_fragen(int *falsche_antwort){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    //Variabeln
 | 
				
			||||||
 | 
					    const int anzahl_fragen = 10;
 | 
				
			||||||
 | 
					    int fragen[3] = {-1, -1,-1};
 | 
				
			||||||
 | 
					    int return_code = 0;
 | 
				
			||||||
 | 
					    int x = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    //abfragen verwendeter Fragen
 | 
				
			||||||
 | 
					    for (int i = 0; i < 3; i++)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        while (1)      
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            x = zufaellig(anzahl_fragen);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (x != fragen[0] && x != fragen[1] && x != fragen[2])
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        fragen[i]=x;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //Fragen
 | 
				
			||||||
 | 
					        switch (x)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					        case 0 :
 | 
				
			||||||
 | 
					            printf("Frage 1 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case 1 :
 | 
				
			||||||
 | 
					            printf("Frage 2 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case 2 :
 | 
				
			||||||
 | 
					            printf("Frage 3 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case 3 :
 | 
				
			||||||
 | 
					            printf("Frage 4 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case 4 :
 | 
				
			||||||
 | 
					            printf("Frage 5 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case 5 :
 | 
				
			||||||
 | 
					            printf("Frage 6 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case 6 :
 | 
				
			||||||
 | 
					            printf("Frage 7 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case 7 :
 | 
				
			||||||
 | 
					            printf("Frage 8 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case 8 :
 | 
				
			||||||
 | 
					            printf("Frage 9 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case 9 :
 | 
				
			||||||
 | 
					            printf("Frage 10 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        default:
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (return_code == 20)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            return 20;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//schwere Fragen
 | 
				
			||||||
 | 
					int schwere_fragen(int *falsche_antwort){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    //Variabeln
 | 
				
			||||||
 | 
					    const int anzahl_fragen = 10;
 | 
				
			||||||
 | 
					    int fragen[3] = {-1, -1,-1};
 | 
				
			||||||
 | 
					    int return_code = 0;
 | 
				
			||||||
 | 
					    int x = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    //abfragen verwendeter Fragen
 | 
				
			||||||
 | 
					    for (int i = 0; i < 3; i++)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        while (1)      
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            x = zufaellig(anzahl_fragen);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (x != fragen[0] && x != fragen[1] && x != fragen[2])
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        fragen[i]=x;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //Fragen
 | 
				
			||||||
 | 
					        switch (x)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					        case 0 :
 | 
				
			||||||
 | 
					            printf("Frage 1 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case 1 :
 | 
				
			||||||
 | 
					            printf("Frage 2 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case 2 :
 | 
				
			||||||
 | 
					            printf("Frage 3 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case 3 :
 | 
				
			||||||
 | 
					            printf("Frage 4 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case 4 :
 | 
				
			||||||
 | 
					            printf("Frage 5 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case 5 :
 | 
				
			||||||
 | 
					            printf("Frage 6 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case 6 :
 | 
				
			||||||
 | 
					            printf("Frage 7 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case 7 :
 | 
				
			||||||
 | 
					            printf("Frage 8 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case 8 :
 | 
				
			||||||
 | 
					            printf("Frage 9 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case 9 :
 | 
				
			||||||
 | 
					            printf("Frage 10 \n");
 | 
				
			||||||
 | 
					            return_code = antwort(2, falsche_antwort);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        default:
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (return_code == 20)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            return 20;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Hauptunktionen                                                            
 | 
				
			||||||
 | 
					int Ramen_Physik(){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Umlaute
 | 
				
			||||||
 | 
					    system("chcp 65001 >null");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Zufallsgenerator initialisieren
 | 
				
			||||||
 | 
					    srand(time(NULL));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    //Variabeln
 | 
				
			||||||
 | 
					    char eingabe = '0';
 | 
				
			||||||
 | 
					    int return_code = 0;
 | 
				
			||||||
 | 
					    int falsche_antwort = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    while (1){
 | 
				
			||||||
 | 
					        //löschen der Konsole
 | 
				
			||||||
 | 
					        printf("\e[1;1H\e[2J");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //Auswahl der Schwierigkeitsstufe
 | 
				
			||||||
 | 
					        printf("1 \t einfache Fragen \n");
 | 
				
			||||||
 | 
					        printf("2 \t mittlere Fragen \n");
 | 
				
			||||||
 | 
					        printf("3 \t schwere Fragen \n");
 | 
				
			||||||
 | 
					        printf("q \t zurück zum Hauptmenu \n");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        scanf("%c", &eingabe);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //Abfrage der Eingabe
 | 
				
			||||||
 | 
					        switch (eingabe){
 | 
				
			||||||
 | 
					            case '1':{
 | 
				
			||||||
 | 
					                printf("\neinfache Fragen\n");
 | 
				
			||||||
 | 
					                return_code = einfache_fragen(&falsche_antwort);
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            case '2':{
 | 
				
			||||||
 | 
					                printf("\nmittlere Fragen\n");
 | 
				
			||||||
 | 
					                return_code = mittlere_fragen(&falsche_antwort);
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            case '3':{
 | 
				
			||||||
 | 
					                printf("\nschwere Fragen\n");
 | 
				
			||||||
 | 
					                return_code = schwere_fragen(&falsche_antwort);
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            case 'q':{
 | 
				
			||||||
 | 
					                printf("\nProgramm beendet \n");
 | 
				
			||||||
 | 
					                return 10;
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            case '\n':{
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            default: {
 | 
				
			||||||
 | 
					                printf("Zu viele ungültige Eingaben. Programm beendet.\n");
 | 
				
			||||||
 | 
					                return 20;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (return_code == 20){
 | 
				
			||||||
 | 
					            return 20;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    return 0;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -1,18 +1,21 @@
 | 
				
			|||||||
/* Ramen_Physik.h
 | 
					/* Physikhelper_Physik.h
 | 
				
			||||||
Hier werden Physikaufgaben gelöst mit einem Spiel als Pause
 | 
					Hier werden Physikaufgaben gelöst mit einem Spiel als Pause
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Autor: Jana Nieblas
 | 
					Autor: Jana Nieblas, Debora Semmler
 | 
				
			||||||
Firma: FHGR
 | 
					Firma: FHGR
 | 
				
			||||||
Version 1.0
 | 
					Version 1.0
 | 
				
			||||||
Datum 15.12.2024
 | 
					Datum 09.12.2024
 | 
				
			||||||
Aenderungen:
 | 
					Aenderungen:
 | 
				
			||||||
V 1.0 15.12.2024 Erste Version
 | 
					V 1.0 09.12.2024 Erste Version
 | 
				
			||||||
*/
 | 
					*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef _FILE_NAME_H_ 
 | 
					#ifndef _FILE_NAME_H_ 
 | 
				
			||||||
#define _FILE_NAME_H_ 
 | 
					#define _FILE_NAME_H_ 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   //extern Phxsik mit Spiel; 
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					   //extern float var1,var2; 
 | 
				
			||||||
   extern int Ramen_Physik();
 | 
					   extern int Ramen_Physik();
 | 
				
			||||||
   
 | 
					   
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
@ -1,351 +0,0 @@
 | 
				
			|||||||
/* Abbildungsrechner.c
 | 
					 | 
				
			||||||
Disese Programm macht folgendes: 
 | 
					 | 
				
			||||||
1. Wahl zur Berechnung von optischen Messgroessen
 | 
					 | 
				
			||||||
2. Berechnung der gewaehlte Messgroesse
 | 
					 | 
				
			||||||
3. Gibt die Berechnung auf der Konsole aus
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Autor: Catherine, Mika und Sebastian
 | 
					 | 
				
			||||||
Firma: FHGR
 | 
					 | 
				
			||||||
Version 1.0
 | 
					 | 
				
			||||||
Datum 14.12.2024
 | 
					 | 
				
			||||||
Aenderungen:
 | 
					 | 
				
			||||||
V 1.0 14.12.2024 Erste Version
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/******************************************************************************
 | 
					 | 
				
			||||||
 ** Eingebundene Bibliotheken			                                     **
 | 
					 | 
				
			||||||
 ******************************************************************************/
 | 
					 | 
				
			||||||
#include <stdio.h>
 | 
					 | 
				
			||||||
#include <stdlib.h>
 | 
					 | 
				
			||||||
/******************************************************************************
 | 
					 | 
				
			||||||
 ** Variablen                                                                **
 | 
					 | 
				
			||||||
 ******************************************************************************/
 | 
					 | 
				
			||||||
float f, a, A, M, y, Y; //Brennweite, Objektweite, Bildweite, Vergroesserung, Objektgroesse, Bildgroesse
 | 
					 | 
				
			||||||
int P = 0; //Programmauswahl 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/******************************************************************************
 | 
					 | 
				
			||||||
 ** Funktions Prototypen                                                     **
 | 
					 | 
				
			||||||
 ******************************************************************************/
 | 
					 | 
				
			||||||
void programmAuswahl();
 | 
					 | 
				
			||||||
void Berechnung_Optische_Abbildung(float f, float a, float A, float M, float y, float Y, int P);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/******************************************************************************
 | 
					 | 
				
			||||||
 ** Hauptfunktion                                                            **
 | 
					 | 
				
			||||||
 ******************************************************************************/
 | 
					 | 
				
			||||||
int Abbildungsrechner()
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    while (P != 10){
 | 
					 | 
				
			||||||
    programmAuswahl();
 | 
					 | 
				
			||||||
    Berechnung_Optische_Abbildung(f, a, A, M, y, Y, P); 
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    P = 0;
 | 
					 | 
				
			||||||
    return 10;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
/******************************************************************************
 | 
					 | 
				
			||||||
 ** Funktionen                                                               **
 | 
					 | 
				
			||||||
 ******************************************************************************/
 | 
					 | 
				
			||||||
void programmAuswahl()
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    printf("Waehlen Sie die zu berechnende Groesse: \n");
 | 
					 | 
				
			||||||
    printf("1: Brennweite (f)\n");
 | 
					 | 
				
			||||||
    printf("2: Objektweite (a)\n");
 | 
					 | 
				
			||||||
    printf("3: Bildweite (A)\n");
 | 
					 | 
				
			||||||
    printf("4: Objektgroesse (y)\n");
 | 
					 | 
				
			||||||
    printf("5: Bildgroesse (Y)\n");
 | 
					 | 
				
			||||||
    printf("6: Vergroesserung (M)\n");
 | 
					 | 
				
			||||||
    printf("q: zurück zum Menu\n");
 | 
					 | 
				
			||||||
    printf("Geben sie Ihre P ein(1-6):\n ");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    char auswahl[21] = {0};
 | 
					 | 
				
			||||||
    long auswahl_int = 0;
 | 
					 | 
				
			||||||
    char *endptr;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    scanf("%20s", auswahl);
 | 
					 | 
				
			||||||
    auswahl_int = strtol((const char*)auswahl, &endptr, 10);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (*endptr != 0){
 | 
					 | 
				
			||||||
        auswahl_int = -1;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    if (*endptr == 'q'){
 | 
					 | 
				
			||||||
        P = 10;
 | 
					 | 
				
			||||||
        return;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    P = auswahl_int;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    switch(P)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        case 1:
 | 
					 | 
				
			||||||
        printf("Sie haben Programm 1 gewaehlt: Brennweite berechnen\n");
 | 
					 | 
				
			||||||
        break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 2:
 | 
					 | 
				
			||||||
        printf("Sie haben Programm 2 gewaehlt: Objektweite berechnen\n");
 | 
					 | 
				
			||||||
        break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 3:
 | 
					 | 
				
			||||||
        printf("Sie haben Programm 3 gewaehlt: Bildweite berechnen\n");
 | 
					 | 
				
			||||||
        break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 4:
 | 
					 | 
				
			||||||
        printf("Sie haben Programm 4 gewaehlt: Objektgroesse berechnen\n");
 | 
					 | 
				
			||||||
        break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 5:
 | 
					 | 
				
			||||||
        printf("Sie haben Programm 5 gewaehlt: Bildgroesse berechnen\n");
 | 
					 | 
				
			||||||
        break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 6:
 | 
					 | 
				
			||||||
        printf("Sie haben Programm 6 gewaehlt: Vergroesserung berechnen\n");
 | 
					 | 
				
			||||||
        break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        default:
 | 
					 | 
				
			||||||
        printf("Dieses Programm ist ungueltigt.\n");
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
void Berechnung_Optische_Abbildung(float f, float a, float A, float M, float y, float Y, int P)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    switch (P) {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 1:     // Berechnung Brennweite [f]
 | 
					 | 
				
			||||||
        printf("Geben Sie Bildweite [A] und Objektweite [a] ein:\n");
 | 
					 | 
				
			||||||
        printf("Bildweite [A]: ");
 | 
					 | 
				
			||||||
        scanf("%f", &A);
 | 
					 | 
				
			||||||
        printf("Objektweite [a]: ");
 | 
					 | 
				
			||||||
        scanf("%f", &a);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Berechnung Brennweite mit Objektweite [a] und Bildweite [A]
 | 
					 | 
				
			||||||
        f = (a * A) / (A + a);
 | 
					 | 
				
			||||||
        // Berechnung Vergroesserung mit Objektweite (a) und Bildweite [A]
 | 
					 | 
				
			||||||
        M = -(A / a);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        printf("-----------------------\n");
 | 
					 | 
				
			||||||
        printf("Brennweite [f]:\n%f", f);
 | 
					 | 
				
			||||||
        printf("\nVergroesserung [M]:\n%f", M);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        printf("\n-----------------------\n");
 | 
					 | 
				
			||||||
        printf("f = (a * A) / (A + a)\n");
 | 
					 | 
				
			||||||
        printf("M = (A / a)\n");
 | 
					 | 
				
			||||||
        printf("-----------------------\n");
 | 
					 | 
				
			||||||
        break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 2:     // Berechnung Objektweite [a]
 | 
					 | 
				
			||||||
        printf("Waehlen Sie die Berechnungsmethode:\n");
 | 
					 | 
				
			||||||
        printf("1: Mit Bildweite [A] und Brennweite [f]\n");
 | 
					 | 
				
			||||||
        printf("2: Mit Bildgroesse [Y] und Objektgroesse [y]\n");
 | 
					 | 
				
			||||||
        scanf("%d", &P);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (P == 1) {
 | 
					 | 
				
			||||||
        printf("Geben Sie Bildweite [A] und Brennweite [f] ein:\n");
 | 
					 | 
				
			||||||
        printf("Bildweite [A]: ");
 | 
					 | 
				
			||||||
        scanf("%f", &A );
 | 
					 | 
				
			||||||
        printf("Brennweite [f]: ");
 | 
					 | 
				
			||||||
        scanf("%f", &f);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Berechnung Objektweite [a] mit Bildweite [A] und Brennweite [f]
 | 
					 | 
				
			||||||
        a = (f * A) / (A - f);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        printf("-----------------------\n");
 | 
					 | 
				
			||||||
        printf("Objektweite [a]:\n%f", a);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        printf("\n-----------------------\n");
 | 
					 | 
				
			||||||
        printf("a = (f * A) / (A - f)\n");
 | 
					 | 
				
			||||||
        printf("-----------------------\n");
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        else if (P == 2) {
 | 
					 | 
				
			||||||
        printf("Geben Sie Bildgroesse [Y] und Objektgroesse [y] ein:\n");
 | 
					 | 
				
			||||||
        printf("Bildgroesse [Y]: ");
 | 
					 | 
				
			||||||
        scanf("%f", &Y);
 | 
					 | 
				
			||||||
        printf("Objektgroesse [y]: ");
 | 
					 | 
				
			||||||
        scanf("%f", &y);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Berechnung Objektweite [a] mit Bildweite [A] und Vergroesserung (M) 
 | 
					 | 
				
			||||||
        a = -(A / M);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        printf("-----------------------\n");
 | 
					 | 
				
			||||||
        printf("Objektweite [a]:\n%f", a);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        printf("\n-----------------------\n");
 | 
					 | 
				
			||||||
        printf("a = a(A / M)\n");
 | 
					 | 
				
			||||||
        printf("-----------------------\n");
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 3:     // Berechnung Bildweite [A]
 | 
					 | 
				
			||||||
        printf("Waehlen Sie die Berechnungsmethode:\n");
 | 
					 | 
				
			||||||
        printf("1: Mit Objektweite [a] und Brennweite [f]\n");
 | 
					 | 
				
			||||||
        printf("2: Mit Objektweite [a] und Vergroesserung [M]\n");
 | 
					 | 
				
			||||||
        scanf("%d", &P);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (P == 1) {
 | 
					 | 
				
			||||||
        printf("Geben Sie Objektweite [a] und Brennweite [f] ein:\n");
 | 
					 | 
				
			||||||
        printf("Objektweite [a]: ");
 | 
					 | 
				
			||||||
        scanf("%f", &a);
 | 
					 | 
				
			||||||
        printf("Brennweite [f]: ");
 | 
					 | 
				
			||||||
        scanf("%f", &f);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Berechnung Bildweite [A] mit Brennweite [f] und Objektweite [a]
 | 
					 | 
				
			||||||
        A = (f * a) / (a - f);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        printf("-----------------------\n");
 | 
					 | 
				
			||||||
        printf("Bildweite [A]:\n%f", A);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        printf("\n-----------------------\n");
 | 
					 | 
				
			||||||
        printf("A = (f * a) / (a - f)\n");
 | 
					 | 
				
			||||||
        printf("-----------------------\n");
 | 
					 | 
				
			||||||
        } 
 | 
					 | 
				
			||||||
        else if (P == 2) {
 | 
					 | 
				
			||||||
        printf("Geben Sie Vergroesserung [M] und Objektweite [a] ein:\n");
 | 
					 | 
				
			||||||
        printf("Vergroesserung [M]: ");
 | 
					 | 
				
			||||||
        scanf("%f", &M);
 | 
					 | 
				
			||||||
        printf("Objektweite [a]");
 | 
					 | 
				
			||||||
        scanf("%f", &a);  
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Berechnung Bildweite [A] mit Vergroesserung [M] und Objektweite [a]
 | 
					 | 
				
			||||||
        A = -(a * M);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        printf("-----------------------\n");
 | 
					 | 
				
			||||||
        printf("Bildweite [A]:\n%f", A);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        printf("\n-----------------------\n");
 | 
					 | 
				
			||||||
        printf("A = -(a * M)\n");
 | 
					 | 
				
			||||||
        printf("-----------------------\n");
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 4:     // Berechnung Objektgroesse [y]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        printf("Waehlen Sie die Berechnungsmethode:\n");
 | 
					 | 
				
			||||||
        printf("1: Mit Bildweite [A], Objektweite [a] und Bildgroesse [y]\n");
 | 
					 | 
				
			||||||
        printf("2: Mit Bildgroesse [Y] und Vergroesserung [M]\n");
 | 
					 | 
				
			||||||
        scanf("%d", &P);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (P == 1) {
 | 
					 | 
				
			||||||
        printf("Geben Sie Bildweite [A] und Objektweite [a] ein:\n");
 | 
					 | 
				
			||||||
        printf("Bildweite [A]: ");
 | 
					 | 
				
			||||||
        scanf("%f", &A);
 | 
					 | 
				
			||||||
        printf("Objektweite [a]: ");
 | 
					 | 
				
			||||||
        scanf("%f", &a); 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Berechnung Objektgroesse [y] mit Bildweite [A] und Objektweite [a] und Bildgroesse [y]
 | 
					 | 
				
			||||||
        y = -(Y * A) / a;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        printf("-----------------------\n");
 | 
					 | 
				
			||||||
        printf("Objektgroesse [y]:\n%f", y);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        printf("\n-----------------------\n");
 | 
					 | 
				
			||||||
        printf("a = -(Y * A) / a\n");
 | 
					 | 
				
			||||||
        printf("-----------------------\n");
 | 
					 | 
				
			||||||
        } 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        else if (P == 2) {
 | 
					 | 
				
			||||||
        printf("Geben Sie Bildgroesse [Y] und Vergroesserung [M] ein:\n");
 | 
					 | 
				
			||||||
        printf("Bildgroesse [Y]: ");
 | 
					 | 
				
			||||||
        scanf("%f", &Y);
 | 
					 | 
				
			||||||
        printf("Vergroesserung[M]: ");
 | 
					 | 
				
			||||||
        scanf("%f", &M);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Berechnung Objektgroesse [y] mit Bildgroesse [Y] und Vergroesserung [M]
 | 
					 | 
				
			||||||
        y = Y / M;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        printf("-----------------------\n");
 | 
					 | 
				
			||||||
        printf("Objektgroesse [y]:\n%f", y);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        printf("\n-----------------------\n");
 | 
					 | 
				
			||||||
        printf("y = Y / M\n");
 | 
					 | 
				
			||||||
        printf("-----------------------\n");
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 5:     // Berechnung Bildgroesse [Y]
 | 
					 | 
				
			||||||
        printf("Waehlen Sie die Berechnungsmethode:\n");
 | 
					 | 
				
			||||||
        printf("1: Mit Bildweite [A], Objektweite [a] und Objektgroesse [y]\n");
 | 
					 | 
				
			||||||
        printf("2: Mit Bildgroesse [Y] und Vergroesserung [M]\n");
 | 
					 | 
				
			||||||
        scanf("%d", &P);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (P == 1) {
 | 
					 | 
				
			||||||
        printf("Geben Sie Bildweite [A], Objektweite [a] und Objektgroesse [y] ein:\n");
 | 
					 | 
				
			||||||
        printf("Bildweite [A]: ");
 | 
					 | 
				
			||||||
        scanf("%f", &A);
 | 
					 | 
				
			||||||
        printf("Objektweite [a]: ");
 | 
					 | 
				
			||||||
        scanf("%f", &a);
 | 
					 | 
				
			||||||
        printf("Objektgroesse [y]: ");
 | 
					 | 
				
			||||||
        scanf("%f", &y); 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Berechnung Bildgroesse [Y] mit Objektweite [a] und Bildweite [A] und Objektgroesse [y]
 | 
					 | 
				
			||||||
        Y = -(A / a) * y;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        printf("-----------------------\n");
 | 
					 | 
				
			||||||
        printf("Bildgroesse [Y]:\n%f", Y);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        printf("\n-----------------------\n");
 | 
					 | 
				
			||||||
        printf("\nY = -(A / a) * y\n");
 | 
					 | 
				
			||||||
        printf("-----------------------\n");
 | 
					 | 
				
			||||||
        } 
 | 
					 | 
				
			||||||
        else if (P == 2) {
 | 
					 | 
				
			||||||
        printf("Geben Sie Bildgroesse [Y] und Vergroesserung [M] ein:\n");
 | 
					 | 
				
			||||||
        printf("Bildgroesse [Y]: ");
 | 
					 | 
				
			||||||
        scanf("%f", &Y);
 | 
					 | 
				
			||||||
        printf("Vergroesserung [M]: ");
 | 
					 | 
				
			||||||
        scanf("%f", &M);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Berechnung Bildgroesse [Y] mit Vergroesserung [M] und Objektgroesse [y]
 | 
					 | 
				
			||||||
        Y = y * M;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        printf("-----------------------\n");
 | 
					 | 
				
			||||||
        printf("Bildgroesse [Y]:\n%f", Y);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        printf("\n-----------------------\n");
 | 
					 | 
				
			||||||
        printf("Y = y * M\n");
 | 
					 | 
				
			||||||
        printf("-----------------------\n");
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        case 6:     // Berechnung Vergroesserung [M]
 | 
					 | 
				
			||||||
        printf("Waehlen Sie die Berechnungsmethode:\n");
 | 
					 | 
				
			||||||
        printf("1: Mit Bildweite [A] und Objektweite [a]\n");
 | 
					 | 
				
			||||||
        printf("2: Mit Bildgroesse [Y] und Objektgroesse [y]\n");
 | 
					 | 
				
			||||||
        scanf("%d", &P);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (P == 1) {
 | 
					 | 
				
			||||||
        printf("Geben Sie Bildweite [A] und Objektweite [a] ein:\n");
 | 
					 | 
				
			||||||
        printf("Bildweite [A]: ");
 | 
					 | 
				
			||||||
        scanf("%f", &A);
 | 
					 | 
				
			||||||
        printf("Objektweite [a]: ");
 | 
					 | 
				
			||||||
        scanf("%f", &a);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Berechnung Vergroesserung [M] mit Objektweite [a] und Bildweite [A]
 | 
					 | 
				
			||||||
        M = -(A / a);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        printf("-----------------------\n");
 | 
					 | 
				
			||||||
        printf("Vergroesserung [M]\n%f", M);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        printf("\n-----------------------\n");
 | 
					 | 
				
			||||||
        printf("M = -(A / a)\n");
 | 
					 | 
				
			||||||
        printf("-----------------------\n");
 | 
					 | 
				
			||||||
        } 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        else if (P == 2) {
 | 
					 | 
				
			||||||
        printf("Geben Sie Bildgroesse [Y] und Objektgroesse [y] ein:\n");
 | 
					 | 
				
			||||||
        printf("Bildgroeße [Y]: ");
 | 
					 | 
				
			||||||
        scanf("%f", &Y);
 | 
					 | 
				
			||||||
        printf("Objektgroesse [y]: ");
 | 
					 | 
				
			||||||
        scanf("%f", &y);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // Berechnung Vergroesserung [M] mit Objektgroesse [y] und Bildgroesse [Y]
 | 
					 | 
				
			||||||
        M = (Y / y); 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        printf("-----------------------\n");
 | 
					 | 
				
			||||||
        printf("Vergroesserung [M]\n%f", M);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        printf("\n-----------------------\n");
 | 
					 | 
				
			||||||
        printf("M = (Y /y)\n");
 | 
					 | 
				
			||||||
        printf("-----------------------\n");
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        break;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@ -1,19 +0,0 @@
 | 
				
			|||||||
/* Abbildungsrechner.h
 | 
					 | 
				
			||||||
Dies ist die Verknüpfung zum Abbildungsrechner
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Autor: Catherine, Sebastian, Mika
 | 
					 | 
				
			||||||
Firma: FHGR
 | 
					 | 
				
			||||||
Version 1.0
 | 
					 | 
				
			||||||
Datum 16.12.2024
 | 
					 | 
				
			||||||
Aenderungen:
 | 
					 | 
				
			||||||
V 1.0 16.12.2024 Erste Version
 | 
					 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#ifndef _Abbildungsrechner_H_ 
 | 
					 | 
				
			||||||
#define _Abbildungsrechner_H_ 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    int Abbildungsrechner();
 | 
					 | 
				
			||||||
   
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
@ -1,174 +0,0 @@
 | 
				
			|||||||
/* InformatikZusammenfassung.c
 | 
					 | 
				
			||||||
Programm das einen Text auf die Konsole ausgibt
 | 
					 | 
				
			||||||
Autor: Giulia Benz
 | 
					 | 
				
			||||||
Firma: FHGR
 | 
					 | 
				
			||||||
Version: 0.1
 | 
					 | 
				
			||||||
Datum: 11.12.2024
 | 
					 | 
				
			||||||
Änderungen:
 | 
					 | 
				
			||||||
0.1 11.12.2024 Erste Version
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Einbinden von Headerdateien der Programmbibliothek.
 | 
					 | 
				
			||||||
#include <stdio.h>
 | 
					 | 
				
			||||||
#include <stdlib.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
//Start unseres Programms
 | 
					 | 
				
			||||||
int Informatik_main(void) {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    int j = 1;
 | 
					 | 
				
			||||||
    int work = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    char auswahl[21] = {0};
 | 
					 | 
				
			||||||
    long auswahl_int = 0;
 | 
					 | 
				
			||||||
    char *endptr;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    while (auswahl_int != 99)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        printf("Waehlen Sie bitte einen Befehl aus oder geben Sie 99 zum Stoppen en ein\n");
 | 
					 | 
				
			||||||
        printf("-1- \t printf \n");
 | 
					 | 
				
			||||||
        printf("-2- \t \\ \n");
 | 
					 | 
				
			||||||
        printf("-3- \t \\n \n");
 | 
					 | 
				
			||||||
        printf("-4- \t %%d \n");
 | 
					 | 
				
			||||||
        printf("-5- \t Sizeof\n");
 | 
					 | 
				
			||||||
        printf("-6- \t \"string\" \n");
 | 
					 | 
				
			||||||
        printf("-7- \t signed char Sie tun: \n");
 | 
					 | 
				
			||||||
        printf("-8- \t short\n");
 | 
					 | 
				
			||||||
        printf("-9- \t int\n");
 | 
					 | 
				
			||||||
        printf("-10- \t long\n");
 | 
					 | 
				
			||||||
        printf("-11- \t long long\n");
 | 
					 | 
				
			||||||
        printf("-12- \t char\n");
 | 
					 | 
				
			||||||
        printf("-13- \t float\n");
 | 
					 | 
				
			||||||
        printf("-14- \t double\n");
 | 
					 | 
				
			||||||
        printf("-15- \t long double\n");
 | 
					 | 
				
			||||||
        printf("-16- \t const\n");
 | 
					 | 
				
			||||||
        printf("-17- \t scanf\n");
 | 
					 | 
				
			||||||
        printf("-18- \t if\n");
 | 
					 | 
				
			||||||
        printf("-19- \t else\n");
 | 
					 | 
				
			||||||
        printf("-20- \t else if\n");
 | 
					 | 
				
			||||||
        printf("-21- \t switch\n");
 | 
					 | 
				
			||||||
        printf("-22- \t for\n");
 | 
					 | 
				
			||||||
        printf("-23- \t while\n");
 | 
					 | 
				
			||||||
        printf("-24- \t do while\n");
 | 
					 | 
				
			||||||
        printf("-25- \t *\n");
 | 
					 | 
				
			||||||
        printf("-26- \t Array\n");
 | 
					 | 
				
			||||||
        printf("-27- \t String\n");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        scanf("%20s", auswahl);
 | 
					 | 
				
			||||||
        auswahl_int = strtol((const char*)auswahl, &endptr, 10);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (*endptr != 0){
 | 
					 | 
				
			||||||
            auswahl_int = -1;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        if (*endptr == 'q'){
 | 
					 | 
				
			||||||
        return 10;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        /*  unötig → case default
 | 
					 | 
				
			||||||
        if( scanf("%i", &work) != 1 )
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            printf("Fehler bei der Eingabe...\n");
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        printf("\n\n");
 | 
					 | 
				
			||||||
        */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        switch(auswahl_int){
 | 
					 | 
				
			||||||
            case 1 : printf("Zeichentexte(strings) auf Konsole ausgeben\n");
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            case 2: printf("Abstand innerhalb des Printf (\t steht für 4 oder 8 mal abstand drücken)\n");
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            case 3: printf("Zeilenumbruch\n");
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            case 4: printf("Platzhalter fuer eine Zahl\n");
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            case 5: printf("Speicherbedarf ermitteln\n");
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            case 6: printf("Zeichenliteral, was in printf steht\n");
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            case 7: printf("Datentyp von -128 bis +127, hierbei sind die Formatzeichen %%hhd fuer dezimal und %%c fuer Zeichen\n");
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            case 8: printf("Datentyp von -32768 bis 32768 mit Formatzeichen %%hd oder %%hi \n");
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            case 9: printf("Datentyp von -32768 bis 32768 mit Formatzeichen %%d oder %%i\n");
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            case 10: printf("Datentyp von -2.147.483.648 bis -2.147.483.648 mit Formatzeichen %%ld oder %%li\n");
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            case 11: printf("Datentyp von -9.223.372.036.854.775.808 bis 9.223.372.036.854.775.808 mit Formatzeichen %%lld oder %%11i \n");
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            case 12: printf("grundlegender Datentyp für Zeichen (nur 1 Byte Speicherplatz)\n");
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            case 13: printf("Suffix für bis zu 7 Dezimalstellen -> %%f\n");
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            case 14: printf("Suffix für bis zu 15-16 Dezimalstellen -> %%f (für printf %%lf)\n");
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            case 15: printf("Suffix für bis mehr al 19 Dezimalstellen -> %%Lf\n");
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            case 16: printf("Konstante = dasselbe wie Variable aber nicht veränderbar während dem Programm\n");
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            case 17: printf("Etwas in Konsole eingeben\n");
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            case 18: printf("bedingte Answeisung\n");
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            case 19: printf("Nach if was es sonst machen soll\n");
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            case 20: printf("Mischung von else und if\n");
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            case 21: printf("Mehrfachverzweigung\n");
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            case 22: printf("Zählerschleife\n");
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            case 23: printf("Schleife\n");
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            case 24: printf("Schleife, wenn man Dinge mehrmals ausführen muss (oder auch nur einmal)\n");
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            case 25: printf("Pointer, zeigt auf etwas und gibt aus was in der Variable steht, aber verändert sie nicht\n");
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            case 26: printf("Ansamlung von Elementen\n");
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            case 27: printf("dasselbe wie Array mit Buchstaben\n");
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            case 99: printf("hoffentlech hei mer der choene helfe ");
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            default: printf("%li falsche Eingabe\n", auswahl_int);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (auswahl_int != 99)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            printf("\n\n0 => Menu\n");
 | 
					 | 
				
			||||||
            scanf("%20li", &auswahl_int);
 | 
					 | 
				
			||||||
            fflush(stdin);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return 0;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -1,19 +0,0 @@
 | 
				
			|||||||
/* Abbildungsrechner.h
 | 
					 | 
				
			||||||
Dies ist die Verknüpfung zum Abbildungsrechner
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Autor: Catherine, Sebastian, Mika
 | 
					 | 
				
			||||||
Firma: FHGR
 | 
					 | 
				
			||||||
Version 1.0
 | 
					 | 
				
			||||||
Datum 16.12.2024
 | 
					 | 
				
			||||||
Aenderungen:
 | 
					 | 
				
			||||||
V 1.0 16.12.2024 Erste Version
 | 
					 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#ifndef _INFORMATIKZUSAMMENFASSUNG_H_ 
 | 
					 | 
				
			||||||
#define _INFORMATIKZUSAMMENFASSUNG_H_ 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    int Informatik_main();
 | 
					 | 
				
			||||||
   
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
							
								
								
									
										62
									
								
								src/main.c
									
									
									
									
									
								
							
							
						
						
									
										62
									
								
								src/main.c
									
									
									
									
									
								
							@ -24,25 +24,19 @@ Datum: 04.12.2024
 | 
				
			|||||||
    #include <sys/ioctl.h>
 | 
					    #include <sys/ioctl.h>
 | 
				
			||||||
    #include <unistd.h>
 | 
					    #include <unistd.h>
 | 
				
			||||||
    #include <termio.h>
 | 
					    #include <termio.h>
 | 
				
			||||||
    #include "Main-vz/kbhit_linux.h"
 | 
					    #include "kbhit_linux.h"
 | 
				
			||||||
#elif _WIN32
 | 
					#elif _WIN32
 | 
				
			||||||
    #include <windows.h>
 | 
					    #include <windows.h>
 | 
				
			||||||
    #include <conio.h>
 | 
					    #include <conio.h>
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// import sub programme
 | 
					// import sub programme
 | 
				
			||||||
#include "Ramen-vz/Ramen_Physik.h"
 | 
					#include "Ramen_Physik.h"
 | 
				
			||||||
#include "Fehlenden-vz/Fehlenden_Elektronik.h"
 | 
					#include "Fehlenden_Elektronik.h"
 | 
				
			||||||
#include "Flugi-tz/Funktion_Flugi.h"
 | 
					 | 
				
			||||||
#include "Flugi-vz/Rechner_Wellenlaenge2.h"
 | 
					 | 
				
			||||||
#include "Wein-tz/Abbildungsrechner.h"
 | 
					 | 
				
			||||||
#include "Wein-vz/InformatikZusammenfassung.h"
 | 
					 | 
				
			||||||
#include "Haenchen-vz/Haenchen_Drehmoment.h"
 | 
					 | 
				
			||||||
#include "test_prog.h"
 | 
					#include "test_prog.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "Main-vz/pipes_test.h"
 | 
					#include "pipes_test.h"
 | 
				
			||||||
#include "Main-vz/pipes2.h"
 | 
					#include "pipes2.h"
 | 
				
			||||||
#include "Main-vz/pipes2_game.h"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef __linux__
 | 
					#ifdef __linux__
 | 
				
			||||||
@ -184,23 +178,23 @@ void print_menu(int terminal_width, int terminal_height, int line){
 | 
				
			|||||||
        printf("\n");
 | 
					        printf("\n");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        print_line("┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓", spaces, (0 <= line && line < 1) ? ";31": ";37");
 | 
					        print_line("┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓", spaces, (0 <= line && line < 1) ? ";31": ";37");
 | 
				
			||||||
        print_line("┃  1 Physik                        (vz) ┃", spaces, (0 <= line && line < 1) ? ";31": ";37");
 | 
					        print_line("┃  1 Ramen Physik                       ┃", spaces, (0 <= line && line < 1) ? ";31": ";37");
 | 
				
			||||||
        print_line("┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫", spaces, (0 <= line && line < 2) ? ";31": ";37");
 | 
					        print_line("┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫", spaces, (0 <= line && line < 2) ? ";31": ";37");
 | 
				
			||||||
        print_line("┃  2 Elektronik                    (vz) ┃", spaces, (1 <= line && line < 2) ? ";31": ";37");
 | 
					        print_line("┃  2 Fehlenden Elektronik               ┃", spaces, (1 <= line && line < 2) ? ";31": ";37");
 | 
				
			||||||
        print_line("┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫", spaces, (1 <= line && line < 3) ? ";31": ";37");
 | 
					        print_line("┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫", spaces, (1 <= line && line < 3) ? ";31": ";37");
 | 
				
			||||||
        print_line("┃  3 Informatik                    (vz) ┃", spaces, (2 <= line && line < 3) ? ";31": ";37");
 | 
					        print_line("┃  3 Programm                           ┃", spaces, (2 <= line && line < 3) ? ";31": ";37");
 | 
				
			||||||
        print_line("┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫", spaces, (2 <= line && line < 4) ? ";31": ";37");
 | 
					        print_line("┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫", spaces, (2 <= line && line < 4) ? ";31": ";37");
 | 
				
			||||||
        print_line("┃  4 Drehmoment                    (vz) ┃", spaces, (3 <= line && line < 4) ? ";31": ";37");
 | 
					        print_line("┃  4 Programm                           ┃", spaces, (3 <= line && line < 4) ? ";31": ";37");
 | 
				
			||||||
        print_line("┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫", spaces, (3 <= line && line < 5) ? ";31": ";37");
 | 
					        print_line("┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫", spaces, (3 <= line && line < 5) ? ";31": ";37");
 | 
				
			||||||
        print_line("┃  5 Wellenlängenrechner           (vz) ┃", spaces, (4 <= line && line < 5) ? ";31": ";37");
 | 
					        print_line("┃  5 Programm                           ┃", spaces, (4 <= line && line < 5) ? ";31": ";37");
 | 
				
			||||||
        print_line("┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫", spaces, (4 <= line && line < 6) ? ";31": ";37");
 | 
					        print_line("┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫", spaces, (4 <= line && line < 6) ? ";31": ";37");
 | 
				
			||||||
        print_line("┃  6 Abbildungsrechner             (tz) ┃", spaces, (5 <= line && line < 6) ? ";31": ";37");
 | 
					        print_line("┃  6 Programm                           ┃", spaces, (5 <= line && line < 6) ? ";31": ";37");
 | 
				
			||||||
        print_line("┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫", spaces, (5 <= line && line < 7) ? ";31": ";37");
 | 
					        print_line("┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫", spaces, (5 <= line && line < 7) ? ";31": ";37");
 | 
				
			||||||
        print_line("┃  7 Quiz                          (tz) ┃", spaces, (6 <= line && line < 7) ? ";31": ";37");
 | 
					        print_line("┃  7 Programm                           ┃", spaces, (6 <= line && line < 7) ? ";31": ";37");
 | 
				
			||||||
        print_line("┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫", spaces, (6 <= line && line < 8) ? ";31": ";37");
 | 
					        print_line("┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫", spaces, (6 <= line && line < 8) ? ";31": ";37");
 | 
				
			||||||
        print_line("┃  8                               (tz) ┃", spaces, (7 <= line && line < 8) ? ";31": ";37");
 | 
					        print_line("┃  8 Programm                           ┃", spaces, (7 <= line && line < 8) ? ";31": ";37");
 | 
				
			||||||
        print_line("┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫", spaces, (7 <= line && line < 9) ? ";31": ";37");
 | 
					        print_line("┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫", spaces, (7 <= line && line < 9) ? ";31": ";37");
 | 
				
			||||||
        print_line("┃  9                               (tz) ┃", spaces, (8 <= line && line < 9) ? ";31": ";37");
 | 
					        print_line("┃  9 Programm                           ┃", spaces, (8 <= line && line < 9) ? ";31": ";37");
 | 
				
			||||||
        print_line("┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛", spaces, (8 <= line && line < 9) ? ";31": ";37");
 | 
					        print_line("┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛", spaces, (8 <= line && line < 9) ? ";31": ";37");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -213,7 +207,7 @@ void print_help(){
 | 
				
			|||||||
    printf("j \t Ein Programm nach unten\n");
 | 
					    printf("j \t Ein Programm nach unten\n");
 | 
				
			||||||
    printf("k \t Ein Programm nach oben\n");
 | 
					    printf("k \t Ein Programm nach oben\n");
 | 
				
			||||||
    printf("Enter \t Um das ausgewählte Programm zu starten\n");
 | 
					    printf("Enter \t Um das ausgewählte Programm zu starten\n");
 | 
				
			||||||
    printf("1 - 9 \t Um das n Programm zu starten\n");
 | 
					    printf("1-n \t Um das n Programm zu starten\n");
 | 
				
			||||||
    printf("q \t Um das Programm zu beenden\n");
 | 
					    printf("q \t Um das Programm zu beenden\n");
 | 
				
			||||||
    printf("\nDrücke eine Taste um zurück zu kommen\n");
 | 
					    printf("\nDrücke eine Taste um zurück zu kommen\n");
 | 
				
			||||||
    char key_input = (char)getch();
 | 
					    char key_input = (char)getch();
 | 
				
			||||||
@ -247,13 +241,14 @@ void run_programm(int programm, int width, int height, bool *used){
 | 
				
			|||||||
    switch (programm) {
 | 
					    switch (programm) {
 | 
				
			||||||
        case 0: return_code = Ramen_Physik(); break;
 | 
					        case 0: return_code = Ramen_Physik(); break;
 | 
				
			||||||
        case 1: return_code = Fehlenden_Elektronik_main(); break;
 | 
					        case 1: return_code = Fehlenden_Elektronik_main(); break;
 | 
				
			||||||
        case 2: return_code = Informatik_main(); break;
 | 
					        case 2: return_code = test_gruppe_programmname(); break;
 | 
				
			||||||
        case 3: return_code = Haenchen_Drehmoment_main(); break;
 | 
					        case 3: return_code = test_gruppe_programmname(); break;
 | 
				
			||||||
        case 4: return_code = Wellenlaengen_rechner_main(); break;
 | 
					        case 4: return_code = test_gruppe_programmname(); break;
 | 
				
			||||||
        case 5: return_code = Abbildungsrechner(); break;
 | 
					        case 5: return_code = test_gruppe_programmname(); break;
 | 
				
			||||||
        case 6: return_code = Flugi(); break;
 | 
					        case 6: return_code = test_gruppe_programmname(); break;
 | 
				
			||||||
        case 7: return_code = test_gruppe_programmname(); break;
 | 
					        case 7: return_code = test_gruppe_programmname(); break;
 | 
				
			||||||
        case 8: return_code = test_gruppe_programmname(); break;
 | 
					        case 8: return_code = test_gruppe_programmname(); break;
 | 
				
			||||||
 | 
					        case 9: return_code = test_gruppe_programmname(); break;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    // ist dazu da um "\n" aus dem buffer zu entfernen!
 | 
					    // ist dazu da um "\n" aus dem buffer zu entfernen!
 | 
				
			||||||
@ -268,10 +263,10 @@ void run_programm(int programm, int width, int height, bool *used){
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void speed(int width, int height, int *start_time, bool *used){
 | 
					void speed(int width, int height, int *start_time, bool *used){
 | 
				
			||||||
    if (*start_time + 30 < time(0)){
 | 
					    if (*start_time + 20 < time(0)){
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    for (int i = 0; i < 6; i++){
 | 
					    for (int i = 0; i < 5; i++){
 | 
				
			||||||
        if (used[i] == 0){
 | 
					        if (used[i] == 0){
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@ -295,9 +290,9 @@ int main(int argc, char **argv){
 | 
				
			|||||||
    int height = 0;
 | 
					    int height = 0;
 | 
				
			||||||
    int line = 0;
 | 
					    int line = 0;
 | 
				
			||||||
    bool run = true;
 | 
					    bool run = true;
 | 
				
			||||||
    bool *used = (bool[6]){0};
 | 
					    bool *used = (bool[5]){0};
 | 
				
			||||||
    int start_time = time(0);
 | 
					    int start_time = time(0);
 | 
				
			||||||
    bool arrows = true;
 | 
					    bool arrows = false;
 | 
				
			||||||
        if (argc >= 2 && strcmp(argv[1], "--ich-benutze-windows-und-bin-auf-die-pfeiltasten-angewiesen") == 0){
 | 
					        if (argc >= 2 && strcmp(argv[1], "--ich-benutze-windows-und-bin-auf-die-pfeiltasten-angewiesen") == 0){
 | 
				
			||||||
            arrows = true;
 | 
					            arrows = true;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@ -333,7 +328,7 @@ int main(int argc, char **argv){
 | 
				
			|||||||
        int last_input = time(0);
 | 
					        int last_input = time(0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        while (!kbhit()){
 | 
					        while (!kbhit()){
 | 
				
			||||||
            if (last_input + 60 <= time(0)){
 | 
					            if (last_input + 30 <= time(0)){
 | 
				
			||||||
                pipes_2(width, height);
 | 
					                pipes_2(width, height);
 | 
				
			||||||
                last_input = time(0);
 | 
					                last_input = time(0);
 | 
				
			||||||
                print_menu(width, height, line);
 | 
					                print_menu(width, height, line);
 | 
				
			||||||
@ -365,7 +360,6 @@ int main(int argc, char **argv){
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            case 'p': pipes(width, height); break;
 | 
					            case 'p': pipes(width, height); break;
 | 
				
			||||||
            case 'P': pipes_2(width, height); break;
 | 
					            case 'P': pipes_2(width, height); break;
 | 
				
			||||||
            case 'o': pipes_2_game(width, height); break;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // windows
 | 
					            // windows
 | 
				
			||||||
            case -32:{
 | 
					            case -32:{
 | 
				
			||||||
@ -410,10 +404,6 @@ int main(int argc, char **argv){
 | 
				
			|||||||
            case '3': run_programm(2, width, height, used); break;
 | 
					            case '3': run_programm(2, width, height, used); break;
 | 
				
			||||||
            case '4': run_programm(3, width, height, used); break;
 | 
					            case '4': run_programm(3, width, height, used); break;
 | 
				
			||||||
            case '5': run_programm(4, width, height, used); break;
 | 
					            case '5': run_programm(4, width, height, used); break;
 | 
				
			||||||
            case '6': run_programm(5, width, height, used); break;
 | 
					 | 
				
			||||||
            case '7': run_programm(6, width, height, used); break;
 | 
					 | 
				
			||||||
            case '8': run_programm(7, width, height, used); break;
 | 
					 | 
				
			||||||
            case '9': run_programm(8, width, height, used); break;
 | 
					 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            default: printf(" Es wurde die Taste: %i gedrückt\n", key_input); // getch();
 | 
					            default: printf(" Es wurde die Taste: %i gedrückt\n", key_input); // getch();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user