Search found 2237 matches

by dr beep
Thu Jul 18, 2024 9:55 pm
Forum: Spectrum BASIC
Topic: Recursive functions in BASIC
Replies: 11
Views: 1082

Re: Recursive functions in BASIC

I don’t have much call for recursion in my job (aside from occasional data validation of complex hierarchical structured data in TSQL) so mostly the DEF FN as shown. I once had a query in a tool and it needed a recursive search to do the job, An expert said it was not possible but I solved it. Prob...
by dr beep
Thu Jul 18, 2024 8:50 pm
Forum: Spectrum BASIC
Topic: Recursive functions in BASIC
Replies: 11
Views: 1082

Re: Recursive functions in BASIC

I consider myself to be a reasonably competent programmer (I spend a fair amount of my professional life doing it) but reading stuff like this still blows my mind. Recursion in general or this BASIC-method with DEF FN? During my study (1987) I coded a recursive mazegenerator in Pascal and got a mes...
by dr beep
Thu Jul 18, 2024 5:39 pm
Forum: Spectrum BASIC
Topic: Recursive functions in BASIC
Replies: 11
Views: 1082

Re: Recursive functions in BASIC

Decimal to binary

Code: Select all

   1 DEF FN b$(d)=VAL$ ((CHR$ 19
3+"d" AND d<=1)+(("FN b$(INT (d/
2))+"+CHR$ 193+STR$ ((d/2)<>INT 
(d/2))) AND d>1))
by dr beep
Thu Jul 18, 2024 5:31 pm
Forum: Spectrum BASIC
Topic: Recursive functions in BASIC
Replies: 11
Views: 1082

Re: Recursive functions in BASIC

I even had a recursive HANOI solution printed in a string.
by dr beep
Thu Jul 18, 2024 5:29 pm
Forum: Spectrum BASIC
Topic: Recursive functions in BASIC
Replies: 11
Views: 1082

Re: Recursive functions in BASIC

Code: Select all

10 Def Fn D$(n,s$)=val$ (("s$+fn D$(n-1,s$)" And N>0)+("""""" And N=0))
20 Print Fn D$(10,"abc")
by dr beep
Thu Jul 11, 2024 5:43 pm
Forum: Hardware
Topic: Correct tape recorder connection to 48k+
Replies: 5
Views: 934

Re: Correct tape recorder connection to 48k+

No, there is no problem having EAR and MIC connected but you might need to adjust the azimuth.
by dr beep
Mon Jul 01, 2024 8:46 pm
Forum: Emulators
Topic: SP-2-ZX81, the new ZX81-emulator for the 48K ZX Spectrum
Replies: 86
Views: 1351582

Re: SP-2-ZX81, the new ZX81-emulator for the 48K ZX Spectrum

I have an idea to improve speed of quaracterdisplay so I hope to bring out 3.01 soon.
by dr beep
Sat Jun 29, 2024 10:49 pm
Forum: Emulators
Topic: SP-2-ZX81, the new ZX81-emulator for the 48K ZX Spectrum
Replies: 86
Views: 1351582

Re: SP-2-ZX81, the new ZX81-emulator for the 48K ZX Spectrum

I now have Quaracterdisplay working, but now IX-intrupt is not working....

so no new release yet