IF x=fx AND y=fy: ZAP : LET l=l+1: LET fx=0: PEN 15: PRINT AT 0,0 l: END IF # ZAP is a built-in SAM BASIC sound effect. # If our head is at the same position as the food, eat it. Alternates color 11 between palette 50 (pink) & 127 (white). # Setup the flashing effect for the food. # Pre-fill the tail memory with the starting location. # xs, ys: current x/y speed (always -1, 0 or 1) The complete code is shown below with inline comments. To play, you can use the SimCoupe emulator. You can download a MGT disk image containing 10 line Snake. Eating food gains you a point and extends your Snake length by 1. You control the Snake with the keys Q, A, O & P for up, down, left, right. This isn't a notable achievement, go see some of the great games from previous years like Sim City! But for a first attempt, I'm pretty chuffed. I aimed for the PUR-80 category and got there with Snake. Category "PUR-120": Program a game in 10 lines (max 120 characters per logical line, abbreviations are allowed).Category "PUR-80": Program a game in 10 lines (max 80 characters per logical line, abbreviations are allowed).Since many BASIC dialects allow you to stack multiple statements onto the same line (SAM BASIC is no exception) there areĪdditional category limits on characters per line, e.g. Like the arcade games for the micro:bit the fun comes from trying to squeeze as much of a game as possible out The competition is simple: write a game in some BASIC language in 10 lines of code. This year (2021) the 10th competition,Īnd the first time I've heard of it, thanks to Dean Belfield. The Basic 10 Liner contest has been running for 11 years.
0 Comments
Leave a Reply. |