Animation simulation realizes passenger operation of elevator

Source: Internet
Author: User

Today, there is an electronic design contest to ask me the elevator running logic C code implementation, I think of learning data structure that will be written in C + +, but for a long time now also remember not clear, directly to the source code to him, let him see.

Think of yourself immediately to start a long and arduous number of model national training, the mood is not good ah.

The results of this sequencing run are as follows: ( to the source code below , but I have to uninstall the VS, I would like to run the next. exe file, the results can not be run, said lost MSVCP120.dll, but there are several previous)




This code can be animated in the form of:

1. The logical rule of realizing elevator manned

2. Elevator to open and close the door, to ensure that the person who went out before the people come in again, to exclude this layer of people to the situation

3. You can initialize any start position of the elevator (but normally it should be initialized at the lowest level)

4. Constantly after the human transport after the random generation of people (like online game brush)

5. Show the operating direction of the elevator and the floor where it is located

6. When the person in the corridor and other elevators when the circle (in circles to represent the person) inside the display is up or down, after entering the elevator to show the number of layers to go

7. Can adjust the elevator operating speed and dwell time

Now look at the code, can't bear looking straight ...

The code is as follows (to compile the pass, remember to add a EASYX graphics library to the VS2013 header file):

#include <graphics.h> #include <conio.h> #include <stdlib.h> #include <time.h> #include < queue> #include <vector> #include <string.h>using namespace std; #define SPEED 30//Elevator Tempo adjustment # define Stay_ Time 1500//elevator dwell times adjustment int tdt_a = 460, Tdt_b = 550, Dt_now_place = 0;//storage Elevator information on the completion of a passenger's service struct People{int now_place;//the number of layers in which the person is currently in T destination;//person to go to the target layer int index;//with this marking to facilitate in the priority queue to get into the elevator and let people out of the elevator operation int x, y;//person in the figure of the specific coordinates}peo[45];// In this program due to the limit of the display size so display up to 45 person struct cmp1//by start position from small to large sort {bool operator () (People A, people b) {return a.now_place > B.now_ Place;}}; struct cmp2//arranged by destination from small to large {bool operator () (People A, people b) {return a.destination > b.destination;}}; struct cmp3//sorted from large to small from start position {bool operator () (People A, people b) {return a.now_place < b.now_place;}}; struct cmp4//is arranged by destination from large to small {bool operator () (People A, people b) {return a.destination < b.destination;}}; struct Elevator{int A, b;//elevator current position specific coordinates (y-coordinate of the upper and Lower lines) (a<b) int C, D;int now_place;//the current number of floors of the elevator int go_place;// The elevator is going to the target layer int direction;//Elevator direction (-1 for undecided, 0 for down, 1 for up) int peo_num;//elevator number int seat[8];int flag;//means the elevator is open now, or closed (0 means close 1 means open)}dt;priority_queue <people, Vector<people>, cmp1> q1;//by starting position from small to large (only recorded the people upstairs, when the elevator) Priority_queue<people, vector< People&gt, cmp2> q2;//arranged by destination from small to large (only records upstairs, when the elevator is used)//when the situation is not continuous use of the queue priority_queue<people, vector<people Cmp1> q5;//by the starting position from small to large (only recorded upstairs, into the elevator when used) priority_queue<people, vector<people> cmp2> q6;// According to the destination from small to large arrangement (only recorded upstairs, when the elevator is used) priority_queue<people, Vector<people>, Cmp3> q3;//by the starting position from the big to the small sort (only recorded downstairs people, In the elevator when used) Priority_queue<people, Vector<people&gt, cmp4> q4;//by destination from the big to the small arrangement (only recorded downstairs people, when the elevator is used)// When the condition is not contiguous the queue priority_queue<people, Vector<people>, Cmp3> q7;//by the starting position from the big to the small sort (only recorded downstairs people, into the elevator when used) priority_ Queue<people, Vector<people>, cmp4> q8;//by destination from large to small (only the people who logged downstairs, when the elevator) void Init_people () {int peo_num[5];/ /store number of randomly generated elevators per floor (max 9 persons) int Peo_y[5][3] = {535, 505, 475, 435, 405, 375, 335, 305, 275, 235, 205, 175, 135, 105, 75};//The (center) Y coordinate exists in the array, convenient for a point int peo_x[3] = {330, 360, 390};//The x-coordinate where the person is located (with a circle representing the person, that is, the center coordinate) srand ((unsigned) time (NULL));//Seeding child while ( !q1.empty ())//queue initialization {Q1.pop ();} while (!q2.empty ()) {Q2.pop ();} while (!q3.empty ())//queue initialization {Q3.pop ();} while (!q4.empty ()) {Q4.pop ();} while (!q5.empty ())//queue initialization {Q5.pop ();} while (!q6.empty ()) {Q6.pop ();} while (!q7.empty ())//queue initialization {Q7.pop ();} while (!q8.empty ()) {Q8.pop ();} for (int i = 0; i < 5; i++) {Peo_num[i] = rand ()% 4;//randomly generates 0-9 number//Changes!!!!!!!!!!!!!!!!! }/*/////////////////////////////////////////////////peo_num[0] = 0; PEO_NUM[1] = 2; PEO_NUM[2] = 1; PEO_NUM[3] = 0; Peo_num[4] = 0;//////////////////////////////////////////////////*/int k = 0;for (int i = 0; i < 5; i++) {for (int j = 0 ; J < Peo_num[i]; J + +) {Peo[k]. Now_place = i;//Initializes the person's current position while (1)//randomly generates the destination that the person wants to go (and excludes this layer of people from going to this layer) {int T1 = rand ()% 5; PEO[K]. Destination = t1;if (T1! = i) {break;}} Setlinecolor (GREEN);//Set the Circle Color Circle (PEO_X[J/3], peo_y[i][j% 3], 15);//With the drawn circle represents the person//tchar s[5];//_stprintf_s (s, _t ("%d") , Peo[k]. Destination); The high version VC recommends using the _stprintf_s function//outtextxy (PEO_X[J/3], peo_y[i][j% 3], s), if (Peo[k]. Destination > Peo[k]. Now_place) {TCHAR c = _t (' on '); Outtextxy (PEO_X[J/3], peo_y[i][j% 3], c);} Else{tchar C = _t (' down '); Outtextxy (PEO_X[J/3], peo_y[i][j% 3], c);} peo[k].x = peo_x[j/3];//records the person's coordinates for the specific position in the diagram (for easy follow-up) Peo[k].y = peo_y[i][j% 3];//enqueue the person in all cases if (peo[k]. Now_place >= dt. NOW_PLACE&AMP;&AMP;PEO[K]. Now_place < Peo[k]. Destination) {Q1.push (peo[k]); Q2.push (Peo[k]);} if (Peo[k]. Now_place >= dt. NOW_PLACE&AMP;&AMP;PEO[K]. Now_place > Peo[k]. Destination) {Q3.push (peo[k]); Q4.push (Peo[k]);} if (Peo[k]. Now_place < dt. NOW_PLACE&AMP;&AMP;PEO[K]. Now_place < Peo[k]. Destination) {Q5.push (peo[k]); Q6.push (Peo[k]);} if (Peo[k]. Now_place < dt. NOW_PLACE&AMP;&AMP;PEO[K]. Now_place > Peo[k]. Destination) {Q7.push (peo[k]); Q8.push (Peo[k]);} k++;}}} void Background_init () {line (100, 50, 100, 550);//Draw the lines on both sides of the lift (300, 150, 400, 150);//Draw Floor (300, 2 Line (300, 350, (+), line (+, 550, +, 550), Setlinecolor (YELLOW);//Draw Rectangle Elevator Rectangle (130, 460, 270, 550); TCHAR s[] = _t ("elevator_state");//Elevator Status Display bar Outtextxy (5, s); TCHAR s1[] = _t ("now_place:"); Outtextxy (ten, S1); TCHAR s2[] = _t ("Direction:"); Outtextxy (Ten, A, S2); TCHAR s3[] = _t ("Peo_num:"); Outtextxy (ten, S3);                     LOGFONT F1;gettextstyle (&AMP;F1);                      Gets the current font settings settextcolor (RED); f1.lfweight = 900;f1.lfheight = 30;    Set the font height to 48_tcscpy_s (f1.lffacename, _t ("blackbody"));    Set the font to "bold" (high version VC recommends using the _tcscpy_s function) f1.lfquality = antialiased_quality;                     Set the output effect to anti-aliasing Settextstyle (&AMP;F1); Set font style OUTTEXTXY (_t ("Elevator Simulation System"));                     LOGFONT F2;gettextstyle (&AMP;F2);    Gets the current font settings settextcolor (white); f2.lfweight = 100;f2.lfheight = 15;_tcscpy_s (F2.lffacename, _t ("blackbody"));    Set the font to "bold" (high version VC recommends using the _tcscpy_s function) f2.lfquality = antialiased_quality;                   Set the output effect to anti-aliasing Settextstyle (&AMP;F2);  Set the font style}void Elevator_init () {dt.a = 460;dt.b = 550;dt. Direction = 1;//1 indicates direction upward, 0 indicates direction downward dt. Now_place = 0;dt. Peo_num = 0;for (int i = 0; i < 8; i++) {Dt.seat[i] = -1;//Initialize each location of the elevator no one}}void elevator_init2 () {dt.a = tdt_a;dt.b = Tdt_ B;//dt. Direction = 1;//1 indicates direction upward, 0 indicates direction downward dt. Now_place = Dt_now_place;//dt. Peo_num = 0;for (int i = 0; i < 8; i++) {Dt.seat[i] = -1;//Initialize each position of the elevator no one}}int Concret1 (People TQ)//The specific operation function {if (dt.a > dt.c) {int T1 = dt.a;int t2 = dt.b;while (dt.a >= dt.c) {/********************** This part of the code is to implement the elevator and lift my wife animation move ************** /setfillcolor (black);//Remove the person from Setlinecolor (black);//Notice that the fill of the circle includes the outer frame, so the color of the line is also set to black!!! for (int i = 0; i < 8; i++) {if (dt.seat[i]! =-1) {fillcircle (i% 4 *, t2-20-i/4 * 40, 15);}} Setlinecolor (GREEN); for (int i = 0; i < 8; i++) {if (dt.seat[i]! =-1) {circle + i% 4 *, dt.b-20-i/4 * 40, 15);//Determine the coordinates of the drawn circle by the relationship between coordinates tchar s[5];_stprintf_s (s, _t ("%d"), dt.seat[i]);//Draw the floor of the person to be on the center of the Circle Outtextxy (4 *, dt.b-20-i/4 * +, s);}} Setlinecolor (BLACK), Rectangle (t1, T2), Setlinecolor (YELLOW), Rectangle (dt.a) dt.b = T1 = dt.a;t2 ;d T.A-= 5;dt.b-= 5; Sleep (speed);/************************************************************************************************ /}dt.a + = 5;dt.b + = 5;} if (Dt.a < dt.c) {int T1 = dt.a;int t2 = dt.b;while (dt.a <= dt.c) {setfillcolor (black);//Remove Man from Setlinecolor (black);//Note Meaning this round fill is to include the outer frame, so the color of the line is also set to black!!! for (int i = 0; i < 8; i++) {if (dt.seat[i]! =-1) {fillcircle (i% 4 *, t2-20-i/4 * 40, 15);}} Setlinecolor (GREEN); for (int i = 0; i < 8; i++) {if (dt.seat[i]! =-1) {circle + i% 4 *, dt.b-20-i/4 * 40,  15);//Determine the coordinates of the drawn circle by the relationship between coordinates tchar s[5];_stprintf_s (s, _t ("%d"), dt.seat[i]);//Draw the floor of the person to be on the center of the Circle Outtextxy (4 *, dt.b- 20-i/4 * +, s);}} Setlinecolor (BLACK), Rectangle (t1, T2), Setlinecolor (YELLOW), Rectangle (dt.a) dt.b = T1 = dt.a;t2 ;d T.a + = 5;dt. B + = 5; Sleep (speed);} DT.A-= 5;dt.b-= 5;} TCHAR s[5];//shows the floor where the elevator is located _stprintf_s (S, _t ("%d"), dt. Now_place); Outtextxy (n, s);//Specific person code if (!dt.flag) {Dt.flag = 1;setlinecolor (BLACK);//Elevator stay open Line (270, dt.c, DT.D);} Setfillcolor (black);//Remove Setlinecolor (Black), fillcircle (tq.x, TQ.Y, 15);//is a person into the//sleep (); Setlinecolor ( GREEN), for (int i = 0; i < 8; i++) {if (dt.seat[i] = = 1) {Dt.seat[i] = TQ. Destination;circle (4 *, dt.d-20-i/4 * 40, 15);//coordinates are determined by the coordinates of the circle to be drawn Tchar s[5];_stprintf_s (S, _t ("%d"), dt. Seat[i]);//draw at the center of the circle the person is going to the floor outtextxy (4 *, dt.d-20-i/4 * +, s); break;}} Sleep (Stay_time), if (Dt.flag)//If the door is open, close the elevator door {Dt.flag = 0;setlinecolor (YELLOW); line (+, dt.c, +, DT.D);} return 1;} int Concret2 ()//passenger out elevator specific operation {if (Dt.a > dt.c) {int T1 = dt.a;int t2 = dt.b;while (dt.a >= dt.c) {/********************** this Part of the code is to achieve the elevator and elevator my wife's animation mobile ************************************/setfillcolor (black);//Remove the person setlinecolor (black);// Note that the fill of this circle includes the outer frame, so the color of the line is also set to black!!! for (int i =0; I < 8; i++) {if (dt.seat[i]! =-1) {fillcircle (+ 4 *, T2-20-i/4 * 40, 15);}}  Setlinecolor (GREEN);//Generate person for (int i = 0; i < 8; i++) {if (dt.seat[i]! =-1) {circle + i% 4 *, dt.b-20-i/4 * 40, 15);//Determine the coordinates of the drawn circle by the relationship between the coordinates TCHAR s[5];_stprintf_s (s, _t ("%d"), dt.seat[i]);//Draw the floor of the person to be on the center of the circle Outtextxy (x + i% 4 *, D T.b-20-i/4 * +, s);}} Setlinecolor (BLACK), Rectangle (t1, T2), Setlinecolor (YELLOW), Rectangle (dt.a) dt.b = T1 = dt.a;t2 ;d T.A-= 5;dt.b-= 5; Sleep (speed);/************************************************************************************************ /}dt.a + = 5;dt.b + = 5;} if (Dt.a < dt.c) {int T1 = dt.a;int t2 = dt.b;while (dt.a <= dt.c) {setfillcolor (black);//Remove Man from Setlinecolor (black);//Note Meaning this round fill is to include the outer frame, so the color of the line is also set to black!!! for (int i = 0; i < 8; i++) {if (dt.seat[i]! =-1) {fillcircle (i% 4 *, t2-20-i/4 * 40, 15);}} Setlinecolor (GREEN);//Generate person for (int i = 0; i < 8; i++) {if (dt.seat[i]! =-1{Circle (x + i% 4 *, dt.b-20-i/4 * 40, 15);//Determine the coordinates of the drawn circle by the relationship between coordinates tchar s[5];_stprintf_s (s, _t ("%d"), Dt.seat[i]); /Draw the floor where this person is going at the center Outtextxy (4 + i% *, dt.b-20-i/4 * +, s);}} Setlinecolor (BLACK), Rectangle (t1, T2), Setlinecolor (YELLOW), Rectangle (dt.a) dt.b = T1 = dt.a;t2 ;d T.a + = 5;dt.b + = 5; Sleep (speed);} DT.A-= 5;dt.b-= 5;} TCHAR s[5];//shows the floor where the elevator is located _stprintf_s (S, _t ("%d"), dt. Now_place); Outtextxy (x, s); tdt_a = dt.a;//records the actual coordinate position of the elevator after a passenger has completed (since this function is the last function performed by a passenger) Tdt_b = Dt.b;dt_now_place = dt. now_place;//specific passenger out of the elevator code if (!dt.flag) {Dt.flag = 1;setlinecolor (BLACK);//Elevator stay open Line (+, dt.c,, DT.D);} Setfillcolor (black);//Remove the person setlinecolor (black);//Note that this circle is filled with the outer frame, so the color of the line is also set to black!!! for (int i = 0; i < 8; i++) {if (dt.seat[i] = = dt. Now_place) {fillcircle (4 *, dt.b-20-i/4 *, +);d t.seat[i] = 1;}} Sleep (Stay_time), if (dt.flag) {Dt.flag = 0;setlinecolor (YELLOW);//Elevator close line (+, dt.c, +, DT.D);} return 1;} void Q1_q2 () {while (!q2.empty () && q2.top (). Destination = = dt. Now_place)//out of the elevator (be sure to use the while loop to ensure that many people out of the elevator queue elements removed cleanly) {people tq1 = Q2.top (); Q2.pop (); switch (tq1. Destination) {Case 0:dt.c = 460;DT.D = 550;if (Concret2 ())//Repetitive code must be made into function {break;} Case 1:dt.c = 360;DT.D = 450;if (Concret2 ())//Repetitive code must be made into function {break;} Case 2:dt.c = 260;DT.D = 350;if (Concret2 ())//Repetitive code must be made into function {break;} Case 3:dt.c = 160;DT.D = 250;if (Concret2 ())//Repetitive code must be made into function {break;} Case 4:dt.c = 60;DT.D = 150;if (Concret2 ())//Repetitive code must be made into function {break;}}} while (!q1.empty () && q1.top (). Now_place = = dt. Now_place)//a person into the elevator {people tq1 = Q1.top (); Q1.pop (); switch (dt. Now_place) {Case 0:dt.c = 460;DT.D = 550;if (Concret1 (TQ1))//Repetitive code must be made into function {break;} Case 1:dt.c = 360;DT.D = 450;if (Concret1 (TQ1))//Repetitive code must be made into function {break;} Case 2:dt.c = 260;DT.D = 350;if (Concret1 (TQ1))//Repetitive code must be made into function {break;} Case 3:dt.c = 160;DT.D = 250;if (Concret1 (TQ1))//Repetitive code must be made into function {break;} Case 4:dt.c = 60;DT.D = 150;if (Concret1 (TQ1))//Repetitive code must be made into function {break;}}} void Q5_q6 () {while (!q5.empty() && q5.top (). Now_place = = dt. Now_place)//a person into the elevator {people tq1 = Q5.top (); Q5.pop (); switch (dt. Now_place) {Case 0:dt.c = 460;DT.D = 550;if (Concret1 (TQ1))//Repetitive code must be made into function {break;} Case 1:dt.c = 360;DT.D = 450;if (Concret1 (TQ1))//Repetitive code must be made into function {break;} Case 2:dt.c = 260;DT.D = 350;if (Concret1 (TQ1))//Repetitive code must be made into function {break;} Case 3:dt.c = 160;DT.D = 250;if (Concret1 (TQ1))//Repetitive code must be made into function {break;} Case 4:dt.c = 60;DT.D = 150;if (Concret1 (TQ1))//Repetitive code must be made into function {break;}}} if (Dt.flag)//If the door is open, close the elevator door {setlinecolor (YELLOW); line (dt.c, DT.D);} while (!q6.empty () && q6.top (). Destination = = dt. Now_place)//out of the elevator (be sure to use the while loop to ensure that many people out of the elevator queue elements removed cleanly) {people tq1 = Q6.top (); Q6.pop (); switch (tq1. Destination) {Case 0:dt.c = 460;DT.D = 550;if (Concret2 ())//Repetitive code must be made into function {break;} Case 1:dt.c = 360;DT.D = 450;if (Concret2 ())//Repetitive code must be made into function {break;} Case 2:dt.c = 260;DT.D = 350;if (Concret2 ())//Repetitive code must be made into function {break;} Case 3:dt.c = 160;DT.D = 250;if (Concret2 ())//Repetitive code must be made into function {break;} Case 4:dt.c = 60;DT.D = 150;if (CoNcret2 ())//Repetitive code must be made into a function {break;}}} void Q3_q4 () {while (!q3.empty () && q3.top (). Now_place = = dt. Now_place)//a person into the elevator {people tq1 = Q3.top (); Q3.pop (); switch (dt. Now_place) {Case 0:dt.c = 460;DT.D = 550;if (Concret1 (TQ1))//Repetitive code must be made into function {break;} Case 1:dt.c = 360;DT.D = 450;if (Concret1 (TQ1))//Repetitive code must be made into function {break;} Case 2:dt.c = 260;DT.D = 350;if (Concret1 (TQ1))//Repetitive code must be made into function {break;} Case 3:dt.c = 160;DT.D = 250;if (Concret1 (TQ1))//Repetitive code must be made into function {break;} Case 4:dt.c = 60;DT.D = 150;if (Concret1 (TQ1))//Repetitive code must be made into function {break;}}} if (Dt.flag)//If the door is open, close the elevator door {Dt.flag = 0;setlinecolor (YELLOW); line (+, dt.c,, DT.D);} while (!q4.empty () && q4.top (). Destination = = dt. Now_place)//out of the elevator (be sure to use the while loop to ensure that many people out of the elevator queue elements removed cleanly) {people tq1 = Q4.top (); Q4.pop (); switch (tq1. Destination) {Case 0:dt.c = 460;DT.D = 550;if (Concret2 ())//Repetitive code must be made into function {break;} Case 1:dt.c = 360;DT.D = 450;if (Concret2 ())//Repetitive code must be made into function {break;} Case 2:dt.c = 260;DT.D = 350;if (Concret2 ())//Repetitive code must be made into function {break;} Case 3:dt.c = 160;DT.D =250;if (Concret2 ())//Repetitive code must be made into a function {break;} Case 4:dt.c = 60;DT.D = 150;if (Concret2 ())//Repetitive code must be made into function {break;}}} void Q7_q8 () {while (!q7.empty () && q7.top (). Now_place = = dt. Now_place)//a person into the elevator {people tq1 = Q7.top (); Q7.pop (); switch (dt. Now_place) {Case 0:dt.c = 460;DT.D = 550;if (Concret1 (TQ1))//Repetitive code must be made into function {break;} Case 1:dt.c = 360;DT.D = 450;if (Concret1 (TQ1))//Repetitive code must be made into function {break;} Case 2:dt.c = 260;DT.D = 350;if (Concret1 (TQ1))//Repetitive code must be made into function {break;} Case 3:dt.c = 160;DT.D = 250;if (Concret1 (TQ1))//Repetitive code must be made into function {break;} Case 4:dt.c = 60;DT.D = 150;if (Concret1 (TQ1))//Repetitive code must be made into function {break;}}} if (Dt.flag)//If the door is open, close the elevator door {Dt.flag = 0;setlinecolor (YELLOW); line (+, dt.c,, DT.D);} while (!q8.empty () && q8.top (). Destination = = dt. Now_place)//out of the elevator (be sure to use the while loop to ensure that many people out of the elevator queue elements removed cleanly) {people tq1 = Q8.top (); Q8.pop (); switch (tq1. Destination) {Case 0:dt.c = 460;DT.D = 550;if (Concret2 ())//Repetitive code must be made into function {break;} Case 1:dt.c = 360;DT.D = 450;if (Concret2 ())//Repetitive code must be made into function {break;} Case 2:dt.c = 260;DT.D = 350;if (Concret2 ())//Repetitive code must be made into function {break;} Case 3:dt.c = 160;DT.D = 250;if (Concret2 ())//Repetitive code must be made into function {break;} Case 4:dt.c = 60;DT.D = 150;if (Concret2 ())//Repetitive code must be made into function {break;}}} void Elevator_run_up1 () {while (dt. Now_place <= 4) {TCHAR s[] = _t ("Up"),//display the direction of the elevator, with the space bar to cover the last display residue Outtextxy (ten, A, s); Q1_Q2 ();d T. now_place++;} Dt. now_place--;} void Elevator_run_up2 () {while (dt. Now_place <= 4) {TCHAR s[] = _t ("Up"),//display the direction of the elevator, with the space bar to cover the last display residue Outtextxy (ten, A, s); Q5_q6 ();d T. now_place++;} Dt. now_place--;} void Elevator_run_down1 () {while (dt. Now_place >= 0) {TCHAR s[] = _t ("Down"),//show the direction of the elevator operation, with the space bar to cover the last display residue Outtextxy (ten, A, s); Q3_q4 ();d T. now_place--;} Dt. now_place++;} void Elevator_run_down2 () {while (dt. Now_place >= 0) {TCHAR s[] = _t ("Down"),//show the direction of the elevator operation, with the space bar to cover the last display residue Outtextxy (ten, A, s); Q7_q8 ();d T. now_place--;} Dt. now_place++;} int main () {Initgraph (400, 600);//sets the size of the output box Background_init ();//initializes the entire background graphic elevator_init (); char C = 1;while (1) {//Get button//c = _getch ();//iF (c = = 113)//Press the Q key to initiate the initialization of the human state Refresh//{init_people ();//}//if (c = = 27)//press ESC to terminate the entire program running//{//break;//}//_getch ();// Press any key elevator to start running elevator_run_up1 (); Elevator_run_down1 (); Elevator_run_up2 (); ELEVATOR_RUN_DOWN2 (); Elevator_init2 ();//tchar s[] = _t ("Stop");//show Elevator is in the stop state, with the space bar to cover the last display residue//outtextxy (ten, A, s);} Closegraph ();//close Drawing screen}





Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Animation simulation realizes passenger operation of elevator

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.