Skip to content
Permalink
Browse files

example dir

  • Loading branch information...
scauligi committed Feb 22, 2019
1 parent 23663ca commit d1c7f6f1948ceef97526f3de35e59cae4a298238
Showing with 26 additions and 0 deletions.
  1. +12 −0 example/example.fact
  2. +14 −0 example/main.c
@@ -0,0 +1,12 @@
export secret uint32 choose(
secret bool cond,
public uint32 a,
public uint32 b) {

secret mut uint32 output = a;
if (cond) {
output = b;
}

return output;
}
@@ -0,0 +1,14 @@
#include <stdio.h>
#include <stdint.h>

#include "example.h"

int main() {
uint32_t a = 221;
uint32_t b = 24;

printf("choose(0, 221, 24) => %u\n", choose(0, a, b));
printf("choose(1, 221, 24) => %u\n", choose(1, a, b));

return 0;
}

0 comments on commit d1c7f6f

Please sign in to comment.
You can’t perform that action at this time.