Skip to content

Version 1.8

Techcraft7 edited this page Dec 25, 2020 · 11 revisions

1.8

The whole program was rewritten, all of the syntax was changed.

NEW SYNTAX

Semicolons!

             |
             V
write("hey!");

Functions

function sayHello(name) {
    write("Hello, " + name + "!");
}
sayHello("7Sharp");

Output

Hello, 7Sharp!

Loops

Loop loop

loop (<number>) {
    //do something <number> times
}

While loop

while (<condition>) {
    //do something while <condition> is true
}

Variables

Super easy! No types!

myVar = 10;

Do complex math! (Thanks to CodingSeb.ExpressionEvaluator)!

myVar = PI * 123 / (1337 + sin(42));

Flow statements

If/else/elseif

if (1 + myvar == 2) {
    //do something
} else if (2 + 2 == myvar) {
    //do something else
} else {
    //do another thing
}

Break/Continue

Continue
loop (10) {
   if (getLoopIndex() == 5) {
        continue;
   }
   write(getLoopIndex());
}
Output
0
1
2
3
4
6
7
8
9
Break
a = 0;
while (a < 10) {
   if (a == 3) {
        a = 1337;
        break;
   }
   write(a);
   a++;
}
write("Outside: " + a);
Output
0
1
2
Outside: 1337

COLORS!

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)

Example to view every color option!

loop (16) {
    bgColor(getLoopIndex());
    loop (16) {
        write("Colorful!");
        fgColor(getLoopIndex());
    }
}

Built in functions

  • write(string); Print text
  • read(string); Get input
  • getLoopIndex(); Get index of loop
  • fgColor(ConsoleColor); Set text color
  • bgColor(ConsoleColor); Set background color

Shell

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>

Shell commands

  • run run code
  • edit edit code (opens editor)
  • load <path> load file at <path> into the editor
  • save <path> save code in editor to <path>
  • clear clear the screen
  • exit close 7Sharp
  • help show help text (shows this list)

Clone this wiki locally