Compare commits
2 Commits
ui-test
...
766c34a925
| Author | SHA256 | Date | |
|---|---|---|---|
| 766c34a925 | |||
| 389b9f788c |
180
Exercises/Practical 1/Practicle 1.kt
Normal file
180
Exercises/Practical 1/Practicle 1.kt
Normal file
@@ -0,0 +1,180 @@
|
||||
import com.sun.org.apache.xpath.internal.operations.Bool
|
||||
|
||||
/**
|
||||
* You can edit, run, and share this code.
|
||||
* play.kotlinlang.org
|
||||
*/
|
||||
fun String.isPalindrome(): Boolean {
|
||||
var treatedString: String = String()
|
||||
this.forEach { char ->
|
||||
if (char.isLetterOrDigit()) treatedString += char.uppercase()
|
||||
}
|
||||
|
||||
return treatedString == treatedString.reversed()
|
||||
}
|
||||
|
||||
fun calculateVolumeOfSphere(radius: Double): Double {
|
||||
return (4.0 / 3.0) * Math.PI * (radius * radius * radius)
|
||||
}
|
||||
|
||||
fun ageMessage(age: Int) {
|
||||
when (age) {
|
||||
in Int.MIN_VALUE..<0 -> println("Unborn")
|
||||
in 0..11 -> println("Young Kid")
|
||||
in 12..17 -> println("Teenager")
|
||||
18 -> println("18 Year Old")
|
||||
in 19..21 -> println("Young Adult")
|
||||
in 22..64 -> println("Adult")
|
||||
in 65..Int.MAX_VALUE -> println("Elderly")
|
||||
}
|
||||
}
|
||||
|
||||
fun powerCalculator(base: Int, exponent: Int): Float {
|
||||
var result: Float = base.toFloat()
|
||||
|
||||
if (base == 0) return 0f
|
||||
else if (exponent == 0) return 1f
|
||||
|
||||
if (exponent < 0) {
|
||||
for (loop in exponent..<-1) {
|
||||
result *= base
|
||||
}
|
||||
result = 1 / result
|
||||
} else {
|
||||
for (loop in 1..<exponent) {
|
||||
result *= base
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
fun Int.isPrime(): Boolean {
|
||||
if (this == 0) return false
|
||||
var tmpVar: Int = this
|
||||
if (this < 0) tmpVar *= -1
|
||||
|
||||
for (loop in 2..tmpVar / 2) {
|
||||
if (tmpVar % loop == 0) return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
fun splitList(list: List<Int>): Array<List<Int>> {
|
||||
val newList1: MutableList<Int> = mutableListOf<Int>()
|
||||
val newList2: MutableList<Int> = mutableListOf<Int>()
|
||||
|
||||
for (loop in 0..<list.size) {
|
||||
if (loop % 2 == 0) newList1.add(list[loop])
|
||||
else newList2.add(list[loop])
|
||||
}
|
||||
|
||||
return arrayOf(newList1, newList2)
|
||||
}
|
||||
|
||||
class Rectangle(var width: Double, var height: Double) {
|
||||
init {
|
||||
println("Created new Rectangle with a width of $width and a height of $height")
|
||||
}
|
||||
|
||||
fun area(): Double {
|
||||
return width * height
|
||||
}
|
||||
|
||||
fun perimeter(): Double {
|
||||
return width * 2 + height * 2
|
||||
}
|
||||
|
||||
fun isSquare(): Boolean {
|
||||
return width == height
|
||||
}
|
||||
}
|
||||
|
||||
fun main() {
|
||||
// 1
|
||||
//println("Hello, world!!!")
|
||||
|
||||
// 2
|
||||
//var myFloat: Float = 10f
|
||||
//myFloat *= 5
|
||||
//println(myFloat)
|
||||
|
||||
// 3
|
||||
//val myInt1: Int = (1..10).random()
|
||||
//val myInt2: Int = (1..10).random()
|
||||
//val myInt3: Int = myInt1 / myInt2
|
||||
//println(myInt1.toString() + " / " + myInt2.toString() + " = " + myInt3.toString())
|
||||
|
||||
// 4
|
||||
//val myString: String = "My String"
|
||||
//println(myString.uppercase().reversed())
|
||||
|
||||
// 5
|
||||
//val myInt1: Int = 2
|
||||
//val myInt2: Int = 2
|
||||
//val myInt3: Int = 4
|
||||
//val myInt4: Int = 4
|
||||
//if ((myInt1 == myInt2 || myInt3 == myInt4) && myInt3 > myInt2) println("Either the first two integers or the last two integers are equal, and the 3rd integer is larger that the 2nd.")
|
||||
|
||||
// 6
|
||||
//val myPalindrome: String = "Satan, oscillate my metallic sonatas."
|
||||
//println(myPalindrome.isPalindrome())
|
||||
|
||||
// 7
|
||||
//println(calculateVolumeOfSphere(2.0))
|
||||
|
||||
// 8
|
||||
//val myIntArray: Array<Int> = arrayOf(1, 2, 3, 4, 5)
|
||||
//val myStringArray: Array<String> = arrayOf("One", "Two", "Three", "Four", "Five")
|
||||
//myIntArray.forEach { println(it) }
|
||||
//myStringArray.forEach { println(it) }
|
||||
|
||||
// 9
|
||||
//val myString: String = "Hello"
|
||||
//val loopAmount: Int = 5
|
||||
//var currentLoop: Int = 0
|
||||
//while (currentLoop < loopAmount) {
|
||||
// println(myString)
|
||||
// currentLoop++
|
||||
//}
|
||||
|
||||
// 10
|
||||
//for (number in 1..42) println(number)
|
||||
|
||||
// 11
|
||||
//(65..90).forEach { println(it.toChar()) }
|
||||
|
||||
// 12
|
||||
//val myArray: Array<Int> = arrayOf(5, 10, 5)
|
||||
//var myResult: Int = 0
|
||||
//myArray.forEach { myResult += it }
|
||||
//println(myResult)
|
||||
|
||||
// 13
|
||||
//val myArray: Array<Int> = arrayOf(5, 10, 2)
|
||||
//val myMutableList: MutableList<Int> = mutableListOf()
|
||||
//for (entry in myArray.reversed()) myMutableList += entry
|
||||
//myMutableList.forEach { println(it) }
|
||||
|
||||
// 14
|
||||
//ageMessage(14)
|
||||
|
||||
// 15
|
||||
//println(powerCalculator(-2, 3))
|
||||
|
||||
// 16
|
||||
//println(887.isPrime())
|
||||
|
||||
// 17
|
||||
//val myRectangle: Rectangle = Rectangle(5.0, 10.0)
|
||||
//println(myRectangle.area())
|
||||
//println(myRectangle.perimeter())
|
||||
//println(myRectangle.isSquare())
|
||||
|
||||
// 18
|
||||
//val myList: List<Int> = listOf<Int>(1, 4, 6, 7, 8)
|
||||
//val myArray: Array<List<Int>> = splitList(myList)
|
||||
//for (item in myArray) {
|
||||
// for (subItem in item) println(subItem)
|
||||
//}
|
||||
}
|
||||
34
Formative Assessment/Formative Assessment.md
Normal file
34
Formative Assessment/Formative Assessment.md
Normal file
@@ -0,0 +1,34 @@
|
||||
### Outline
|
||||
1. Gameplay
|
||||
1. Co-Op
|
||||
2. Competitive
|
||||
3. Combat
|
||||
4. The Witch
|
||||
### Gameplay
|
||||
The game will be played with the phone held vertically. The game will be a roguelite with a both a cooperative and a competitive game mode.
|
||||
|
||||
Players must enter a dungeon with another player in order to kill The Witch. They may enter with some prepared items in Co-op, but will be going in without in the competitive game mode.
|
||||
|
||||
Upon entering a room, the player will be given some options. If there are enemies, they will be given the option to fight them. They will be given the option to search clutter if it exists within the room. Any chests can be looted with additional chests maybe reviled behind clutter. All of these activities can reward equipment that can be used in future fights/games.
|
||||
|
||||
After the player determines they have sufficiently cleared the room they can pick adjacent rooms. Players can end up meeting each other if they end up picking the same room. Players may group up and take rooms together. In co-op this will result in the loot being split. In competitive this will result in the person who initiated the action, if it was searching clutter or looting a chest, or dealt the final blow (maybe dice roll instead) in a combat encounter.
|
||||
|
||||
##### Co-Op
|
||||
Players will be allowed to bring prepared items, such as potions, and must work with their partner to scour the dungeon in order to get powerful enough to kill The Witch. Some collected loot can be taken back and used in future runs if the players were not able to finish a run completely.
|
||||
|
||||
Players may be resurrected at certain interactable that may spawn randomly in rooms.
|
||||
|
||||
##### Competitive
|
||||
Players must be quick but careful when doing a competitive run. The first person to kill The Witch wins.
|
||||
|
||||
Once a player is dead they are removed from the game. The final player can make it to the end and kill The Witch for a greater reward.
|
||||
|
||||
##### Combat
|
||||
Upon entering a combat encounter the options available to the Player will change to reflect the actions they can take. They will be given the option to flee. This will take them to an adjacent room with all unclaimed loot in the previous room now locked to them (not chance based). Players will also have the option to attack with a certain action. If the enemy is shielded, the Player can use a shield-break attack. If the enemy is weak to fire they may use a fire attack if they have one etc. Attack options will depend on the players equipment.
|
||||
|
||||
##### The Witch
|
||||
The Witch is the ultimate fight in a run. They will test the Player's breadth of held equipment. If the Player(s) do not have the equipment capable of taking down The Witch they will find the fight very difficult.
|
||||
|
||||
Players will be allowed to run and keep all the collected equipment should they manage to escape (Chance based?).
|
||||
|
||||
See [[Idea Whiteboard]] for more details. A [PNG version](Idea%20Whiteboard.png) and an [SVG Version](Idea%20Whiteboard.svg) are also available.
|
||||
BIN
Formative Assessment/Idea Whiteboard.png
Normal file
BIN
Formative Assessment/Idea Whiteboard.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 MiB |
2
Formative Assessment/Idea Whiteboard.svg
Normal file
2
Formative Assessment/Idea Whiteboard.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 1.7 MiB |
Reference in New Issue
Block a user