Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return score #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
This is the 80x23 version. You control it with `a` (left), `d` (right), `w` (rotate),
`s` (drop), and `q` (quit). It depends on `curses.h` (so you'll need to compile with
`-lcurses`, and install curses if you don't already have it) and requires C++11.
The score is returned after execution.

### tinytetris-commented.cpp
This one is almost identical to `tinytetris.cpp`, but not minified, and with some
comments to make it easier to read (but it's still tricky to read in certain parts).
comments to make it easier to read (but it's still tricky to read in certain parts).
1 change: 1 addition & 0 deletions tinytetris-commented.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,5 @@ int main() {
box(stdscr, 0, 0);
runloop();
endwin();
return score;
}
2 changes: 1 addition & 1 deletion tinytetris.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ r))x--;if(c==100&&x+N(r,16)<9&&!C(x+1,y,r))x++;if(c==115){while(!C(x,y+1,r)){y++
;U();}R();P();}if(c==119){++r%=4;while(x+N(r,16)>9)x--;if(C(x,y,r)){x=f;r=h;}}if
(c==113)return 0;U();F();}}I main(){srand(time(0));initscr();start_color();for(c
=1;c<8;c++){init_pair(c,c,0);}P();resizeterm(22,22);noecho();timeout(0);curs_set
(0);box(stdscr,0,0);L();endwin();} // Conor Taylor
(0);box(stdscr,0,0);L();endwin();return s;} // Conor Taylor