123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|739|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> AI Threads -> Google Gemini 2.5

Wed, 26 Mar 2025, 09:39
Jayenkai

Google Gemini 2.5


If you head on over to AIStudio.Google.com you can have a play with some of the newer models. 2.5 Pro is available for testing (I seem to have been able to use it once, for free, and then it just stops working!!)

I fed it the recent version of CommandList_Long.txt which is what I've been feeding to the A.I's to teach them how to code with GotoJSE.
I then prompted..

Do you think you could create a simple version of Tetris that would run in the GotoJSE language?
It should use GamePad(ButtonLeft) and GamePad(ButtonRight) to move the shapes as they drop. GamePad(ButtonDown) would speed up the drop, GamePad(ButtonA) and GamePad(ButtonB) to rotate, and maybe GamePad(ButtonY) to do the "smash" drop thing. For graphics, maybe use a grid of letters in the grid? So an L shaped block could be made of 4 T's for a T, O's for a block, S and Z for those.. d's and b's for the two reversed L shapes.. And , of course, I's for the bar.


Okay, this is a fun challenge! Creating a full Tetris clone requires careful handling of rotation, collision, and the game grid. Given GotoJSE's limitations (no local variables, reliance on globals and Gosub), this will be structured differently than in modern languages, but it's definitely possible.

Here's a simple implementation based on your request. It uses text characters for blocks and handles the core mechanics. Collision detection and rotation are simplified.


  --v


Explanation and Notes:

Grid: A 2D array Grid(GridW, GridH) stores the state of the playfield. 0 is empty, and 1 through 7 represent the type of block landed there (index + 1).
Block Data: BlockDataX and BlockDataY store the relative (x, y) coordinates of each of the 4 squares that make up a tetromino, for each type and rotation, relative to a pivot point. This is standard for Tetris implementations.
Drawing: It loops through the Grid array to draw landed blocks and then draws the current falling block using the BlockData arrays and CurrentX, CurrentY, etc. It uses the Text command with the characters you specified (I, O, T, S, Z, d, b).
Collision (CheckCollision): This subroutine is crucial. It checks if a potential move (new X, Y, or rotation) would result in any part of the block being outside the grid boundaries or overlapping with an already landed block in the Grid array. It sets a global flag GlobalCollisionFlag.
Landing (LandBlock): When a block can no longer move down, this subroutine transfers its shape from the temporary Current* variables into the main Grid array. It then calls ClearLines.
Line Clearing (ClearLines): Checks the grid from bottom to top. If a full line is found, it increments the score/lines, shifts everything above it down, and clears the top row. It re-checks the same row index after clearing because it now contains new blocks.
Rotation: Rotation involves calculating the next rotation index and checking for collisions. A very basic wall kick is included (tries moving left/right by 1 if the initial rotation fails). Proper Tetris wall kicks (SRS) are much more complex.
Hard Drop: Finds the lowest valid Y position by repeatedly checking collisions downwards, then moves the block there and lands it immediately.
Globals: Due to GotoJSE's nature, many variables are global. CheckCollision uses global parameters CheckX, CheckY, etc., and sets the GlobalCollisionFlag as its "return" value.
Game Over: Occurs if a newly spawned block immediately collides (meaning the top is blocked).
Performance: Using Text for every block might be slower than using Rect on some systems, but it directly matches your request for letter graphics.

This provides the basic framework. You could expand it with features like a "next block" preview, hold piece, more sophisticated scoring, sounds for rotation/movement, etc.


...
Just a shame it doesn't work. But we're getting closer!!!

-=-=-
''Load, Next List!''
Fri, 28 Mar 2025, 11:32
dna
This is an excellent bit of work.
BMax does go gather than 3D

-=-=-
DNA