-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex29.rb
More file actions
45 lines (34 loc) · 755 Bytes
/
Copy pathex29.rb
File metadata and controls
45 lines (34 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
people = 20
cats = 30
dogs = 15
#if statements check the logic on the same line, then execute if true
if people < cats
puts "Too many cats! The world is doomed!"
end
# Test - looks like without indent it just executes the thing in the if
# if people == cats
# puts "Too many cats! The world is doomed!"
# end
if people > cats
puts "Not many cats! The world is saved!"
end
if people < dogs
puts "The world is drooled on!"
end
if people > dogs
puts "The world is dry!"
end
dogs += 5
if people >= dogs
puts "People are greater than or equal to dogs."
end
if people <= dogs
puts "People are less than or equal to dogs."
end
if people == dogs
puts "People are dogs."
end
# Boolean test
if true
puts "Test was successful!! :D :D"
end