Move 1988-2004 entries into subdirs
We we move 1988-2004 entries from all of a year's winning entries in a single directory to each winner being in their own sub-directory under the given year directory.
This commit is contained in:
1 parent
1e82e8aa3e
commit
d2a42f42e8
478 files changed
No files matched your search
@@ -0,0 +1,71 @@
|
||||
10 REM Lunar Lander
|
||||
20 REM By Diomidis Spinellis
|
||||
30 PRINT "You aboard the Lunar Lander about to leave the spacecraft."
|
||||
60 GOSUB 4000
|
||||
70 GOSUB 1000
|
||||
80 GOSUB 2000
|
||||
90 GOSUB 3000
|
||||
100 H = H - V
|
||||
110 V = ((V + G) * 10 - U * 2) / 10
|
||||
120 F = F - U
|
||||
130 IF H > 0 THEN 80
|
||||
135 H = 0
|
||||
140 GOSUB 2000
|
||||
150 IF V > 5 THEN 200
|
||||
160 PRINT "Congratulations! This was a very good landing."
|
||||
170 GOSUB 5000
|
||||
180 GOTO 10
|
||||
200 PRINT "You have crashed."
|
||||
210 GOTO 170
|
||||
1000 REM Initialise
|
||||
1010 V = 70
|
||||
1020 F = 500
|
||||
1030 H = 1000
|
||||
1040 G = 2
|
||||
1050 RETURN
|
||||
2000 REM Print values
|
||||
2010 PRINT " Meter readings"
|
||||
2015 PRINT " --------------"
|
||||
2020 PRINT "Fuel (gal):"
|
||||
2030 PRINT F
|
||||
2040 GOSUB 2100 + 100 * (H <> 0)
|
||||
2050 PRINT V
|
||||
2060 PRINT "Height (m):"
|
||||
2070 PRINT H
|
||||
2080 RETURN
|
||||
2100 PRINT "Landing velocity (m/sec):"
|
||||
2110 RETURN
|
||||
2200 PRINT "Velocity (m/sec):"
|
||||
2210 RETURN
|
||||
3000 REM User input
|
||||
3005 IF F = 0 THEN 3070
|
||||
3010 PRINT "How much fuel will you use?"
|
||||
3020 INPUT U
|
||||
3025 IF U < 0 THEN 3090
|
||||
3030 IF U <= F THEN 3060
|
||||
3040 PRINT "Sorry, you have not got that much fuel!"
|
||||
3050 GOTO 3010
|
||||
3060 RETURN
|
||||
3070 U = 0
|
||||
3080 RETURN
|
||||
3090 PRINT "No cheating please! Fuel must be >= 0."
|
||||
3100 GOTO 3010
|
||||
4000 REM Detachment
|
||||
4005 PRINT "Ready for detachment"
|
||||
4007 PRINT "-- COUNTDOWN --"
|
||||
4010 FOR I = 1 TO 11
|
||||
4020 PRINT 11 - I
|
||||
4025 GOSUB 4500
|
||||
4030 NEXT I
|
||||
4035 PRINT "You have left the spacecraft."
|
||||
4037 PRINT "Try to land with velocity less than 5 m/sec."
|
||||
4040 RETURN
|
||||
4500 REM Delay
|
||||
4510 FOR J = 1 TO 500
|
||||
4520 NEXT J
|
||||
4530 RETURN
|
||||
5000 PRINT "Do you want to play again? (0 = no, 1 = yes)"
|
||||
5010 INPUT Y
|
||||
5020 IF Y = 0 THEN 5040
|
||||
5030 RETURN
|
||||
5040 PRINT "Have a nice day."
|
||||
@@ -0,0 +1,24 @@
|
||||
#define O(b,f,u,s,c,a)b(){int o=f();switch(*p++){X u:_ o s b();X c:_ o a b();default:p--;_ o;}}
|
||||
#define t(e,d,_,C)X e:f=fopen(B+d,_);C;fclose(f)
|
||||
#define U(y,z)while(p=Q(s,y))*p++=z,*p=' '
|
||||
#define N for(i=0;i<11*R;i++)m[i]&&
|
||||
#define I "%d %s\n",i,m[i]
|
||||
#define X ;break;case
|
||||
#define _ return
|
||||
#define R 999
|
||||
typedef char*A;int*C,E[R],L[R],M[R],P[R],l,i,j;char B[R],F[2];A m[12*R],malloc
|
||||
(),p,q,x,y,z,s,d,f,fopen();A Q(s,o)A s,o;{for(x=s;*x;x++){for(y=x,z=o;*z&&*y==
|
||||
*z;y++)z++;if(z>o&&!*z)_ x;}_ 0;}main(){m[11*R]="E";while(puts("Ok"),gets(B)
|
||||
)switch(*B){X'R':C=E;l=1;for(i=0;i<R;P[i++]=0);while(l){while(!(s=m[l]))l++;if
|
||||
(!Q(s,"\"")){U("<>",'#');U("<=",'$');U(">=",'!');}d=B;while(*F=*s){*s=='"'&&j
|
||||
++;if(j&1||!Q(" \t",F))*d++=*s;s++;}*d--=j=0;if(B[1]!='=')switch(*B){X'E':l=-1
|
||||
X'R':B[2]!='M'&&(l=*--C)X'I':B[1]=='N'?gets(p=B),P[*d]=S():(*(q=Q(B,"TH"))=0,p
|
||||
=B+2,S()&&(p=q+4,l=S()-1))X'P':B[5]=='"'?*d=0,puts(B+6):(p=B+5,printf("%d\n",S
|
||||
()))X'G':p=B+4,B[2]=='S'&&(*C++=l,p++),l=S()-1 X'F':*(q=Q(B,"TO"))=0;p=B+5;P[i
|
||||
=B[3]]=S();p=q+2;M[i]=S();L[i]=l X'N':++P[*d]<=M[*d]&&(l=L[*d]);}else p=B+2,P[
|
||||
*B]=S();l++;}X'L':N printf(I)X'N':N free(m[i]),m[i]=0 X'B':_ 0 t('S',5,"w",N
|
||||
fprintf(f,I))t('O',4,"r",while(fgets(B,R,f))(*Q(B,"\n")=0,G()))X 0:default:G()
|
||||
;}_ 0;}G(){l=atoi(B);m[l]&&free(m[l]);(p=Q(B," "))?strcpy(m[l]=malloc(strlen(p
|
||||
)),p+1):(m[l]=0,0);}O(S,J,'=',==,'#',!=)O(J,K,'<',<,'>',>)O(K,V,'$',<=,'!',>=)
|
||||
O(V,W,'+',+,'-',-)O(W,Y,'*',*,'/',/)Y(){int o;_*p=='-'?p++,-Y():*p>='0'&&*p<=
|
||||
'9'?strtol(p,&p,0):*p=='('?p++,o=S(),p++,o:P[*p++];}
|
||||
@@ -0,0 +1,100 @@
|
||||
Best Language Tool:
|
||||
|
||||
Diomidis Spinellis
|
||||
Imperial College, University of London
|
||||
Myrsinis 1
|
||||
GR-145 62 Kifissia
|
||||
Greece
|
||||
|
||||
|
||||
Judges' comments:
|
||||
|
||||
Compile and run. Give the following lines as input:
|
||||
|
||||
OLD LANDER.BAS
|
||||
RUN
|
||||
|
||||
Be sure not to run out of fuel!
|
||||
|
||||
|
||||
Selected notes from the author:
|
||||
|
||||
This is the DDS-BASIC Interpreter (Version 1.00).
|
||||
|
||||
Immediate commands:
|
||||
|
||||
RUN LIST NEW OLD filename
|
||||
BYE SAVE filename
|
||||
|
||||
Program commands:
|
||||
|
||||
variable names a to z variables initialized to 0 on RUN
|
||||
FOR var = exp TO exp NEXT variable
|
||||
GOSUB exp RETURN
|
||||
GOTO exp IF exp THEN exp
|
||||
INPUT variable PRINT string
|
||||
PRINT exp var = exp
|
||||
REM any text END
|
||||
|
||||
Expressions (ranked by precedence):
|
||||
|
||||
Bracketed expressions
|
||||
number (leading 0 for octal, 0x for hex, else decimal), variable
|
||||
Unary -
|
||||
* /
|
||||
+ -
|
||||
= <>
|
||||
> <
|
||||
<= >=
|
||||
(* and + are also used for boolean AND and boolean OR)
|
||||
Boolean expressions evaluate to 0 for false and 1 for true
|
||||
|
||||
Editing:
|
||||
|
||||
- Line editor using line re-entry.
|
||||
- A line number with nothing following it, deletes the line.
|
||||
|
||||
Input format:
|
||||
|
||||
- Free format positioning of tokens on the line.
|
||||
- No space is allowed before the line number.
|
||||
- Exactly one space is needed between the OLD or SAVE command and
|
||||
the filename.
|
||||
- ALL INPUT MUST BE UPPERCASE.
|
||||
|
||||
Limits:
|
||||
|
||||
Line numbers 1-10000
|
||||
Line length 999 characters
|
||||
FOR nesting 26
|
||||
GOSUB 999 levels
|
||||
Program Dynamically allocated
|
||||
Expressions -32768 - 32767 for 16 bit machines,
|
||||
-2147483648 - 2147483647 for 32 bit machines
|
||||
|
||||
Error checking / error reports:
|
||||
|
||||
No error checking is performed.
|
||||
The message `core dumped' signifies a syntax or semantic error.
|
||||
|
||||
Hosting Environment:
|
||||
|
||||
ANSI C, traditional K&R C or OSF ANDF
|
||||
ASCII or EBCIDIC character set
|
||||
48K bytes memory
|
||||
|
||||
The Speed of DDS-BASIC Interpreter (Version 1.00). relative to
|
||||
Microsoft Advanced BASIC 3.31 is Approximately 60%.
|
||||
|
||||
The code size could be further reduced by doing ugly things like
|
||||
not declaring the return type of functions, not freeing memory,
|
||||
#defining define, and joining lines. In its present 1536 character
|
||||
form the program is reasonably portable (it may fail to run in a
|
||||
tagged object architecture) and nicely formatted (it fits in an
|
||||
80*25 screen).
|
||||
|
||||
Copyright (c) 1990, Landon Curt Noll & Larry Bassel.
|
||||
All Rights Reserved. Permission for personal, educational or non-profit use is
|
||||
granted provided this this copyright and notice are included in its entirety
|
||||
and remains unaltered. All other uses must receive prior permission in writing
|
||||
from both Landon Curt Noll and Larry Bassel.
|
||||
Reference in new issue
Block a user