getting deep into the memory map of commodore BASIC 2.0
https://www.masswerk.at/nowgobang/2020/commodore-basic-variables
macabre, in hindsight
@vidak oh, the original creator just died didn't they
re: macabre, in hindsight
@screwtape i am attempting to answer the question of whether it would be better to use arrays of undefined type, or variables of string type to store maybe... 20 or so player objects
- replies
- 2
- announces
- 0
- likes
- 1
re: macabre, in hindsight
@screwtape @vidak Yeah, Thomas Kurtz; John Kemeny died back in '92.
But BASIC will live forever.
re: macabre, in hindsight
@vidak @screwtape As noted, I prefer to just use memory directly, but esp. any MS BASIC like Commodore does garbage collection on strings, you can't use them in-place as a database.
In Atari BASIC, DIM D$(1024) gives you 1K of bytes that do not move, up to you to slice out substrings.
#basic
re: macabre, in hindsight
@mdhughes @screwtape perhaps it does not matter, but it would be a great deal simpler to me to have the names of the variables directly exposed to the player
this may cheapen the game a little, but i do understand what you're saying regarding:
10 DIM A(11)
20 LET A(1) = "BAG NAME #1"
30 FOR I=2 TO 11:LET A(I)=".":NEXT I
re: macabre, in hindsight
@vidak @screwtape Yeah, I'd always generate the text on display only, from constants:
?"BAG #";N
FOR X=1 TO 10:?IT$(BAG(X)):NEXT X
(or in Atari BASIC, IT$(BAG(X)*10,BAG(X)*10+9) for a 10-char max name out of a big blob of text)
You can make more complex data structures in BASIC by using some numbers as "address" indices. See Peoples Computer Company, 1973 issues, Programmer's Toolbox, they build stacks, trees, graphs in just arrays:
https://archive.org/search?query=creator%3A%22People%27s+Computer+Company%22&sort=title
#basic
sensitive media
re: macabre, in hindsight
@mdhughes @screwtape ah, i think you may have misunderstood what is meant to be happening in the game, quite a bit of it cannot be generated from constants, it is a sandbox game
these code listings are incredible though, i am going to study them very closely to see what gems they hold!
re: macabre, in hindsight
@vidak @screwtape Even a sandbox has fixed elements (sand, not-sand). Just reference them by ids, or poke bytes somewhere and look them up.
Yeah, PCC was *amazing*. Some of that got into Creative Computing and such, and a few BASIC books.
re: macabre, in hindsight
@mdhughes @screwtape i've always wanted to make an issue or two of a sweet BASIC listing compilation for the community--doubtless the last 30 years have seen some amazing new BASIC games created