Skip to content
Browse files

A better implementation of rotation

  • Loading branch information...
1 parent 0f21caf commit 59adc96789f2f67ce2607a508aa9c2738dd8034a @mattgu74 committed May 27, 2011
Showing with 1 addition and 2 deletions.
  1. +1 −2 src/tetris.opa
View
3 src/tetris.opa
@@ -289,13 +289,12 @@ Tetris(size, nbcol, nbline, speed, color) = {{
objet_rotate() =
- // First implementation late in the night (not the best)
_ = Cell.call(mySession, {rotate})
void
object_session_rotate(session : Tetris.session) =
rotate(~{x ; y}, acc)=
- List.add({x=2-y;y=2-x},acc)
+ List.add({x=-1*y;y=x},acc)
newobject=List.fold(rotate,session.object.object.cases,List.empty)
sess =
{ etat = session.etat ;

0 comments on commit 59adc96

Please sign in to comment.
Something went wrong with that request. Please try again.