Check out Alice Chess, our featured variant for June, 2024.


[ Help | Earliest Comments | Latest Comments ]
[ List All Subjects of Discussion | Create New Subject of Discussion ]
[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]

Single Comment

Game Courier Developer's Guide. Learn how to design and program Chess variants for Game Courier.[All Comments] [Add Comment or Rating]
🕸📝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.