LiveCode - What is it? 1. What is LiveCode? Who uses it? 2. How Easy is it? 3. What Apps and Programs can you write with it?
1. What is LiveCode? LiveCode is an easy, English-like, object-oriented, event-driven programming language. Despite it's simplicity, it is a powerful, full featured language with over 2,000 commands and behaviors. It is used by many corporations, government agencies, academic institutions and school systems.
The community version is free, open source and actively being enhanced and extended. It deploys programs on every platform including Windows, OS/X, Linux, iOS, Android and even HTML as standalone. (Standalone means that it will run on any computer. You do not need to have or install LiveCode to run them). The newest version has a Foreign Function Interface (FFI) allowing it to run native Javascript and Java Classes. More interfaces are coming
Who is using it? - Some of the customers using it.(includes NASA, KLM Airlines, Univ. of Vienna, BYU, NY Law School, etc) Review of It - Review: It's Freaking Incredible Turing Festival - Presentation at the Turing Festival where the CEO builds an app in 3 minutes
PCWorld Review - another review ... but there are others better and newer (Do a Google Search)
Livecode is basically English commands. Even though it is a powerful, full-featured, object-oriented and event-driven language, it is easy to read, write and debug. It is like writing in psuedo-code. You can concentrate on the program and not the language.
You program in LiveCode as you do with other languages. The syntax is relaxed and the command set is English-like.
A few of the commands in LiveCode: (See how English-like they are, it is just like talking. Yes, programming can be that easy)
if yourAnswer is "Yes" then do this else do that subtract 10 from field "score" move image "bird" to 100,238 in 2 secs go to card "instructions" answer "Do you want to play?" with "Yes" or "No" intersect (image "arrow" , image "apple") revSpeak ("Good morning, how are you today.")
The following is actual code that will run on PC computers, Apple computers, Linux computers, iOS devices (iPhone, iPad) and Android devices (smartphones, tablets) or in a web browser. These were all written by high school students (grades 9-12, ages 13-17).
Not knowing the language, look at the actual examples below and see if you can understand what is going on.
on openCard put 10 into field "tries left" end openCard
on GuessMyNumber
local myNum, guess (these are variables where we save the original number and the guesses)
put random(100) into myNum (this has the computer pick a random number between 1 and 100)
answer "I am thinking of a number from 1 to 100, would you like to try to guess it in 10 tries?" with "No" or "Yes"
if it is "Yes" then
repeat for 10 times
ask "Try again, what is your guess?"
put it into guess
if guess < myNum then answer "Your answer is too low, guess higher" if guess > myNum then answer "Your answer is too high, guess lower" if guess = myNum then
answer "Good job, you guessed it"
exit GuessMyNumber
end if subtract 1 from field "tries left"
end repeat
end if
answer "10 guesses are up. The answer was " & theNumber
put 10 into field "tries left"
B. Children's Matching Game ("drag and drop")
In this first screen, you have to match the animals on the right to the ones on the left. For each animal, you hold the mouse button down to drag it and release the button to "drop" it. If you drop it in the wrong place, it just goes back to it's start
Here is all the code that you need:
(this code goes on the cow)
if intersect ( image "cow 1" , image "cow 2") then
// if you dropped "cow 1" on to "cow 2", then you got it right
answer "Good job. You matched the cows"
// if not correct, move "cow 1" back to the start - to location 200,200
move the image "cow 1" to 200,200
(this code goes on the pig)
if intersect ( image "pig 1" , image "pig 2") then
answer "Good job. You matched the pigs"
move the image "pig 1" to 200,300
In this second screen, you have to put the animals on the right with its friends on the left. For each animal, you hold the mouse button down to drag it and release the button to "drop" it. If you drop it in the wrong place, it just goes back to it's start
(this code goes on the card)
if intersect ( image "sheep" , graphic "rectangle 1") then
move the image "sheep" to 200,100
if intersect ( image "chick" , graphic "rectangle 2") then
move the image "chick" to 200,200
if intersect ( image "sheep" , graphic "rectangle 3") then
move the image "sheep" to 200,300
You use the cursor (arrow) keys on the keyboard to move the mouse. If you run into a wall of the maze, it goes back to the start. The object is to get to the cheese. The maze is hand drawn with lines which are then "grouped" into a group called "maze"
(this code goes on the card)
if x = "right" then // if you pressed the right arrow key, move the mouse right +1 set the right of image "mouse" to the right of image "mouse" + 1 if x = "left" then // if you pressed the left arrow key, move the mouse left -1
set the left of image "mouse" to the left of image "mouse" - 1
set the top of image "mouse" to the top of image "mouse" - 1
set the bottom of image "mouse" to the bottom of image "mouse" + 1
if intersect (image "mouse" , group "maze" ) then move the image "mouse" to 74,27 in 1 sec if intersect (image "mouse" , image "cheese" ) then answer "Hooray, You Win !!)
D. Action Game ( Frogger) You use the cursor (arrow) keys on the keyboard to make the frog move. The object is to get across the highway without being hit by a car
(this code goes on the card)
set the right of image "frog" to the right of image "frog" + 1
set the left of image "frog" to the left of image "frog" - 1
set the top of image "frog" to the top of image "frog" - 1
set the bottom of image "frog" to the bottom of image "frog" + 1
if intersect (image "frog" , image "car" ) then
answer "You lose, play again? " with "No" or "Yes"
move the image "frog" to 100,50
The cars move from right to left and when they go off on the left side of the card, the start again on the right side. They move every 10 millisecs and always are moving whether or not the frog is moving
set the left of image "car" to the left of image "car" - 2
if the left of image "car" < 0 then
set the left of image "car" to the right of the card "road"
send "moveCars" to me in 10 millisecs
E. Stock Quote App/Widget
This is an app or widget that check the price of your favorite stocks by clicking on the button
The following code is what is on the Apple (AAPL) button:
on mouseUp local x // get the latest quotes from Yahoo finance website put url "http://finance.yahoo.com/d/quotes.csv?s=AAPL&f=nbgh" into x put item 1 of line 1 of x into the field "NameAns" put item 2 of line 1 of x into the field "BidAns" put item 3 of line 1 of x into the field "HighAns" put item 4 of line 1 of x into the field "LowAns" end mouseUp
For more examples and code samples go here
F. Animal Wizard Animal Wizard Knows Every Animal on the Planet !! That is an exaggeration right now, but it does know a lot of them.
If you tell it the first letter of the animal you are thinking of, it will guess the animal. If it does not guess it, it will add it to its list and know about it the next time you run it.
It learns from you.
3. What Apps and Programs Can You Write, What Has Been Written In LiveCode?
The following is what we have done in class, and you can also learn to do:
Data/BigData - How popular is your name? How many people in the US have the same name? DigitalMagic - Add people/remove people from photographs, change backgrounds easily with code Chat Room - Build your own chat room, web server, mail client, or completely new Internet protocol
The following is what other people have done: (older)
Games - Apps - Written by students like you, download and play them on your PC/Mac computer,
1001 Things To Do - See a wide range of programs and games written by other people. You will be amazed at what all can be done with a few lines of code
Apps in LiveCode - (see the apps listed below)
This is an incomplete listing because most apps do not advertise their base language. These are Apps from the Apple App Store people have written and mentioned on the LiveCode Forums. This is what I have been able to find...
Customers/Developers
Posts:
Etud - (Free) Business, Turkish
Many Educational Apps listed here
BeatSpeak - a talking multilingual metronome
EV-Point - electric vehicle recharge station finder - using browser javascript interaction, Google fusion + maps
My dad and I put out "Flat Out Fitness", a fitness timer for high-intensity interval training, that is sold on the App Store, Amazon Marketplace, and Google Play. - App Store - Google Play - Amazon Marketplace
|