true $@running () $@bidders 0 $@topbid () $@topbidder BidSocket.new @bidsocket [ false =running bidders :.stop map; bidsocket.close ] Timer.new @timer timer.start [running] [ ( bidsocket.acceptbidder @bidder . bidders bidder push =bidders . ("Hello " bidder.name " welcome to the auction!") concat bidder.sendMessage , [running] [ bidder topbidder = . [ "You are the highest bidder! Waiting for new bids..." bidder.sendMessage , [bidder topbidder = running & .] while bidder topbidder ~= ["You have been outbid!" bidder.sendMessage] if ] [ ("The current bid is " topbid.show " by " topbidder.name "Please make a bid.") concat bidder.sendMessage , bidder.getBid @bid , bid bidder.balance > ["You do not have sufficient funds to make this bid!" bidder.sendMessage] bid topbid <= ["Your bid was too low please try again." bidder.sendMessage] [ "Your bid was accepted." bidder.sendMessage , bid =topbid bidder =topbidder , bidders [bidder ~=] filter [ ("New bid of " bid.show " by " bidder.name) concat b.sendMessage . ] #b map; , timer.reset ] ??# ] ?# , ] while ) [] #` ; . ] while bidders [ b topbidder = [ b.balance topbid - b.=balance ("Congratulations you won the auction. " topbid.show " has been deducted from your account balance") concat b.sendMessage ] [ ("Auction won by " topbidder.name " with bid of " topbid.show) concat b.sendMessage ] ?# b.disconnect . ] #b map;