Skip to content

Commit

Permalink
fix: fix main files
Browse files Browse the repository at this point in the history
  • Loading branch information
GirZ0n committed Nov 6, 2023
1 parent 2aceb19 commit b77a984
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package jetbrains.refactoring.course.patterns

fun main() {
val transportName = "car"
fun main(args: Array<String>) {
val transportName = args[0]
val transport = if (transportName == "car") {
Car()
} else if (transportName == "bicycle") {
Expand All @@ -10,4 +10,5 @@ fun main() {
throw IllegalArgumentException("Unknown transport")
}
val driveMessage = transport.drive()
println(driveMessage)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@ package jetbrains.refactoring.course.patterns

fun main(args: Array<String>) {
val transportName = args[0]
val transport = if (transportName == "car") {
Car()
} else if (transportName == "bicycle") {
Bicycle()
} else {
throw IllegalArgumentException("Unknown transport")
}
val driveMessage = transport.drive()
val driveMessage = TransportationServiceFactory().getTransportation(transportName).drive()
println(driveMessage)
}

0 comments on commit b77a984

Please sign in to comment.