-
Notifications
You must be signed in to change notification settings - Fork 0
/
gamer.c
97 lines (90 loc) · 1.42 KB
/
gamer.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
#include <string.h>
#include <stdio.h>
#define xx 8
#define yy 8
#define zz 8
int i[xx*yy*zz+2];
int sscore=0;
int version(){
return 0;
}
int main(){
printf("version %d\n",version());
return 0;
}
int eeppromX(int a){
int ii=0;
int l=0;
char i[]={"hello world...\n"};
l=strlen(i);
if(a>0 && a<l+1){
ii=(int)i[a-1];
}else{if(a==0){
ii=(int)l;
}else{ii=0;}
}
return ii;
}
int encodeX(int a){
int size=16;
int ii=-1;
int i[]={5,7,9,3,71,10,10,12,4,12,2,1,2,3,15,16};
if(a>-1 && a<size){
ii=i[a];
}else{ii=-1;}
return ii;
}
int min(int a,int b){
int c=a;
if(b<a)c=b;
return c;
}
int power(int a,int b){
int c;
int d;
c=a;
if(b>0){
for(d=0;d<b-1;d++){
c=c*a;
}
}else{c=1;}
return c;
}
int add(int a,int b){
return a+b;
}
int ram3d(int x,int y,int z,int writes,int value){
int ii=0;
int l=xx*yy*zz;
int indexs=0;
indexs=x+(y*xx)+(xx*yy*z);
if(indexs>2 && indexs<l+3){
if(writes!=0)i[indexs-3]=value;
ii=(int)i[indexs-3];
}else{if(indexs==0){
ii=xx;
}else{
if(indexs==1){
ii=yy;
}else{if(indexs==2){
ii=zz;
}
}
}}
return ii;
}
int scores(int a){
sscore=sscore+a;
return sscore;
}
int floatEmulator(int a,int b,int matfunc){
int ii=0;
int precs=1000;
if(matfunc==0)ii=a+b;
if(matfunc==1)ii=a-b;
if(matfunc==2)ii=a*b;
if(matfunc==3)ii=a/b;
if(matfunc==4)ii=a*precs;
if(matfunc==5)ii=a/precs;
return ii;
}