Loopus2011_ex2.c

loading
details
attribute value
description
owner Johannes Waldmann
uploaded 2017-08-17 03:45:23.0
disk size 385 Bytes
downloadable true
type
attribute value
name no_type
processor id 1
description this is the default benchmark type for rejected benchmarks and benchmarks that are not associated with a type.
owning community none
loading contents
int nondet();


void Loopus2011_ex2(int r, int s) {
int c = 4; int n; int f = 0; int d = 0;
do {
  n = nondet();
  if (c == 1 ) break;
  if (f) c /= 2;
  if (n > r) {
    if (d == 1 && !f) {f = 1; c /= 2; }
    d = 2; s += c;
    if (s > 255) break; }
  else if (n < r) {
    if (d == 2 && !f) {f = 1; c /= 2; }
    d = 1; s -= c;
    if (s < 0) break; }
  else break; }
while (1); 
}
popout

content may be truncated. 'popout' for larger text window.

actions get anonymous link download benchmark