You can help CodeWalrus stay online by donating here. | New CodeWalrus | Old (dark mode) | Old (light) | Discord server

Configuration format

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

0
b/[Inactive] Ninjabyte Electronics (hardware) publicado por u/DarkestEx November 16, 2015, 09:57:59 PM
So I guess we will also have a so called Claw Data Notation to have easily editable configuration files that will be used by the OS and the games to store highscores and savegames and to load levels from.

It will have arrays of numbers, numbers, strings and booleans and uses key-value pairs.
Comments are there too. The overall style will be similar to Claw.
I think I will also make it possible to compile it into bytecode too so that it loads faster but then the possibility of editing it easily is lost.

Here is a sample:

name = "Sample"  -- this is a comment
levels = [1,2,3,4,5223,4,3,2,22,45,243,34,564,2,4,55,63,24,35,244,56,23,532,556,25562,252,224,25,24]  -- note that we only have one dimensional arrays, but we can always use y*width+x or level*level_size+offset to make a two dimensional array out of it.
level_size = 5
hard_level = true  -- will eval to numeric 1, also we can use A-Za-z0-9_ for names

Last Edit: November 16, 2015, 11:20:50 PM by DarkestEx
Inicia sesión o crea una cuenta para dejar un comentario
u/Dream of Omnimaga November 16, 2015, 10:16:53 PM
Will those Claw files be hosted in games/gamename folders like C games data?
u/DarkestEx November 16, 2015, 10:24:21 PM
Quote from: DJ Omnimaga on November 16, 2015, 10:16:53 PM
Will those Claw files be hosted in games/gamename folders like C games data?
Yes they will. C games are also encouraged to use the same format and we will, as we implement the parser in C anyways, provide an API to easily use this format in C too. Claw will have bindings for it too.
Last Edit: November 16, 2015, 10:36:02 PM by DarkestEx
u/Dream of Omnimaga November 16, 2015, 10:34:54 PM
Yeah it would be better if games all used the same format, providing that it's not a nightmare to send stuff like it was on the HP Prime (although most HP issues are due to using a proprietary linking software instead of mass storage device). Just make sure that games use separate sub-folders so that they can't overwrite each others.
u/DarkestEx November 16, 2015, 10:36:46 PM
Quote from: DJ Omnimaga on November 16, 2015, 10:34:54 PM
Yeah it would be better if games all used the same format, providing that it's not a nightmare to send stuff like it was on the HP Prime (although most HP issues are due to using a proprietary linking software instead of mass storage device). Just make sure that games use separate sub-folders so that they can't overwrite each others.
Yes that is what I thought too.


By the way, should the assignment character be? = or :
= is more similar to Claw or C

Here are both in comparison:

With :

name: "Sample"  -- this is a comment
levels: [1,2,3,4,5223,4,3,2,22,45,243,34,564,2,4,55,63,24,35,244,56,23,532,556,25562,252,224,25,24]  -- note that we only have one dimensional arrays, but we can always use y*width+x or level*level_size+offset to make a two dimensional array out of it.
level_size: 5
hard_level: true  -- will eval to numeric 1, also we can use A-Za-z0-9_ for names


And with =

name = "Sample"  -- this is a comment
levels = [1,2,3,4,5223,4,3,2,22,45,243,34,564,2,4,55,63,24,35,244,56,23,532,556,25562,252,224,25,24]  -- note that we only have one dimensional arrays, but we can always use y*width+x or level*level_size+offset to make a two dimensional array out of it.
level_size = 5
hard_level = true  -- will eval to numeric 1, also we can use A-Za-z0-9_ for names


The whitespace around the : or = is ignored in any case.
u/Dream of Omnimaga November 16, 2015, 10:39:59 PM
Go with =. Much more common and from experience with the HP Prime, having to type := or even : seems to be annoying when used to = for so long.
u/DarkestEx November 16, 2015, 11:20:13 PM
Quote from: DJ Omnimaga on November 16, 2015, 10:39:59 PM
Go with =. Much more common and from experience with the HP Prime, having to type := or even : seems to be annoying when used to = for so long.
Alright I think so too :)
u/alexgt November 17, 2015, 12:17:54 AM
Quote from: DJ Omnimaga on November 16, 2015, 10:39:59 PM
Go with =. Much more common and from experience with the HP Prime, having to type := or even : seems to be annoying when used to = for so long.
Lol, I program on calc so I just code with the -> sign still, I guess that it is a habit from Ti-Basic.

But yeah Dark go with = instead of the others like DJ said ;)
u/DarkestEx November 17, 2015, 01:31:36 AM
Quote from: alexgt on November 17, 2015, 12:17:54 AM
Quote from: DJ Omnimaga on November 16, 2015, 10:39:59 PM
Go with =. Much more common and from experience with the HP Prime, having to type := or even : seems to be annoying when used to = for so long.
Lol, I program on calc so I just code with the -> sign still, I guess that it is a habit from Ti-Basic.

But yeah Dark go with = instead of the others like DJ said ;)
Alright I'll do. I hope this configuration format is straight forward to use and change.
u/novenary November 17, 2015, 09:18:42 AM
I know a lot of configuration formats that use : instead of =, at any rate I prefer the latter and hate := (which has a different meaning than = in make by the way).
u/DarkestEx November 17, 2015, 10:13:33 AM
Quote from: Streetwalrus on November 17, 2015, 09:18:42 AM
I know a lot of configuration formats that use : instead of =, at any rate I prefer the latter and hate := (which has a different meaning than = in make by the way).
Well we were never going to use := anyways. So we will use = for the configuration.

How do you all like the configuration format so far?
u/Dream of Omnimaga November 22, 2015, 07:41:42 AM
Actually, now that I see alexgt post, -> would be nice as well if it was supported, because TI-BASIC programmers would get used to it faster. However, it really has to be -> and not a special character like on calculators, so that it's easier to type on a computer keyboard. But if you support -> then perhaps = should be supported as well for those who are more used to computer languages.

As for the configuration format, I am ok with it.
u/DarkestEx July 24, 2016, 03:45:25 PM
Quote from: DJ Omnimaga on November 22, 2015, 07:41:42 AM
Actually, now that I see alexgt post, -> would be nice as well if it was supported, because TI-BASIC programmers would get used to it faster. However, it really has to be -> and not a special character like on calculators, so that it's easier to type on a computer keyboard. But if you support -> then perhaps = should be supported as well for those who are more used to computer languages.

As for the configuration format, I am ok with it.
Given that this configuration format will still be implemented into Claw, though I don't know if the arrow will be implemented as I don't know if we will implement the configuration module in the TI-84+ version at all.
u/Dream of Omnimaga July 24, 2016, 03:58:29 PM
Just make sure to choose programming characters that don't require the user to constantly open Windows Character Map and searching for special characters there every second or so. On the HP Prime it was kinda annoying that some of the most rudimentary characters required doing that and it considerably slowed down program writing.
u/DarkestEx July 24, 2016, 04:02:55 PM
Quote from: DJ Omnimaga on July 24, 2016, 03:58:29 PM
Just make sure to choose programming characters that don't require the user to constantly open Windows Character Map and searching for special characters there every second or so. On the HP Prime it was kinda annoying that some of the most rudimentary characters required doing that and it considerably slowed down program writing.
It'll be a simple equal sign. I don't really plan supporting writing Claw code on a Calc.
Start a Discussion

b/[Inactive] Ninjabyte Electronics (hardware)

Official board about Ninjabyte hardware projects, such as their Z80 computer.

10
Topics
Explore Board
Website statistics


MyCalcs | Ticalc.org | Cemetech | Omnimaga | TI-Basic Developer | MaxCoderz | TI-Story | Casiocalc.org | Casiopeia | The Museum of HP Calculators | HPCalc.org | CnCalc.org | Music 2000 Community | TI Education | Casio Education | HP Calcs | NumWorks | SwissMicros | Sharp Calculators
Powered by EzPortal