Skip to content
View in the app

A better way to browse. Learn more.

MagicDuel Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Help

Featured Replies

I'm envisioning something akin to a multi-player game of chess at a clickie.

I need a reality check on data structures possible within MD before I embark on this big project, and teaching myself the coding details.

Am I correct that we are allowed ONE and only one variable to be universally stored and accessible through a clickie regardless of which player accesses it(using store and retrieve functions)?

But that one variable can be an array?

In the punch-card days, an Array was a numbered list of finite pre-defined length. In MD script it is of variable length, theoretically unlimited, the index number the computer might use is hidden, and an entry is 2-part consisting of "tag" and "data". Tag is text, data is anything. Correct?

A variable not previously filled is "null" not zero?

Is there a practical limit to the size of the array we can store? When does it start impacting server cost or whatever?

(pre-note: I do NOT know MD script but am intrigued that it exists!)

I've made a simple "checkers" type game for one of my programming courses, using a single variable. The challenge was to use a text string, or numeric value to hold the entire array, and for checkers, since it was only one type of "game token" I could use bit-shifting to handle if the space was occupied or not. I never got that working since it requires two types of value (red/black tokens) but did use a text-string to 'encode' the entuire board, with X being black, and O being red, and a - being an epty space. Thus the entire board would be "stored" as "XX--X-O-XX-X-O------O-----X-----, etc."
the maths behind movement were simply shifting the single characters around in functions.

Good luck with your project though! Im wondering if that sort of thing would work for Chess, using letters (capital or not?) for the various rooks, knights, pawns, etc. Hmmm.....

  • Root Admin

[quote name='Fyrd Argentus' timestamp='1296226040' post='78143']
Am I correct that we are allowed ONE and only one variable to be universally stored and accessible through a clickie regardless of which player accesses it(using store and retrieve functions)?
But that one variable can be an array?
[/quote]

Never heard you are only allowed to have one aoau (all object, all user) var. Iv got a tonn for several different things.

It can be an array.

[quote name='Fyrd Argentus' timestamp='1296226040' post='78143']
In the punch-card days, an Array was a numbered list of finite pre-defined length.
In MD script it is of variable length, theoretically unlimited, the index number the computer might use is hidden, and an entry is 2-part consisting of "tag" and "data".
Tag is text, data is anything. Correct?
[/quote]

arrays in mdscript can be undefined length, Allowing for adding in items randomly. the index doesnt really matter, all that matters is the name and what is stored

example

$test = array();
$test[1] = "hello world";
$test[] = "hello";
$test['testing'] = "boo!";

Are all valid (probably, not sure about middle, but im pretty sure it will give the index one higher than previous one given, aka 2)


[quote name='Fyrd Argentus' timestamp='1296226040' post='78143']
A variable not previously filled is "null" not zero?
[/quote]

Yup

[quote name='Fyrd Argentus' timestamp='1296226040' post='78143']
Is there a practical limit to the size of the array we can store?
When does it start impacting server cost or whatever?
[/quote]

Not sure about Server Cost, But when you get a larger variables it will end up causing a memory allocation limit, and the script wont run. Happens when you are dealing with larger amounts of data

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Forum Statistics

  • Total Topics 17.5k
  • Total Posts 182.2k

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.