mirror of
https://github.com/markusfisch/BinaryEye.git
synced 2024-09-20 03:52:16 +02:00
Make conditional an argument
To avoid the repetition of the function invocation. Also make bt a constant variable because it can be.
This commit is contained in:
parent
6a47a7e477
commit
319ae53b3b
@ -174,16 +174,18 @@ fun encodeAsText(
|
||||
for (y in 0 until h step 2) {
|
||||
for (x in 0 until w) {
|
||||
val tp = bitMatrix.get(y, x)
|
||||
var bt = y + 1 >= h || bitMatrix.get(y + 1, x);
|
||||
val bt = y + 1 >= h || bitMatrix.get(y + 1, x)
|
||||
sb.append(
|
||||
if (tp && bt) {
|
||||
sb.append(' ')//'\u0020'
|
||||
' '
|
||||
} else if (tp) {
|
||||
sb.append('▄')//'\u2584'
|
||||
'▄'
|
||||
} else if (bt) {
|
||||
sb.append('▀')//'\u2580'
|
||||
'▀'
|
||||
} else {
|
||||
sb.append('█')//'\u2588'
|
||||
'█'
|
||||
}
|
||||
)
|
||||
}
|
||||
sb.append('\n')
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user