Skip to content

Using GoCode

Owen2k6 edited this page Sep 25, 2022 · 21 revisions

GoCode Requires GoOS HDD support to be enabled.

What is GoCode

GoCode is a simple coding language used for GoOS in order for users to make apps and maybe even games!

The Source code is entirely open and is located under the run command in kernel.cs

Feel free to contribute!

Basics

GoCode has some simple lines you can do.

e.g \n just means new line fyi

print=hello world - This will print hello world obviously!

variable=1=hello \n input=say hello: \n variable=2={getInput} \n if=1=equals=2=Hello there!=end - This will ask the user to say hello. if they say hello, it responds Hello There! whereas if they say something else, it will close the program.

Variables

GoCode has a maximum of 10 variables to be stored at a time.

the syntax of the command is as followed

variable=Number to store it to 1-10=thing to store

You can store anything within variables but they can only be called by IF and PRINT so far!

Input

GoCode is able to request input from the user.

input has a maximum of 1 argument

input=text - replace text with what you want to ask the user, to them it will show up as text_ the _ representing the OS carrot.

this command releases a store that can be recieved by variables and the print command.

Stores

GoCode has a total of 11 stores so far.

They are as followed

Variables

{1} {2} {3} {4} {5} {6} {7} {8} {9} {10}

Input

{getInput}

For example, in the print command, you can add any of these and it will replace {store} with the correct data when in run mode.

Sleep

GoCode has a sleep command that will halt the code for a set amount of time (in milliseconds)

For example, sleep=1000 would put the thread to sleep for 1 second.

Stop

Want to make the user have to press a key to continue? this line will help

stop=Press any key to continue

this will send a message to the user halting the thread and in dark red Press any key to continue

You can set the string to anything or even leave it blank!

RandomNum

make the OS generate a random number.

example

randomnum=0=10=1 - This will generate a number between 0 and 10 then store it in variable 1

GoCode RandomNum requires a variable to store it to, otherwise it won't work.

Clear

Self explanitory but it clears the console of all text before continuing This line does not require a = or will it ever need one.

clear is all you need to put on one line.

Clone this wiki locally