Skip to content

Commit 83d36d4

Browse files
added documentation and improved features
1 parent 0c5b9a0 commit 83d36d4

File tree

6 files changed

+62
-12
lines changed

6 files changed

+62
-12
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Installing VisualScript is simple.
2+
Download the latest release from here:
3+
https://github.com/Bruceli-iscool/VisualScript/releases/tag/1.0.1
4+
Then extract the zip file.
5+
Your done!
6+
To code VisualScript all you need is notepad.
7+
We, however, prefer Visual Studio Code.
8+
To start create a file with an .vs extension.
9+
Then code in it.
10+
More about that in later chapters.
11+
Then find the VisualScript executable.
12+
Enter the path to your code.
13+
It should run.
14+
Also, you can use built in commands for help.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
After you have installed VisualScript you can start coding!
2+
The most basic feature is log()
3+
usage:
4+
log("Hello World")
5+
This buts Hello World on the console.
6+
Then there is an advanced version of log:
7+
logf
8+
logf prints a formated string to the terminal.
9+
usage:
10+
logf("Hello ", "John")

documentation/Basics/3. variables

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Variable declaration in VisualScript is very simple.
2+
x = "value"
3+
It works the same as Python
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
To draw in a seperate window you can use the art commands.

src/VisualScript.py

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from tkinter import *
66
import turtle
77
import matplotlib.pyplot as plt
8-
import django
8+
import sys
99

1010
tur = turtle
1111

@@ -28,7 +28,11 @@ def process_code(file):
2828
"f":"format",
2929
"x=":"!=",
3030
"delete":"del",
31-
"with_name":"as"
31+
"with_name":"as",
32+
"function":"def",
33+
"toLowerCase":"lower",
34+
"toUpperCase":"upper",
35+
3236

3337

3438

@@ -105,21 +109,44 @@ def chartDot(datasetx, datasety, ytitle, xtitle):
105109
plt.scatter(datasetx, datasety)
106110
plt.xlabel(xtitle)
107111
plt.ylabel(ytitle)
108-
def chartScatter(datasetx, datasety):
112+
def chartScatter(datasetx, datasety, xtitle, ytitle):
109113
timesx = len(datasetx)
110114
for i in range(timesx):
111115
plt.scatter(datasetx[i], datasety[i])
112-
116+
plt.xlabel(xtitle)
117+
plt.ylabel(ytitle)
118+
plt.show
119+
def chartTheme(theme):
120+
plt.style(theme)
121+
return
113122
def windowTitle(title):
114123
window.title(title)
115124
return
116125
def ArtBoardTitle(name):
117126
screen = turtle.Screen()
118127
screen.title(name)
119128
return
129+
120130
def ChartShow():
121131
plt.show()
122132
return
133+
def logf(value, formatedvalue):
134+
print(value+"{}".format(formatedvalue))
135+
return
136+
def returnMedian(list, chart):
137+
sortedlist = sorted(list)
138+
middle_value = len(sortedlist) // 2
139+
final = (sortedlist[middle_value] + sortedlist[~middle_value]) / 2 # Use / for average
140+
if chart.lower() == 'y':
141+
plt.plot(final, final)
142+
plt.show()
143+
else:
144+
pass
145+
return final
146+
def exit():
147+
sys.exit()
148+
149+
123150

124151

125152

src/example.vs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
// this is a comment
2-
get tkinter with_name john
3-
log("Hello, World")
4-
5-
log(add(1, 2))
6-
chartLine([1, 2, 3, 4], [2, 4, 6, 8], "", "")
7-
x = [1, 2, 3]
8-
y = [1, 2, 3]
9-
chartScatter(x, y)
2+
list = [1, 2, 3, 4, 5, 6 , 7, 8, 9, 10, 10, 12, 11]
3+
x = returnMedian(list, "y")
4+
log(x)

0 commit comments

Comments
 (0)