World of Spectrum
  • Categories
  • Discussions
  • FAQ
  • Sign In
Home › Search
Title Search
@title beer Word 'beer' in title
User Search
  • @user admin Only posts by Admin
Text Search
  • @body beer Word 'beer' in the text
Phrase Search
"Hello World" Exact phrase match
Exclude Terms
  • car -red Search cars that are not red
"Or" Searches
  • honda | bmw 'honda' or 'bmw' results
Multi-Field
@(title,body) hello Both contain 'hello'
WildCard
  • hond* civ* Match all with an astrix
Combination
  • @title bmw @user admin
See more supported syntax examples
Search Again :: Adv Search 1000 results in 0.002s
<1234567…34>
  • Help with random numbers......Hi all, wonder if anyone can help me... sort of a novice here ... I have been trying to write a simple ish basic program to compare random sets of n…

    ... an example of using a recursive function to do the duplicate ... /> [code]
    2 DEF FN a()=FN r(1+INT (RND*49 ... )):
    DEF FN r(x)=VAL (("FN a()" AND a(x ... 6
    80 LET a(FN a())=n
    110 NEXT ...
    Battle Bunny Battle Bunny July 2011 Sinclair Basic
  • Help with random numbers......Hi all, wonder if anyone can help me... sort of a novice here ... I have been trying to write a simple ish basic program to compare random sets of n…

    ... an example of using a recursive function to do the duplicate ... /> [code]
    2 DEF FN a()=FN r(1+INT (RND*n ... )):
    DEF FN r(x)=VAL (("FN a()" AND a(x ... -1
    80 LET a(FN a())=50-n
    110 ...
    loonix loonix July 2011 Sinclair Basic
  • INSTR function...Hi Folks, Another little program that people might find useful: [CODE]100 DIM i(4) 110 LET a$="This is some sample text" 120 LET b$="text" 130 GO S…

    Here's a recursive DEF FN INSTR one-liner, cunningly contrived ... it in a separate function "FN c(c,o$)" didn't ... . I thought that maybe "DEF FN c()=c+LEN o$-1 ... />
    [code]
    4 DEF FN i(w$,o$,c)=
    VAL (("FN i(w$,o$,c+1 ...
    Battle Bunny Battle Bunny September 2011 Sinclair Basic
  • Any ideas on how to solve this equation?If I have three numbers 10:A:B where A & B are equal +ve integers <10, what formula could I apply to pairs of numbers (A,10) or (10,B) such that the …

    ... the actual function. The FN P2() was the result ... and develop a single recursive DEF FN which could do the ... it in right this time. FN n() converts between any ... from" parameter in a nested FN b() to convert that result ...
    DEF FN n(n,f,t)=FN b(FN b(n,f ...
    Battle Bunny Battle Bunny September 2011 Development
  • numbers to binaryHi everyone, I have looked through the manual and have found nothing. How do you change a number to binary easily? I know you can go binary to decim…

    ... have to say that your recursive definition i very very interesting ... =Dr BEEP;544274]1 def fn b$(d)=val$ (("str$ ... />
    2 DEF FN c$(d,b)=VAL$ (("FN z$(d)" AND ... d=b))
    5 DEF FN z$(d)=CHR$ (d+ ... />
    :smile:

    And FN c$(45648,36) gives Z80 ...
    mattsteel mattsteel September 2011 Sinclair Basic
  • numbers to binaryHi everyone, I have looked through the manual and have found nothing. How do you change a number to binary easily? I know you can go binary to decim…

    ... have to say that your recursive definition i very very interesting ... />
    2 DEF FN c$(d,b)=VAL$ (("FN z$(d)" AND ... d=b))
    5 DEF FN z$(d)=CHR$ (d+48 ... />
    :smile:

    And FN c$(45648,36) gives Z80 ...
    BloodBaz BloodBaz September 2011 Sinclair Basic
  • INSTR function...Hi Folks, Another little program that people might find useful: [CODE]100 DIM i(4) 110 LET a$="This is some sample text" 120 LET b$="text" 130 GO S…

    LOL - thanks Crisis but I will stick with good old BASin. It delivers everything I need and I can live without recursive DEF FN. ;)

    Paddy
    Paddy Coleman Paddy Coleman October 2011 Sinclair Basic
  • FN nesting error?While playing with FN functions that call assembly, I've found something weird. Check out this code: [code]10 DEF FN f(a,b)=a+b 20 PRINT FN f(FN f(…

    I agree with McLeods explanation. An inner FN with a different name has a private parking place and does not need the hidden storage in the same DEF FN statement. Did known recursive functions escape from this by having the inner FN's as the first element?
    roko roko October 2011 Sinclair Basic
  • stuck on recursive functionI want this function to PEEK 'l' bytes from memory starting at 's' and return them as a string, but however much I fiddle about with quoting and pare…

    ... solution for those interested. A recursive function needs an evaluating bit ... the CHR$ ... + VAL$ bit, the FN j$ bit and the """""" bit ... addressed byte from memory;
    * ("FN j$("+STR$ (s+1)+","+STR ... ( 56168 ) and then VAL$ sees "FN j$((56169),(7))" and so ...
    Battle Bunny Battle Bunny February 2012 Sinclair Basic
  • those darned recursive functions againI've been stuck on this one all evening. I want to dump out some memory in binary to debug a program. I've got a simple mod 2 division loop to do tha…

    ... /> [code]
    100 DEF FN b$(n,b$)
    =("0 ... b$)
    +VAL$ (("FN b$("+STR$ INT (n/2 ... as just 1E+9 but FN b$(999999999,"") prints the ... [code]
    (if n0) : FN b$(INT (n/2),STR ... What I need is a recursive DEF FN visualisation utility, which can ...
    Battle Bunny Battle Bunny March 2012 Sinclair Basic
  • those darned recursive functions againI've been stuck on this one all evening. I want to dump out some memory in binary to debug a program. I've got a simple mod 2 division loop to do tha…

    ... /> What I need is a recursive DEF FN visualisation utility, which can ... would be evaluated by the FN call as in the second ... to fix a broken DEF FN.[/QUOTE]
    Wouldn't it ... generate an eye-bleeding DEF FN from it.
    JamesW JamesW March 2012 Sinclair Basic
  • those darned recursive functions againI've been stuck on this one all evening. I want to dump out some memory in binary to debug a program. I've got a simple mod 2 division loop to do tha…

    ... loop, then stick the DEF FN in the middle, replace the ... "DEF FN...=" with PRINT, remove any VAL ... should be handy for debugging recursive DEF FNs.
    Battle Bunny Battle Bunny March 2012 Sinclair Basic
  • Keyboard problem...Hi Folks, I have hit a problem in MRT and I cannot see how to get around it. Please allow me to explain. I have a list of items from which one can…

    ... GO TO, GO SUB, DEF FN (I think that's all ... beforehand then a self-contained FN would work, but it would ... impossible to use nested or recursive FNs - and using a bunch ... of LETs prior to every FN call isn't very pretty ...
    Battle Bunny Battle Bunny April 2012 Sinclair Basic
  • Cricket: Duckworth/Lewis CalculatorIdeal for any one-day cricket match which uses the Duckworth/Lewis method to calculate the target score if there is an interruption to play. The alg…

    ... code]
    10 DEF FN d(o,w,u)=299 ... plain w in your def fn, but only use it ... br /> [code]
    10 DEF FN d(o,u)=299.76148 ...
    [code]
    10 DEF FN d(o,w,u)=299 ... use it.
    its not recursive , or i really mis ... EXP functions in that DEF FN, as each of them ...
    PrinceGaz PrinceGaz August 2012 Brand new software
  • Project on ZX Spectrum in UniversityHi everyone, I am Max, student of media studies in berlin, and I have to do a little project on the spectrum. I am working on a sinclair zx spectrum…

    ... to write certain forms of recursive function. For example, this function ... a string:

    DEF FN j$(s,l)=CHR$ PEEK ... (s)+VAL$ (("FN j$("+STR$ (s+1)+","+STR ...
    Battle Bunny Battle Bunny December 2012 Announcements
  • calculator and sinusok, look at the Sysel's routine: [PHP]3 5b00 *s 4 5b00 tabsin = #7000 03 mksin 19.11.1995 Busy soft …

    ... self-modifying code and a recursive function to boot.
    [code ... ) TO ):
    LET b(i)=FN i(0,LEN n$): LET ... /> NEXT i
    2012 DEF FN i(i,j)=VAL (("(CODE ... $(j)>=""A""))*base^i+FN i(i+1,j-1 ... n.
    [code] 10 DEF FN h$(n)=CHR$ (INT n ...
    Battle Bunny Battle Bunny January 2013 Development
  • Spectrum Utility Routines Compendium (pending)I couldn't make up my mind into which section to put this, so it's ended up here for some tenuous reason. I haven't forgotten about this. I've been …

    ... was a bug in the recursive version of the Hex2Dec function ... $ ($5F5E0FF = 99999999)
    3051 DEF FN d(h$)=16^(LEN h ... h$>64))
    +VAL (("FN d(h$(2 TO))+" AND ... minor change, I updated the recursive versions of AND, OR, XOR ...
    Battle Bunny Battle Bunny August 2013 Announcements
  • Confounded DEF FNCan anyone see why this is going wrong? I've been tinkering with it since tea time and got nowhere. [code] 2 DEF FN t$(n,t,d) =STR$ INT (n/t)…

    ... /> To PS.
    The recursive DEF FN to format the time is ... it's being evaluated, the FN uses an extra 1kb of ... only way to stop a recursive string function.

    Taking ... Andrew's original non-recursive DEF FN was written assuming that the ...
    Battle Bunny Battle Bunny August 2013 Sinclair Basic
  • Confounded DEF FNCan anyone see why this is going wrong? I've been tinkering with it since tea time and got nowhere. [code] 2 DEF FN t$(n,t,d) =STR$ INT (n/t)…

    ... )
    +STR$ INT (FN V(FN V(FN V(n,1800000),180000 ... /> +STR$ INT (FN V(FN V(FN V(FN V(n,1800000),180000 ... /> STR$ INT (FN V(FN V(FN V(FN V(FN V(n,1800000 ... , just for comparison. The recursive versions are usually substantially smaller ...
    Battle Bunny Battle Bunny August 2013 Sinclair Basic
  • Writing faster BASICIn terms of structuring BASIC programs, what are the best ways allocate variables, functions, arrays? Any tips. I remember INPUT mag had some suggest…

    ... forgot to mention is that recursive DEF FNs are generally, often ... than the equivalent expanded DEF FN, and always use more memory ... always possible to expand a recursive DEF FN (eg. if the terminating ... describes how to calculate DEF FN memory usage. There's a ...
    Battle Bunny Battle Bunny December 2013 Sinclair Basic
  • quick RAM copy using LET in BASICI'm in the process of reviewing, revising and refining all the programming tips & utility routines which I've posted on this forum over the last eigh…

    ... in strings (eg. in a recursive DEF FN), use TXT2Emu's "{..}" codes ... }; UDG A = {90} (or {A}); FN = {A8}.
    Battle Bunny Battle Bunny March 2014 Sinclair Basic
  • User defined function in Sinclair BASICI'm looking to create a user defined function in Sinclair BASIC to add up numbers being input. This is the program without a user defined function be…

    ... . However the function can be recursive and this leads to much ... in rather amazing one-line recursive DEF FNs.

    Unfortunately ... a think.

    def fn s(a$)=(a$"" AND VAL ... )) + ((LEN a$ > 1) AND FN s(a$(2 TO)))
    Alcoholics Anonymous Alcoholics Anonymous February 2017 BASIC
  • User defined function in Sinclair BASICI'm looking to create a user defined function in Sinclair BASIC to add up numbers being input. This is the program without a user defined function be…

    ... occur in a string (FN and TO in this ... FN s("12345") = 15 for example.

    A recursive ... digits left:
    VAL (("FN s(a$(2 TO ))+" ...
    (this is the recursive looping bit);
    or adds ... terminating condition bit, as "FN s(a$(2 TO ))+" ...
    Battle Bunny Battle Bunny February 2017 BASIC
  • Go to, gosub or something different?I'm going to write an arcade game in basic. May compile it. In both basic and compiled basic would a goto or gosub be faster? Also if I stored …

    ... SUB stack. Calling a FN is slower as every statement ... as long as a DEF FN only references its own local ... its parameters within its DEF FN extent which is always ... first; but a DEF FN is restricted in the code ... to a GO SUB routine. Recursive DEF FNs use much more ...
    Battle Bunny Battle Bunny August 2017 Sinclair Basic
<1234567…34>

Latest Posts

  • Where to Buy the New or Fairly Recent , Excellent ZX Spectrum Games Software?
    Your Spec-chum on 1:34PM
  • i am currently listening to........
    mel the bell on 11:34AM
  • Mis-labeled cassette titles or a name change?
    harriusherbartio on 11:06AM
  • Ways to preserve Speccy Tapes in the loft
    harriusherbartio on 10:58AM
  • Fixed Speccy Software. And which games remained unfixed?
    harriusherbartio on 10:47AM
  • Minor British Sports that did become games on the ZX Spectrum
    harriusherbartio on 10:30AM
  • How to return to basic properly from ASM
    Paradigm Shifter on 1:54AM
  • Frankie's ZX Spectrum Digouts
    Zup on April 8
  • Elusive Strategy Games done by the Smaller or less Prolific Software Houses.
    harriusherbartio on April 8
  • 1992 Spectrum Software
    harriusherbartio on April 7

HitBox

Word Docs Hits
recursive 215 281
fn 866 4.4K

Related Threads

  • Can you improve this recursive DEF FN?I came up with this function to scan strings for characters without needing to use FOR...NEXT and IF...THEN, but it seems rather long-winded. Can any…
  • Recursive functionsA while ago Phil demonstrated a nice example of recursiveness in a DEF FN function. Sadly it doesn't appear to be online anymore and I have difficult…
  • Recursive acronymsBrowsing through Wikipedia (as one does, y'know -- it's so full of itself and What Wikipedia Is Not, strange that it never mentions the three main th…
  • DEF FN DirectivesI am looking at using some machine code functions from the DK Graphics Pack. They are machine code but they are called via Basic with the function de…
  • Recursive 4-way floodfillHi guys)<br /> <br /> Shortly, I wanna find out whether there's a way to some object. Perhaps some of you have already encountered such an issue whic…
  • fn bug in basin?Hi.<br /> I was just trying to make myself some functions in basin and when i tryed them, the progam stopped on call.<br /> So i've tryed this simple…
  • FN nesting error?While playing with FN functions that call assembly, I've found something weird. <br /> <br /> Check out this code:<br /> [code]10 DEF FN f(a,b)=a+b<b…
  • stuck on recursive functionI want this function to PEEK 'l' bytes from memory starting at 's' and return them as a string, but however much I fiddle about with quoting and pare…
  • those darned recursive functions againI've been stuck on this one all evening. I want to dump out some memory in binary to debug a program. I've got a simple mod 2 division loop to do tha…
  • BASin v.15 DEF FN bugThe bug would appear to be in "BASSupport.pas : Procedure ProcessDEFFN"; as it's not inserting the 6-byte variable place holder after each parameter …

Related Searches

  • recursive
  • modulo function def fn
  • fuse def fn keyboard
  • def fn usr
  • fn defadd
  • def fn
  • def fn within a function
  • fn h
  • upper case fn
  • def fn d
  • bin def fn
  • def fn recursive bug
  • def fn bug
  • recursive function
  • binary recursive function
  • recursive backtrack
  • def fn recursive bin
  • fn usr
  • dr beep s recursive def fn
  • recursive def fn

Copyright © 2024 World of Spectrum