Rebirth: I Carry A Desktop Computer Inside Me - #28 - Chapter 28 It’S Hard For You Computer Students To Find A Girlfriend
- Home
- Rebirth: I Carry A Desktop Computer Inside Me
- #28 - Chapter 28 It’S Hard For You Computer Students To Find A Girlfriend
Minesweeper is actually a classic game, but the overall design difficulty is not high.
There are a few things that need to be paid attention to, such as how to implement it. If there are no mines in the clicked place, the blank space will extend and expand all the plots that have no mines.
“We have four layers for the entire minesweeper, covering layer, mine layer, digital layer and background layer.” Jiang Cheng held the design drawing and communicated with Zhu Jian.
“We can use the Picturebox component to implement the interface framework. I can give this one a try.” Zhu Jian nodded and took over the interface.
Of course Jiang Cheng had no problem, “I’ll take care of the header files.”
When designing a game for the first time, Jiang Cheng didn’t think about how big the game would be, nor did he think about innovation or anything like that. Instead, he started by referring to the classic scanning game.
First, they designed a simple game with a 9*9 grid. Later, the two of them enriched the code and expanded it to intermediate and advanced levels.
The two had a simple communication and planned to get started first by sorting out the basic game initialization interface and mouse gesture definitions.
None of them are very experienced. When it comes to programming, Zhu Jian is more experienced.
At the beginning, Jiang Cheng also stumbled a bit. After all, although he had tried many programming experiments on the in-body computer, they were generally exercises, which were somewhat different from current practice.
The exercises only need to implement one or two small functions.
But the real development of games is different, and you have to face various needs.
Header files, also called header files, reuse global variables (functions) in multiple code files to prevent definition conflicts.
Although Jiang Cheng had had contact with it before, his mastery was not very good. In order to improve this program, he was learning and experimenting at the same time, and slowly compiled the header files.
#include <stdio.h>
#include <stdib.h>
#include <time.h>
…………
Freshman life is on the right track.
Jiang Cheng coordinated and attended computer and software engineering classes according to the curriculum (some classes were taken together). At the same time, he followed his own study plan and got more exposure to software engineering courses. The rest of the time, he and Zhu Jian worked together to improve mine clearance. game.
Progress is rapid.
By the end of September, Jiang Cheng’s minesweeper game was ready for debugging.
Hao Yongjun provided some picture materials to make the simple frame interface look better.
For example, the covering blocks on the thunder are more three-dimensional, and when the thunder is pressed, there will be a small explosion effect.
Jiang Cheng copied the code, directly connected it through the LAN, and imported it into the computer in his body.
Start the simulation run.
After all, it is a computer inside the body, and Jiang Cheng can quickly debug it according to his inner requirements.
Soon, he discovered many minor problems or areas where the code was not optimized enough.
“Fourth, look at this paragraph. What I considered before was to open the blank space and extend it in four directions one by one, but there are too many codes and it is not optimized enough.” Jiang Cheng pointed to one of the paragraphs and said, “I think we Use a different idea to do this algorithm.”
While talking, Jiang Cheng started to change the code
if(test(mine, x, y)==0)
{ ˘ board[x][y] = ‘ ‘;
for (i = x-1; i
{ int j;
for (j = y-1; j
…………
Zhu Jian looked at it and nodded, “Yes, this is better.”
Hao Yongjun was eating the apple and couldn’t wait to ask, “How’s it going? Is it ready? Let’s try it?”
Zhu Jian raised his eyebrows, “Come on, I’ll be fine soon.”
After all, this is my first game design. Although it is developed based on classic games, it is still coded in my own hands. There is no copying of code, and there is no monopoly on the world. There is a feeling of joint participation.
After a while, a program with a size of less than 1M was released.
I shared it with Hao Yongjun and Xu Siyuan through KouKou, and everyone started the game.
Click on the program, and a sky-blue frame interface will open.
It’s similar to classic Minesweeper, but there aren’t that many options, only the 9*9 entry-level version.
The game has three options: low, medium and high. The low level has 10 mines, the medium level has 20 mines, and the high level has 40 mines.
Hao Yongjun played with it for a while and said, “It feels good, especially this thunder explosion animation. Well, what I did is pretty good…”
“Superficial.” Xu Siyuan snorted, quickly clicked with his hand, and he finished the game in one go, “Master Minesweeper, clear it in seconds.”
Jiang Cheng smiled and said, “I’ll see if we can add an online function later, the four of us can compare our mine clearance speeds and become masters of mine clearance.”
“This is possible. Let’s just practice. How to implement these online functions?” Zhu Jian’s eyes lit up.
This practice of mini-games allowed him to gain a lot of experience. Although Jiang Cheng contributed more to the main program, he also participated in the development and basically mastered it.
Hao Yongjun was a little anxious, “Don’t be too fast. Siyuan and I are also learning. We are still learning. Wait for us to come together.”
He could tell that Jiang Cheng had a strong learning ability and good hands-on skills. Only by working with him could he master his skills quickly.
If you just rely on taking classes, you will generally not be able to join the project experiment team until after your sophomore year.
But now it’s only been a month, and Jiang Chengcheng has started to take everyone to fix it on their own.
“Next time we choose a project, we can ask the teacher to help guide us.” Jiang Cheng nodded, “It’s better to do a small minesweeper now. For really big programs or games, we still lack experience.”
Zhu Jian chuckled and said, “Who told you, a pervert, to lead us in game development as soon as school starts?”
“If we do this, it will be easy to make money in the future!” Jiang Cheng blinked his clean eyes.
“That’s true.” Zhu Jian smiled, “But I don’t want to become a coder in a game company.”
Jiang Cheng suggested, “Let’s take a few days off and continue self-study. During the National Day, we’ll think about what projects we should do next. Do you have any good suggestions?”
“No, third child, you can figure out what to do, and we’ll just follow suit.” Hao Yongjun said, “Although the pressure in class is not great, there is a lot of self-study after class, so I don’t have time.”
“Stop talking, I’m reading one dollar calculus.” Xu Siyuan said very little, turned off the Minesweeper game, and continued to study hard.
—————————-
Since the beginning of school, Jiang Cheng has devoted himself wholeheartedly to the learning process. He will make one or two phone calls every week, and most of the time, he is doing self-study and programming exercises.
“Chengzi, do you have a National Day holiday?” Chen Ru took the phone and asked.
“I have seven days off. I don’t know what I’m going to do. I might just study on my own at school.” Jiang Cheng also knew that it was not realistic to go back these days.
After all, Guanglin County is too far from Kyoto.
“It’s better to move around and stop immersing yourself in books.”
“Okay, I understand. I’ll go visit Kyoto later.” Jiang Cheng immediately accepted his mother’s criticism and suggestions.
“That’s about it. Winter is coming soon. You need to buy a few more sets of clothes. The clothes you wore before were all from high school. Now that you are in college, you have to dress yourself up.” Chen Ru said, “If you don’t know how to choose, , you can ask Xinran to accompany you…”
“Uh, Mom, where did you go?” Jiang Cheng said with sweat on his face.
“That’s right, I’ve heard others say that it’s hard for you computer students to find a girlfriend, but you have to…”
“Hey, Mom, the signal here is not good. I’ll call you next time.” Jiang Cheng hung up the phone.
I’m only a freshman now, and my mother is already so worried about me.
Just as the phone call ended, Qin Jin called again.
This guy’s major is also computer science and technology, so he has kept up with Jiang Cheng’s pace.
Jinghua Northern College is not in Kyoto, but in Langhe City, Northern Hebei Province.
But it’s not too far away, in Yanjiao.
“Nariko, how are you doing lately? Why don’t we come over here to have some fun during the National Day?”
“I haven’t decided yet on National Day. I should continue reading most of the time.”
“You’re going crazy if you still read books. I’ve been dying to read calculus recently. Heaven, earth, why do you want me to study mathematics? I want to change my major…”