From 8555f22896f5ab4aa8c2794494c3bc359449ac32 Mon Sep 17 00:00:00 2001 From: ssccinng Date: Fri, 9 Aug 2024 11:49:13 +0000 Subject: [PATCH] add quiet --- ScixingTetrisCore/TetrisGameBoard.cs | 2 +- ZZZTOJ.Botris/Program.cs | 9 +++++++++ ZZZTOJ.Botris/ZZZBot.cs | 9 +++++++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ScixingTetrisCore/TetrisGameBoard.cs b/ScixingTetrisCore/TetrisGameBoard.cs index 2d02928..95f4bbf 100644 --- a/ScixingTetrisCore/TetrisGameBoard.cs +++ b/ScixingTetrisCore/TetrisGameBoard.cs @@ -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++; diff --git a/ZZZTOJ.Botris/Program.cs b/ZZZTOJ.Botris/Program.cs index 186a49a..9b2f219 100644 --- a/ZZZTOJ.Botris/Program.cs +++ b/ZZZTOJ.Botris/Program.cs @@ -4,6 +4,9 @@ using ZZZTOJ.Botris; using System.Runtime.InteropServices; + + + try { nint v = ZZZTOJCore.AIName(8); @@ -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; @@ -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; } \ No newline at end of file diff --git a/ZZZTOJ.Botris/ZZZBot.cs b/ZZZTOJ.Botris/ZZZBot.cs index ef2cd41..569c411 100644 --- a/ZZZTOJ.Botris/ZZZBot.cs +++ b/ZZZTOJ.Botris/ZZZBot.cs @@ -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;