add extra files
This commit is contained in:
parent
5b32cb677a
commit
e657af0635
38
basic/social-security.bas
Normal file
38
basic/social-security.bas
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
[start]
|
||||||
|
cls
|
||||||
|
print "This program will help you determine"
|
||||||
|
print "if you are old enough to apply for"
|
||||||
|
print "Social Security."
|
||||||
|
print
|
||||||
|
input "Please enter your current age."; age
|
||||||
|
if age < 65 then [young]
|
||||||
|
if age > 65 then [old]
|
||||||
|
if age = 65 then [correct]
|
||||||
|
goto [start]
|
||||||
|
|
||||||
|
[young]
|
||||||
|
cls
|
||||||
|
print "You are too young. Please try again"
|
||||||
|
print "in a couple of years."
|
||||||
|
print
|
||||||
|
input "Press 'Enter' to continue."; dummyVariable
|
||||||
|
print
|
||||||
|
goto [start]
|
||||||
|
|
||||||
|
[old]
|
||||||
|
cls
|
||||||
|
print "You are should have applied for"
|
||||||
|
print "Social Security by now."
|
||||||
|
print
|
||||||
|
input "Press 'Enter' to continue."; dummyVariable
|
||||||
|
print
|
||||||
|
goto [start]
|
||||||
|
|
||||||
|
[correct]
|
||||||
|
cls
|
||||||
|
print "You are now eligiable to apply for "
|
||||||
|
print "Social Security."
|
||||||
|
print
|
||||||
|
input "Press 'Enter' to continue."; dummyVariable
|
||||||
|
print
|
||||||
|
goto [start]
|
18
basic/taxes.bas
Normal file
18
basic/taxes.bas
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
[start]
|
||||||
|
print "Type a dollar and cent amount ?"
|
||||||
|
input "(Press 'Enter' alone for help) "; amount
|
||||||
|
let tax = amount * 0.05
|
||||||
|
print "Tax is: "; tax; ". Total is: "; tax+amount
|
||||||
|
goto [start]
|
||||||
|
|
||||||
|
[help]
|
||||||
|
cls
|
||||||
|
print "SALESTAX.BAS Help"
|
||||||
|
print
|
||||||
|
print "This tax program determines how much tax is"
|
||||||
|
print "due on an amount entered and also computes"
|
||||||
|
print "the total amount. The tax rate is 5%."
|
||||||
|
print
|
||||||
|
input "Press [Enter] to continue."; dummyVariable
|
||||||
|
cls
|
||||||
|
goto [start]
|
25
basic/taxes2.bas
Normal file
25
basic/taxes2.bas
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
[start]
|
||||||
|
print "Type a dollar and cent amount ?"
|
||||||
|
input "(Press 'Enter' alone for help) "; valueA
|
||||||
|
let tax = amount * 0.05
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
let valueB = int(valueA)
|
||||||
|
valueC = valueA - valueB
|
||||||
|
|
||||||
|
goto [start]
|
||||||
|
|
||||||
|
[help]
|
||||||
|
cls
|
||||||
|
print "SALESTAX.BAS Help"
|
||||||
|
print
|
||||||
|
print "This tax program determines how much tax is"
|
||||||
|
print "due on an amount entered and also computes"
|
||||||
|
print "the total amount. The tax rate is 5%."
|
||||||
|
print
|
||||||
|
input "Press [Enter] to continue."; dummyVariable
|
||||||
|
cls
|
||||||
|
goto [start]
|
0
index.html
Normal file
0
index.html
Normal file
5
qb64/hello.bas
Normal file
5
qb64/hello.bas
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
PRINT "Hello World"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
20
qb64/linedemo2.bas
Normal file
20
qb64/linedemo2.bas
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
'-------------------------
|
||||||
|
'-LINE demonstration #2 -
|
||||||
|
'-------------------------
|
||||||
|
|
||||||
|
const YELLOW = _RGB32(255, 255, 0)
|
||||||
|
|
||||||
|
SCREEN _NEWIMAGE(640, 480, 32)
|
||||||
|
cls
|
||||||
|
line (299, 219)-(319,0), YELLOW
|
||||||
|
LINE -(339, 219), YELLOW
|
||||||
|
LINE -(629, 239), YELLOW
|
||||||
|
LINE -(339, 259), YELLOW
|
||||||
|
LINE -(319, 479), YELLOW
|
||||||
|
LINE -(299, 259), YELLOW
|
||||||
|
LINE -(0, 239), YELLOW
|
||||||
|
LINE -(299, 219), YELLOW
|
||||||
|
LOCATE 16.36
|
||||||
|
PRINT "PRESS A KEY"
|
||||||
|
SLEEP
|
||||||
|
SYSTEM
|
32
qb64/linedemo3.bas
Normal file
32
qb64/linedemo3.bas
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
'-------------------------
|
||||||
|
'-LINE demonstration #3 -
|
||||||
|
'-------------------------
|
||||||
|
|
||||||
|
CONST YELLOW = _RGB32(255, 255, 0)
|
||||||
|
dim Style&
|
||||||
|
dim Bit%
|
||||||
|
dim Dir%
|
||||||
|
|
||||||
|
Dir% = -1
|
||||||
|
|
||||||
|
SCREEN _NEWIMAGE(640, 480, 32)
|
||||||
|
do
|
||||||
|
cls
|
||||||
|
_LIMIT 30
|
||||||
|
LOCATE 2, 33
|
||||||
|
PRINT "A Stylized Line"
|
||||||
|
LOCATE 4, 21
|
||||||
|
PRINT "Press the Space Bar to change directions"
|
||||||
|
LOCATE 6, 23
|
||||||
|
PRINT "Press the Escape key to exit the program."
|
||||||
|
if _KEYHIT = 32 THEN Dir% = -Dir%
|
||||||
|
Bit% = Bit% + Dir%
|
||||||
|
if Bit% = 16 THEN
|
||||||
|
Bit% = 0
|
||||||
|
ELSEIF Bit% = -1 then
|
||||||
|
Bit% = 15
|
||||||
|
End if
|
||||||
|
Style& = 2 ^ Bit%
|
||||||
|
LINE (99, 129)-(539, 409), YELLOW, B , Style&
|
||||||
|
_DISPLAY
|
||||||
|
LOOP UNTIL _KEYDOWN(27)
|
4
qb64/name.bas
Normal file
4
qb64/name.bas
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
PRINT "Enter your name:"
|
||||||
|
INPUT user$
|
||||||
|
PRINT "Hello " + user$
|
||||||
|
|
BIN
red/hello-gui.exe
Normal file
BIN
red/hello-gui.exe
Normal file
Binary file not shown.
3
red/hello-gui.red
Normal file
3
red/hello-gui.red
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Red [Needs: 'View]
|
||||||
|
|
||||||
|
view [text "Hello, World!"]
|
BIN
red/hello.exe
Normal file
BIN
red/hello.exe
Normal file
Binary file not shown.
3
red/hello.red
Normal file
3
red/hello.red
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Red [Title: "Simple hello world Script"]
|
||||||
|
|
||||||
|
print "Hello, World"
|
3
red/image-viewer.red
Normal file
3
red/image-viewer.red
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Red [ tite: "Simple Image Viewer" needs: 'view]
|
||||||
|
|
||||||
|
|
6352
red/libRedRT-defs.r
Normal file
6352
red/libRedRT-defs.r
Normal file
File diff suppressed because one or more lines are too long
1
red/libRedRT-extras.r
Normal file
1
red/libRedRT-extras.r
Normal file
|
@ -0,0 +1 @@
|
||||||
|
red/symbol/make-opt red/alloc-at-tail red/none/make-in red/unicode/to-utf16-len red/unicode/to-utf16 red/handle/make-at red/unicode/load-utf16 red/ownership/unbind-each red/image/resize red/image/delete red/date/make-at red/vector/make-at red/OS-image/delete red/float/abs red/image/any-resize red/OS-image/width? red/OS-image/height? red/binary/make-at red/OS-image/make-image red/file/to-OS-path red/string/rs-abs-at red/map/put red/collector/keep red/collector/register red/unicode/get-cache red/percent/rs-make-at red/string/sniff-chars
|
1084
red/libRedRT-include.red
Normal file
1084
red/libRedRT-include.red
Normal file
File diff suppressed because it is too large
Load Diff
BIN
red/libRedRT.dll
Normal file
BIN
red/libRedRT.dll
Normal file
Binary file not shown.
BIN
red/print-message.exe
Normal file
BIN
red/print-message.exe
Normal file
Binary file not shown.
2
red/print-message.red
Normal file
2
red/print-message.red
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
Red [ Title: "My program" needs: 'view]
|
||||||
|
view [ text "Its a great big world!" button "Quit" [quit] ]
|
BIN
red/print-name.exe
Normal file
BIN
red/print-name.exe
Normal file
Binary file not shown.
3
red/print-name.red
Normal file
3
red/print-name.red
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Red [Needs: 'View]
|
||||||
|
|
||||||
|
view [name: field button "Hi" [print ["Hi" name/text]]]
|
60
ruby/get_number.rb
Normal file
60
ruby/get_number.rb
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
# Get My Number Game
|
||||||
|
# written by: you!
|
||||||
|
|
||||||
|
puts "Welcome to 'Get My Number!'"
|
||||||
|
|
||||||
|
print "What's your name? "
|
||||||
|
|
||||||
|
input = gets
|
||||||
|
|
||||||
|
name = input.chomp
|
||||||
|
|
||||||
|
puts "Welcome, #{name}!"
|
||||||
|
|
||||||
|
# Store a random number for the player to guess.
|
||||||
|
|
||||||
|
puts "I've got a number between 1 and 100."
|
||||||
|
|
||||||
|
puts "Can you guess it?"
|
||||||
|
|
||||||
|
target = rand(100) + 1
|
||||||
|
|
||||||
|
# Track how many gueses the player has made.
|
||||||
|
|
||||||
|
num_guesses = 0
|
||||||
|
|
||||||
|
# Track whether the player has guessed correctly
|
||||||
|
|
||||||
|
guessed_it = false
|
||||||
|
|
||||||
|
until num_guesses == 10 || guessed_it
|
||||||
|
|
||||||
|
puts "You've got #{10 - num_guesses} guesses left."
|
||||||
|
|
||||||
|
print "Make a guess."
|
||||||
|
|
||||||
|
guess = gets.to_i
|
||||||
|
|
||||||
|
num_guesses += 1
|
||||||
|
|
||||||
|
# Compare the guess to the target.
|
||||||
|
# Print the appropriate message.
|
||||||
|
|
||||||
|
if guess < target
|
||||||
|
puts "Oops. Your guess was LOW."
|
||||||
|
elsif guess > target
|
||||||
|
puts "Oops. Your guess was HIGH."
|
||||||
|
elsif guess == target
|
||||||
|
puts "Good job, #{name}!"
|
||||||
|
puts "You guessed my number in #{num_guesses} gueses!"
|
||||||
|
guessed_it = true
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
# If player ran out of turns, tell them what the nubmer was.
|
||||||
|
|
||||||
|
unless guessed_it
|
||||||
|
puts "Sorry. You didn't get my number. (It was #{target}.)"
|
||||||
|
end
|
||||||
|
|
13
ruby/soda_methods.rb
Normal file
13
ruby/soda_methods.rb
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
def order_soda(flavor, size = "medium", quantity = 1)
|
||||||
|
if quantity == 1
|
||||||
|
plural = "soda"
|
||||||
|
else
|
||||||
|
plural = "sodas"
|
||||||
|
end
|
||||||
|
puts "#{quantity} #{size} #{flavor} #{plural}!"
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
order_soda("orange")
|
||||||
|
order_soda("lemon-lime", "small", 2)
|
||||||
|
order_soda("grape", "large")
|
3
ruby/sort.rb
Normal file
3
ruby/sort.rb
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
numbers = [5, 3, 2, 4, 1]
|
||||||
|
|
||||||
|
print numbers.sort
|
29
ruby/vehicle_methods.rb
Normal file
29
ruby/vehicle_methods.rb
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
def accelerate
|
||||||
|
puts "Stepping on the gas"
|
||||||
|
puts "Speeding up"
|
||||||
|
end
|
||||||
|
|
||||||
|
def sound_horn
|
||||||
|
puts "Pressing the horn button"
|
||||||
|
puts "Beep beep!"
|
||||||
|
end
|
||||||
|
|
||||||
|
def use_headlights(brightness)
|
||||||
|
puts "Turning on #{brightness} headlights"
|
||||||
|
puts "Watch out for deer!"
|
||||||
|
end
|
||||||
|
|
||||||
|
def use_headlights(brightness = "low-beam")
|
||||||
|
puts "Turning on #{brightness} headlights"
|
||||||
|
puts "Watch out for deer!"
|
||||||
|
end
|
||||||
|
|
||||||
|
def mileage(miles_driven, gas_used)
|
||||||
|
return miles_driven / gas_used
|
||||||
|
end
|
||||||
|
|
||||||
|
trip_mileage = mileage(400, 12)
|
||||||
|
puts "You got #{trip_mileage} MPG on this trip."
|
||||||
|
|
||||||
|
lifetime_mileage = mileage(11432, 366)
|
||||||
|
puts "This car averages #{lifetime_mileage} MPG."
|
Loading…
Reference in New Issue
Block a user