added another part of the code, attempt at recreating https://git.dvorakmortonxd.dev/dvorakmortonxd/DvorakMSDOS later on, added a space to help with consistency

This commit is contained in:
dvorakmortonxd 2026-05-25 22:49:31 +02:00
commit 74792b7786
5 changed files with 20 additions and 4 deletions

9
main.c
View file

@ -3,6 +3,7 @@
//importing basic modules
#include <stdio.h>
#include <stdlib.h>
#include "dvorakmsdos.h"
#ifdef _WIN32
#include <conio.h>
#define GETCH() _getch()
@ -143,6 +144,7 @@ int main() {
// PRESS ANY KEY TO CONTINUE
printf("\n\nPress any key to continue...");
fflush(stdout); // this forces the buffer to print NOW, fixing the "bug" in which it prints out everything AFTER the next line (scanf)
GETCH();
#ifdef _WIN32
system("cls");
@ -154,7 +156,7 @@ int main() {
printf("\n\nINPUT BELOW:\n"); // DIVIDER
char fruit[50]; //MAX 50 CHARACTERS
printf("Pick a fruit (SINGLE WORD, EVERYTHING ELSE GETS IGNORED): ");
fflush(stdout); // this forces the buffer to print NOW, fixing the "bug" in which it prints out everything AFTER the next line (scanf)
fflush(stdout); // same use case as above in the first input part of the code
scanf("%s", fruit);
printf("\nYou choose %s as your fruit!", fruit);
@ -165,7 +167,7 @@ int main() {
fflush(stdout); // same use case as above in the first input part of the code
while (getchar() != '\n') {} // clears the input buffer so it doesnt print out excess input from the fruit one
scanf(" %49[^\n]", vegetable); // the "[^\n]" means to read everything except a newline, which means you can input spaces inside now, 49 makes it so it doesnt crash once it has more than 50 characters
printf("The %s will be a perfect choice for this salat!", vegetable);
printf("\nThe %s will be a perfect choice for this salat!", vegetable);
// END OF THE MAIN.C CODE, HERE YOU WILL BE ABLE TO CONTINUE ON TO OTHER EXPERIMENTS OF MINE
printf("\n\nSWITCH OVER TO\n"); // DIVIDER
@ -175,7 +177,8 @@ int main() {
fflush(stdout); // same use case as above in the first input part of the code
char chc = GETCH();
if (chc == '1') {
printf("placeholder");
msmain(); // calls dvorakmsdos.c
return 0;
} else if (chc == '2') {
return 0;
} else {