Use the C language to write a hamster game

#include

#include

#include

Int main()

{

Int times;//number of games

Int mousex=0;//X-axis coordinates of the mouse

Int mousey=0;//Y-axis coordinates of the mouse

Int posx=0;//X-axis coordinates of the hammer

Int posy=0;//Y-axis coordinate of the hammer

Int hits=0;//Statistics of hitting mice

Int missed=0;//The number of statistical errors

Int i,row,col;//circular mouse effect variable

//1. Nine mouse holes and the number of times the mouse was hit

Srand(time(0));//random seed

Printf("â–¡â–¡â–¡â–¡â–¡â–¡â–¡â–¡â–¡");

Printf("Please enter the number of times the mouse is played:");

Scanf("%d",×);

//2. The effect of cycling multiple times

For(i=1;i<=times;i++)

{

//The random coordinates of the mouse

Mousex=rand()%3+1;//The random number of the mouse's X-axis coordinates from 1-3

Mousey=rand()%3+1;//The random number of the mouse's Y-axis coordinates from 1-3

/ / Determine the scope of use of the hammer

Do

{

Printf ("Please enter the coordinates of the hammer:");

Scanf("%d%d",&posx,&posy);

}while(posx<1 || posx>3 || posy<1 || posy>3);

/ / Determine whether the coordinates of the hammer and mouse are consistent

If(mousex==posx && mousey==posy)//Hit the mouse

Hits++;

Else

Missed++;

/ / Cycle print map

For(row=1;row<=3;row++)

{

For(col=1;col<=3;col++)

{

If(row==posy&&col==posx)//The coordinates of the hammer

Printf("â– ");

Else if(row==mousey&&col==mousex)//rat coordinates

Printf("☆");

Else

Printf("â–¡");

}

Printf("");

}

Printf("hit %d times, hit %d times", hits, missed);

}

Return 0;

}

Use the C language to write a hamster game

Waterproof Vertical Mount D-Sub Connectors


waterproof D-sub system is IP67 rated. These panel-mount connectors are available in solder cup as well as right angle and vertical PCB mount types. The cable-mount connector kit includes the connector, which has solder cup contacts. These connectors are available in 9-, 15-, and 25-positions in standard density and 15-, 26-, and 44-positions in high density. The recommended wire gauge for the solder cup connector is 22 AWG to 26 AWG.

These panel-mount waterproof D-subs are designed for rear-mount applications in panels that are up to 2.0 mm thick. They come with two sets of jackscrews. One jackscrew set is 5 mm long for panel thickness up to 1.2 mm, and the other is 6 mm long for panel thicknesses from 1.2 mm to 2.0 mm.

Cable mount D-sub connector kits come with the backshell, seal, thumbscrews, and solder cup connector. They are also easy to install. Simply fit the cable through the backshell, terminate the wire to the solder cup contacts, and hand tighten the cable nut on the rear of the backshell. The backshell will seal a particular range of cable diameters depending on the position count of the connector. Consult the datasheet for specific cable diameter ranges.


Specifications

Current rating

Standard D-sub: 5 A

Hi-density D-sub: 2 A

Breakdown voltage: ≥ AC 500 V/1 minute

Insulation resistance: ≥ 500 MΩ @ DC 500 V

Contact resistance: ≤ 20 mΩ


Material

Contacts: copper alloy, gold-plated

Connector body: nylon 9T or PBT, UL Recognized

Shell: steel, nickel-plated


Applications

DV camcorder

DV VTR

Non-linear editing system

Broadcast monitor

Betacam deck


Antenk waterproof d-sub connectors including


Panel Mount Waterproof D-Sub Connectors:
Water Proof D-Sub, Standard Density, Male, Panel Mount
Water Proof D-Sub, Standard Density, Female, Panel Mount
Water Proof D-Sub, Standard Density, Female, PCB Mount
Waterproof solder cup, stamped & formed contact D-sub waterproof
solder cup,machined contacts D-sub waterproof

Vertical Mount Waterproof D-Sub Connectors:
Combo Power + Signal D-Sub Connector, Vertical Mount, Pluge Type,

right angle D-sub waterproof
IP67 rated Combo power D-sub waterproof

Standard Density, Waterproof Vertical Mount D-Sub Connectors, High Density Waterproof Vertical Mount D-Sub Connectors,IP67 D-Sub Connectors Vertical Mount,Board Mount Waterproof Vertical Mount D-Sub Connectors

ShenZhen Antenk Electronics Co,Ltd , https://www.antenkcon.com