Skip to content

builtins and basic use

Ccode-lang edited this page Nov 18, 2021 · 5 revisions

Important!

  • Don't use a function as a argument for a function. Please store the function output in a variable.
  • All types used for variables in JavaScript can be used in Ccode.

Included commands

Print syntax:

print('hi')

Import syntax:

import <module name>

This will import all functions from that module.
See how this works in imports.cc.

Variables syntax1:

set h = 5

Syntax2:

h = 5

If statements syntax:

if h == 5 {  
print 'hi'  
}  
elif h == 4 {   
print 'bye'  
}  
else {  
print 'hello'  
}  

Input syntax:

input(">>")
// or
h = input(">>")

This gets user input and stores it in the given variable.

Sleep syntax:

// use seconds
sleep(5)

Inline javascript

js <js command> js

While syntax:

while h == 1 {  
print 'hi'  
}  

Functions

Declaration

func test(num1, num2) {
  print num1 + num2
}

Using function

test(1, 2)

Comments

// This is a comment
``

Welcome to the Ccode language wiki!

Clone this wiki locally