sw-battle-test-c

Interesting test task in C instead of C++
git clone git://bsandro.tech/sw-battle-test-c
Log | Files | Refs | README

CREATE_MAP.c (492B)


      1 #include "core/command.h"
      2 
      3 static void create_map(World *w, int width, int height) {
      4     //printf("create_map(%p,%d,%d)\n", (void *)w, width, height);
      5     Map_Init(&w->map, width, height);
      6     printf("[%d] MAP_CREATED width=%d height=%d\n", w->turn, width, height);
      7 }
      8 
      9 bool cmd_create_map(World *w, int argc, char **argv) {
     10     if (argc!=2) {
     11         puts("cmd_create_map() invalid arguments");
     12         return false;
     13     }
     14     create_map(w, atoi(argv[0]), atoi(argv[1]));
     15     return true;
     16 }
     17