First test work commit, don't touch

This commit is contained in:
Robert Virding
2018-12-22 01:23:40 +01:00
parent 3ceb8c38db
commit d4d02fd576
97 changed files with 10599 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
// An implementation of the factorial function where each recursive
// call is to another contract. Not the cheapest way to compute factorial.
contract FactorialServer =
function fac : (int) => int
contract Factorial =
record state = {worker : FactorialServer}
function init(worker) = {worker = worker}
function set_worker(worker) = put(state{worker = worker})
function fac(x : int) : int =
if(x == 0) 1
else x * state.worker.fac(x - 1)