From e6ac8f2c97eb6933e566d2ffdb021822c408ee59 Mon Sep 17 00:00:00 2001 From: Calcitem Date: Wed, 17 May 2023 23:39:16 +0800 Subject: [PATCH] Convert part of Hungarian to English to solve the problem of garbled characters --- Malom3/Main.vb | 44 ++++++++++++++++++++++---------------------- Malom3/Rules.vb | 10 +++++----- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Malom3/Main.vb b/Malom3/Main.vb index 6783d9f..491047e 100644 --- a/Malom3/Main.vb +++ b/Malom3/Main.vb @@ -191,8 +191,8 @@ Public Class FrmMain ' 'For i = 0 To 23 ' ' Dim adj As Integer = 0 - ' ' For j = 1 To Rules.CSLT�blaGr�f(i, 0) - ' ' adj = adj Or (1 << CSLT�blaGr�f(i, j)) + ' ' For j = 1 To Rules.CSLTableGraph(i, 0) + ' ' adj = adj Or (1 << CSLTableGraph(i, j)) ' ' Next ' ' r = r & adj & "," ' 'Next @@ -670,8 +670,8 @@ Public Class Game Return End If - p.Quit() 'p-t kil�ptetj�k, h�tha esetleg benne volt egy j�t�kban (pl. NewGame-n�l az ezel�ttiben) - If _Ply(i) IsNot Nothing Then _Ply(i).Quit() 'kil�ptetj�k azt a j�t�kost, akinek a hely�re p j�n + p.Quit() 'we exit p to see if it was in a game (e.g. NewGame in the previous one) + If _Ply(i) IsNot Nothing Then _Ply(i).Quit() 'the player replaced by p is kicked out _Ply(i) = p If i = 0 Then 'set menus frm.MnuPly1Human.Checked = p.GetType() = GetType(HumanPlayer) @@ -701,7 +701,7 @@ Public Class Game End Sub - Public Sub MakeMove(ByVal M As Move) 'a player objektumok h�vj�k meg, amikor l�pni szeretn�nek + Public Sub MakeMove(ByVal M As Move) 'called by player objects when they want to move Try 'Debug.Print(Microsoft.VisualBasic.Timer & " MakeMove, sidetomove: " & s.SideToMove) ' @@ -807,11 +807,11 @@ Public Class Game If TypeOf Ply(s.SideToMove) Is HumanPlayer Then If s.KLE Then frm.LblKov.Text = "Take a stone." If s.phase = 1 Then - 'Dim pr = MaxKSZ - s.F�lrakottKorongCount(s.SideToMove) + 'Dim pr = MaxKSZ - s.StackedPuckCount(s.SideToMove) 'If pr > 0 Then - ' frm.LblF�lrak.Text = pr & " stones to place." + ' frm.LblUpload.Text = pr & " stones to place." 'Else - ' frm.LblF�lrak.Text = "No more stones to place." + ' frm.LblUpload.Text = "No more stones to place." 'End If frm.LblSetnum.Text = MaxKSZ - s.SetStoneCount(0) & ", " & MaxKSZ - s.SetStoneCount(1) & " stones to place." Else @@ -843,8 +843,8 @@ Public Class Game Dim tmp = current Do current = current.Previous - Loop While (current.Previous IsNot Nothing AndAlso Not TypeOf Ply(current.Value.SideToMove) Is HumanPlayer) 'addig vonunk vissza, hogy ne g�p k�vetkezzen - If TypeOf Ply(current.Value.SideToMove) Is ComputerPlayer Then 'ha nem siker�lt, akkor vissza�ll�tjuk az eredeti �llapotot + Loop While (current.Previous IsNot Nothing AndAlso Not TypeOf Ply(current.Value.SideToMove) Is HumanPlayer) 'we withdraw until no machine follows + If TypeOf Ply(current.Value.SideToMove) Is ComputerPlayer Then 'if it failed, we restore the original state current = tmp Return False Else @@ -867,8 +867,8 @@ Public Class Game Dim tmp = current Do current = current.Next - Loop While (current.Next IsNot Nothing AndAlso Not TypeOf Ply(current.Value.SideToMove) Is HumanPlayer) 'addig megy�nk el�re, hogy ne g�p k�vetkezzen - If TypeOf Ply(current.Value.SideToMove) Is ComputerPlayer Then 'ha nem siker�lt, akkor vissza�ll�tjuk az eredeti �llapotot + Loop While (current.Next IsNot Nothing AndAlso Not TypeOf Ply(current.Value.SideToMove) Is HumanPlayer) 'we go forward until no machine follows + If TypeOf Ply(current.Value.SideToMove) Is ComputerPlayer Then 'if it failed, we restore the original state current = tmp Return False Else @@ -981,15 +981,15 @@ Public Class Game End Class Public Class GameState - Public T(23) As Integer 'a t�bla (-1: �res, 0: feh�r korong, 1: fekete korong) + Public T(23) As Integer 'the board (-1: empty, 0: white piece, 1: black piece) Public phase As Integer = 1 Public SetStoneCount(1) As Integer 'how many stones the players have set Public StoneCount(1) As Integer - Public KLE As Boolean 'koronglev�tel j�n-e + Public KLE As Boolean 'is there a puck removal coming? Public SideToMove As Integer Public MoveCount As Integer Public over As Boolean - Public winner As Integer '(-1, ha d�ntetlen) + Public winner As Integer '(-1, if a draw) Public block As Boolean Public LastIrrev As Integer @@ -997,7 +997,7 @@ Public Class GameState Return StoneCount(p) + MaxKSZ - SetStoneCount(p) End Function - Public Sub New() 'j�tszma eleje + Public Sub New() 'start of game For i = 0 To 23 T(i) = -1 Next @@ -1062,12 +1062,12 @@ Public Class GameState End If LastIrrev = 0 End If - If (TypeOf M Is SetKorong Or TypeOf M Is MoveKorong) AndAlso Malome(M.hov, Me) > -1 And StoneCount(1 - SideToMove) > 0 Then 'ha malmot csin�lt a l�p�s es van az ellenfelnek korongja + If (TypeOf M Is SetKorong Or TypeOf M Is MoveKorong) AndAlso Malome(M.hov, Me) > -1 And StoneCount(1 - SideToMove) > 0 Then 'if he made a monkey, your move is your opponent's puck KLE = True Else SideToMove = 1 - SideToMove - If SetStoneCount(0) = MaxKSZ And SetStoneCount(1) = MaxKSZ And phase = 1 Then phase = 2 'korongmozgat�sra v�lt�s - If Not TudLepni(Me) Then + If SetStoneCount(0) = MaxKSZ And SetStoneCount(1) = MaxKSZ And phase = 1 Then phase = 2 'switching to disc movement + If Not YouCanMove(Me) Then over = True block = True winner = 1 - SideToMove @@ -1195,7 +1195,7 @@ Public Class GameState End If End If End If - If Not KLE AndAlso Not TudLepni(Me) Then 'TudLepni doesn't handle the KLE case. However, we should always have a move in KLE, see the validity check above. + If Not KLE AndAlso Not YouCanMove(Me) Then 'YouCanMove doesn't handle the KLE case. However, we should always have a move in KLE, see the validity check above. over = True block = True winner = 1 - SideToMove @@ -1214,10 +1214,10 @@ Public Class GameState End Function - Public Sub New(ByVal s As String) 'v�g�lapr�l beilleszt�shez + Public Sub New(ByVal s As String) 'to paste from clipboard Dim ss() As String = s.Split(",") Try - If ss(33) = "malom" OrElse ss(34) = "malom" OrElse ss(35) = "malom" OrElse ss(37) = "malom2" Then 'tudni kell �rtelmezni a r�gebbi form�tumokat is + If ss(33) = "malom" OrElse ss(34) = "malom" OrElse ss(35) = "malom" OrElse ss(37) = "malom2" Then 'you need to be able to interpret older formats as well For i = 0 To 23 T(i) = ss(i) Next diff --git a/Malom3/Rules.vb b/Malom3/Rules.vb index 8174e12..20fd81c 100644 --- a/Malom3/Rules.vb +++ b/Malom3/Rules.vb @@ -21,13 +21,13 @@ Imports System.Windows.Forms Module Rules - Public MillPos(,), StdLaskerMillPos(15, 2), MoraMillPos(19, 2) As Byte 'megadja az egyes StdLaskerMalomPozícióban részt vevő mezők sorszámát + Public MillPos(,), StdLaskerMillPos(15, 2), MoraMillPos(19, 2) As Byte 'gives the sequence number of each field participating in StdLaskerMillPosition Public InvMillPos()(), StdLaskerInvMillPos(23)(), MoraInvMillPos(23)() As Integer 'ith element gives those indexes into MalomPoz where the ith field occurs Public BoardGraph(,), StdLaskerBoardGraph(24, 24), MoraBoardGraph(24, 24) As Boolean 'adjacency matrix Public ALBoardGraph(,), StdLaskerALBoardGraph(24, 4), MoraALBoardGraph(24, 4) As Byte 'adjacency list, 0th element is the number of neighbors Public VariantName As String - Public Const LastIrrevLimit = 50 'a flyordie-on 50 'hány lépés telhet el koronglevétel/folrakas nélkül, mielőtt döntetlennel véget érne a játék + Public Const LastIrrevLimit = 50 'on flyordie 50 'how many moves can pass without puck removal/folraker before the game ends in a draw Public Sub InitRules() StdLaskerMillPos(0, 0) = 1 @@ -61,9 +61,9 @@ Module Rules Dim kell As Boolean For i = 0 To 23 'mezőkön Dim l As New List(Of Integer) - For j = 0 To 15 'StdLaskerMalomPozíciókon + For j = 0 To 15 'StdLaskerMillPositions kell = False - For k = 0 To 2 'StdLaskerMalomPozíció mezőin + For k = 0 To 2 'StdLaskerMillPosition fields If StdLaskerMillPos(j, k) = i Then kell = True Next If kell Then @@ -180,7 +180,7 @@ Module Rules End If Next End Function - Public Function TudLepni(ByVal s As GameState) As Boolean 'megmondja, hogy a soron következő játékos tud-e lépni '(doesn't handle the KLE case) + Public Function YouCanMove(ByVal s As GameState) As Boolean 'tells whether the next player can move '(doesn't handle the KLE case) Debug.Assert(Not s.KLE) If s.SetStoneCount(s.SideToMove) = MaxKSZ And s.StoneCount(s.SideToMove) > 3 Then For i = 0 To 23