repl.it
C

No description

fork
loading
Files
  • main.c
  • test.j
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#include <time.h>
#include <stdio.h>
#include <stdlib.h>

#define LMAX 256
#define SMAX 128

int px, py, pz;
FILE *errlog = NULL;

typedef struct{
	int x;
	int y;
	int w;
	int h;
	int damage;
	char **text;
	char **items;
}mObject;

int ccrypt(char **lvl){
	FILE *in, *out;
	char name[SMAX], temp[3][11], words = {"produce",\
	"ugly", "retire", "even", "imprint", "fluttering",\
	"classy", "were", "wish", "pathetic"};

	if((in = fopen(lvl, "r") == NULL){
		 fputs("map source cant be opened\n", errlog);
		return 1;
	}

  // keygen
  do{
    for(int i=0;i<3;i++){
		t = srand(time(NULL))%10;
		name[i] = temp[t];
	}
	int amt = sprintf("%s%s%s%d.lvl", name[0],\
		name[1], name[2], srand(time(NULL)));
	}while(amt <= LMAX);

	if((out = fopen(name, "w+")) == NULL){
	  fputs("dest file is broke\n", errlog);
	  return 1;
	}

	// compression

	// encrytion
	for(int i;(ch = fgetc(in)) != EOF;i++){
		ch ^= name[i];
		ch = ch >> 6;
	}

  fclose(in);
  fclose(out);
}

int ddcrypt(char **lvl){}

int mapGen(){}

int load(int x, int y, char **lvl){
  FILE *in, *out;
  int open = 0;
  char strArr[LMAX], ch;
  mObject objArr[SMAX];

  if(in = fopen(lvl, "rb")){
    return 1;
  }
sprintf();

  while(fgets(arr, in)){
      switch(ch){
		  case 'l':
		  	break;
        case 'h':
          break;
        case 'c':
          break;
        case 'w':
          break;
        case 'd':
          break;
        case 's':
          break;
        case '{':
          open++;
          break;
		case '}':
			open--;
			break;
      }
  }

  fclose(in);
  fclose(out);
}

int main(inr argc, char **argv) {
  px = 0;
  py = 0;
  pz = 0;

  if(fopen(error.log, "a+")){
	fprintf(stderr, "ERROR CANNOT OPEN ERRLOG\n");
    exit(1);
  }
  fclose(errlog);
}
Fetching token
?