Category:Corescript: Difference between revisions

describe print
No edit summary
(describe print)
 
(5 intermediate revisions by 2 users not shown)
Line 1:
{{language}}
Corescript is a simple interpreted language that has been implemented in several languages.
Github: https://github.com/corescript-lang
 
Corescript is a simple programming language inspired
It is based off of Microsoft Batch and Javascript.
by Windows Batch, JS, and MIT's Scratch.
The initial version, Corescript0, has a very bare bones syntax, and
is limited on what it can do.
```
input name = What's your name?
:top
print Hello, (name)!
print Hello, World!
goto top
```
 
The main idea was to work with `print Hello World`. No
The first version, implemented in 2017, leaned toward Scratch's
parenthesis, just like Batch.
design.
 
All the Corescript interpreters/compilers are
The first version was implemented in Javascript as an online tool,
available here as open-source:
but later versions were implemented in C#, Go, and C.
Github: https://github.com/corescript-lang
 
== The Language ==
# Corescript1
ForThe initial version, Corescript to0, behas morea flexiblevery andbare usablebones syntax, a better
yet is very simple and easy to learn.
version had to be implemented. It should maintain the same ideas
as the original version, but be able to do complex things like Python.
 
This pageHere is unfinished,a solink here is ato textan example ofprogram:
https://raw.githubusercontent.com/corescript-lang/explaination/master/programs/classicexample.corescript
what Corescript1 will look like:
 
The first version, implemented in May 2017, leaned toward Scratch's
```
design.
# This is an array
var names = ["Jim", "Bob"]
 
The first version was implemented in Javascript as an online tool,
# This is a function
but later versions were also implemented in C#, Go, and C.
function printNames:
loop names as name:
print name
 
# Print names
printNames names
 
# Print first name
function firstName array:
return array[0]
 
var name = firstName names
if name = "Bob":
print "First name is Bob"
 
The new JS version has been released and can be used here:
# This is a 10x10 hashtag cube
https://corescript-lang.github.io/editor/
repeat 10:
repeat 10:
print "#"
print "\n"
# Functions such as print, var are reserved
function print string:
print string
# Output: Reserved function name
```
Anonymous user