wm: mastermind-qt

Download patch

ref: 813fe6b1cb4403729a4a3c31c8ad7e8cf0ffa1dd
parent: 7ff6f699a31d27a20684a0457afb8e5735b6fef7
author: mkf <mkf@hp.lan>
date: Wed Apr 26 17:57:02 EDT 2023

change some strings, replace arc4random() with random() for windows

arc4random() doesn't seem to be there in windows, replace it with
something less-random and more portable

--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -18,7 +18,7 @@
     /* it's technically legal, but
     we get a int that's shorter than n */
     do
-        num = arc4random() % 10;
+        num = random() % 10;
     while (num == 0);
 
     /* we have already generated one digit */
@@ -25,7 +25,7 @@
     while(n > 1)
     {
         num *= 10;
-        num += arc4random() % 10;
+        num += random() % 10;
         n--;
     }
     return num;
@@ -118,6 +118,7 @@
     m.setText(QString::fromStdString("It's " + std::to_string(goal) + " you cheater"));
     m.setIcon(QMessageBox::Information);
     copy = m.addButton("i'm too lazy to remember that, please copy that to clipboard", QMessageBox::YesRole);
+    m.addButton("k", QMessageBox::AcceptRole);
     m.exec();
     if(m.clickedButton() == copy)
     {
@@ -170,7 +171,7 @@
 {
     QMessageBox m;
     QAbstractButton *y;
-    m.setText("But-But... are you really totally 100% completely sure about it?");
+    m.setText("B-but... are you really totally completely 100% sure about it?");
     m.setIcon(QMessageBox::Question);
     y = m.addButton("Yea", QMessageBox::AcceptRole);
     m.addButton("Nay!", QMessageBox::RejectRole);