GreatSyntacticShift: Codegen testdata fixed

This commit is contained in:
Andrey Breslav
2011-12-20 22:56:13 +04:00
parent 41fd43b5e5
commit 6aad3b2662
67 changed files with 151 additions and 151 deletions
@@ -1,4 +1,4 @@
namespace mask
package mask
import std.io.*
import java.io.*
@@ -52,7 +52,7 @@ class Luhny() {
fun check() {
if (digits.size() < 14) return
print("check")
val sum = digits.sum { i, d =>
val sum = digits.sum { i, d ->
// println("$i -> $d")
if (i % 2 == digits.size()) {
val f = d * 2 / 10
@@ -94,12 +94,12 @@ class Luhny() {
}
}
fun <T> T.pr(f : fun(T) : Unit) : T {
fun <T> T.pr(f : (T) -> Unit) : T {
f(this)
return this
}
fun LinkedList<Int>.sum(f : fun(Int, Int ): Int): Int {
fun LinkedList<Int>.sum(f : (Int, Int )-> Int): Int {
var sum = 0
for (i in 1..size()) {
val j = size() - i
@@ -120,7 +120,7 @@ fun LinkedList<Int>.sum(f : fun(Int, Int ): Int): Int {
fun Char.isDigit() = Character.isDigit(this)
fun Reader.forEachChar(body : fun(Char) : Unit) {
fun Reader.forEachChar(body : (Char) -> Unit) {
do {
var i = read();
if (i == -1) break