diff --git a/90 Tower/csharp/Tower/Resources/Congratulations.txt b/90 Tower/csharp/Tower/Resources/Congratulations.txt new file mode 100644 index 00000000..332297b2 --- /dev/null +++ b/90 Tower/csharp/Tower/Resources/Congratulations.txt @@ -0,0 +1,2 @@ + +Congratulations diff --git a/90 Tower/csharp/Tower/Resources/DiskCountPrompt.txt b/90 Tower/csharp/Tower/Resources/DiskCountPrompt.txt new file mode 100644 index 00000000..a45c3461 --- /dev/null +++ b/90 Tower/csharp/Tower/Resources/DiskCountPrompt.txt @@ -0,0 +1 @@ +How many disks do you want to move (7 is max) \ No newline at end of file diff --git a/90 Tower/csharp/Tower/Resources/DiskCountQuit.txt b/90 Tower/csharp/Tower/Resources/DiskCountQuit.txt new file mode 100644 index 00000000..b573854d --- /dev/null +++ b/90 Tower/csharp/Tower/Resources/DiskCountQuit.txt @@ -0,0 +1,2 @@ +All right, wise guy, if you can't play the game right, I'll +just take my puzzle and go home. So long. \ No newline at end of file diff --git a/90 Tower/csharp/Tower/Resources/DiskCountRetry.txt b/90 Tower/csharp/Tower/Resources/DiskCountRetry.txt new file mode 100644 index 00000000..c8ec4b10 --- /dev/null +++ b/90 Tower/csharp/Tower/Resources/DiskCountRetry.txt @@ -0,0 +1 @@ +Sorry, but i can't do that job for you. \ No newline at end of file diff --git a/90 Tower/csharp/Tower/Resources/DiskPrompt.txt b/90 Tower/csharp/Tower/Resources/DiskPrompt.txt new file mode 100644 index 00000000..a7f127db --- /dev/null +++ b/90 Tower/csharp/Tower/Resources/DiskPrompt.txt @@ -0,0 +1 @@ +Which disk would you like to move \ No newline at end of file diff --git a/90 Tower/csharp/Tower/Resources/DiskQuit.txt b/90 Tower/csharp/Tower/Resources/DiskQuit.txt new file mode 100644 index 00000000..56d19d5f --- /dev/null +++ b/90 Tower/csharp/Tower/Resources/DiskQuit.txt @@ -0,0 +1 @@ +Stop wasting my time. Go bother someone else. \ No newline at end of file diff --git a/90 Tower/csharp/Tower/Resources/DiskRetry.txt b/90 Tower/csharp/Tower/Resources/DiskRetry.txt new file mode 100644 index 00000000..1efe29b4 --- /dev/null +++ b/90 Tower/csharp/Tower/Resources/DiskRetry.txt @@ -0,0 +1 @@ +Illegal entry... You may only type 3, 5, 7, 9, 11, 13, or 15. \ No newline at end of file diff --git a/90 Tower/csharp/Tower/Resources/DiskUnavailable.txt b/90 Tower/csharp/Tower/Resources/DiskUnavailable.txt new file mode 100644 index 00000000..721ddccf --- /dev/null +++ b/90 Tower/csharp/Tower/Resources/DiskUnavailable.txt @@ -0,0 +1 @@ +That disk is below another one. Make another choice. \ No newline at end of file diff --git a/90 Tower/csharp/Tower/Resources/IllegalMove.txt b/90 Tower/csharp/Tower/Resources/IllegalMove.txt new file mode 100644 index 00000000..243c8d8f --- /dev/null +++ b/90 Tower/csharp/Tower/Resources/IllegalMove.txt @@ -0,0 +1,3 @@ +You can't place a larger disk on top of a smaller one, +it might crush it! +Now then, \ No newline at end of file diff --git a/90 Tower/csharp/Tower/Resources/Instructions.txt b/90 Tower/csharp/Tower/Resources/Instructions.txt new file mode 100644 index 00000000..93c71b8d --- /dev/null +++ b/90 Tower/csharp/Tower/Resources/Instructions.txt @@ -0,0 +1,10 @@ +In this program, we shall refer to disks by numerical code. +3 will represent the smallest disk, 5 the next size, +7 the next, and so on, up to 15. If you do the puzzle with +2 disks, their code names would be 13 and 15. With 3 disks +the code names would be 11, 13 and 15, etc. The needles +are numbered from left to right, 1 to 3. We will +startup with the disks on needle 1, and attempt to move them +to needle 3. + +Good luck! diff --git a/90 Tower/csharp/Tower/Resources/Intro.txt b/90 Tower/csharp/Tower/Resources/Intro.txt new file mode 100644 index 00000000..a88049a9 --- /dev/null +++ b/90 Tower/csharp/Tower/Resources/Intro.txt @@ -0,0 +1,11 @@ + Towers + Creative Computing Morristown, New Jersey + + + +Towers of Hanoi puzzle. + +You must transfer the disks from the left to the right +tower, one at a time, never putting a larger dish on a +smaller disk. + diff --git a/90 Tower/csharp/Tower/Resources/NeedlePrompt.txt b/90 Tower/csharp/Tower/Resources/NeedlePrompt.txt new file mode 100644 index 00000000..59dcebe7 --- /dev/null +++ b/90 Tower/csharp/Tower/Resources/NeedlePrompt.txt @@ -0,0 +1 @@ +Place disk on which needle \ No newline at end of file diff --git a/90 Tower/csharp/Tower/Resources/NeedleQuit.txt b/90 Tower/csharp/Tower/Resources/NeedleQuit.txt new file mode 100644 index 00000000..e75e3d87 --- /dev/null +++ b/90 Tower/csharp/Tower/Resources/NeedleQuit.txt @@ -0,0 +1,2 @@ +I tried to warn you, but you wouldn't listen, +Bye bye, big shot. \ No newline at end of file diff --git a/90 Tower/csharp/Tower/Resources/NeedleRetry.txt b/90 Tower/csharp/Tower/Resources/NeedleRetry.txt new file mode 100644 index 00000000..19701eec --- /dev/null +++ b/90 Tower/csharp/Tower/Resources/NeedleRetry.txt @@ -0,0 +1,2 @@ +I'll assume you hit the wrong key this time. But watch it, +I only allow one mistake \ No newline at end of file diff --git a/90 Tower/csharp/Tower/Resources/PlayAgainPrompt.txt b/90 Tower/csharp/Tower/Resources/PlayAgainPrompt.txt new file mode 100644 index 00000000..3972e7bd --- /dev/null +++ b/90 Tower/csharp/Tower/Resources/PlayAgainPrompt.txt @@ -0,0 +1,2 @@ + +Try again (Yes or No) \ No newline at end of file diff --git a/90 Tower/csharp/Tower/Resources/Strings.cs b/90 Tower/csharp/Tower/Resources/Strings.cs new file mode 100644 index 00000000..62b84d0a --- /dev/null +++ b/90 Tower/csharp/Tower/Resources/Strings.cs @@ -0,0 +1,38 @@ +using System.IO; +using System.Reflection; +using System.Runtime.CompilerServices; + +namespace Tower.Resources +{ + internal static class Strings + { + internal static string Congratulations => GetResource(); + internal static string DiskCountPrompt => GetResource(); + internal static string DiskCountQuit => GetResource(); + internal static string DiskCountRetry => GetResource(); + internal static string DiskPrompt => GetResource(); + internal static string DiskQuit => GetResource(); + internal static string DiskRetry => GetResource(); + internal static string DiskUnavailable => GetResource(); + internal static string IllegalMove => GetResource(); + internal static string Instructions => GetResource(); + internal static string Intro => GetResource(); + internal static string NeedlePrompt => GetResource(); + internal static string NeedleQuit => GetResource(); + internal static string NeedleRetry => GetResource(); + internal static string PlayAgainPrompt => GetResource(); + internal static string Thanks => GetResource(); + internal static string Title => GetResource(); + internal static string TooManyMoves => GetResource(); + internal static string YesNoPrompt => GetResource(); + + private static string GetResource([CallerMemberName] string name = "") + { + var streamName = $"Tower.Resources.{name}.txt"; + using var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(streamName); + using var reader = new StreamReader(stream); + + return reader.ReadToEnd(); + } + } +} diff --git a/90 Tower/csharp/Tower/Resources/Thanks.txt b/90 Tower/csharp/Tower/Resources/Thanks.txt new file mode 100644 index 00000000..435d89c7 --- /dev/null +++ b/90 Tower/csharp/Tower/Resources/Thanks.txt @@ -0,0 +1,2 @@ + +Thanks for the game! diff --git a/90 Tower/csharp/Tower/Resources/Title.txt b/90 Tower/csharp/Tower/Resources/Title.txt new file mode 100644 index 00000000..a88049a9 --- /dev/null +++ b/90 Tower/csharp/Tower/Resources/Title.txt @@ -0,0 +1,11 @@ + Towers + Creative Computing Morristown, New Jersey + + + +Towers of Hanoi puzzle. + +You must transfer the disks from the left to the right +tower, one at a time, never putting a larger dish on a +smaller disk. + diff --git a/90 Tower/csharp/Tower/Resources/TooManyMoves.txt b/90 Tower/csharp/Tower/Resources/TooManyMoves.txt new file mode 100644 index 00000000..c517218e --- /dev/null +++ b/90 Tower/csharp/Tower/Resources/TooManyMoves.txt @@ -0,0 +1,2 @@ +Sorry, but i have orders to stop is you make more than +128 moves. \ No newline at end of file diff --git a/90 Tower/csharp/Tower/Resources/YesNoPrompt.txt b/90 Tower/csharp/Tower/Resources/YesNoPrompt.txt new file mode 100644 index 00000000..62612ce2 --- /dev/null +++ b/90 Tower/csharp/Tower/Resources/YesNoPrompt.txt @@ -0,0 +1,2 @@ + +'Yes' or 'No' please \ No newline at end of file diff --git a/90 Tower/csharp/Tower/Tower.csproj b/90 Tower/csharp/Tower/Tower.csproj index 20827042..c0de0594 100644 --- a/90 Tower/csharp/Tower/Tower.csproj +++ b/90 Tower/csharp/Tower/Tower.csproj @@ -5,4 +5,8 @@ net5.0 + + + +