#include "tetris.h"
int ro[3][6]={{0,0,0,0,0,0},{0,0,1,0,1,0},{0,1,2,0,3,2}},
po[3][6]={{0,0,0,0,0,0},{0,1,2,0,0,1},{0,1,1,0,0,1}},
ne[3][6]={{0,1,2,3,4,5},{2,0,3,0,1,2},{5,3,4,1,2,0}};
int nowp,nowf;
void init(int n) {
nowp=0;
}
int position;
int rotation;
void new_figure(int figure_type) {
nowp=ne[nowf-1][nowp];
nowf=figure_type;
}
int get_position() {
return po[nowf-1][nowp];
}
int get_rotation() {
return ro[nowf-1][nowp];
}
Compilation message (stderr)
tetris.h:1:9: warning: #pragma once in main file
1 | #pragma once
| ^~~~
tetris_c.h:1:9: warning: #pragma once in main file
1 | #pragma once
| ^~~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |