Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int size_x = 82, size_y = 27;
- void game();
- void display(char core[size_y][size_x]);
- int main() {
- game();
- return 0;
- }
- void game() {
- char horizontal = '-';
- char vertical = '|';
- char space = ' ';
- char core[27][82];
- //TODO сделать считывания из файла
- for (int y = 0; y < size_y; y++) {
- for (int x = 0; x < size_x; x++) {
- if (y == 0 || y == 26) {
- core[y][x] = horizontal;
- } else if (x == 0 || x == 81) {
- core[y][x] = vertical;
- } else {
- core[y][x] = space;
- }
- }
- }
- //Временая задование значений
- core[4][1] = 'x';
- core[4][2] = 'x';
- core[4][3] = 'x';
- core[3][3] = 'x';
- core[2][2] = 'x';
- display(core[size_y][size_x]);
- }
- void display(char core[size_y][size_x]) {
- // char (*p_array)[size_x] = core;
- for (int y = 0; y < size_y; y++) {
- for (int x = 0; x < size_x; x++) {
- printf("%c", core[y][x]);
- }
- printf("%c", '\n');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement