From 0c7dc5db85fd45945d9a1275f341756ca5d32280 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Tue, 14 Apr 2020 18:46:17 +0800 Subject: [PATCH] v1.7 --- Form_Game.frm | 69 +++++++++++++++++++++++++++++++++++++++-------- Form_Solution.frm | 6 ++--- Form_Wait.frm | 5 ++-- HRD_Game.vbp | 2 +- HRD_Game.vbw | 2 +- 5 files changed, 66 insertions(+), 18 deletions(-) diff --git a/Form_Game.frm b/Form_Game.frm index c5bb964..732d4c4 100644 --- a/Form_Game.frm +++ b/Form_Game.frm @@ -2,7 +2,7 @@ VERSION 5.00 Begin VB.Form Form_Game AutoRedraw = -1 'True BorderStyle = 1 'Fixed Single - Caption = "HRD Game v1.6 by Dnomd343" + Caption = "HRD Game v1.7 by Dnomd343" ClientHeight = 7305 ClientLeft = 45 ClientTop = 690 @@ -14,12 +14,20 @@ Begin VB.Form Form_Game ScaleHeight = 7305 ScaleWidth = 7290 StartUpPosition = 2 '屏幕中心 + Begin VB.CommandButton Command_Prompt + Caption = "提示下一步" + Height = 495 + Left = 5760 + TabIndex = 14 + Top = 4440 + Width = 1335 + End Begin VB.CommandButton Command_Solution Caption = "最少步解法" Height = 495 Left = 5760 TabIndex = 13 - Top = 5520 + Top = 5760 Width = 1335 End Begin VB.CommandButton Command_Add_Favourite @@ -27,7 +35,7 @@ Begin VB.Form Form_Game Height = 495 Left = 5760 TabIndex = 12 - Top = 3000 + Top = 2640 Width = 1335 End Begin VB.CommandButton Command_Favourite @@ -35,7 +43,7 @@ Begin VB.Form Form_Game Height = 495 Left = 5760 TabIndex = 11 - Top = 2280 + Top = 1920 Width = 1335 End Begin VB.CommandButton Command_Reduction_Snapshot @@ -43,7 +51,7 @@ Begin VB.Form Form_Game Height = 495 Left = 5760 TabIndex = 10 - Top = 4200 + Top = 3840 Width = 1335 End Begin VB.CommandButton Command_Create_Snapshot @@ -51,7 +59,7 @@ Begin VB.Form Form_Game Height = 495 Left = 5760 TabIndex = 9 - Top = 3600 + Top = 3240 Width = 1335 End Begin VB.CommandButton Command_Rand_Case @@ -59,7 +67,7 @@ Begin VB.Form Form_Game Height = 495 Left = 5760 TabIndex = 8 - Top = 1680 + Top = 1320 Width = 1335 End Begin VB.CommandButton Command_Select_Case @@ -67,7 +75,7 @@ Begin VB.Form Form_Game Height = 495 Left = 5760 TabIndex = 7 - Top = 1080 + Top = 720 Width = 1335 End Begin VB.CommandButton Command_Create_Case @@ -75,7 +83,7 @@ Begin VB.Form Form_Game Height = 495 Left = 5760 TabIndex = 6 - Top = 480 + Top = 120 Width = 1335 End Begin VB.Timer Timer_Layout @@ -88,7 +96,7 @@ Begin VB.Form Form_Game Height = 495 Left = 5760 TabIndex = 1 - Top = 4800 + Top = 5040 Width = 1335 End Begin VB.Timer Timer_Get_Time @@ -179,6 +187,7 @@ Dim mouse_x As Long, mouse_y As Long, mouse_button As Integer Dim last_move As Integer, move_times As Integer Dim total_steps As Long, total_time As Long Dim snapshot_code As String, snapshot_step As Long +Dim prompt_wait_data As Boolean Private Sub Menu_Debug_Mode_Click() Menu_Debug_Mode.Checked = Not Menu_Debug_Mode.Checked If Menu_Debug_Mode.Checked = True Then debug_mode = True Else debug_mode = False @@ -335,6 +344,16 @@ Private Sub Command_Reduction_Snapshot_Click() Label_Step = "步数: " & total_steps Label_Code = snapshot_code End Sub +Private Sub Command_Prompt_Click() + If solve_compete = True Then MsgBox "你已经解好啦", , "> _ <": Exit Sub + wait_file_name = Label_Code & ".txt" + If Dir(Label_Code & ".txt") <> "" Then Kill Label_Code & ".txt" + Shell "Engine.exe -q " & Label_Code + wait_cancel = False + waiting = True + prompt_wait_data = True + Form_Wait.Show 1 +End Sub Private Sub Command_Reset_Click() total_steps = 0 total_time = 0 @@ -946,7 +965,7 @@ Private Sub Timer_Debug_Timer() Text_Debug = debug_dat End Sub Private Sub Timer_Layout_Timer() - Dim width As Integer + Dim width As Integer, temp As String width = gap * 5 + square_width * 4 Label_Title.Top = 45 Label_Code.Top = 7000 @@ -978,4 +997,32 @@ Private Sub Timer_Layout_Timer() Call Analyse(start_code) Call Output_Graph End If + If prompt_wait_data = True And waiting = False Then + prompt_wait_data = False + Open Label_Code.Caption & ".txt" For Input As #1 + Line Input #1, temp + If temp = "No Solution" Then + MsgBox "无解", , "> _ <" + Else + Line Input #1, temp + Line Input #1, temp + last_move = 10 + If total_steps = 0 Then + playing = True + Timer_Get_Time.Enabled = True + End If + total_steps = total_steps + 1 + Label_Step = "步数: " & total_steps + Label_Code = temp + Call Analyse(temp) + Call Output_Graph + If Block(0).address = 13 Then + Timer_Get_Time = False + playing = False + solve_compete = True + MsgBox "恭喜你成功完成!" & vbCrLf & "编码: " & start_code & vbCrLf & "步数: " & total_steps & vbCrLf & "用时: " & Right(Label_Time, Len(Label_Time) - 4), , "(>__<)" + End If + End If + Close #1 + End If End Sub diff --git a/Form_Solution.frm b/Form_Solution.frm index 2735acd..8148ae2 100644 --- a/Form_Solution.frm +++ b/Form_Solution.frm @@ -60,12 +60,12 @@ Begin VB.Form Form_Solution Width = 615 End Begin VB.ListBox List_Solution - Height = 4560 + Height = 4740 ItemData = "Form_Solution.frx":0000 Left = 3720 List = "Form_Solution.frx":0002 TabIndex = 0 - Top = 360 + Top = 290 Width = 1455 End Begin VB.Timer Timer_Get_Data @@ -78,7 +78,7 @@ Begin VB.Form Form_Solution Height = 180 Left = 0 TabIndex = 6 - Top = 120 + Top = 80 Width = 90 End End diff --git a/Form_Wait.frm b/Form_Wait.frm index 57dbc59..58606de 100644 --- a/Form_Wait.frm +++ b/Form_Wait.frm @@ -1,12 +1,12 @@ VERSION 5.00 Begin VB.Form Form_Wait BorderStyle = 0 'None - ClientHeight = 1140 + ClientHeight = 465 ClientLeft = 0 ClientTop = 0 ClientWidth = 1920 LinkTopic = "Form1" - ScaleHeight = 1140 + ScaleHeight = 465 ScaleWidth = 1920 ShowInTaskbar = 0 'False StartUpPosition = 2 '屏幕中心 @@ -45,6 +45,7 @@ Begin VB.Form Form_Wait Height = 465 Left = 0 TabIndex = 0 + ToolTipText = "双击可取消哦" Top = 0 Width = 1920 End diff --git a/HRD_Game.vbp b/HRD_Game.vbp index 02c852c..bfe667f 100644 --- a/HRD_Game.vbp +++ b/HRD_Game.vbp @@ -19,7 +19,7 @@ Name="HRD_Game" HelpContextID="0" CompatibleMode="0" MajorVer=1 -MinorVer=6 +MinorVer=7 RevisionVer=0 AutoIncrementVer=0 ServerSupportFiles=0 diff --git a/HRD_Game.vbw b/HRD_Game.vbw index d48f7f6..3331a4e 100644 --- a/HRD_Game.vbw +++ b/HRD_Game.vbw @@ -1,6 +1,6 @@ Form_Game = 52, 52, 883, 479, , 26, 28, 857, 453, C Module = 52, 52, 883, 479, -Form_Classic_Cases = 104, 104, 891, 531, , 104, 104, 937, 531, C +Form_Classic_Cases = 104, 104, 891, 531, Z, 104, 104, 937, 531, C Form_Creator = 130, 130, 917, 557, , 104, 104, 891, 531, C Form_Rand_Case = 78, 78, 855, 505, , 156, 156, 933, 583, C Form_Favourite = 52, 52, 829, 479, , 26, 26, 803, 453, C