MCPcopy Create free account
hub / github.com/MultithreadedJSBook/code-samples / main

Function main

ch1-c-threads/happycoin.c:37–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37int main() {
38 uint32_t seed = time(NULL);
39 int count = 0;
40 for (int i = 1; i < 10000000; i++) {
41 uint64_t random_num = random64(&seed);
42 if (is_happycoin(random_num)) {
43 printf("%" PRIu64 " ", random_num);
44 count++;
45 }
46 }
47 printf("\ncount %d\n", count);
48 return 0;
49}

Callers

nothing calls this directly

Calls 2

random64Function · 0.70
is_happycoinFunction · 0.70

Tested by

no test coverage detected