mirror of
https://github.com/InsanusMokrassar/PsychomatrixBase.git
synced 2024-11-22 08:13:57 +00:00
fixes of 1 -> 8 and 8 -> 1 operations
This commit is contained in:
parent
e381d54dfd
commit
f571fecb58
@ -95,7 +95,7 @@ object FourGrowTwo : Operation() {
|
|||||||
|
|
||||||
object EightGrowOne : Operation() {
|
object EightGrowOne : Operation() {
|
||||||
override fun canConvert(numbers: List<Byte>, changesHistory: List<Operation>): Boolean {
|
override fun canConvert(numbers: List<Byte>, changesHistory: List<Operation>): Boolean {
|
||||||
return numbers[8] > 0
|
return numbers[8] > changesHistory.count { it == OneGrowEight }
|
||||||
&& (TwoGrowFour.canConvert(numbers, changesHistory) || FourGrowTwo.canConvert(numbers, changesHistory))
|
&& (TwoGrowFour.canConvert(numbers, changesHistory) || FourGrowTwo.canConvert(numbers, changesHistory))
|
||||||
}
|
}
|
||||||
override fun canInvert(numbers: List<Byte>, changesHistory: List<Operation>): Boolean {
|
override fun canInvert(numbers: List<Byte>, changesHistory: List<Operation>): Boolean {
|
||||||
@ -128,7 +128,7 @@ object EightGrowOne : Operation() {
|
|||||||
|
|
||||||
object OneGrowEight : Operation() {
|
object OneGrowEight : Operation() {
|
||||||
override fun canConvert(numbers: List<Byte>, changesHistory: List<Operation>): Boolean {
|
override fun canConvert(numbers: List<Byte>, changesHistory: List<Operation>): Boolean {
|
||||||
return numbers[1] > 1
|
return numbers[1] / 2 > changesHistory.count { it == EightGrowOne }
|
||||||
}
|
}
|
||||||
override fun canInvert(numbers: List<Byte>, changesHistory: List<Operation>): Boolean {
|
override fun canInvert(numbers: List<Byte>, changesHistory: List<Operation>): Boolean {
|
||||||
return numbers[8] > 0 && changesHistory.contains(this)
|
return numbers[8] > 0 && changesHistory.contains(this)
|
||||||
|
Loading…
Reference in New Issue
Block a user