mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-01-01 15:49:59 -08:00
Add resources
This commit is contained in:
1
25_Chief/csharp/Resources/Answer.txt
Normal file
1
25_Chief/csharp/Resources/Answer.txt
Normal file
@@ -0,0 +1 @@
|
||||
What do you have
|
||||
1
25_Chief/csharp/Resources/Believe.txt
Normal file
1
25_Chief/csharp/Resources/Believe.txt
Normal file
@@ -0,0 +1 @@
|
||||
Now do you believe me
|
||||
1
25_Chief/csharp/Resources/Bet.txt
Normal file
1
25_Chief/csharp/Resources/Bet.txt
Normal file
@@ -0,0 +1 @@
|
||||
I bet your number was{0}. Am I right
|
||||
0
25_Chief/csharp/Resources/Bye.txt
Normal file
0
25_Chief/csharp/Resources/Bye.txt
Normal file
2
25_Chief/csharp/Resources/Instructions.txt
Normal file
2
25_Chief/csharp/Resources/Instructions.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
Take a number and add 3. Divide this number by 5 and
|
||||
multiply by 8. Divide by 5 and add the same. Subtract 1.
|
||||
31
25_Chief/csharp/Resources/Lightning.txt
Normal file
31
25_Chief/csharp/Resources/Lightning.txt
Normal file
@@ -0,0 +1,31 @@
|
||||
You have made me mad!!!
|
||||
There must be a great lightning bolt!!
|
||||
|
||||
|
||||
X X
|
||||
X X
|
||||
X X
|
||||
X X
|
||||
X X
|
||||
X X
|
||||
X X
|
||||
X X
|
||||
X X
|
||||
X XXX
|
||||
X X
|
||||
XX X
|
||||
X X
|
||||
X X
|
||||
X X
|
||||
X X
|
||||
X X
|
||||
X X
|
||||
X X
|
||||
X X
|
||||
XX
|
||||
X
|
||||
*
|
||||
|
||||
#########################
|
||||
|
||||
I hope you believe me now, for your sake!!
|
||||
1
25_Chief/csharp/Resources/Original.txt
Normal file
1
25_Chief/csharp/Resources/Original.txt
Normal file
@@ -0,0 +1 @@
|
||||
What was your original number
|
||||
2
25_Chief/csharp/Resources/Ready.txt
Normal file
2
25_Chief/csharp/Resources/Ready.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
I am Chief Numbers Freek, the great Indian math god.
|
||||
Are you ready to take the test you called me out for
|
||||
41
25_Chief/csharp/Resources/Resource.cs
Normal file
41
25_Chief/csharp/Resources/Resource.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace Chief.Resources;
|
||||
|
||||
internal static class Resource
|
||||
{
|
||||
internal static class Streams
|
||||
{
|
||||
public static Stream Bye => GetStream();
|
||||
public static Stream Instructions => GetStream();
|
||||
public static Stream Lightning => GetStream();
|
||||
public static Stream ShutUp => GetStream();
|
||||
public static Stream Title => GetStream();
|
||||
}
|
||||
|
||||
internal static class Formats
|
||||
{
|
||||
public static string Bet => GetString();
|
||||
public static string Working => GetString();
|
||||
}
|
||||
|
||||
internal static class Prompts
|
||||
{
|
||||
public static string Answer => GetString();
|
||||
public static string Believe => GetString();
|
||||
public static string Original => GetString();
|
||||
public static string Ready => GetString();
|
||||
}
|
||||
|
||||
private static string GetString([CallerMemberName] string? name = null)
|
||||
{
|
||||
using var stream = GetStream(name);
|
||||
using var reader = new StreamReader(stream);
|
||||
return reader.ReadToEnd();
|
||||
}
|
||||
|
||||
private static Stream GetStream([CallerMemberName] string? name = null)
|
||||
=> Assembly.GetExecutingAssembly().GetManifestResourceStream($"Stars.Resources.{name}.txt")
|
||||
?? throw new ArgumentException($"Resource stream {name} does not exist", nameof(name));
|
||||
}
|
||||
1
25_Chief/csharp/Resources/ShutUp.txt
Normal file
1
25_Chief/csharp/Resources/ShutUp.txt
Normal file
@@ -0,0 +1 @@
|
||||
Shut up, pale face with wise tongue.
|
||||
5
25_Chief/csharp/Resources/Title.txt
Normal file
5
25_Chief/csharp/Resources/Title.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
Chief
|
||||
Creative Computing Morristown, New Jersey
|
||||
|
||||
|
||||
|
||||
5
25_Chief/csharp/Resources/Working.txt
Normal file
5
25_Chief/csharp/Resources/Working.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
So you think you're so smart, eh?
|
||||
Now watch.
|
||||
{0}plus 3 equals{1}. This divided by 5 equals{2};
|
||||
This times by 8 equals{3}. If we divide by 5 and add 5,
|
||||
we get{4}, which, minus 1, equals{5}.
|
||||
Reference in New Issue
Block a user