• C / C + + programming diary: strategy play strange text games (repair optimization version with source code)

Time：2021-2-12

This game is very simple. It is a game composed of a for loop, several while and multiple if statements   #includeusingnamespacestd;intmain(){intshengming=30,gongji=10,jinbi=10,smsx=30,duobi1=3;inta=0,b=0,c=0,d=0;cout< for(inti=0;i<1;i–){cout<>a;if(a==1){while(1){cout<=10″<=40″<=15″<>b;if(b==1&&jinbi>=10){ while(1){cout<>c;if(c==1&&jinbi>=10){gongji+=5;jinbi-=10;cout<=50){gongji+=25;jinbi-=50;cout<   <=200){gongji+=100;jinbi-=200;cout<=1000){gongji+=500;jinbi-=1000;cout< {break;}elseif(c>3){cout<=10){shengming=smsx;jinbi-=10;cout<=40){while(1){cout<>c;if(c==1){smsx+=10;shengming+=10;jinbi-=40;cout< <=100){smsx+=25;shengming+=25;jinbi-=100;cout<=400){smsx+=100;shengming+=100;jinbi-=400;cout<=2000){smsx+=500;shengming+=500;jinbi-=2000;cout< <=15){while(1){cout<>c;if(c==1){duobi1+=1;jinbi-=15;cout<   <=100){duobi1+=10;jinbi-=150;cout<=400){duobi1+=20;jinbi-=300;cout< <=2000){duobi1+=100;jinbi-=1500;cout< Hit 100 to get 100 “gold coin”<>b;if(b==1){intsm=20,gj=10;intduobi=duobi1;cout<0){cout<>c;if(c==1){shengming-=gj;sm-=gongji;cout<0){cout< < <0){cout<>c;if(c==1){shengming-=gj;sm-=gongji;cout<0){cout<   <0){cout<>c;if(c==1){shengming-=gj;sm-=gongji;cout< <0){cout< <0){cout< Enter: C; if (C = = 1) {Shengming – = […]

• Explanation of algorithm comprehension and analysis of greedy algorithm

Time：2020-12-3

Greedy Algorithm  Part 1  Introduction of greedy algorithm Greedy algorithm is an algorithm that starts from a certain initial state and advances to the goal by selecting the local optimal solution every time, and finally expects to obtain the overall optimal solution. According to this definition, the greedy selection criterion is to choose the “best” […]

• Tutorial document | 3D Parkour game development

Time：2020-10-10

This tutorial will lead you to develop a complete 3D Parkour game from scratch. It is mainly for readers who have some experience in egret2d development. You can learn from egretpro development hand in hand, and quickly start your journey of egretrpro development. Here is the whole process of making the game. Game making Before […]

• [big data practice] ksql stream processing — how to output multiple streams to a topic

Time：2020-6-15

[big data practice] ksql flow processing — how to push the data processing results to the specified topic Requirement scenario description In the production environment, each business service generateseventWill be pushed toKafkaMessage middleware. For example: for the recharge CenterRecharge eventIt will be pushed to KafkarechargeIn topic, playersSettlement eventIt will be pushed to Kafkagame_scoreTopic. The platform […]

• C programming (3): Cantor table

Time：2020-6-14

Example 3 Cantor table Title Description One of the famous proofs of modern mathematics is Georg Cantor’s proof that rational numbers are enumerable. He proved the proposition with the following table: 1/1  1/2  1/3  1/4  …… 2/1  2/2  2/3  …… 3/1  3/2  …… 4/1  …… …… Now we use the Z-type method to number each […]

• How to store players’ gold coins in reworld

Time：2020-2-19

Function effect display Running environment Win7，Win8，Win10 Reworld version experience version VC? Redist.x64 running environment Supplement for zero base readers Download and install the corresponding version of reworld Reworld official website: http://www.reworlder.com/ Reworld creator’s Home Forum: http://bbs.reworlder.com After downloading and installing, register an account to open the empty map Download and install VC? Redist.x64.rar running environment […]

• The Solution of Pirate Sharing Problem by SQL (Greedy Algorithms)

Time：2019-9-24

problem Economically, there is a “pirate dividend” model: five pirates snatched 100 gold coins, and they put forward the plan in the order of drawing lots: first, the distribution plan was put forward by No. 1, then five people voted, more than half agreed that the plan was passed, otherwise he would be thrown into […]