Freezing Basic

The place for codemasters or beginners to talk about programming any language for the Spectrum.
MrPixel
Microbot
Posts: 170
Joined: Sat Mar 24, 2018 7:42 pm

Freezing Basic

Post by MrPixel » Mon May 14, 2018 6:56 pm

i decided to screw around with basic and decided to make a inescapable loop

(i was bored)

10 REM gosub loop
11 plot 12,2
12 draw 14,2
13 if Inkey$="a" then goto 20
20 goto 10


any other ways to do so?
0 x

User avatar
R-Tape
Site Admin
Posts: 1607
Joined: Thu Nov 09, 2017 11:46 am

Re: Freezing Basic

Post by R-Tape » Mon May 14, 2018 7:16 pm

any other ways to do so?
I give you Spectropolis, a city that slowly comes to life at night. Watch and wonder as the lights from buildings, cars and stars flicker while the inhabitants go about their business.

Code: Select all

5 BORDER 0: PAPER 0: CLS
10 INK 1+(RND*7)
20 PLOT RND*255, RND*175
40 GOTO 10
0 x

User avatar
RMartins
Manic Miner
Posts: 331
Joined: Thu Nov 16, 2017 3:26 pm

Re: Freezing Basic

Post by RMartins » Mon May 14, 2018 7:33 pm

Code: Select all

10 FOR i= 1 TO 2 STEP 0
20 PRINT i
30 NEXT i
Dumb loop will keep BASIC ocuppied.
0 x

User avatar
1024MAK
Microbot
Posts: 188
Joined: Wed Nov 15, 2017 2:52 pm
Location: Sunny Somerset in the U.K. in Europe

Re: Freezing Basic

Post by 1024MAK » Wed May 16, 2018 4:52 pm

Code: Select all

10 LET HELL=20 : LET bottles=1E8
20 POKE 23692,255
30 PRINT bottles;" green bottles sitting"',"on the wall..."
40 LET bottles=bottles-1
50 GO TO HELL
Mark
2 x

MrPixel
Microbot
Posts: 170
Joined: Sat Mar 24, 2018 7:42 pm

Re: Freezing Basic

Post by MrPixel » Wed May 16, 2018 5:36 pm

1024MAK wrote:
Wed May 16, 2018 4:52 pm

Code: Select all

10 LET HELL=20 : LET bottles=1E8
20 POKE 23692,255
30 PRINT bottles;" green bottles sitting"',"on the wall..."
40 LET bottles=bottles-1
50 GO TO HELL
Mark
LOL :lol:
0 x

MrPixel
Microbot
Posts: 170
Joined: Sat Mar 24, 2018 7:42 pm

Re: Freezing Basic

Post by MrPixel » Wed May 16, 2018 5:39 pm

you magnificent bastard!
1 x

User avatar
Ast A. Moore
Manic Miner
Posts: 691
Joined: Mon Nov 13, 2017 3:16 pm

Re: Freezing Basic

Post by Ast A. Moore » Wed May 16, 2018 5:41 pm

When I was modding my Toast Rack to improved the video output quality, I needed to create a gray screen in BASIC, which would also access contended memory with with a varying frequency. So just did this and pressed buttons while it ran:

Code: Select all

1 RUN
0 x
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.

User avatar
R-Tape
Site Admin
Posts: 1607
Joined: Thu Nov 09, 2017 11:46 am

Re: Freezing Basic

Post by R-Tape » Wed May 16, 2018 7:03 pm

Is it possible to properly freeze BASIC (disable BREAK) without using POKE or any USR?
0 x

User avatar
Ast A. Moore
Manic Miner
Posts: 691
Joined: Mon Nov 13, 2017 3:16 pm

Re: Freezing Basic

Post by Ast A. Moore » Wed May 16, 2018 7:15 pm

R-Tape wrote:
Wed May 16, 2018 7:03 pm
Is it possible to properly freeze BASIC (disable BREAK) without using POKE or any USR?
I don’t think so. Since you can’t disable interrupts (from BASIC), and the ISR at $38 is what checks for keypresses, I don’t see an obvious way of doing that. Well, BEEP (and a few other BASIC commands) do disable interrupts, but making a long BEEP is more of a cheat.

EDIT: Oh, you can’t fool BASIC that easily, either. BEEP doesn’t allow to play super long notes. :D
0 x
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.

AndyC
Microbot
Posts: 169
Joined: Mon Nov 13, 2017 5:12 am

Re: Freezing Basic

Post by AndyC » Wed May 16, 2018 7:30 pm

Code: Select all

10 POKE 23620,0
;)
0 x

Post Reply