GNOME Bugzilla – Bug 737004
[PATCH] Add --size option, for debug.
Last modified: 2014-09-20 15:53:55 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
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.
Created attachment 286687 [details] [review] Add --size option, for testing. Hope this will work even with my strange git bugs…
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.
Successfully challenged on IRC, so pushing