From 60ed8314852aff157d8ce7897f4786bd8b1cdb85 Mon Sep 17 00:00:00 2001 From: catsus Date: Mon, 10 Oct 2022 13:06:25 +0200 Subject: [PATCH] Tidied up the comments --- adv.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/adv.c b/adv.c index fa4a2fc..003f2aa 100644 --- a/adv.c +++ b/adv.c @@ -16,10 +16,8 @@ #define _NEWLINE 10 #define _SPACEBAR 32 -/* Ett äventyrligt test - - 27/8-2022 - initial program. Chopping up input - 9/10-2022 - actual program. Added parsing of input, move & help command, and idea of exits and directions +/* + adv - text based adventure. See changelog for details and ideas for future work */ char *roomName[16] = {"hallen", "ett vardagsrum", "Rum 2", "Rum 3", @@ -28,7 +26,7 @@ char *roomName[16] = {"hallen", "ett vardagsrum", "Rum 2", "Rum 3", "Rum 12", "Rum 13", "Rum 14", "Rum 15"}; char *roomDesc[16] = { "Det ligger en ful matta på golvet. \nDet luktar ättika..", "En TV står och brusar bredvid en bokhylla.\nTapeterna på väggen ramlar nästan av."}; -short int roomExits[16] = {15,15,15,15, /* Binär information om utgångar. 1111 (15) = alla riktningar, osv */ +short int roomExits[16] = {15,15,15,15, /* Binary information about available exits */ 15,15,15,15, /* 1000 - north, 0100 - east, 0010 - south, 0001 - west */ 15,15,15,15, 15,15,15,15}; @@ -37,7 +35,7 @@ short int commandParts; char command[5][16]; short int currentRoom; -short int looking; /* 0 - north, 1 - south, 2- west, 3 - east */ +short int looking; /* Will hold direction in the same format as directions */ int main () { startup(); @@ -66,7 +64,7 @@ int enterRoom () { } int prompt () { - char input[40]; // Stoppa allt i variabeln input + char input[40]; /* Hold user input */ printf("Vad vill du göra?\n"); fgets(input,40,stdin); @@ -74,23 +72,23 @@ int prompt () { commandParts=0; int i=0; - int ltr=0; // Position för bokstaven i ordet + int ltr=0; /* Position marker for the word being processed */ while (i