Search found 18 matches

by MarkTheStrange
Sat Aug 24, 2024 5:17 am
Forum: Libraries and Examples
Topic: USR() function to sort BASIC string array
Replies: 0
Views: 855

USR() function to sort BASIC string array

This is an implementation of Shell's sort designed to be called via USR() from CBM BASIC. In my testing it sorted 100 words in 3 jiffies, and 1000 in under a second. The argument should be the address of the array's first element: X=USR(POINTER(A$(0))) There's a loader program which can be assembled...
by MarkTheStrange
Wed Apr 17, 2024 9:05 pm
Forum: Misc Apps
Topic: Biorhythm Calculator
Replies: 0
Views: 1134

Biorhythm Calculator

This seems like a suitably retro application for our new retro computer. Written in Prog8 so the graphing is reasonably speedy. (If you aren't familiar with Biorhythms, you can read about the insanity on Wikipedia .) The Prog8 source code includes a general-purpose date manipulation library, which s...
by MarkTheStrange
Sat Jan 20, 2024 4:45 am
Forum: Misc Apps
Topic: Towers of Hanoi in BASIC
Replies: 1
Views: 1496

Towers of Hanoi in BASIC

Thought this would make a relatively simple demo of what you can do with BASIC. It loads some sprites into memory and draws some pegs and then animates the solution for the 8-disc Towers of Hanoi puzzle. The solution part uses recursion via global arrays functioning as "stacks" for each &q...
by MarkTheStrange
Thu Jan 11, 2024 6:42 pm
Forum: Misc Apps
Topic: Matrix-style digital rain screensaver
Replies: 0
Views: 37841

Matrix-style digital rain screensaver

This renders a version of the digital rain display seen in The Matrix . 2587 Screen shot It's all PETSCII (no halfwidth kana characters, sorry). It doesn't do anything else – no messages fade in or anything – but it does have a bit of variability. You can use the + and - keys to make it faster or sl...
by MarkTheStrange
Tue Dec 19, 2023 2:06 am
Forum: Development Tools
Topic: VolksForth
Replies: 14
Views: 15338

Re: VolksForth

I'm afraid I don't think you can do much on the X16 with VolksForth in this form (i.e. no access to the kernel or even PETSCII control codes in its stock configuration). You can do a lot in plain text mode on the X16 - display text in multiple colors anywhere on the screen, for instance. In VolksFor...
by MarkTheStrange
Wed Dec 06, 2023 2:57 am
Forum: Development Tools
Topic: VolksForth
Replies: 14
Views: 15338

Re: VolksForth

I think there's two reasons for this. For one, I guess it's hard to implement the Forth-83 standard words KEY, EXPECT and QUIT with the CBM BASIC screen editor. And two, the first VolksForth, on the C64, offers to use up to 50k of RAM ($0800-$CFFF) and thus didn't have the BASIC ROM enabled. Fair, ...
by MarkTheStrange
Tue Dec 05, 2023 5:17 pm
Forum: Development Tools
Topic: VolksForth
Replies: 14
Views: 15338

Re: VolksForth

@voidstar There are standards for FORTH (FORTH-83, ANS FORTH), but no two are quite alike anyway. I'm not familiar with any that have a word named STACK, though. The stack (well, the data stack; there's also a return stack) is where operands live, but is itself unnamed. The nondestructive way to loo...
by MarkTheStrange
Tue Dec 05, 2023 12:50 pm
Forum: Development Tools
Topic: VolksForth
Replies: 14
Views: 15338

Re: VolksForth

Cool to see Forth on the X16! Some initial thoughts: It seems odd not to take advantage of the screen editor – by which I just mean the one that BASIC uses, not X16Edit, i.e. reading input using BASIN/CHRIN instead of rolling your own cursor and using GETIN. You lose the ability to cursor around the...
by MarkTheStrange
Fri Oct 27, 2023 2:14 am
Forum: X16 Feature Requests
Topic: BASIC ROLL command?
Replies: 12
Views: 11260

Re: BASIC ROLL command?

The abbreviation is not always what you expect; it's based on the order the keywords appear in the table in ROM, first match wins. So, for instance, iN is INPUT#, not INPUT. In fact, so are inP, inpU, and inpuT; there is no way to abbreviate INPUT at all. But yes, BASIC will handle a line of 250 byt...
by MarkTheStrange
Thu Oct 26, 2023 5:37 pm
Forum: X16 Feature Requests
Topic: BASIC ROLL command?
Replies: 12
Views: 11260

Re: BASIC ROLL command?

For another speedup, in addition to RND(.) for RND(0) , you can use the pi symbol for RND(1) , which is just a hardcoded value greater than 0 that doesn't require the number parser nor a variable lookup. Good point. RND() behaves differently based on the sign – well, actually, SGN() – of its argume...