After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 737004 - [PATCH] Add --size option, for debug.
[PATCH] Add --size option, for debug.
Status: RESOLVED FIXED
Product: iagno
Classification: Applications
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: iagno-maint
iagno-maint
Depends on: 737003
Blocks: 737007
 
 
Reported: 2014-09-20 02:09 UTC by Arnaud B.
Modified: 2014-09-20 15:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add --size option, for testing. (13.76 KB, patch)
2014-09-20 02:09 UTC, Arnaud B.
reviewed Details | Review
Add --size option, for testing. (14.76 KB, patch)
2014-09-20 15:44 UTC, Arnaud B.
committed Details | Review

Description Arnaud B. 2014-09-20 02:09:58 UTC
Created attachment 286670 [details] [review]
Add --size option, for testing.

Here is a patch that adds the --size option, permitting to play on a (for example) 10×10 board; AIs other than level one won’t work as usual, I’ll patch them later to make a real play option. It’s mainly for now a patch for debugging graphical issues, testing routines in other conditions (should have helped to detect my recent error[1]). It integrates all the changes of the last patch of the Add Player.INVALID bug[2] apart the controversial optimization that will come back later. =) 

[1] https://bugzilla.gnome.org/show_bug.cgi?id=710125
[2] https://bugzilla.gnome.org/show_bug.cgi?id=735615
Comment 1 Michael Catanzaro 2014-09-20 14:02:51 UTC
Review of attachment 286670 [details] [review]:

Even if it's debug-only, let's add some sanity-checking to the board sizes. Let's print a warning (with stderr.printf(), not warning()) and fall back to 8 if the size is odd or negative.  Maybe also if it's greater than, say, 30 (which seems arbitrary, but 30 plays smoothly for me while 32 performs quite poorly), but since it's just for testing I think it's fine to accept crazy even numbers if you want.

::: data/iagno.6
@@ +68,3 @@
+Changes the size of the board.
+This option is for debug only, some AIs won't work with it.
+Size should be even and at least 6.

"This option is for debugging only. The AI may not perform optimally. The size must be even and at least six."

FWIW, the min size seems to be four, not six.
Comment 2 Arnaud B. 2014-09-20 15:44:46 UTC
Created attachment 286687 [details] [review]
Add --size option, for testing.

Hope this will work even with my strange git bugs…
Comment 3 Michael Catanzaro 2014-09-20 15:50:11 UTC
Review of attachment 286687 [details] [review]:

::: data/iagno.6
@@ +66,3 @@
 .TP
+.B \-s, \-\-size=<size>
+Changes the size of the board. The size must be even and at least 4.

For small numbers (various rules say <10, <=10, <=12) we write them out, so "four" rather than "4."

::: src/iagno.vala
@@ -144,3 @@
             window.maximize ();
         add_window (window);
-

This is such a nit I wouldn't have mentioned it if not for my other comment, but I think this blank line made sense.
Comment 4 Michael Catanzaro 2014-09-20 15:53:51 UTC
Successfully challenged on IRC, so pushing