Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

ICFP Programming Contest 2011

Name: Anonymous 2011-06-17 3:10

Name: Anonymous 2011-06-17 5:14

contest site is now a shitty blog that requires JavaScript to view
Fuck no.

Name: Anonymous 2011-06-17 5:24

>>2

Doesn't have Javascript enabled

Every site uses Javascript these days. You should have it enabled by default.

Name: Anonymous 2011-06-17 5:24

>>2
The hosts are Japanese. Be easy on them.

Name: Anonymous 2011-06-17 5:53

Lambda: The Gathering
Sounds like something /prog/ would like to play. Very autistic.

Name: Java Suit 2011-06-17 6:31

JAVA

Name: Anonymous 2011-06-17 19:07

http://goo.gl/FTP9F
Must be a single .tar.gz file (archived by tar and compressed by gzip). Must include two files "./install" (for installation) and "./run" (for running) as well as the "./src/" directory.

What if you can't stand unix and don't like programming with all that arcane crap?  What are they going to do next year, make everyone submit their code in punch cards?

Name: Anonymous 2011-06-17 19:30

>>7
Well, I suppose you are then cordially invited to GTFO and eventually STFU.

Name: Anonymous 2011-06-17 20:35

>>7

8.5/10

Name: Anonymous 2011-06-17 21:51

>>7
Worse. Next year's requirement is an .msi

.msi is pretty good for what it is. Better than 3rd party installers anyway.

Name: Anonymous 2011-06-18 21:12

>>3
using JS to display STATIC CONTENT

Name: Anonymous 2011-06-18 21:54

>>11
I suppose they should have used PHP or [AJ]SP.

Name: VIPPER 2011-06-19 15:26

/prog/ participating or is it to busy haxing anus?

Name: Anonymous 2011-06-19 15:49

>>13
why do you care, you cant even code.

Name: VIPPER 2011-06-19 16:02

>>14
Atleast im autistic.

Name: VIPPER 2011-06-19 16:04

>>14
Yes i can.
;_;

Name: Anonymous 2011-06-19 16:10

Why do I always find these ICFP problems boring as fuck?

Name: Anonymous 2011-06-19 17:10

Lambda: The Gathering
( ≖‿≖)

Name: Anonymous 2011-06-19 21:32

What should that mean by "boring as fuck"?

Name: Anonymous 2011-06-19 23:38

People will be playing this game for days, if not weeks, after the contest ends.

Name: Anonymous 2011-06-20 11:56

I was going somewhere with this, but then I saw the function composition examples and noticed my implementation didn't support that at all, and gave up. Probably starting over later. I absolutely loathed the way they phrased everything. We know what fucking currying is, ICFP.

class Slot:
    def __init__(self, value, vitality):
        self.value = value
        self.vitality = vitality
    def alive(self):
        return self.vitality > 0
    def dead(self):
        return self.vitality <= 0

class Player:
    def __init__(self, pid):
        self.pid = pid
        self.slots = [Slot(self.card('I'), 10000) for i in range(256)]
    def turn(self):
        print('=== player {}'.format(self.pid))
        for i, s in enumerate(self.slots):
            if s.vitality == -1: # zombie
                s.value = s.value(self.card('I')) # what the fuck, icfp
                s.vitality = 0
            if (s.vitality, s.value) != (10000, self.card('I')):
                if type(s.value) == int:
                    sv = s.value
                else:
                    sv = s.value.__func__.__name__[2:]
                print("slot {}: ({}, {})".format(i, s.vitality, sv))
        try:
            choice = input('1 = card -> slot, 2 = slot -> card: ')
            if choice == '1':
                cn = input('card name: ')
                card = self.card(cn)
                sn = int(input('slot number: '))
                slot = self.slots[sn]
                slot.value = card(slot.value)
                print('player {} applied card {} to slot {}'.format(
                    self.pid, cn, sn))
            elif choice == '2':
                sn = int(input('slot number: '))
                slot = self.slots[sn]
                cn = input('card name: ')
                card = self.card(cn)
                slot.value = slot.value(card)
                print('player {} applied slot {} to card {}'.format(
                    self.pid, sn, cn))
            else:
                raise Exception("invalid option")
        except AttributeError as e:
            print("no such card!")
        except Exception as e:
            print("error!", e)
    def card(self, name):
        return eval('self.c_' + name)
    def score(self):
        return len([s for s in self.slots if s.alive()])

    def c_I(self, x): return x
    def c_zero(self, x): return 0
    def c_succ(self, n):
        if n < 65535:
            return n + 1
        return 65535
    def c_dbl(self, n):
        if n < 32768:
            return n * 2
        return 65535
    def c_get(self, i):
        s = self.slots[i]
        if s.dead():
            raise Exception("slot is dead")
        return s.value
    def c_put(self, i): return self.card('I')
    def c_S(self, f): return lambda g: lambda x: f(x)(g(x))
    def c_K(self, x): return lambda y: x
    def c_inc(self, i):
        s = self.slots[i]
        if s.alive() and s.vitality < 65535:
            s.vitality += 1
        return self.card('I')
    def c_dec(self, i):
        s = self.opponent.slots[255-i]
        if s.alive():
            s.vitality -= 1
        return self.card('I')
    def c_attack(self, i):
        def z1(j):
            def z2(n):
                s = self.slots[i]
                v = s.vitality
                if n > v: raise Exception("invalid attack")
                t = self.opponent.slots[255-j]
                t.vitality -= n * 9 // 10
                if t.vitality < 0: t.vitality = 0
                return self.card('I')
            return z2
        return z1
    def c_help(self, i):
        def z1(j):
            def z2(n):
                s = self.slots[i]
                v = s.vitality
                if n > v: raise Exception("invalid help")
                t = self.slots[j]
                t.vitality += n * 11 // 10
                if t.vitality > 65535: t.vitality = 65535
                return self.card('I')
            return z2
        return z1
    def c_copy(self, i):
        return self.opponent.slots[i]
    def c_revive(self, i):
        if self.slots[i].dead():
            self.slots[i].vitality = 1
        return self.card('I')
    def c_zombie(self, i):
        def z1(x):
            t = self.opponent.slots[255-i]
            if t.alive(): raise Exception("card is alive")
            t.value = x
            t.vitality = -1
        return z1

players = (Player(0), Player(1))
players[0].opponent = players[1]
players[1].opponent = players[0]

for t in range(1, 100001):
    print('*** turn {}'.format(t))
    for p in players:
        p.turn()

Name: Anonymous 2011-06-20 11:59

>>20
U MENA YEARS!

Name: Anonymous 2011-06-20 12:06

>>21
Seriously, FIOC is repulsive. Shit like this:

sv = s.value.__func__.__name__[2:]

Name: Anonymous 2011-06-20 12:49

sum prlp wen facd w/ a problem dey think 'i no use regaxum ' now their 2 probloms

Name: Anonymous 2011-06-20 13:34

>>23
That's actually my fault for doing meta-programing in Python of all languages. It's a terrible hack to turn methods like <bound method Player.c_zero of <__main__.Player object at 0x021F3590>> to a string, here "zero".

Don't change these.
Name: Email:
Entire Thread Thread List