Allow for newline at end of Fens.txt file

Merge pull request #195 from joshuajeschek/fens-newline
This commit is contained in:
Sebastian Lague 2023-07-23 16:47:08 +02:00 committed by GitHub
commit 9700276b51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,6 +3,7 @@ using ChessChallenge.Example;
using Raylib_cs; using Raylib_cs;
using System; using System;
using System.IO; using System.IO;
using System.Linq;
using System.Runtime.ExceptionServices; using System.Runtime.ExceptionServices;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
@ -66,7 +67,7 @@ namespace ChessChallenge.Application
BotStatsA = new BotMatchStats("IBot"); BotStatsA = new BotMatchStats("IBot");
BotStatsB = new BotMatchStats("IBot"); BotStatsB = new BotMatchStats("IBot");
botMatchStartFens = FileHelper.ReadResourceFile("Fens.txt").Split('\n'); botMatchStartFens = FileHelper.ReadResourceFile("Fens.txt").Split('\n').Where(fen => fen.Length > 0).ToArray();
botTaskWaitHandle = new AutoResetEvent(false); botTaskWaitHandle = new AutoResetEvent(false);
StartNewGame(PlayerType.Human, PlayerType.MyBot); StartNewGame(PlayerType.Human, PlayerType.MyBot);
@ -448,4 +449,4 @@ namespace ChessChallenge.Application
boardUI.Release(); boardUI.Release();
} }
} }
} }