// Test Lib for game using IC void place_char(char symb[], int col, int row) { display_set_xy(col, row); printf("%s",symb); } void place_int(int numb, int col, int row) { display_set_xy(col, row); printf("%d",numb); } void place_vert_char(char symb [], int col, int row) { int k; for (k = 0; k < _array_size(symb); k++) { display_set_xy(col, row+k); printf("%c",symb[k]); } } // rows are 0 to 13, // columns are 0 to 27 /* Values for keys: A = 1 B = 2 up = 64 down = 128 right = 16 left = 32 L(shoulder) = 512 R(shoulder) = 256 */ int get_key() { if (a_button()==1) return 1; if (b_button()==1) return 2; if (up_button()==1) return 64; if (down_button()==1) return 128; if (check_button(16)==1) return 16; if (check_button(32)==1) return 32; if (check_button(512)==1) return 512; if (check_button(256)==1) return 256; return 0; } // test game 1 // test game 1 operational! // test of rewrite speed // rewrite speed OK! 0.05 is nice, not insane int rand_int(int lower, int upper) { int ret; ret = random(upper-lower+1); ret = ret + lower; return ret; } float f_part(float numb) { int ipart; float ret; ipart = ((int) (numb)); ret = numb - ((float) (ipart)); return ret; } int i_part(float numb) { int ret; ret = ((int) (numb)); return ret; }