-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathSanctuary.kt
58 lines (46 loc) · 2.32 KB
/
Sanctuary.kt
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
46
47
48
49
50
51
52
53
54
55
56
57
58
fun main() {
// Write your code below 🏞
val responsibilities = mutableListOf("feed the chimps", "play a random game", "conduct a health check on Foxie")
var responsibilitiesComplete = 0
var timeSpent = 0
var totalShiftTime = 4
val foxiesHealthCheck = mutableMapOf<String, Any?>()
var chimpsHaveEaten = mutableMapOf("Bonnie" to false, "Jubilee" to false, "Frodo" to false, "Foxie" to false)
// First responsibility
println("First, ${responsibilities[0]}")
println("Feeding Bonnie...")
chimpsHaveEaten["Bonnie"] = true
println("Feeding Jubilee...")
chimpsHaveEaten["Jubilee"] = true
println("Feeding Frodo...")
chimpsHaveEaten["Frodo"] = true
println("Feeding Foxie...")
chimpsHaveEaten["Foxie"] = true
timeSpent += 1
responsibilitiesComplete++
println("All chimps have now been fed! You've completed $responsibilitiesComplete / ${responsibilities.size} responsibilities.")
// Second responsibility
println("\nNext, ${responsibilities[1]}")
val games = mutableSetOf("tug-of-war with a blanket", "catch and throw", "number game")
val randomGame = games.random()
println(randomGame)
timeSpent += 1
responsibilitiesComplete++
println("Each animal has now played a game of $randomGame. You've completed $responsibilitiesComplete / ${responsibilities.size} responsibilities.")
// Third responsibility
println("\nNext, ${responsibilities[2]}")
foxiesHealthCheck.put("Temperature", 37.2)
foxiesHealthCheck.put("Mood", "Happy")
println("Foxie has a temperature of ${foxiesHealthCheck["Temperature"]} and is feeling ${foxiesHealthCheck["Mood"]}.")
timeSpent += 1
responsibilitiesComplete++
println("You've now completed $responsibilitiesComplete / ${responsibilities.size} responsibilities.")
// Wrap up
if (timeSpent <= totalShiftTime && responsibilitiesComplete == responsibilities.size) {
println("\nAwesome work! You've completed all of your responsibilites for the day, and you can clock out.")
} else if (timeSpent >= totalShiftTime && responsibilitiesComplete == responsibilities.size){
println("Great job today! You've completed all of your responsibilities but with over time.")
} else {
println("You went over time and did not complete all of your responsibilites.")
}
}