fun main() { /* * Two roads diverged in a yellow wood * And sorry I could not travel both * And be one traveler, long I stood * And looked down one as far as I could * To where it bent in the undergrowth * */
val (roadOne, roadTwo) = arrayOf(Road(), Road()) val yellowWoodRoads = arrayOf(roadOne, roadTwo) val me = Traveler()
/* * Then took the other, as just as fair * And having perhaps the better claim, * Because it was grassy and wanted wear; * Thought as for that the passing there * Had worn them really about the same * */
val theOtherRoad = if (me.roadToTravel == yellowWoodRoads[0]) yellowWoodRoads[1] else yellowWoodRoads[0]
/* * And both that morning equally lay * In leaves no step had trodden black. * Oh, I kept the first for another day! * Yet knowing how way leads on to way, * I doubted if I should ever come back * */
/* * I shall be telling this with a sigh * Somewhere ages and ages hence: * Two roads diverged in a wood, and I- * I took the one less traveled by, * And that has made all the difference * */
val somewhereAgesAndAges = Moment() val lessTraveledRoad = if( somewhereAgesAndAges.roads[0].traveled < somewhereAgesAndAges.roads[1].traveled ) somewhereAgesAndAges.roads[0] else somewhereAgesAndAges.roads[1]
/* * Models * */data class Road( val name: String = "", var grassy: Int = 0, var traveled: Int = 0 ) { fun findUndergrowth(): Int { return Int.MAX_VALUE } }data class Traveler( val name: String = "", var roadToTravel: Road? = null )data class Moment( val time: Long = 0L, val place: String = "Wood", val roads: Array<Road> = arrayOf(Road(), Road()), val me: Traveler = Traveler(), var isDifferent: Boolean = false )