Added draw menu, vars and additional functions needed for it
Added some functionality to the procdump to show the current console and parent pids of processes for debugging Added var to clearconsole that enables the internal lock if one wasnt prelocked before hand Fixed issue where race conditions would stop the title from drawing by drawing it to the buffer too Fixed issue where the maze function was spamming the conswrite and cons lock by changing it to send an entire line instead of 1 char at a time
This commit is contained in:
23
maze.c
23
maze.c
@ -45,13 +45,22 @@ int main(int argc, char *argv[]) {
|
||||
seed = atoi(argv[i + 1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
cls();
|
||||
greeting();
|
||||
printf(1, "Start Maze\n");
|
||||
|
||||
char mazeline[80];
|
||||
for (int y = 0; y < lines; y++)
|
||||
{
|
||||
for (int x = 0; x < 80; x++)
|
||||
for (int x = 0; x < 79; x++)
|
||||
{
|
||||
if (x == 0)
|
||||
{
|
||||
mazeline[x] = ' ';
|
||||
continue;
|
||||
}
|
||||
|
||||
int rndnum = rngrange(188, 197, seed);
|
||||
switch (rndnum)
|
||||
{
|
||||
@ -65,10 +74,12 @@ int main(int argc, char *argv[]) {
|
||||
rndnum = 180;
|
||||
break;
|
||||
}
|
||||
printf(1, "%c", rndnum);
|
||||
|
||||
}
|
||||
//printf(1, "\n");
|
||||
// This is causing huge lock ups due to having to lock the console for each character
|
||||
// is what im guessing so instead write it to a per line buffer then print
|
||||
//printf(1, "%c", rndnum);
|
||||
mazeline[x] = rndnum;
|
||||
}
|
||||
printf(1, "%s\n", mazeline);
|
||||
sleep(10);
|
||||
}
|
||||
printf(1, "Maze Ended\n");
|
||||
|
Reference in New Issue
Block a user