0

am making tetris in ti-basic, every time a tetrimono lands i would like to update some rows lists either from 0 to one, or whenever a line clears, the entire rows list to zero, or false

an example. someone clears 4 rows with the straight tetrimono. because it is 4 units long facing vertical, it checks the coordinates of x and then updates 4 lists, with the corresponding list number, in this case 6 of 10 piece slots. it updates these slots to one, or true. it then checks every row list if it is full or not; in this case, lists TR1,TR2,TR3, and TR4 all have ten values of 1, or true, and no values of 0,or false. for every row that has all true values it resets all values to one. what would be the most efficient way of updating every coordinate that the terimono lands in... continuing on the code

ZoomRcl
11→Dim(ʟTR1)
11→Dim(ʟTR2)
//goes up to 9
11→Dim(ʟTRA)
11→Dim(ʟTRB)
// goes up to l, for 21 rows
ClrDraw
Line(15,-31,-15,-31)
Line(-15,-31,-15,31)
Line(15,-31,15,31)
Line(15,31,-15,31)
Lbl 1
-5→x  // i set the xmin and xmax to -47, and 47
30→y  // i set the ymin and ymax to -31, and 31
randIint(1,6)→P //determines which tetrimono will be spawned
Lbl 2
if p=1
goto 3
if p=2
goto 4
if P=3
goto 5
if p=4
goto 6
if p=5
goto 7
if p=6
goto 8
if p=7
goto 9

lbl 3
 //visual code for L tetrimono 1
 Line(x,y,x+8,y)   also, is it possible to make a x coordinate list that draws all x coordinates, like x1,y1 to x2,y2 then x2,y2 to x3,y3, etc without external libraries 
 Line(x+8,y,x+8,y-5)
 Line(X+8,y-5,x+6,y-50
 Line(x+6,Y-5,X+6,y-2)
 Line(x+6,y-2,x,y-2>
 Line(x,y-2,x,y)
 goto 10
 lbl 4
 //mirrored l tetrimono 
 goto 10
 lbl 5
 //line tetrimono
 goto 10
 lbl 6
 //box tetrimono
 goto 10
 lbl 7
 //s tetrimono
 goto 10
 lbl 8
 //z  tetrimono
 lbl 9
 //t tetrimono
  lbl 10
  y-3→y
  
  //this is where i need help making tetris
  • before anyone comments, i know this is really long, but ive had too many times where they say my question is too vague, so i have to do that ↑ so that NOONE can say its too vague – Virtual Ghost May 13 '18 at 05:30

1 Answers1

0

What have you tried? Obviously, you need a game loop that redraws the tetrimono as it falls. The game loop should be something along the lines of while ( tetrimono isn't on top of a 1 block) pause for some number of miliseconds (i assume you want blocks to fall faster as time has gone on so this will be variable), take in user key input, and then update tetrimono position. The way you would check for if the tetrimono is over a 1 block is through a modified recursive backtracking algorithm. I don't see what's hard about updating tetrimono coordinates, so that's your plan.

Unfortunately, yout game will involve a lot of loops that will take a lot of time as you have to update the lists a lot, and may be extremely slow.

Meepo
  • 368
  • 4
  • 19
  • By the way, I know how to draw the tetrimono, what I need to know is how to set up a grid true false system on wheels is returning block is. I've tried every three, but blocks overlap wierdly, and it'll take another month to code 5x blocks – Virtual Ghost May 30 '18 at 22:03
  • What want to do to draw is if, for example listline3(4) is filled, or one, draw a box based on a set line list, as a separate program. That's how I made settings for poker – Virtual Ghost May 30 '18 at 22:06
  • @VirtualGhost your wording is a little unclear, I hope you can figure it out. There are several tetris programs on ti programming websites, maybe you could look there and see what other people did. – Meepo Jun 04 '18 at 06:06
  • i wish i could, but i do not have a trnsfer cord, i always type it in by hand. i am asking for a tetriis program that renders the shapes based on what points of a list come up as filled – Virtual Ghost Jun 18 '18 at 15:04
  • like, if examplelist(5) is filled, its a drawn box – Virtual Ghost Jun 18 '18 at 15:05
  • btw, i do not know a way to put a speed linit on a ti 83+. there is no clock – Virtual Ghost Jun 18 '18 at 15:06
  • the speed limit is simply just making it loop a few times before doing something – Meepo Jun 26 '18 at 02:00