Not logged in.

From instruction: Complexity, intensity and disorder

Code: Vodka needed by fogus

Take a shot of vodka for every wrong answer. Written in the Vodka programming language. http://projects.earthvssoup.com/vodka/

-m

(fn docompl ($c)
	(/ $c 3145727.0)
)

(fn dodis ($d)
	(* $d (rand))
)

(fn doin ($i)
	(* $i (* (docompl $i) (dodis $i)))
)

(fn process ($c $i $d)
	(:= @start (list $c $i $d))
	
	(:= @end 
		(list 
			(reduce docompl @start) 
			(reduce dodis @start) 
			(reduce doin @start)
		)
	)
	
	(reduce * @end)
)

(while t
	(print "Complexity?" endl)
	(:= $complexity (float (read)))

	(print "Intensity?" endl)
	(:= $intensity (float (read)))

	(print "Disorder?" endl)
	(:= $disorder (float (read)))	

	(print "What is your guess?" endl)
	(:= $guess (float (read)))
	
	(if (= $guess (process $complexity $intensity $disorder))
		RIGHT!
	 else
	 	WRONG!
	)
)

[download]

Written in Vodka. Released under the GPLv3 license