Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int size_y = 27, size_x = 82;
- void display(char *core);
- int main() {
- char core[27][82];
- //TODO сделать миню на свитчкейсах для выбора карты
- FILE *file;
- char input;
- file = freopen("input.txt", "r", stdin);
- for (int y = 0; y < size_y + 1; y++) {
- for (int x = 0; x < size_x + 1; x++) {
- input = fgetc(file);
- if (input == ' ') {
- core[y][x] = ' ';
- } else if (input == 'x') {
- core[y][x] = 'x';
- } else if (input == '-') {
- core[y][x] = '-';
- }else if (input == '|') {
- core[y][x] = '|';
- }
- }
- }
- fclose(file);
- display(*core);
- return 0;
- }
- void display(char *core) {
- char (*p_array)[size_x] = core;
- for (int y = 0; y < size_y; y++) {
- for (int x = 0; x < size_x; x++) {
- printf("%c", p_array[y][x]);
- }
- printf("\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement