mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-23 07:29:02 -08:00
Initial version
This commit is contained in:
24
08 Batnum/csharp/Batnum.csproj
Normal file
24
08 Batnum/csharp/Batnum.csproj
Normal file
@@ -0,0 +1,24 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<NeutralLanguage>en-US</NeutralLanguage>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Properties\Resources.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Update="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
25
08 Batnum/csharp/Batnum.sln
Normal file
25
08 Batnum/csharp/Batnum.sln
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.31019.35
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Batnum", "Batnum.csproj", "{64F32165-9D67-42B1-B04C-953CC756A170}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{64F32165-9D67-42B1-B04C-953CC756A170}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{64F32165-9D67-42B1-B04C-953CC756A170}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{64F32165-9D67-42B1-B04C-953CC756A170}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{64F32165-9D67-42B1-B04C-953CC756A170}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {73E40CC2-0E4E-48CF-8BDD-D6B6E995C14F}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
114
08 Batnum/csharp/BatnumGame.cs
Normal file
114
08 Batnum/csharp/BatnumGame.cs
Normal file
@@ -0,0 +1,114 @@
|
||||
using Batnum.Properties;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Batnum
|
||||
{
|
||||
public enum WinOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Last person to play wins
|
||||
/// </summary>
|
||||
WinWithTakeLast = 1,
|
||||
/// <summary>
|
||||
/// Last person to play loses
|
||||
/// </summary>
|
||||
WinWithAvoidLast = 2
|
||||
}
|
||||
|
||||
public enum Players
|
||||
{
|
||||
Computer = 1,
|
||||
Human = 2
|
||||
}
|
||||
|
||||
public class BatnumGame
|
||||
{
|
||||
public BatnumGame(int pileSize, WinOptions winCriteria, int minTake, int maxtake, Players firstPlayer, Func<string, int>askPlayerCallback)
|
||||
{
|
||||
this.pileSize = pileSize;
|
||||
this.winCriteria = winCriteria;
|
||||
this.minTake = minTake;
|
||||
this.maxTake = maxtake;
|
||||
this.currentPlayer = firstPlayer;
|
||||
this.askPlayerCallback = askPlayerCallback;
|
||||
}
|
||||
|
||||
private int pileSize;
|
||||
private WinOptions winCriteria;
|
||||
private int minTake;
|
||||
private int maxTake;
|
||||
private Players currentPlayer;
|
||||
private Func<string, int> askPlayerCallback;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the game is running
|
||||
/// </summary>
|
||||
public bool IsRunning => pileSize > 0;
|
||||
|
||||
/// <summary>
|
||||
/// Takes the next turn
|
||||
/// </summary>
|
||||
/// <returns>A message to be displayed to the player</returns>
|
||||
public string TakeTurn()
|
||||
{
|
||||
//Edge condition - can occur when minTake is more > 1
|
||||
if (pileSize < minTake)
|
||||
{
|
||||
pileSize = 0;
|
||||
return string.Format(Resources.END_DRAW, minTake);
|
||||
}
|
||||
return currentPlayer == Players.Computer ? ComputerTurn() : PlayerTurn();
|
||||
}
|
||||
|
||||
private string PlayerTurn()
|
||||
{
|
||||
int draw = askPlayerCallback(Resources.INPUT_TURN);
|
||||
if (draw == 0)
|
||||
{
|
||||
pileSize = 0;
|
||||
return Resources.INPUT_ZERO;
|
||||
}
|
||||
if (draw < minTake || draw > maxTake || draw > pileSize)
|
||||
{
|
||||
return Resources.INPUT_ILLEGAL;
|
||||
}
|
||||
pileSize = pileSize - draw;
|
||||
if (pileSize == 0)
|
||||
{
|
||||
return winCriteria == WinOptions.WinWithTakeLast ? Resources.END_PLAYERWIN : Resources.END_PLAYERLOSE;
|
||||
}
|
||||
currentPlayer = Players.Computer;
|
||||
return "";
|
||||
}
|
||||
|
||||
private string ComputerTurn()
|
||||
{
|
||||
//first calculate the move to play
|
||||
int sumTake = minTake + maxTake;
|
||||
int draw = pileSize - sumTake * (int)(pileSize / (float)sumTake);
|
||||
draw = Math.Clamp(draw, minTake, maxTake);
|
||||
|
||||
//detect win/lose conditions
|
||||
switch (winCriteria)
|
||||
{
|
||||
case WinOptions.WinWithAvoidLast when (pileSize == minTake): //lose condition
|
||||
pileSize = 0;
|
||||
return string.Format(Resources.END_COMPLOSE, minTake);
|
||||
case WinOptions.WinWithAvoidLast when (pileSize <= maxTake): //avoid automatic loss on next turn
|
||||
draw = Math.Clamp(draw, minTake, pileSize - 1);
|
||||
break;
|
||||
case WinOptions.WinWithTakeLast when pileSize <= maxTake: // win condition
|
||||
draw = Math.Min(pileSize, maxTake);
|
||||
pileSize = 0;
|
||||
return string.Format(Resources.END_COMPWIN, draw);
|
||||
}
|
||||
pileSize -= draw;
|
||||
currentPlayer = Players.Human;
|
||||
return string.Format(Resources.COMPTURN, draw, pileSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
111
08 Batnum/csharp/ConsoleUtilities.cs
Normal file
111
08 Batnum/csharp/ConsoleUtilities.cs
Normal file
@@ -0,0 +1,111 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Batnum
|
||||
{
|
||||
public static class ConsoleUtilities
|
||||
{
|
||||
/// <summary>
|
||||
/// Ask the user a question and expects a comma separated pair of numbers representing a number range in response
|
||||
/// the range provided must have a maximum which is greater than the minimum
|
||||
/// </summary>
|
||||
/// <param name="question">The question to ask</param>
|
||||
/// <param name="minimum">The minimum value expected</param>
|
||||
/// <param name="maximum">The maximum value expected</param>
|
||||
/// <returns>A pair of numbers representing the minimum and maximum of the range</returns>
|
||||
public static (int min, int max) AskNumberRangeQuestion(string question, Func<int, int, bool> Validate)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
Console.Write(question);
|
||||
Console.Write(" ");
|
||||
string[] rawInput = Console.ReadLine().Split(',');
|
||||
if (rawInput.Length == 2)
|
||||
{
|
||||
if (int.TryParse(rawInput[0], out int min) && int.TryParse(rawInput[1], out int max))
|
||||
{
|
||||
if (Validate(min, max))
|
||||
{
|
||||
return (min, max);
|
||||
}
|
||||
}
|
||||
}
|
||||
Console.WriteLine();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ask the user a question and expects a number in response
|
||||
/// </summary>
|
||||
/// <param name="question">The question to ask</param>
|
||||
/// <param name="minimum">A minimum value expected</param>
|
||||
/// <param name="maximum">A maximum value expected</param>
|
||||
/// <returns>The number the user entered</returns>
|
||||
public static int AskNumberQuestion(string question, Func<int, bool> Validate)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
Console.Write(question);
|
||||
Console.Write(" ");
|
||||
string rawInput = Console.ReadLine();
|
||||
if (int.TryParse(rawInput, out int number))
|
||||
{
|
||||
if (Validate(number))
|
||||
{
|
||||
return number;
|
||||
}
|
||||
}
|
||||
Console.WriteLine();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Align content to center of console.
|
||||
/// </summary>
|
||||
/// <param name="content">Content to center</param>
|
||||
/// <returns>Center aligned text</returns>
|
||||
public static string CenterText(string content)
|
||||
{
|
||||
int windowWidth = Console.WindowWidth;
|
||||
return String.Format("{0," + ((windowWidth / 2) + (content.Length / 2)) + "}", content);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes the specified data, followed by the current line terminator, to the standard output stream, while wrapping lines that would otherwise break words.
|
||||
/// source: https://stackoverflow.com/questions/20534318/make-console-writeline-wrap-words-instead-of-letters
|
||||
/// </summary>
|
||||
/// <param name="paragraph">The value to write.</param>
|
||||
/// <param name="tabSize">The value that indicates the column width of tab characters.</param>
|
||||
public static void WriteLineWordWrap(string paragraph, int tabSize = 4)
|
||||
{
|
||||
string[] lines = paragraph
|
||||
.Replace("\t", new String(' ', tabSize))
|
||||
.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
|
||||
|
||||
for (int i = 0; i < lines.Length; i++)
|
||||
{
|
||||
string process = lines[i];
|
||||
List<String> wrapped = new List<string>();
|
||||
|
||||
while (process.Length > Console.WindowWidth)
|
||||
{
|
||||
int wrapAt = process.LastIndexOf(' ', Math.Min(Console.WindowWidth - 1, process.Length));
|
||||
if (wrapAt <= 0) break;
|
||||
|
||||
wrapped.Add(process.Substring(0, wrapAt));
|
||||
process = process.Remove(0, wrapAt + 1);
|
||||
}
|
||||
|
||||
foreach (string wrap in wrapped)
|
||||
{
|
||||
Console.WriteLine(wrap);
|
||||
}
|
||||
|
||||
Console.WriteLine(process);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
30
08 Batnum/csharp/Program.cs
Normal file
30
08 Batnum/csharp/Program.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using Batnum;
|
||||
using Batnum.Properties;
|
||||
using System;
|
||||
|
||||
Console.WriteLine(ConsoleUtilities.CenterText(Resources.GAME_NAME));
|
||||
Console.WriteLine(ConsoleUtilities.CenterText(Resources.INTRO_HEADER));
|
||||
Console.WriteLine();
|
||||
Console.WriteLine();
|
||||
Console.WriteLine();
|
||||
ConsoleUtilities.WriteLineWordWrap(Resources.INTRO_PART1);
|
||||
Console.WriteLine();
|
||||
ConsoleUtilities.WriteLineWordWrap(Resources.INTRO_PART2);
|
||||
|
||||
while (true)
|
||||
{
|
||||
Console.WriteLine();
|
||||
int pileSize = ConsoleUtilities.AskNumberQuestion(Resources.START_QUESTION_PILESIZE, (n) => n > 1);
|
||||
WinOptions winOption = (WinOptions)ConsoleUtilities.AskNumberQuestion(Resources.START_QUESTION_WINOPTION, (n) => Enum.IsDefined(typeof(WinOptions), n));
|
||||
(int minTake, int maxTake) = ConsoleUtilities.AskNumberRangeQuestion(Resources.START_QUESTION_DRAWMINMAX, (min,max) => min >= 1 && max < pileSize && max > min);
|
||||
Players currentPlayer = (Players)ConsoleUtilities.AskNumberQuestion(Resources.START_QUESTION_WHOSTARTS, (n) => Enum.IsDefined(typeof(Players), n));
|
||||
|
||||
BatnumGame game = new BatnumGame(pileSize, winOption, minTake, maxTake, currentPlayer, (question) => ConsoleUtilities.AskNumberQuestion(question, (c) => true));
|
||||
while(game.IsRunning)
|
||||
{
|
||||
string message = game.TakeTurn();
|
||||
Console.WriteLine(message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
216
08 Batnum/csharp/Properties/Resources.Designer.cs
generated
Normal file
216
08 Batnum/csharp/Properties/Resources.Designer.cs
generated
Normal file
@@ -0,0 +1,216 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Batnum.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Batnum.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to COMPUTER TAKES {0} AND LEAVES {1}.
|
||||
/// </summary>
|
||||
internal static string COMPTURN {
|
||||
get {
|
||||
return ResourceManager.GetString("COMPTURN", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to COMPUTER TAKES {0} AND LOSES.
|
||||
/// </summary>
|
||||
internal static string END_COMPLOSE {
|
||||
get {
|
||||
return ResourceManager.GetString("END_COMPLOSE", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to COMPUTER TAKES {0} AND WINS.
|
||||
/// </summary>
|
||||
internal static string END_COMPWIN {
|
||||
get {
|
||||
return ResourceManager.GetString("END_COMPWIN", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to ITS A DRAW, THERE ARE ONLY {0} PIECES LEFT.
|
||||
/// </summary>
|
||||
internal static string END_DRAW {
|
||||
get {
|
||||
return ResourceManager.GetString("END_DRAW", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to TOUGH LUCK, YOU LOSE..
|
||||
/// </summary>
|
||||
internal static string END_PLAYERLOSE {
|
||||
get {
|
||||
return ResourceManager.GetString("END_PLAYERLOSE", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to CONGRATULATIONS, YOU WIN..
|
||||
/// </summary>
|
||||
internal static string END_PLAYERWIN {
|
||||
get {
|
||||
return ResourceManager.GetString("END_PLAYERWIN", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to BATNUM.
|
||||
/// </summary>
|
||||
internal static string GAME_NAME {
|
||||
get {
|
||||
return ResourceManager.GetString("GAME_NAME", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to ILLEGAL MOVE, RENETER IT.
|
||||
/// </summary>
|
||||
internal static string INPUT_ILLEGAL {
|
||||
get {
|
||||
return ResourceManager.GetString("INPUT_ILLEGAL", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to YOUR MOVE ?.
|
||||
/// </summary>
|
||||
internal static string INPUT_TURN {
|
||||
get {
|
||||
return ResourceManager.GetString("INPUT_TURN", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to I TOLD YOU NOT TO USE ZERO! COMPUTER WINS BY FORFEIT..
|
||||
/// </summary>
|
||||
internal static string INPUT_ZERO {
|
||||
get {
|
||||
return ResourceManager.GetString("INPUT_ZERO", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to CREATIVE COMPUTING MORRISTOWN, NEW JERSEY.
|
||||
/// </summary>
|
||||
internal static string INTRO_HEADER {
|
||||
get {
|
||||
return ResourceManager.GetString("INTRO_HEADER", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to THIS PROGRAM IS A 'BATTLE' OF NUMBERS GAME, WHERE THE COMPUTER IS YOUR OPPONENT.
|
||||
/// </summary>
|
||||
internal static string INTRO_PART1 {
|
||||
get {
|
||||
return ResourceManager.GetString("INTRO_PART1", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to THE GAME STARTS WITH AN ASSUMED PILE OF OBJECTS. YOU AND YOUR OPPONENT ALTERNATELY REMOVE OBJECTS FROM THE PILE. WINNNING IS DEFINED IN ADVANCE AS TAKING THE LAST OBJECT OR NOT. YOU CAN ALSO SPECIFY SOME OTHER BEGINING CONDITIONS. DON'T USER ZERO, HOWWEVER, IN PLAYING THE GAME..
|
||||
/// </summary>
|
||||
internal static string INTRO_PART2 {
|
||||
get {
|
||||
return ResourceManager.GetString("INTRO_PART2", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to ENTER MIN AND MAX ?.
|
||||
/// </summary>
|
||||
internal static string START_QUESTION_DRAWMINMAX {
|
||||
get {
|
||||
return ResourceManager.GetString("START_QUESTION_DRAWMINMAX", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to ENTER PILE SIZE ?.
|
||||
/// </summary>
|
||||
internal static string START_QUESTION_PILESIZE {
|
||||
get {
|
||||
return ResourceManager.GetString("START_QUESTION_PILESIZE", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to ENTER START OPTION - 1 COMPUTER FIRST, 2 YOU FIRST ?.
|
||||
/// </summary>
|
||||
internal static string START_QUESTION_WHOSTARTS {
|
||||
get {
|
||||
return ResourceManager.GetString("START_QUESTION_WHOSTARTS", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to ENTER WIN OPTION - 1 TO TAKE LAST, 2 TO AVOID LAST: ?.
|
||||
/// </summary>
|
||||
internal static string START_QUESTION_WINOPTION {
|
||||
get {
|
||||
return ResourceManager.GetString("START_QUESTION_WINOPTION", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
171
08 Batnum/csharp/Properties/Resources.en.resx
Normal file
171
08 Batnum/csharp/Properties/Resources.en.resx
Normal file
@@ -0,0 +1,171 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="COMPTURN" xml:space="preserve">
|
||||
<value>COMPUTER TAKES {0} AND LEAVES {1}</value>
|
||||
</data>
|
||||
<data name="END_COMPLOSE" xml:space="preserve">
|
||||
<value>COMPUTER TAKES {0} AND LOSES</value>
|
||||
</data>
|
||||
<data name="END_COMPWIN" xml:space="preserve">
|
||||
<value>COMPUTER TAKES {0} AND WINS</value>
|
||||
</data>
|
||||
<data name="END_DRAW" xml:space="preserve">
|
||||
<value>ITS A DRAW, THERE ARE ONLY {0} PIECES LEFT</value>
|
||||
</data>
|
||||
<data name="END_PLAYERLOSE" xml:space="preserve">
|
||||
<value>TOUGH LUCK, YOU LOSE.</value>
|
||||
</data>
|
||||
<data name="END_PLAYERWIN" xml:space="preserve">
|
||||
<value>CONGRATULATIONS, YOU WIN.</value>
|
||||
</data>
|
||||
<data name="GAME_NAME" xml:space="preserve">
|
||||
<value>BATNUM</value>
|
||||
</data>
|
||||
<data name="INPUT_ILLEGAL" xml:space="preserve">
|
||||
<value>ILLEGAL MOVE, RENETER IT</value>
|
||||
</data>
|
||||
<data name="INPUT_TURN" xml:space="preserve">
|
||||
<value>YOUR MOVE ?</value>
|
||||
</data>
|
||||
<data name="INPUT_ZERO" xml:space="preserve">
|
||||
<value>I TOLD YOU NOT TO USE ZERO! COMPUTER WINS BY FORFEIT.</value>
|
||||
</data>
|
||||
<data name="INTRO_HEADER" xml:space="preserve">
|
||||
<value>CREATIVE COMPUTING MORRISTOWN, NEW JERSEY</value>
|
||||
</data>
|
||||
<data name="INTRO_PART1" xml:space="preserve">
|
||||
<value>THIS PROGRAM IS A 'BATTLE' OF NUMBERS GAME, WHERE THE COMPUTER IS YOUR OPPONENT</value>
|
||||
</data>
|
||||
<data name="INTRO_PART2" xml:space="preserve">
|
||||
<value>THE GAME STARTS WITH AN ASSUMED PILE OF OBJECTS. YOU AND YOUR OPPONENT ALTERNATELY REMOVE OBJECTS FROM THE PILE. WINNNING IS DEFINED IN ADVANCE AS TAKING THE LAST OBJECT OR NOT. YOU CAN ALSO SPECIFY SOME OTHER BEGINING CONDITIONS. DON'T USER ZERO, HOWWEVER, IN PLAYING THE GAME.</value>
|
||||
</data>
|
||||
<data name="START_QUESTION_DRAWMINMAX" xml:space="preserve">
|
||||
<value>ENTER MIN AND MAX ?</value>
|
||||
</data>
|
||||
<data name="START_QUESTION_PILESIZE" xml:space="preserve">
|
||||
<value>ENTER PILE SIZE ?</value>
|
||||
</data>
|
||||
<data name="START_QUESTION_WHOSTARTS" xml:space="preserve">
|
||||
<value>ENTER START OPTION - 1 COMPUTER FIRST, 2 YOU FIRST ?</value>
|
||||
</data>
|
||||
<data name="START_QUESTION_WINOPTION" xml:space="preserve">
|
||||
<value>ENTER WIN OPTION - 1 TO TAKE LAST, 2 TO AVOID LAST: ?</value>
|
||||
</data>
|
||||
</root>
|
||||
171
08 Batnum/csharp/Properties/Resources.fr.resx
Normal file
171
08 Batnum/csharp/Properties/Resources.fr.resx
Normal file
@@ -0,0 +1,171 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="COMPTURN" xml:space="preserve">
|
||||
<value>L'ORDINATEUR PREND {0} ET LAISSE {1}</value>
|
||||
</data>
|
||||
<data name="END_COMPLOSE" xml:space="preserve">
|
||||
<value>L'ORDINATEUR PREND {0} ET PERD</value>
|
||||
</data>
|
||||
<data name="END_COMPWIN" xml:space="preserve">
|
||||
<value>L'ORDINATEUR PREND {0} ET GAGNE</value>
|
||||
</data>
|
||||
<data name="END_DRAW" xml:space="preserve">
|
||||
<value>MATCH NUL, IL RESTE SEULEMENT {0} PIECES</value>
|
||||
</data>
|
||||
<data name="END_PLAYERLOSE" xml:space="preserve">
|
||||
<value>PAS DE CHANCE. TU AS PERDU.</value>
|
||||
</data>
|
||||
<data name="END_PLAYERWIN" xml:space="preserve">
|
||||
<value>BRAVO! TU AS GAGNE</value>
|
||||
</data>
|
||||
<data name="GAME_NAME" xml:space="preserve">
|
||||
<value>BATNUM</value>
|
||||
</data>
|
||||
<data name="INPUT_ILLEGAL" xml:space="preserve">
|
||||
<value>CE COUP EST INTERDIT. RE-ESSAIE</value>
|
||||
</data>
|
||||
<data name="INPUT_TURN" xml:space="preserve">
|
||||
<value>TON TOUR ?</value>
|
||||
</data>
|
||||
<data name="INPUT_ZERO" xml:space="preserve">
|
||||
<value>JE TE DIS DE NE PAS UTILISER LE ZERO! L'ORDINATEUR GAGNE PAR DEFAUT.</value>
|
||||
</data>
|
||||
<data name="INTRO_HEADER" xml:space="preserve">
|
||||
<value>CREATIVE COMPUTING MORRISTOWN, NEW JERSEY</value>
|
||||
</data>
|
||||
<data name="INTRO_PART1" xml:space="preserve">
|
||||
<value>CE PROGRAMME EST UN JEU 'BATAILLE' DE NOMBRES, OU L'ORDINATEUR EST TON ADVERSAIRE</value>
|
||||
</data>
|
||||
<data name="INTRO_PART2" xml:space="preserve">
|
||||
<value>LE JEU COMMENCE AVEC UNE NOMBRE D'OBJETS DEFINI. TOI ET TON ADVERSAIRE ENLEVEZ EN ALTERNANCE UN NOMBRE D'OBJETS. LES CONDITIONS DE VICTOIRE SON DÉFINIES À L'AVANCE COMME PRENDRE OU NE PAS PRENDRE LE DERNIER OBJET. VOUS POUVEZ ÉGALEMENT PRÉCISER D'AUTRES CONDITIONS DES LE DÉBUT. TOUTEFOIS, N'UTILISEZ PAS LE CHIFFRE ZERO.</value>
|
||||
</data>
|
||||
<data name="START_QUESTION_DRAWMINMAX" xml:space="preserve">
|
||||
<value>ENTRE LE MINIMUM ET MAXIMUM D'OBJETS A RETIRER POUR CHAQUE TOUR ?</value>
|
||||
</data>
|
||||
<data name="START_QUESTION_PILESIZE" xml:space="preserve">
|
||||
<value>ENTRE LE NOMBRE D'OBJETS ?</value>
|
||||
</data>
|
||||
<data name="START_QUESTION_WHOSTARTS" xml:space="preserve">
|
||||
<value>ENTRE QUI COMMENCE - 1 L'ORDINATEUR, 2 TOI ?</value>
|
||||
</data>
|
||||
<data name="START_QUESTION_WINOPTION" xml:space="preserve">
|
||||
<value>ENTRE LA CONDITION DE VICTOIRE - 1 PRENDRE LA DERNIERE PIECE, 2 EVITER LA DERNIERE PIECE ?</value>
|
||||
</data>
|
||||
</root>
|
||||
171
08 Batnum/csharp/Properties/Resources.resx
Normal file
171
08 Batnum/csharp/Properties/Resources.resx
Normal file
@@ -0,0 +1,171 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="COMPTURN" xml:space="preserve">
|
||||
<value>COMPUTER TAKES {0} AND LEAVES {1}</value>
|
||||
</data>
|
||||
<data name="END_COMPLOSE" xml:space="preserve">
|
||||
<value>COMPUTER TAKES {0} AND LOSES</value>
|
||||
</data>
|
||||
<data name="END_COMPWIN" xml:space="preserve">
|
||||
<value>COMPUTER TAKES {0} AND WINS</value>
|
||||
</data>
|
||||
<data name="END_DRAW" xml:space="preserve">
|
||||
<value>ITS A DRAW, THERE ARE ONLY {0} PIECES LEFT</value>
|
||||
</data>
|
||||
<data name="END_PLAYERLOSE" xml:space="preserve">
|
||||
<value>TOUGH LUCK, YOU LOSE.</value>
|
||||
</data>
|
||||
<data name="END_PLAYERWIN" xml:space="preserve">
|
||||
<value>CONGRATULATIONS, YOU WIN.</value>
|
||||
</data>
|
||||
<data name="GAME_NAME" xml:space="preserve">
|
||||
<value>BATNUM</value>
|
||||
</data>
|
||||
<data name="INPUT_ILLEGAL" xml:space="preserve">
|
||||
<value>ILLEGAL MOVE, RENETER IT</value>
|
||||
</data>
|
||||
<data name="INPUT_TURN" xml:space="preserve">
|
||||
<value>YOUR MOVE ?</value>
|
||||
</data>
|
||||
<data name="INPUT_ZERO" xml:space="preserve">
|
||||
<value>I TOLD YOU NOT TO USE ZERO! COMPUTER WINS BY FORFEIT.</value>
|
||||
</data>
|
||||
<data name="INTRO_HEADER" xml:space="preserve">
|
||||
<value>CREATIVE COMPUTING MORRISTOWN, NEW JERSEY</value>
|
||||
</data>
|
||||
<data name="INTRO_PART1" xml:space="preserve">
|
||||
<value>THIS PROGRAM IS A 'BATTLE' OF NUMBERS GAME, WHERE THE COMPUTER IS YOUR OPPONENT</value>
|
||||
</data>
|
||||
<data name="INTRO_PART2" xml:space="preserve">
|
||||
<value>THE GAME STARTS WITH AN ASSUMED PILE OF OBJECTS. YOU AND YOUR OPPONENT ALTERNATELY REMOVE OBJECTS FROM THE PILE. WINNNING IS DEFINED IN ADVANCE AS TAKING THE LAST OBJECT OR NOT. YOU CAN ALSO SPECIFY SOME OTHER BEGINING CONDITIONS. DON'T USER ZERO, HOWWEVER, IN PLAYING THE GAME.</value>
|
||||
</data>
|
||||
<data name="START_QUESTION_DRAWMINMAX" xml:space="preserve">
|
||||
<value>ENTER MIN AND MAX ?</value>
|
||||
</data>
|
||||
<data name="START_QUESTION_PILESIZE" xml:space="preserve">
|
||||
<value>ENTER PILE SIZE ?</value>
|
||||
</data>
|
||||
<data name="START_QUESTION_WHOSTARTS" xml:space="preserve">
|
||||
<value>ENTER START OPTION - 1 COMPUTER FIRST, 2 YOU FIRST ?</value>
|
||||
</data>
|
||||
<data name="START_QUESTION_WINOPTION" xml:space="preserve">
|
||||
<value>ENTER WIN OPTION - 1 TO TAKE LAST, 2 TO AVOID LAST: ?</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1,3 +1,11 @@
|
||||
Original source downloaded [from Vintage Basic](http://www.vintage-basic.net/games.html)
|
||||
|
||||
Conversion to [Microsoft C#](https://docs.microsoft.com/en-us/dotnet/csharp/)
|
||||
|
||||
This conversion uses C#9 and is built for .net 5.0
|
||||
|
||||
Functional changes from Original
|
||||
- handle edge condition for end game where the minimum draw amount is greater than the number of items remaining in the pile
|
||||
- Takes into account the width of the console
|
||||
- Mulilingual Support (English/French currently)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user