changeset 100:b861d026f3df

Removed The ugly millionaire
author Sigurd Meldgaard <stm@daimi.au.dk>
date Fri, 10 Jul 2009 11:01:12 +0200
parents 3e0aadd17eb7
children 1f6c095453ae
files examples/millionaires.py
diffstat 1 files changed, 0 insertions(+), 48 deletions(-) [+]
line wrap: on
line diff
--- a/examples/millionaires.py	Wed Jul 08 13:20:22 2009 +0200
+++ b/examples/millionaires.py	Fri Jul 10 11:01:12 2009 +0200
@@ -28,54 +28,6 @@
 
 # ===========================================================================
 
-
-# The ugly millionaires program
-def mill1(runtime):
-    print "-" * 64
-    print "Program started"
-    print
-
-    networths = runtime.input(runtime.players.keys(), Zp, input)
-    ids = runtime.input(runtime.players.keys(), Zp, runtime.id)
-    ls = zip(ids, networths)
-
-    def max(ls, client, value):
-        print "Max..."
-        if ls == []:
-            return (client, value)
-        def update(r, ls, id, networth, client, value):
-            print "  update", id, networth
-            if r:
-                print "  true"
-                client = id
-                value = networth
-            return max(ls, client, value)
-        id, networth = ls.pop()
-        d = runtime.output(networth >= value)
-        d.addCallback(update, ls, id, networth, client, value)
-        return d
-
-    d = max(ls, Share(runtime, Zp, Zp(0)), Share(runtime, Zp, Zp(0)))
-    def rest((c,v)):
-        d1 = runtime.open(c)
-        d2 = runtime.open(v)
-        results = gather_shares([d1, d2])
-        def result((c,v)):
-            print "Result", c, v
-        results.addCallback(result)
-    d.addCallback(rest)
-
-    runtime.schedule_callback(d, lambda _: runtime.synchronize())
-    runtime.schedule_callback(d, lambda _: runtime.shutdown())
-
-def field_converter(field, x):
-    def convert(x):
-        return field(x.value)
-    x.addCallback(convert)
-    return x
-
-# ===========================================================================
-
 # The not so nice millionaires program
 def runNotNiceMills(runtime):
     # Input player identity.