Home
last modified time | relevance | path

Searched refs:red_hp (Results 1 – 1 of 1) sorted by relevance

/system/utest/fit/examples/
A Dpromise_example2.cpp113 auto play_round(int* red_hp, int* blue_hp) { in play_round() argument
116 [red_hp, blue_hp]( in play_round()
120 *red_hp = std::max(*red_hp - std::get<1>(damages).value(), 0); in play_round()
121 printf("Hit-points remaining: red %d, blue %d\n", *red_hp, *blue_hp); in play_round()
122 if (*red_hp != 0 && *blue_hp != 0) in play_round()
127 if (*red_hp == 0 && *blue_hp == 0) in play_round()
129 else if (*red_hp != 0) in play_round()
143 return fit::make_promise([red_hp = 100, blue_hp = 100](fit::context& context) mutable { in play_game()
148 [&red_hp, &blue_hp, in play_game()
153 round = play_round(&red_hp, &blue_hp); in play_game()

Completed in 2 milliseconds