Last active
September 27, 2018 11:38
-
-
Save armcha/d1a128b9e124308d869ce94fa170460b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main(args: Array<String>) { | |
val առաջինՊայման: Բուլյան = ճիշտԷ | |
val երկրորդՊայման: Բուլյան = սխալԷ | |
val երրորդՊայման: Բուլյան = ճիշտԷ | |
եթե(առաջինՊայման) { | |
առաջինՄեթոդ() | |
} այլապես եթե(երկրորդՊայման) { | |
երկրորդՄեթոդ() | |
} այլապես եթե(երրորդՊայման) { | |
երրորդՄեթոդ() | |
} այլապես { | |
չորրորդՄեթոդ() | |
} | |
} | |
fun առաջինՄեթոդ() { | |
} | |
fun երկրորդՄեթոդ() { | |
} | |
fun երրորդՄեթոդ() { | |
} | |
fun չորրորդՄեթոդ() { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Բուլյան(val value: Boolean) | |
val ճիշտԷ = Բուլյան(true) | |
val սխալԷ = Բուլյան(false) | |
class Predicate(private val predicate: Բուլյան) { | |
infix fun այլապես(action: () -> Unit): Predicate { | |
if (!predicate.value) | |
action() | |
return Predicate(predicate) | |
} | |
infix fun այլապես(predicate: Predicate) = predicate | |
} | |
fun եթե(predicate: Բուլյան, action: () -> Unit): Predicate { | |
if (predicate.value) | |
action() | |
return Predicate(predicate) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment