~mdw
/
sgt
/
puzzles
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Vary the behaviour of Mines's solve function depending on whether the
[sgt/puzzles]
/
penrose.c
diff --git
a/penrose.c
b/penrose.c
index
18c4258
..
ccde30d
100644
(file)
--- a/
penrose.c
+++ b/
penrose.c
@@
-96,7
+96,7
@@
struct vector { int a, b, c, d; };
struct vector { int a, b, c, d; };
-static vector v_origin()
+static vector v_origin(
void
)
{
vector v;
v.a = v.b = v.c = v.d = 0;
{
vector v;
v.a = v.b = v.c = v.d = 0;
@@
-107,7
+107,7
@@
static vector v_origin()
* draw an isoceles triangle centred on the X axis. */
#ifdef TEST_VECTORS
* draw an isoceles triangle centred on the X axis. */
#ifdef TEST_VECTORS
-static vector v_unit()
+static vector v_unit(
void
)
{
vector v;
{
vector v;
@@
-219,7
+219,7
@@
static const char *v_debug(vector v)
* Tiling routines.
*/
* Tiling routines.
*/
-vector xform_coord(vector vo, int shrink, vector vtrans, int ang)
+
static
vector xform_coord(vector vo, int shrink, vector vtrans, int ang)
{
if (shrink < 0)
vo = v_shrinkphi(vo);
{
if (shrink < 0)
vo = v_shrinkphi(vo);
@@
-434,7
+434,7
@@
void penrose_count_tiles(int depth, int *nlarge, int *nsmall)
* (later mail: this is an overestimate by about 5%)
*/
* (later mail: this is an overestimate by about 5%)
*/
-int penrose(penrose_state *state, int which)
+int penrose(penrose_state *state, int which
, int angle
)
{
vector vo = v_origin();
vector vb = v_origin();
{
vector vo = v_origin();
vector vb = v_origin();
@@
-444,6
+444,9
@@
int penrose(penrose_state *state, int which)
vb.b = state->start_size;
vb.b = state->start_size;
+ vo = v_rotate(vo, angle);
+ vb = v_rotate(vb, angle);
+
if (which == PENROSE_P2)
return penrose_p2_large(state, 0, 1, vo, vb);
else
if (which == PENROSE_P2)
return penrose_p2_large(state, 0, 1, vo, vb);
else
@@
-539,7
+542,7
@@
int test_cb(penrose_state *state, vector *vs, int n, int depth)
return 0;
}
return 0;
}
-void usage_exit()
+void usage_exit(
void
)
{
fprintf(stderr, "Usage: penrose-test [--recursion] P2|P3 SIZE DEPTH\n");
exit(1);
{
fprintf(stderr, "Usage: penrose-test [--recursion] P2|P3 SIZE DEPTH\n");
exit(1);