QuickSilver is a programming language within Scratch. It features variable spawning and naming, a unique Telepoint system for flow control, and a compiler and decompiler to share coding!
Tutorial
Running a Program
There are two ways to run a QuickSilver program:
Dev Run
To Dev Run, you first type your program out on a plaintext document (TextEdit in Macs, NotePad in windows), and save it on the Desktop. To run it, show the list named Program, right-click it, and select import, and then navigate to your file. Then, press the green flag, and type R in the text box. This method is the best for making a program.
Presentation Run
If you want to run a program by someone else, ask them to post the compilation. It will look like this:
Testing#PRINT$#Hello world#STOP
Simply press the green flag, type D, and then paste that coding in the ask box. Then, press the green flag again, and type R.
By the way, to compile a program you just ran, press the green flag, and type C. Then copy the coding that appears at the bottom of the list Terminal.
Syntax:
QuickSilver coding has simple syntax. The first line of any code is dedicated to a title/note, and is ignored. Then, you type a command or a Telepoint. I will explain Telepoints later. Any command will have one or many arguments. You type each argument in a new line. Example:
CLS [clears terminal] PRINT$ [means print string] Hello world [text to print]
Any code will end with 'STOP', which stops the script. Finally, no text (title, variable/telepoint names, print/input text) in the coding can contain the hash (#), or your compiler will mess up.
That's pretty much it!
To print Hello World PRINT$ Hello World STOP
Variables
Variables
To make a variable, you type:
%<variable name here>
To access a variable, you type:
^%<variable name here>
Here are all the variable commands:
SET ^%<var name> <value> INPUT <text to display for input> ^%<var name> + <can be replaced with -,*,/,^,MOD> ^%<var to store result in> <variable or number> <variable or number> PRINTV ^%<var name> JOIN ^%<variable to store answer in> <variable or string> <variable or string> GETLETTER ^%<variable to store answer in> <variable/number> <variable or string> $//note//Basically this one is the (letter (1) of [hello]) block. LENGTH <variable to store result in> <variable or string>
Operators can access variables and constants.
Telepoints
A Telepoint is a marker in a script:
To explain Telepoints $This_is_a_telepoint
They start with a $.
Telepoints are best used for flow control, but can also help clean up coding. Here's how you can use a Telepoint in flow control:
Telepoint explanation: infinite loop, will print Hi! forever $loop PRINT$ Hi! JMP ^$loop STOP
To explain Telepoints %n %x INPUT How many times to I print hi? %x $loop <= Telepoint name PRINT$ Hi! BRANCH< <can be replaced with = or >, too> <= Branch command ^%n ^%x ^$loop <= Telepoint to jump to STOP
The BRANCH command tells you to go to the labelled Telepoint if the condition (v1 =/>/< v2) is fulfilled.
Last edited by Hardmath123 (2011-04-17 07:04:59)
Offline
This program calculates pi. The REPEAT input basically asks how accurate the calculation should be. But, accuracy means it takes longer to run.
Calculating pi#CLS#%pi#%6#%2#%even#%odd#%*6#%stored#SET#^%stored#1#SET#^%6#2#SET#^%2#2#SET#^%EVEN#0#SET#^%ODD#1#%REPEAT#INPUT#Repeat how many times?#^%REPEAT#%n#%1#SET#^%1#1#$loop#+#^%n#^%n#^%1#$*************#+#^%EVEN#^%EVEN#^%2#/#^%*6#^%EVEN#^%ODD#*#^%stored#^%stored#^%*6#*#^%pi#^%stored#^%6#+#^%ODD#^%ODD#^%2#/#^%*6#^%EVEN#^%ODD#*#^%stored#^%stored#^%*6#*#^%pi#^%stored#^%6#$***************#PRINTV#^%pi#^%REPEAT#BRANCH<#^%n#^%REPEAT#^$loop#PRINTV#^%pi#STOP#
Offline
It's a Programming Language within a Programming Language within a Programming Language!
Offline
confusing
Offline
puppetadventurer wrote:
confusing
How so?
Offline
It's a programming language. Like QBASIC or LOGO.
Offline
#PRINT$#Bump.#STOP#
Offline
Update:
•Added JMP feature
Offline
Major update:
•Operators can now operate with variables AND numbers: You can to x + 1, while before you could only do x+y
•Added mod and exponents
•Added strings. Now uses JOIN, LENGTH, and GETLETTER.
Changed default program yet again.
Offline
Sample codes:
Calculates π Calculating pi#CLS#%pi#%6#%2#%even#%odd#%*6#%stored#SET#^%stored#1#SET#^%6#2#SET#^%2#2#SET#^%EVEN#0#SET#^%ODD#1#%REPEAT#INPUT#Repeat how many times?#^%REPEAT#%n#%1#SET#^%1#1#$loop#+#^%n#^%n#^%1#$*************#+#^%EVEN#^%EVEN#^%2#/#^%*6#^%EVEN#^%ODD#*#^%stored#^%stored#^%*6#*#^%pi#^%stored#^%6#+#^%ODD#^%ODD#^%2#/#^%*6#^%EVEN#^%ODD#*#^%stored#^%stored#^%*6#*#^%pi#^%stored#^%6#$***************#PRINTV#^%pi#^%REPEAT#BRANCH<#^%n#^%REPEAT#^$loop#PRINTV#^%pi#STOP# Prints times tables from 0x0 to 12x12 This program prints the times tables up to 12*12#CLS#%r1#%r2#%p#%x#%12#SET#^%12#13#$r1#$r2#*#^%x#^%r1#^%r2#JOIN#^%p#^%r1# times #JOIN#^%p#^%p#^%r2#JOIN#^%p#^%p# equals to #JOIN#^%p#^%p#^%x#PRINTV#^%p#+#^%r1#^%r1#1#BRANCH<#^%r1#^%12#^$r1#SET#^%r1#0#+#^%r2#^%r2#1#BRANCH<#^%r2#^%12#^$r2#PRINT$#Now memorize them!#STOP# Calculates e Calculate 'e'#PRINT$#I will now calculate 'e'!#CLS#%n#%1#%1/n#%(1/n)+1#%((1/n)+1)^n#%result#SET#^%1#1#INPUT#What should n be?#^%n#$////////////////////////////#$loop#+#^%n#^%n#^%1#$****************************#$*****THE***CALCULATION******#$****************************#/#^%1/n#^%1#^%n#+#^%(1/n)+1#^%1/n#^%1#^#^%((1/n)+1)^n#^%(1/n)+1#^%n#PRINTV#^%((1/n)+1)^n#$\\\\\\\\\\\\\\\\\\\\\\\\\\\\#JMP#^$loop#STOP# Calculates phi (the golden ratio) Calculates the golden ratio. Uses Fibonnachi sequence.#CLS#%n1#%n2#%ratio#%NUMBERTO#INPUT#Upto what number?#^%NUMBERTO#SET#^%n1#1#SET#^%n2#0#$loop#+#^%n2#^%n1#^%n2#+#^%n1#^%n1#^%n2#/#^%ratio#^%n1#^%n2#PRINTV#^%ratio#BRANCH<#^%n1#^%NUMBERTO#^$loop#STOP#
Last edited by Hardmath123 (2011-04-14 11:15:33)
Offline
Factorial %n INPUT What should I find the factorial of? ^%n %x SET ^%x 1 $/////// $loop * ^%x ^%x ^%n - ^%n ^%n 1 BRANCH< 0 ^%n ^$loop PRINTV ^%x STOP
Compiled:
Factorial#%n#INPUT#What should I find the factorial of?#^%n#%x#SET#^%x#1#$///////#$loop#*#^%x#^%x#^%n#-#^%n#^%n#1#BRANCH<#0#^%n#^$loop#PRINTV#^%x#STOP#
Offline
Earthboundjeff wrote:
It's a Programming Language within a Programming Language within a Programming Language!
No...
QuickSilver Scratch Modified Squeak Normal Squeak Smalltalk C#/C++/C MS-DOS Normal Computer Technology Existance of technology Existance of the Earth Existance of the Big Bang Existance of Space. That's a programming language in a programming language in a programming language based on a programming language which is based on a programming language in a programming language in a programming language in technology in technology in existance of earth in existance of the big bang and the existance of Space!
QuickSilver has a little hard syntax -- I don't have much to say.
Offline
rdococ wrote:
Earthboundjeff wrote:
It's a Programming Language within a Programming Language within a Programming Language!
No...
QuickSilver Scratch Modified Squeak Normal Squeak Smalltalk C#/C++/C MS-DOS Normal Computer Technology Existance of technology Existance of the Earth Existance of the Big Bang Existance of Space. That's a programming language in a programming language in a programming language based on a programming language which is based on a programming language in a programming language in a programming language in technology in technology in existance of earth in existance of the big bang and the existance of Space!![]()
QuickSilver has a little hard syntax -- I don't have much to say.
Really? How so?
Offline