I have to say that using RobotC is a liberating experience. I've been fiddling with both the NXT-G language and also the NXT toolkit for LabView. They both have their place, but there's just nothing quite like getting back to good ol' C.

Thanks to the RobotC team for making such a wonderful alternative available. This was my first project, which I wrote this weekend to get my feet wet with your product. As with all things, there are some things that I wish were different, but overall, I'd say that this is by far my favorite way to program for the NXT.

Enjoy, everyone:

Use the left and right buttons to move the piece. The OK button will rotate the piece. The exit button causes the piece to drop. Pressing the exit button three times in a row will abort the program.

NOTE: Make sure to use the 1.38 Beta version or newer. When I was trying to do this with version 1.10 it caused some pretty nasty problems.

// See if the game is over now for (int i = 0; i < curPiece.maxHeight; i++) for (int j = 0; j < curPiece.maxWidth; j++) if (curPiece.pattern[i][j] && gameBoard[curPiece.curRow + i][curPiece.curCol + j]) return eGameOver;

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum