Get the App
SLTechnology News&Howtos  ›  Development  › 

How to push the box in C language

Shulou Source: shulou.com Published: 2022-06-01 03:59:02 11月12日 Update

In this article, the editor introduces in detail "how to push the box in C language". The content is detailed, the steps are clear, and the details are handled properly. I hope this article "how to push the box in C language" can help you solve your doubts. Let's follow the editor's ideas to learn new knowledge.

The specific code is as follows

# include#include#include// calls the getch function int main () {char arr [8] [8] = {{0pje 3PME 3PM 3PM 3pm 0}, {0pm 3PM 5PM 5PM 5pm 0}, {0PM 3PM 3PM 3PM 3pm 0}, {0pm 3PM 3PM 4PM 4pm 3pm 3}, {3pm 0pm 3pm 4pm 4pm 3pm 3}, {3pm 0pm 4pm 4pm 0pm 3}, {3pm 0pm 0pm 2pm 0pm 0pm 3}, {3pm 3pm 3ML 3ML 3ML 3pm 3pm 3pm 3 / / define a two-digit array to simulate the map int (1) / / enter an endless loop to end the loop {int cnt2=0; system ("clear"); / / Clean the screen for (int iDepositional IOUs readreadable ptr); / / restore configuration information tcsetattr (STDIN_FILENO,TCSANOW,&old); return key_val } # endif//GETCH_H

0 is the space, @ is the villain, # is the wall, $is the box, O is the location where the box needs to be reached, the number 7 is the coincidence of the person and the O position, and the number 9 is the coincidence of the box and the O position, that is, it has reached the specified position.

After reading this, the article "how to push the box in C language" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself to understand it. If you want to know more about related articles, welcome to follow the industry information channel.

Tags: Location box position direction terminal configuration information push box language number article loop code content function in place villain data proper that is Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia macOS Redmi Docker MariaDB