mirror of
https://github.com/dancojocaru2000/ai-project-idastar.git
synced 2025-02-22 16:39:35 +02:00
Initial interface
This commit is contained in:
parent
59c139cbbf
commit
8cc3e460f2
4 changed files with 68 additions and 3 deletions
3
.vscode/launch.json
vendored
3
.vscode/launch.json
vendored
|
@ -17,7 +17,8 @@
|
||||||
"args": [],
|
"args": [],
|
||||||
"cwd": "${workspaceFolder}",
|
"cwd": "${workspaceFolder}",
|
||||||
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
|
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
|
||||||
"console": "internalConsole",
|
"console": "integratedTerminal",
|
||||||
|
"internalConsoleOptions": "neverOpen",
|
||||||
"stopAtEntry": false
|
"stopAtEntry": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
58
Program.cs
58
Program.cs
|
@ -1,5 +1,59 @@
|
||||||
// See https://aka.ms/new-console-template for more information
|
// See https://aka.ms/new-console-template for more information
|
||||||
Console.WriteLine("Hello, World!");
|
|
||||||
Console.WriteLine("this is slow");
|
string[] labyrinthIN = System.IO.File.ReadAllLines(@"C:\UNI\AI\IDAstar\labyrinth.txt");
|
||||||
|
string[] labyrinthOUT = System.IO.File.ReadAllLines(@"C:\UNI\AI\IDAstar\labyrinthOUT.txt");
|
||||||
|
|
||||||
|
|
||||||
|
System.Console.WriteLine("The input labyrinth: ");
|
||||||
|
foreach (string line in labyrinthIN)
|
||||||
|
{
|
||||||
|
FormattedLabRow(line);
|
||||||
|
}
|
||||||
|
|
||||||
|
System.Console.WriteLine("The output labyrinth: ");
|
||||||
|
foreach (string line in labyrinthOUT)
|
||||||
|
{
|
||||||
|
FormattedLabRow(line);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void FormattedLabRow(string line) {
|
||||||
|
char[] characters = line.ToCharArray();
|
||||||
|
foreach (char c in characters) {
|
||||||
|
switch ( c ) {
|
||||||
|
case '#': {
|
||||||
|
Console.BackgroundColor = ConsoleColor.White;
|
||||||
|
Console.Write(" ");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case ' ': {
|
||||||
|
Console.BackgroundColor = ConsoleColor.Black;
|
||||||
|
Console.Write(" ");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case 'S': {
|
||||||
|
Console.BackgroundColor = ConsoleColor.Green;
|
||||||
|
Console.Write(" ");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case 'F': {
|
||||||
|
Console.BackgroundColor = ConsoleColor.Red;
|
||||||
|
Console.Write(" ");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case 'p': {
|
||||||
|
Console.BackgroundColor = ConsoleColor.Cyan;
|
||||||
|
Console.Write(" ");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Console.ResetColor();
|
||||||
|
Console.WriteLine();
|
||||||
|
}
|
5
labyrinth.txt
Normal file
5
labyrinth.txt
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
###S#
|
||||||
|
# #
|
||||||
|
## #
|
||||||
|
# ##
|
||||||
|
#F###
|
5
labyrinthOUT.txt
Normal file
5
labyrinthOUT.txt
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
###S#
|
||||||
|
# p#
|
||||||
|
##pp#
|
||||||
|
#pp##
|
||||||
|
#F###
|
Loading…
Add table
Reference in a new issue