Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit32e99d7

Browse files
update
1 parenta8271f9 commit32e99d7

File tree

14 files changed

+52101
-49197
lines changed

14 files changed

+52101
-49197
lines changed

‎ebOS/Kernel.cs‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public class Kernel : Sys.Kernel
1212
privateconststringver="1.0.0";
1313
privateconststringcalcver="1.0.0";
1414
privateconststringcryptver="1.0.0";
15+
privateconststringxoxver="1.0.0";
1516

1617
protectedoverridevoidBeforeRun()
1718
{
@@ -113,6 +114,13 @@ protected override void Run()
113114
//Console.ForegroundColor = ConsoleColor.White;
114115
Encrypt.Run();
115116
break;
117+
//games
118+
case"xox":
119+
//Console.ForegroundColor = ConsoleColor.Blue;
120+
Console.WriteLine("xox "+xoxver);
121+
//Console.ForegroundColor = ConsoleColor.White;
122+
XOX.Run();
123+
break;
116124
//no reason
117125
case"hello":
118126
Console.WriteLine("Hello World");
@@ -123,7 +131,7 @@ protected override void Run()
123131
//default
124132
default:
125133
Console.ForegroundColor=ConsoleColor.Red;
126-
Console.WriteLine("\""+i+"\""+" is not a command!");
134+
Console.WriteLine("\""+i1+"\""+" is not a command!");
127135
Console.ForegroundColor=ConsoleColor.White;
128136
break;
129137
}

‎ebOS/XOX.cs‎

Lines changed: 73 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
// in progress
22
usingSystem;
3+
usingSystem.Collections.Generic;
4+
usingSystem.Linq;
5+
usingSystem.Text;
6+
//using System.IO;
7+
usingSys=Cosmos.System;
38
namespaceebOS
49
{
510
publicclassXOX
@@ -11,26 +16,88 @@ public class XOX
1116
game1,
1217
game2,
1318
game3};
14-
15-
voiddraw()
19+
//string[,] game = {{ " ", " ", " " },{ " ", " ", " " },{ " ", " ", " " }};
20+
//int[,] game = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } };
21+
staticintturn=0;
22+
staticbooldorun=true;
23+
staticvoiddraw()
1624
{
1725
Console.Clear();
1826
Console.WriteLine("+-+-+-+");
27+
/*for (int y = 0; y < game.GetLength(0); y++)
28+
{
29+
for (int x = 0; x < game.GetLength(1); x++)
30+
{
31+
Console.Write(game[y, x] + "|");
32+
}
33+
Console.Write("\n");
34+
//Console.WriteLine(x);
35+
Console.WriteLine("+-+-+-+");
36+
}*/
1937
foreach(string[]xingame)
2038
{
2139
Console.Write("|");
2240
foreach(stringyinx)
2341
{
2442
Console.Write(y+"|");
2543
}
44+
Console.Write("\n");
2645
//Console.WriteLine(x);
2746
Console.WriteLine("+-+-+-+");
2847
}
29-
Console.WriteLine("+-+-+-+");
3048
}
31-
publicvoidRun()
49+
publicstaticvoidRun()
3250
{
33-
draw();
34-
}
51+
/*string[] game1 = { " ", " ", " " };
52+
string[] game2 = { " ", " ", " " };
53+
string[] game3 = { " ", " ", " " };
54+
string[][] game = {game1,game2,game3 };*/
55+
stringc="O";
56+
turn=0;
57+
dorun=true;
58+
while(dorun)
59+
{
60+
draw();
61+
if((turn%2)==1)
62+
{
63+
Console.WriteLine("X:");
64+
c="X";
65+
}
66+
else
67+
{
68+
Console.WriteLine("O:");
69+
c="O";
70+
}
71+
boolgood=false;
72+
while(!good)
73+
{
74+
Console.Write("column: ");
75+
stringcol=Console.ReadLine();
76+
Console.Write("row: ");
77+
stringrow=Console.ReadLine();
78+
try
79+
{
80+
intcolint=int.Parse(col);
81+
introwint=int.Parse(row);
82+
if((colint>=1&&colint<=3)&&(rowint>=1&&rowint<=3))
83+
{
84+
game[rowint-1][colint-1]=c;
85+
good=true;
86+
turn++;
87+
}
88+
else
89+
{
90+
Console.WriteLine("Not A Number 1-3!");
91+
}
92+
}
93+
catch
94+
{
95+
Console.WriteLine("Not A Number 1-3!");
96+
}
97+
98+
}
99+
}
100+
101+
}
35102
}
36103
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp