wm: mastermind-qt

Download patch

ref: f5d23dcaf45f0d03a2afa881995cc9edfb62483a
parent: 813fe6b1cb4403729a4a3c31c8ad7e8cf0ffa1dd
author: mkf <mkf@hp.lan>
date: Wed Apr 26 18:16:01 EDT 2023

now it should work well on double digit len

--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -7,7 +7,8 @@
 #include <QTreeWidgetItem> /* guessTree */
 #include <QClipboard>
 
-int len = 0, goal = 0, guess = 0, lives = 0;
+uint64_t guess = 0, goal = 0;
+int len = 0, lives = 0;
 bool win;
 
 
@@ -153,7 +154,7 @@
 bool MainWindow::action_newgame()
 {
     bool res;
-    len = QInputDialog::getInt(this, "MasterMind", "Enter Length of number:", 2, 2, 9, 1, &res);
+    len = QInputDialog::getInt(this, "MasterMind", "Enter Length of number:", 2, 2, 10, 1, &res);
     if(res)
     {
         lives = len;
--- a/mainwindow.ui
+++ b/mainwindow.ui
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>440</width>
-    <height>364</height>
+    <width>500</width>
+    <height>440</height>
    </rect>
   </property>
   <property name="sizePolicy">
@@ -18,16 +18,22 @@
   </property>
   <property name="minimumSize">
    <size>
-    <width>440</width>
+    <width>500</width>
     <height>364</height>
    </size>
   </property>
   <property name="maximumSize">
    <size>
-    <width>440</width>
-    <height>364</height>
+    <width>500</width>
+    <height>440</height>
    </size>
   </property>
+  <property name="baseSize">
+   <size>
+    <width>500</width>
+    <height>440</height>
+   </size>
+  </property>
   <property name="windowTitle">
    <string>MasterMind</string>
   </property>
@@ -40,8 +46,8 @@
      <rect>
       <x>10</x>
       <y>130</y>
-      <width>411</width>
-      <height>191</height>
+      <width>471</width>
+      <height>261</height>
      </rect>
     </property>
     <column>
@@ -69,9 +75,15 @@
       <height>101</height>
      </rect>
     </property>
+    <property name="smallDecimalPoint">
+     <bool>false</bool>
+    </property>
     <property name="digitCount">
-     <number>1</number>
+     <number>2</number>
     </property>
+    <property name="segmentStyle">
+     <enum>QLCDNumber::Flat</enum>
+    </property>
    </widget>
    <widget class="QTextEdit" name="textChecked">
     <property name="enabled">
@@ -81,7 +93,7 @@
      <rect>
       <x>190</x>
       <y>80</y>
-      <width>231</width>
+      <width>291</width>
       <height>41</height>
      </rect>
     </property>
@@ -97,6 +109,9 @@
       <pointsize>26</pointsize>
      </font>
     </property>
+    <property name="cursor" stdset="0">
+     <cursorShape>IBeamCursor</cursorShape>
+    </property>
     <property name="layoutDirection">
      <enum>Qt::LeftToRight</enum>
     </property>
@@ -150,7 +165,7 @@
      <rect>
       <x>190</x>
       <y>33</y>
-      <width>231</width>
+      <width>291</width>
       <height>41</height>
      </rect>
     </property>
@@ -179,7 +194,7 @@
     <rect>
      <x>0</x>
      <y>0</y>
-     <width>440</width>
+     <width>500</width>
      <height>20</height>
     </rect>
    </property>
@@ -401,8 +416,8 @@
    <slot>action_guide()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>219</x>
-     <y>9</y>
+     <x>-1</x>
+     <y>-1</y>
     </hint>
     <hint type="destinationlabel">
      <x>219</x>