/*
* tits.PRG by dom cook
* (c) 2017 sollia 3
*/
PROGRAM tits;
const
grid_wide=10;
grid_high=20;
grid_x0=100;
grid_y0=100;
grid_size=grid_wide*grid_high;
cell_size=10;
global;
struct cell_data[grid_size]
x_pos;
y_pos;
x_coord;
y_coord;
state;
end
graph_cell[1];
private
i;
BEGIN
set_fps(60,0);
set_mode(m640x480);
graph=new_map(120,240,0,0,20);
x=grid_x0;
y=grid_y0;
graph_cell[0]=new_map(cell_size,cell_size,0,0,30);
graph_cell[1]=new_map(cell_size,cell_size,0,0,40);
for(i=0; i<grid_size; i+=1)
cell_data[i].x_coord=i % grid_wide;
cell_data[i].y_coord=i / grid_wide;
cell_data[i].x_pos=cell_data[i].x_coord*cell_size;
cell_data[i].y_pos=cell_data[i].y_coord*cell_size;
cell_data[i].state=rand(0,1);
map_put(0,graph,graph_cell[cell_data[i].state],cell_data[i].x_pos,cell_data[i].y_pos);
end
write(0,40,10,2,"fps: ");
write_int(0,40,10,0,&fps);
loop
for(i=0; i<grid_size; i+=1)
cell_data[i].state=rand(0,1);
map_put(0,graph,graph_cell[cell_data[i].state],cell_data[i].x_pos,cell_data[i].y_pos);
end
frame;
end
END
|