dMZX Forums: Arrays? - dMZX Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Arrays? Does Megazeux have Arrays?

#1 User is offline   Mr Goof 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 10
  • Joined: 14-June 05

Posted 07 January 2013 - 04:11 AM

Hi everybody I haven't been on here in a while and I have been outlining a new game concept. I am wondering does Megazeux support any kind of Array constructs? One dimension, two dimensional arrays? If so where do I find the information on it? If not is there something similar tip trick that you can do? Thanks
0

#2 User is offline   Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,895
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 07 January 2013 - 04:19 AM

Not quite, but there are two similar things you can do:

#1 Interpolation in counter names
You can interpolate counters into the names of other counter names to simulate things like arrays. You can also do this when sending labels, to create something like a switch/case statement.
loop start
set "items&LOOPCOUNT&" "LOOPCOUNT"
loop 9


#2 String indexing
With this method, you create a string and index its bytes. This consumes less memory and makes save files smaller but is limited to values 0-255. It is also limited to one dimension unless you use interpolation in the string name itself (as above) or flatten the addressing with something like ('y'*'width'+'x').

set "COMMANDS" 10000

set "$string.321" 'a'

loop start
if "$string.('LOOPCOUNT')" = 'a' "foundIt"
loop "('$string.length'-1)"
* "Didn't find 'a' in the string."
end
: "foundIt"
* "Found 'a' at &LOOPCOUNT&!"
end

"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
0

#3 User is offline   Mr Goof 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 10
  • Joined: 14-June 05

Posted 08 January 2013 - 02:21 AM

thanks a bunch I will look into these
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users