if ((i & 1) == 1) {
j = y / STEP_CORN_Y;
}
+ else if ((i & 3) == 0) {
+ j = y / (STEP_CORN_Y*2);
+ j = j*2 + 1;
+ }
else {
- y += (STEP_CORN_Y/2);
- y /= (STEP_CORN_Y*2);
- j = (y * 2) + 1;
+ y += (STEP_CORN_Y);
+ j = y / (STEP_CORN_Y*2);
+ j = j*2;
}
if (ijcoord_to_xycoord(i, j, &x, &y) < 0)
return 0;
}
-
/******** CORN */
/* return the index of a corn given its i,j coords. */
/* tomato */
idx = ijcoord_to_tomato_idx(i, j);
if (idx >= 0) {
- printf("%d %d\n", i, j);
wp->type = WP_TYPE_TOMATO;
wp->present = 1;
wp->tomato.idx = idx;