Check out Modern Chess, our featured variant for January, 2025.

Enter Your Reply

The Comment You're Replying To
🕸Fergus Duniho wrote on Tue, Jun 21, 2016 05:08 PM UTC:

I'm planning to make some changes to how variables work in GAME Code. In practice, the distinction between my and local variables has been a moot one. Both are given the narrowest scope when created, and they differ in whether they are lexically scoped to the current subroutine (my) or to the main scope (local). This difference makes local variables visible to any functions they call. In general, it is a bad idea to use local variables in this way. The basic idea behind a local variable in other languages is that it will be local to the function it is created in, and it will not be visible to other functions. So, my variables are what actually work like local variables in other languages. Also, my variables are quicker to access. So, I plan to remove what I have called local variables and use the name local for my variables. For the sake of not breaking old code, I'll treat my and local as synonyms. So, the available variable scopes will just include global, local, and static, where global has wide/main scope, local has narrow/subroutine scope, and static has wide/subroutine scope. Narrow/main scope, which is currently called local, will be removed.

I also want to provide better support for multidimensional arrays. I don't like the setelem command. I would rather do something like set var[key] "something or other". While I can currently use something like var[key] as a variable name, doing so won't currently create an array element. I want it to add an element to an actual array that will be recognized by functions that work with arrays. I also want to be able to replace key with a variable, such as var[#key]. This will require some changes to line parsing.


Edit Form

Comment on the page Game Courier Developer's Guide

Conduct Guidelines
This is a Chess variants website, not a general forum.
Please limit your comments to Chess variants or the operation of this site.
Keep this website a safe space for Chess variant hobbyists of all stripes.
Because we want people to feel comfortable here no matter what their political or religious beliefs might be, we ask you to avoid discussing politics, religion, or other controversial subjects here. No matter how passionately you feel about any of these subjects, just take it someplace else.
Avoid Inflammatory Comments
If you are feeling anger, keep it to yourself until you calm down. Avoid insulting, blaming, or attacking someone you are angry with. Focus criticisms on ideas rather than people, and understand that criticisms of your ideas are not personal attacks and do not justify an inflammatory response.
Quick Markdown Guide

By default, new comments may be entered as Markdown, simple markup syntax designed to be readable and not look like markup. Comments stored as Markdown will be converted to HTML by Parsedown before displaying them. This follows the Github Flavored Markdown Spec with support for Markdown Extra. For a good overview of Markdown in general, check out the Markdown Guide. Here is a quick comparison of some commonly used Markdown with the rendered result:

Top level header: <H1>

Block quote

Second paragraph in block quote

First Paragraph of response. Italics, bold, and bold italics.

Second Paragraph after blank line. Here is some HTML code mixed in with the Markdown, and here is the same <U>HTML code</U> enclosed by backticks.

Secondary Header: <H2>

  • Unordered list item
  • Second unordered list item
  • New unordered list
    • Nested list item

Third Level header <H3>

  1. An ordered list item.
  2. A second ordered list item with the same number.
  3. A third ordered list item.
Here is some preformatted text.
  This line begins with some indentation.
    This begins with even more indentation.
And this line has no indentation.

Alt text for a graphic image

A definition list
A list of terms, each with one or more definitions following it.
An HTML construct using the tags <DL>, <DT> and <DD>.
A term
Its definition after a colon.
A second definition.
A third definition.
Another term following a blank line
The definition of that term.