Esempio n. 1
0
void update(team *overall, batsman *team1, bowler *team2, matchinfo *info) { /*it is main updater function*/
	char a[4];
	char *e = "%s";
	int v, x;
	system("clear");
	start(overall);
	in_the_ground(team1);
	warming_up(team2);
	move(10, 11);
	printf("\e[1menter name of batsman on stike: " ANSI_COLOR_RESET);
	move(45, 11);
	scanf(e, name);
	onstrike = send_batsman(team1, name);
	move(10, 12);
	printf("\e[1menter name of batsman off strike:"  ANSI_COLOR_RESET);
	move(45, 12);
	scanf(e, name);
	offstrike = send_batsman(team1, name);
	taking_guard(onstrike);
	taking_guard(offstrike);
	move(10, 13);
	printf("\e[1menter name of bowler: "  ANSI_COLOR_RESET);
	move(35, 13);		
	scanf(e, name);	
	bowling = give_bowl(team2, name);
	shining_bowl(bowling);
	x = 27;
	while((overall->balls != (info->overs * 6)) && (overall->wickets != 10)) {
		move(0, 26);     	
		printf("\e[1menter runs made , wicket(w), wide(y), noball(n), extra(e) end inning(esc)"  ANSI_COLOR_RESET);
		move(0, x);		
		scanf("%s", a);
		x = 27;
		if(a[0] == 27)
			break;
		input(a);
		if(wrong) {
			move(0, 28);
			printf("\e[1mINVALIND INPUT:"  ANSI_COLOR_RESET);
			x = 29;
			wrong = 0;
			continue;
		}
		else if(ab[0] == '\0')
			add_runs_with_no_extra(team1, team2, overall, info);
		else {			
			if(ab[0] == 'y' || ab[0] == 'n' || ab[0] == 'e') {
				add_runs_with_extra(team1, team2, overall, info);
			}
			else {
				move(0,28);
				printf("\e[1mbowled(b), caught(c), lbw(l), run out(r), retired hurt(h), heatwicket(t), time out(o)"  ANSI_COLOR_RESET);
				move(0, 29);
				wicket(team1, team2, overall, info);			
			}
		}
		if((overall->innings == 2) && overall->target <= 0) 
			break;			
	}
Esempio n. 2
0
void mode6(void)
{
	set_all_servo(ON);
	deploy_legs();
	delay_s(1);
	warming_up();
	delay_s(2);
	set_all_servo(OFF);
}