-
Notifications
You must be signed in to change notification settings - Fork 4
Version 1.8
Techcraft7 edited this page Dec 25, 2020
·
11 revisions
The whole program was rewritten, all of the syntax was changed.
|
V
write("hey!");function sayHello(name) {
write("Hello, " + name + "!");
}
sayHello("7Sharp");Hello, 7Sharp!
loop (<number>) {
//do something <number> times
}while (<condition>) {
//do something while <condition> is true
}Super easy! No types!
myVar = 10;
Do complex math! (Thanks to CodingSeb.ExpressionEvaluator)!
myVar = PI * 123 / (1337 + sin(42));
If/else/elseif
if (1 + myvar == 2) {
//do something
} else if (2 + 2 == myvar) {
//do something else
} else {
//do another thing
}loop (10) {
if (getLoopIndex() == 5) {
continue;
}
write(getLoopIndex());
}0
1
2
3
4
6
7
8
9
a = 0;
while (a < 10) {
if (a == 3) {
a = 1337;
break;
}
write(a);
a++;
}
write("Outside: " + a);0
1
2
Outside: 1337
See ConsoleColor for colors (works with numbers too!)
Names should be ALL_CAPS_WITH_WORDS_SEPERATED_BY_UNDERSCORES.
Ex: DARK_BLUE
fgColor(COLOR)bgColor(COLOR)
loop (16) {
bgColor(getLoopIndex());
loop (16) {
write("Colorful!");
fgColor(getLoopIndex());
}
}-
write(string);Print text -
read(string);Get input -
getLoopIndex();Get index of loop -
fgColor(ConsoleColor);Set text color -
bgColor(ConsoleColor);Set background color
7Sharp opens to a shell that can be used to edit, save, and load 7Sharp files, as well as a few other things. It looks like:
7Sharp>
-
runrun code -
editedit code (opens editor) -
load <path>load file at<path>into the editor -
save <path>save code in editor to<path> -
clearclear the screen -
exitclose 7Sharp -
helpshow help text (shows this list)
