This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
display.setStatusBar( display.HiddenStatusBar ) | |
local slotsGroup = display.newGroup() | |
local machineGroup = display.newGroup() | |
local _W = display.contentWidth | |
local _H = display.contentHeight | |
local mr = math.random | |
local credit = 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
var contacts = [ | |
{ name: "Contact 1", address: "1, a street, a town, a city, AB12 3CD", tel: "5555555555", email: "myemail.me.com", type: "family" }, | |
{ name: "Contact 2", address: "2, a street, a town, a city, AB12 3CD", tel: "4444444444", email: "youremail.me.com", type: "friend" }, | |
{ name: "Contact 3", address: "3, a street, a town, a city, AB12 3CD", tel: "3333333333", email: "theiremail.me.com", type: "friend" }, | |
{ name: "Contact 4", address: "4, a street, a town, a city, AB12 3CD", tel: "2222222222", email: "hisemail.me.com", type: "colleague" }, | |
{ name: "Contact 5", address: "5, a street, a town, a city, AB12 3CD", tel: "1111111111", email: "heremail.me.com", type: "family" } | |
]; | |
} (jquery)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print ( "Welcome, to the World of Games and I'm the god of this world people call Kami, other knows me as the Narrator." ) | |
print ( "Oh, great adventure could I ask you your name? (Insert Name)" ) | |
myName = raw_input() | |
if myName == 'Kami': | |
print ( "Hey my name is Kami you can't use this name!" ) | |
else | |
print ( "Uhh, nice name I guess. Well let's get the show on the road, oh yeah can I ask you how old you are? (Insert Age)" ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setting up conditional statement | |
print("Enter Your age") | |
myAge = raw_input() | |
if myAge >= 10: # The state of an if / else statement | |
print( "You're not a kid anymore." ) | |
elif myAge <= 19: # Use elif for additional conditions... kinda like elseif | |
print( "You must be a teen!" ) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Creating a class, or the blueprints for our objects in games and apps | |
-- Making a class is just like a function | |
function animalFactory( name ) | |
local animal = { -- a table with the values of our animal object | |
name = "kitteh", | |
says = "nyan", | |
position = { x = 0, y = 0 } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Functions are special instructions packed into a function keyword | |
-- They allow you to pack complex instructions for reuse | |
local function addMe( a, b ) -- in this function, a and b are what's being fed in. We call these arguments | |
if tonumber( a ) and tonumber( b ) == true then | |
return a + b | |
else | |
return "You can't add these" | |
end | |
print( "Enter a number " ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- How to create tables... or super variables and put them to use | |
-- Tables are containers for values | |
myTable = { 1, 2, 3, 4, 5, 6 } | |
-- now, let's walk through our table | |
for i = 1, 6 do | |
print( myTable[ i ] )-- i is the index or the current position in the table | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- teaching our computer to make decisions | |
-- To start, let's create some variables that track our input | |
print( "Hey, are you tired right now? ( type yes or no ) " ) | |
tired = io.flush() -- makes our tired variable what we type in | |
print( "I almost forgot, what's your name?" ) | |
myName = io.flush() | |
-- Now we add some basic conditions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- teaching our computer to make decisions | |
-- To start, let's create some variables that track our input | |
print( "Hey, are you tired right now? ( type yes or no ) " ) | |
tired = io.flush() -- makes our tired variable what we type in | |
print( "I almost forgot, what's your name?" ) | |
myName = io.flush() | |
-- Now we add some basic conditions |