/*TrisPackage.Tris/draw();*/
void draw()
{
string formattext="";
string succsign="{}";
string failsign="..";
int ii,kk,ff=0;
now=DateTime.Now;
____draw(0,ref ff, "Time:[" + now.ToString("yyyy-MM-dd HH:mm:ss") + "]");
for(ii=0; ii<MAPY-1; ii++)
{
for(kk=1; kk<MAPX-1; kk++)
{
if(tris[ ii,kk] == 1) formattext=formattext+succsign;
else formattext=formattext+failsign;
}
____draw(0,ref ff,formattext);
}
____draw(0,ref ff,"Score:[" + score.ToString("00000000") + "]");
}
void ____draw(int x,ref int y, string str)
{
try
{
Console.SetCursorPosition(x,y);
y++;
Console.Write(str);
}
catch(ArgumentOutOfRangeException e)
{
Console.WriteLine(e.Message);
}
}
'c# 언어' 카테고리의 다른 글
Handler>>DoWorkEventHandler/RunWorkerCompletedEventHandler (0) | 2021.12.14 |
---|---|
TrisPackage.Tris/exchange_check(); (0) | 2021.12.09 |
TrisPackage.Tris/running(); (0) | 2021.11.19 |
TrisPackage.Tris/check_horizon(); (0) | 2021.11.19 |
TrisPackage.Tris/delete_column(); (0) | 2021.11.19 |