Skip to content

Commit bdd41b2

Browse files
committed
create project solution; add Board, ConsoleOutput, MainRules classes; add IOutput, IRules interfaces.
0 parents  commit bdd41b2

File tree

10 files changed

+254
-0
lines changed

10 files changed

+254
-0
lines changed

Diff for: .gitignore

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Autosave files
2+
*~
3+
4+
# build
5+
[Oo]bj/
6+
[Bb]in/
7+
packages/
8+
TestResults/
9+
10+
# globs
11+
Makefile.in
12+
*.DS_Store
13+
*.sln.cache
14+
*.suo
15+
*.cache
16+
*.pidb
17+
*.userprefs
18+
*.usertasks
19+
config.log
20+
config.make
21+
config.status
22+
aclocal.m4
23+
install-sh
24+
autom4te.cache/
25+
*.user
26+
*.tar.gz
27+
tarballs/
28+
test-results/
29+
Thumbs.db
30+
.vs/
31+
32+
# Mac bundle stuff
33+
*.dmg
34+
*.app
35+
36+
# resharper
37+
*_Resharper.*
38+
*.Resharper
39+
40+
# dotCover
41+
*.dotCover

Diff for: KingsTableConsoleEdition.sln

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 2012
4+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KingsTableConsoleEdition", "KingsTableConsoleEdition\KingsTableConsoleEdition.csproj", "{21E4C17D-9016-4AEF-A50C-44AEEC04EDE8}"
5+
EndProject
6+
Global
7+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8+
Debug|x86 = Debug|x86
9+
Release|x86 = Release|x86
10+
EndGlobalSection
11+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
12+
{21E4C17D-9016-4AEF-A50C-44AEEC04EDE8}.Debug|x86.ActiveCfg = Debug|x86
13+
{21E4C17D-9016-4AEF-A50C-44AEEC04EDE8}.Debug|x86.Build.0 = Debug|x86
14+
{21E4C17D-9016-4AEF-A50C-44AEEC04EDE8}.Release|x86.ActiveCfg = Release|x86
15+
{21E4C17D-9016-4AEF-A50C-44AEEC04EDE8}.Release|x86.Build.0 = Release|x86
16+
EndGlobalSection
17+
EndGlobal

Diff for: KingsTableConsoleEdition/Board.cs

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using System;
2+
namespace KingsTableConsoleEdition
3+
{
4+
public class Board
5+
{
6+
7+
char[,] board;
8+
9+
public Board()
10+
{
11+
}
12+
13+
public void MakeBoard(int height)
14+
{
15+
board = new char[height, height];
16+
for (int i = 0; i < height; i++)
17+
{
18+
for (int j = 0; j < height; j++)
19+
{
20+
board[i, j] = '_';
21+
}
22+
}
23+
}
24+
25+
public char[,] GetBoard()
26+
{
27+
return board;
28+
}
29+
}
30+
}

Diff for: KingsTableConsoleEdition/ConsoleOutput.cs

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
using System;
2+
using KingsTableConsoleEdition.Interfaces;
3+
namespace KingsTableConsoleEdition
4+
{
5+
public class ConsoleOutput : IOutput
6+
{
7+
public ConsoleOutput()
8+
{
9+
Console.WriteLine("Welcome to 'King's Table: Console Edition'");
10+
}
11+
12+
public void ShowBoard(char[,] board)
13+
{
14+
String separator = "|";
15+
16+
Console.WriteLine("");
17+
for (int i = 0; i < board.GetLength(0); i++)
18+
{
19+
Console.Write(separator);
20+
for (int j = 0; j < board.GetLength(1); j++)
21+
{
22+
Console.Write(board[i, j].ToString() + separator);
23+
}
24+
Console.WriteLine("");
25+
}
26+
Console.WriteLine("");
27+
}
28+
29+
public void ShowResult()
30+
{
31+
Console.WriteLine("The game result will go here");
32+
}
33+
34+
public void PrintString(string toPrint)
35+
{
36+
Console.WriteLine(toPrint);
37+
}
38+
}
39+
}

Diff for: KingsTableConsoleEdition/Interfaces/IOutput.cs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System;
2+
namespace KingsTableConsoleEdition.Interfaces
3+
{
4+
public interface IOutput
5+
{
6+
7+
void ShowBoard(char[,] board);
8+
void ShowResult();
9+
void PrintString(string toPrint);
10+
11+
}
12+
}

Diff for: KingsTableConsoleEdition/Interfaces/IRules.cs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
namespace KingsTableConsoleEdition.Interfaces
3+
{
4+
public interface IRules
5+
{
6+
7+
8+
9+
}
10+
}
+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
6+
<ProjectGuid>{21E4C17D-9016-4AEF-A50C-44AEEC04EDE8}</ProjectGuid>
7+
<OutputType>Exe</OutputType>
8+
<RootNamespace>KingsTableConsoleEdition</RootNamespace>
9+
<AssemblyName>KingsTableConsoleEdition</AssemblyName>
10+
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
11+
</PropertyGroup>
12+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
13+
<DebugSymbols>true</DebugSymbols>
14+
<DebugType>full</DebugType>
15+
<Optimize>false</Optimize>
16+
<OutputPath>bin\Debug</OutputPath>
17+
<DefineConstants>DEBUG;</DefineConstants>
18+
<ErrorReport>prompt</ErrorReport>
19+
<WarningLevel>4</WarningLevel>
20+
<ExternalConsole>true</ExternalConsole>
21+
<PlatformTarget>x86</PlatformTarget>
22+
</PropertyGroup>
23+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
24+
<Optimize>true</Optimize>
25+
<OutputPath>bin\Release</OutputPath>
26+
<ErrorReport>prompt</ErrorReport>
27+
<WarningLevel>4</WarningLevel>
28+
<ExternalConsole>true</ExternalConsole>
29+
<PlatformTarget>x86</PlatformTarget>
30+
</PropertyGroup>
31+
<ItemGroup>
32+
<Reference Include="System" />
33+
</ItemGroup>
34+
<ItemGroup>
35+
<Compile Include="Program.cs" />
36+
<Compile Include="Properties\AssemblyInfo.cs" />
37+
<Compile Include="Interfaces\IOutput.cs" />
38+
<Compile Include="ConsoleOutput.cs" />
39+
<Compile Include="Interfaces\IRules.cs" />
40+
<Compile Include="MainRules.cs" />
41+
<Compile Include="Board.cs" />
42+
</ItemGroup>
43+
<ItemGroup>
44+
<Folder Include="Interfaces\" />
45+
</ItemGroup>
46+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
47+
</Project>

Diff for: KingsTableConsoleEdition/MainRules.cs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using System;
2+
using KingsTableConsoleEdition.Interfaces;
3+
namespace KingsTableConsoleEdition
4+
{
5+
public class MainRules : IRules
6+
{
7+
public MainRules()
8+
{
9+
}
10+
}
11+
}

Diff for: KingsTableConsoleEdition/Program.cs

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System;
2+
using KingsTableConsoleEdition.Interfaces;
3+
namespace KingsTableConsoleEdition
4+
{
5+
class MainClass
6+
{
7+
8+
static IOutput consoleOutput;
9+
static Board board;
10+
11+
public static void Main(string[] args)
12+
{
13+
consoleOutput = new ConsoleOutput();
14+
board = new Board();
15+
board.MakeBoard(11);
16+
17+
consoleOutput.ShowBoard(board.GetBoard());
18+
consoleOutput.ShowResult();
19+
}
20+
}
21+
}

Diff for: KingsTableConsoleEdition/Properties/AssemblyInfo.cs

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
4+
// Information about this assembly is defined by the following attributes.
5+
// Change them to the values specific to your project.
6+
7+
[assembly: AssemblyTitle("KingsTableConsoleEdition")]
8+
[assembly: AssemblyDescription("")]
9+
[assembly: AssemblyConfiguration("")]
10+
[assembly: AssemblyCompany("")]
11+
[assembly: AssemblyProduct("")]
12+
[assembly: AssemblyCopyright("${AuthorCopyright}")]
13+
[assembly: AssemblyTrademark("")]
14+
[assembly: AssemblyCulture("")]
15+
16+
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
17+
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
18+
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
19+
20+
[assembly: AssemblyVersion("1.0.*")]
21+
22+
// The following attributes are used to specify the signing key for the assembly,
23+
// if desired. See the Mono documentation for more information about signing.
24+
25+
//[assembly: AssemblyDelaySign(false)]
26+
//[assembly: AssemblyKeyFile("")]

0 commit comments

Comments
 (0)