-
Cybernoid editorSo, my long tern goal is to make my own Cybernoid or Rex like game (see an ancient thread about Sprite advice)...but my skills are somewhat lacking..…
... two-liner:
10 DEF FN x$(a) = CHR$(a+48 ... >9))
20 DEF FN h$(x) = FN x$(INT (x/16 ... )) + FN x$(x-16*INT (x ... /16))
30 PRINT FN h$(201)
... understand how Alcoholics Anonymous's DEF FN version works - so your effort ... -
Cool BASIC tricks and tips!Following on from Dunny's excellent suggestion of a compendium of BASIC tips + tricks, I believe it would be better to have a topic dedicated to it. …
[code]
DEF FN x$(a) = CHR$(a+48+(7 AND a>9))
DEF FN h$(x) = VAL$("FN h$(INT(x/16))+FN x$(x-16*INT (x/16))"(1+(13 AND x -
Cool BASIC tricks and tips!Following on from Dunny's excellent suggestion of a compendium of BASIC tips + tricks, I believe it would be better to have a topic dedicated to it. …
[QUOTE=Dr BEEP;171915]I would do it like this:
[code]
DEF FN h$(x) = "0123456789ABCDEF"(INT(x/16))+"0123456789ABCDEF"(x-16*INT (x/16))
[/code][/QUOTE]
Dr Beep, that is a very cool lateral solution, which even I understand! :-) -
Cool BASIC tricks and tips!Following on from Dunny's excellent suggestion of a compendium of BASIC tips + tricks, I believe it would be better to have a topic dedicated to it. …
You have been using another computer :)
DEF FN h$(x) = "0123456789ABCDEF"([B]1+[/B]INT(x/16))+"0123456789ABCDEF"([B]1+[/B](x-16*INT (x/16)))
will print FOR i = 0 TO 255: PRINT FN h$(i) : NEXT i -
Cool BASIC tricks and tips!Following on from Dunny's excellent suggestion of a compendium of BASIC tips + tricks, I believe it would be better to have a topic dedicated to it. …
... using another computer :)
DEF FN h$(x) = "0123456789ABCDEF"([B]1 ... i = 0 TO 255: PRINT FN h$(i) : NEXT i[/QUOTE ... the perfect BASIC
DEF FN h$(x) = "0123456789ABCDEF"(.5+x ... -
Getting scr addresses from x and yCould someone please tell me how to calculate the 8 screen addresses corresponding to a character printed in basic at coordinates x and y? For examp…
In BASIC:
[CODE]
DEF FN a(y,x)=16384+x+(y-INT (y/32))*32+INT (y/8)*2048
[/CODE] -
Getting scr addresses from x and yCould someone please tell me how to calculate the 8 screen addresses corresponding to a character printed in basic at coordinates x and y? For examp…
... ]In BASIC:
[CODE]
DEF FN a(y,x)=16384+x ... like:
[CODE]
DEF FN a(y,x)=16384+x ... -
Getting scr addresses from x and yCould someone please tell me how to calculate the 8 screen addresses corresponding to a character printed in basic at coordinates x and y? For examp…
... like:
[CODE]
DEF FN a(y,x)=16384+x ... brackets:
[code]
DEF FN a(y,x)=16384+x ... -
Getting scr addresses from x and yCould someone please tell me how to calculate the 8 screen addresses corresponding to a character printed in basic at coordinates x and y? For examp…
For a function that gives you each line too:
[code]
DEF FN a(y,x,l)=16128+x+32*y+1792*INT(y/8)+l*256
[/code]
Where l takes the values 1 to 8. Change the 16128 to 16384 if you want to use 0-7 for the line numbers. -
Getting scr addresses from x and yCould someone please tell me how to calculate the 8 screen addresses corresponding to a character printed in basic at coordinates x and y? For examp…
... do what you want, the DEF FNs described here are very ... question for the gurus: Are DEF FN faster or slower than executing ... -
Getting scr addresses from x and yCould someone please tell me how to calculate the 8 screen addresses corresponding to a character printed in basic at coordinates x and y? For examp…
[QUOTE=48K;176838]Are DEF FN faster or slower than executing ... program to find the DEF FN each time an FN is executed, but ... if you keep all your DEF FNs ... the time as opposed to DEF FN which renames the vars used ... -
Game OptimisationBelow is a section of code Im using for movement enermy display and collision detect. What happens is that you move the sight with ,.qa and space do…
... in Sinclair Basic:
Define DEF FN in top, place GO SUB ... -
Game OptimisationBelow is a section of code Im using for movement enermy display and collision detect. What happens is that you move the sight with ,.qa and space do…
... in Sinclair Basic:
Define DEF FN in top, place GO SUB ... at the moment is the DEF FN part but apart from that ... -
Game OptimisationBelow is a section of code Im using for movement enermy display and collision detect. What happens is that you move the sight with ,.qa and space do…
... above. Same goes for the DEF FN function. The search is also ... -
Cool BASIC tricks and tips!Following on from Dunny's excellent suggestion of a compendium of BASIC tips + tricks, I believe it would be better to have a topic dedicated to it. …
... using another computer :)
DEF FN h$(x) = "0123456789ABCDEF"([B]1 ... i = 0 TO 255: PRINT FN h$(i) : NEXT i[/QUOTE ... out of range). Could the DEF FN be rehashed to recursively call ... -
The Non Randomness of Sam BasicHows about this for weird. Hardly ever bothered with such simple stuff before but this is what I just did on the Sam ( as in a real one now I've got …
... :
[code]
1 DEF FN r(c,d,p)=c ... >=-d)
10 PLOT FN r(RND*255,255,PEEK ... 23672),FN r(RND*175,175,PEEK ... -
Oneliner contestHello to you all, I dare you to make a program on 1 BASIC line. Here is the place to sent your ONELINERS [url]http://www.zxspectrum.00freehost.co…
... always make our own subroutine, DEF FN, or machine code routine. But ... -
cant format answereHi all, I am writing a short basic program that will convert a frequency to a length. 10 print "Spectrum antenna length conversion." 20 let w = 468 …
... -bogglingly complicated series of nested DEF FN statements ... -
Oneliner contestHello to you all, I dare you to make a program on 1 BASIC line. Here is the place to sent your ONELINERS [url]http://www.zxspectrum.00freehost.co…
... expression with a "DEF FN".
The expression FN v(o$) takes ... reason this is now a DEF FN is that it has to ... SCREEN$ value, and the same FN(v) function can now be ... -
Oneliner contestHello to you all, I dare you to make a program on 1 BASIC line. Here is the place to sent your ONELINERS [url]http://www.zxspectrum.00freehost.co…
... :
[CODE]
1 DEF FN v(o$)=2*(o$="r ... c=(m>0)*(c$=" ")*FN v(k$):
FOR r ... -
Oneliner contestHello to you all, I dare you to make a program on 1 BASIC line. Here is the place to sent your ONELINERS [url]http://www.zxspectrum.00freehost.co…
...
[code]
1 DEF FN v(o$)=2*(o$="r ... c=(m>0)*(c$=" ")*FN v(k$):
FOR r ... -
Oneliner contestHello to you all, I dare you to make a program on 1 BASIC line. Here is the place to sent your ONELINERS [url]http://www.zxspectrum.00freehost.co…
... variable crosswind.
Added DEF FN r() to read the keyboard ... -
Oneliner contestHello to you all, I dare you to make a program on 1 BASIC line. Here is the place to sent your ONELINERS [url]http://www.zxspectrum.00freehost.co…
... /> I changed the following:- replaced DEF FN r() with your suggested version ... -
Oneliner contestHello to you all, I dare you to make a program on 1 BASIC line. Here is the place to sent your ONELINERS [url]http://www.zxspectrum.00freehost.co…
... allow multiple key presses via DEF FN r(x), as used in ... -
Oneliner contestHello to you all, I dare you to make a program on 1 BASIC line. Here is the place to sent your ONELINERS [url]http://www.zxspectrum.00freehost.co…
... :
LET b=256:
DEF FN w(x)=PEEK ABS x ... (x+1):
LET e=FN w(g+15):
LET ... /> LET z$="":
LET k=FN w(-p-1):
LET ... +4:
LET p=q+FN w(p+2):
LET ... -
Oneliner contestHello to you all, I dare you to make a program on 1 BASIC line. Here is the place to sent your ONELINERS [url]http://www.zxspectrum.00freehost.co…
... places, you could use a DEF FN to position the cursor like ...