Skip to content

Commit

Permalink
add quiet
Browse files Browse the repository at this point in the history
  • Loading branch information
ssccinng committed Aug 9, 2024
1 parent de54d1e commit 8555f22
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ScixingTetrisCore/TetrisGameBoard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public virtual ClearMessage TryClearLines()
spinCnt += TetrisRule.CheckPostionOk(this, TetrisMinoStatus.Position.X, TetrisMinoStatus.Position.Y + 2) ? 0 : 1;
spinCnt += TetrisRule.CheckPostionOk(this, TetrisMinoStatus.Position.X + 2, TetrisMinoStatus.Position.Y + 2) ? 0 : 1;
if (spinCnt >= 3) isTspin = true;
if (spinCnt >= 3) Console.WriteLine("Tspin");
// if (spinCnt >= 3) Console.WriteLine("Tspin");
}
if (cnt == 4 || isTspin) B2B++;

Expand Down
9 changes: 9 additions & 0 deletions ZZZTOJ.Botris/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
using ZZZTOJ.Botris;
using System.Runtime.InteropServices;




try
{
nint v = ZZZTOJCore.AIName(8);
Expand All @@ -27,6 +30,11 @@
File.WriteAllText("botconfig.json", JsonSerializer.Serialize(botSetting));
}

if (args.Contains("--quiet")) {

botSetting.Quiet = true;
}

BotrisBot bot = new(botSetting.Token);
ZZZBot bot1 = new() { BotSetting = botSetting };
bot.RequestMove += Bot_RequestMove;
Expand Down Expand Up @@ -66,6 +74,7 @@ public class BotSetting

public string Token { get; set; } = string.Empty;
public string RoomKey { get; set; } = string.Empty;
public bool Quiet {get;set;} = false;
//public bool AutoLevel { get; set; } = true;

}
9 changes: 7 additions & 2 deletions ZZZTOJ.Botris/ZZZBot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,13 @@ public MoveResult GetMove(RequestMovePayload requestMovePayload)
}

_IOBoard.PrintBoard();
Console.WriteLine($"combo: {requestMovePayload.GameState.combo,-3} b2b: {requestMovePayload.GameState.b2b} garbage: {requestMovePayload.GameState.garbageQueued.Length,-3}");
Console.WriteLine($"mino: {requestMovePayload.GameState.current.piece} pos: {requestMovePayload.GameState.current.x} {requestMovePayload.GameState.current.y}");

if (!BotSetting.Quiet) {
Console.WriteLine($"combo: {requestMovePayload.GameState.combo,-3} b2b: {requestMovePayload.GameState.b2b} garbage: {requestMovePayload.GameState.garbageQueued.Length,-3}");
Console.WriteLine($"mino: {requestMovePayload.GameState.current.piece} pos: {requestMovePayload.GameState.current.x} {requestMovePayload.GameState.current.y}");
}


//if (_nowIdx == 0)
//{
// _startTime = DateTime.Now;
Expand Down

0 comments on commit 8555f22

Please sign in to comment.