Solutions update
This commit is contained in:
parent
bca12e24f6
commit
db7d99c254
|
@ -62,7 +62,7 @@ fun main() {
|
|||
ID(name=b, id=LCcPJtUGh5),
|
||||
ID(name=c, id=Acs5BzSj6m),
|
||||
ID(name=d, id=gHrshDvhwc)
|
||||
""".trimIndent()
|
||||
"""
|
||||
val bank = Bank("Jerry's Savings & Loan")
|
||||
listOf(ID("Morty Smith"), ID("Beth Smith"),
|
||||
ID("Summer Smith")).forEach {
|
||||
|
|
|
@ -12,4 +12,4 @@ class SumChars(text: String) {
|
|||
|
||||
fun main() {
|
||||
SumChars("What?").sum eq 467
|
||||
}
|
||||
}
|
|
@ -14,7 +14,7 @@ class Turbine(val id: Int) {
|
|||
}
|
||||
override fun toString() =
|
||||
"Generator $id running: " +
|
||||
"${::_generator.isInitialized}"
|
||||
"${::_generator.isInitialized}"
|
||||
}
|
||||
|
||||
class PowerPlant(nTurbines: Int = 4) {
|
||||
|
@ -24,10 +24,8 @@ class PowerPlant(nTurbines: Int = 4) {
|
|||
require(number in 0..turbines.size)
|
||||
return turbines[number].generator
|
||||
}
|
||||
fun status() {
|
||||
turbines.forEach {
|
||||
trace(it.toString())
|
||||
}
|
||||
fun status() = turbines.forEach {
|
||||
trace(it.toString())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,17 +6,17 @@ files:
|
|||
- offset: 231
|
||||
length: 115
|
||||
placeholder_text: ' = Generator(0) // TODO'
|
||||
- offset: 413
|
||||
- offset: 411
|
||||
length: 31
|
||||
placeholder_text: TODO()
|
||||
- offset: 531
|
||||
- offset: 529
|
||||
length: 31
|
||||
placeholder_text: TODO()
|
||||
- offset: 609
|
||||
- offset: 607
|
||||
length: 73
|
||||
placeholder_text: TODO()
|
||||
- offset: 708
|
||||
length: 51
|
||||
- offset: 702
|
||||
length: 47
|
||||
placeholder_text: TODO()
|
||||
- name: test/Tests.kt
|
||||
visible: false
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
package operatorOverloadingExercise3
|
||||
import atomictest.*
|
||||
|
||||
class Repository<T>(val initSize: Int = 10) {
|
||||
class Repository<T>(initSize: Int = 10) {
|
||||
private val list =
|
||||
MutableList<T?>(initSize) { null }
|
||||
operator fun plusAssign(rv: T) {
|
||||
|
|
|
@ -4,9 +4,9 @@ files:
|
|||
visible: true
|
||||
placeholders:
|
||||
- offset: 103
|
||||
length: 740
|
||||
length: 736
|
||||
placeholder_text: class Repository
|
||||
- offset: 858
|
||||
- offset: 854
|
||||
length: 833
|
||||
placeholder_text: |-
|
||||
/*
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// CheckInstructions/Task4.kt
|
||||
// CheckInstructions/CheckInstructionsSoln4.kt
|
||||
package checkInstructionsExercise4
|
||||
import atomictest.*
|
||||
|
||||
|
|
|
@ -3,10 +3,10 @@ files:
|
|||
- name: src/Task.kt
|
||||
visible: true
|
||||
placeholders:
|
||||
- offset: 86
|
||||
- offset: 103
|
||||
length: 985
|
||||
placeholder_text: class Tank
|
||||
- offset: 1086
|
||||
- offset: 1103
|
||||
length: 422
|
||||
placeholder_text: |-
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue