This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-03-25 03:33:12

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

QuickSilver, a programming language WITHIN Scratch!

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:

Code:

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:

Code:

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!

Code:

To print Hello World
PRINT$
Hello World
STOP

Variables

Variables

To make a variable, you type:

Code:

%<variable name here>

To access a variable, you type:

Code:

^%<variable name here>

Here are all the variable commands:

Code:

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:

Code:

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:

Code:

Telepoint explanation: infinite loop, will print Hi! forever
$loop
PRINT$
Hi!
JMP
^$loop
STOP

Code:

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)


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#2 2011-03-25 07:34:56

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: QuickSilver, a programming language WITHIN Scratch!

This program calculates pi. The REPEAT input basically asks how accurate the calculation should be. But, accuracy means it takes longer to run.

Code:

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#

Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#3 2011-03-25 12:28:54

Earthboundjeff
Scratcher
Registered: 2010-09-28
Posts: 1000+

Re: QuickSilver, a programming language WITHIN Scratch!

It's a Programming Language within a Programming Language within a Programming Language!


https://encrypted-tbn0.google.com/images?q=tbn:ANd9GcR1SONrHUmdKZXQNDgtN_vpycOOo-BDMfnlqHZRA1lMpYXhX7Jc

Offline

 

#4 2011-03-25 12:29:14

puppetadventurer
Scratcher
Registered: 2011-02-20
Posts: 1000+

Re: QuickSilver, a programming language WITHIN Scratch!

confusing


3

Offline

 

#5 2011-03-25 16:06:54

applejack
Scratcher
Registered: 2010-03-23
Posts: 100+

Re: QuickSilver, a programming language WITHIN Scratch!

coo! I should make something like it!


http://i.imgur.com/zKzps.png
http://blocks.scratchr.org/API.php?action=onlineStatus&amp;type=square&amp;user=applejack -I'm http://blocks.scratchr.org/API.php?action=onlineStatus&amp;type=text&amp;user=applejack

Offline

 

#6 2011-03-26 07:21:57

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: QuickSilver, a programming language WITHIN Scratch!

puppetadventurer wrote:

confusing

How so?


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#7 2011-03-26 08:35:16

Servine
Scratcher
Registered: 2011-03-19
Posts: 1000+

Re: QuickSilver, a programming language WITHIN Scratch!

what? It is very confusing


http://bluetetrarpg.x10.mx/usercard/?name=Servine

Offline

 

#8 2011-03-27 02:50:21

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: QuickSilver, a programming language WITHIN Scratch!

It's a programming language. Like QBASIC or LOGO.


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#9 2011-03-29 10:28:21

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: QuickSilver, a programming language WITHIN Scratch!

Code:

#PRINT$#Bump.#STOP#

Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#10 2011-04-13 06:01:44

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: QuickSilver, a programming language WITHIN Scratch!

Update:

•Added JMP feature


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#11 2011-04-14 10:14:05

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: QuickSilver, a programming language WITHIN Scratch!

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.


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#12 2011-04-14 11:15:04

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: QuickSilver, a programming language WITHIN Scratch!

Sample codes:

Code:

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)


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#13 2011-04-17 07:53:16

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: QuickSilver, a programming language WITHIN Scratch!

Code:

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:

Code:

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#

Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#14 2011-04-17 10:30:42

rdococ
Scratcher
Registered: 2009-10-11
Posts: 1000+

Re: QuickSilver, a programming language WITHIN Scratch!

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!  lol

QuickSilver has a little hard syntax -- I don't have much to say.

Offline

 

#15 2011-04-17 11:15:30

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: QuickSilver, a programming language WITHIN Scratch!

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!  lol

QuickSilver has a little hard syntax -- I don't have much to say.

Really? How so?


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

Board footer