#11 Article 589 Posted at 1987/11/15 19:46:48 by TO-Y68K (MAP533) [PRG.NL3]

Subject: NEDI68.BAS ツヅキ

2530 endfunc
 2540 func mon()
 2550   mouse(1):mouse(4)
 2560 endfunc
 2570 func p_preset()
 2580 r={0,8,8,8,7,6,5,4,3,2,8,0,8,0,8,0}
 2590 g={0,8,7,6,5,4,3,2,1,0,0,8,8,0,0,8}
 2600 b={0,8,6,5,4,3,2,1,0,0,0,0,0,8,8,8}
 2610 for i=16 to 23:r(i)=24-i:next
 2620 for i=24 to 31:g(i)=32-i:next
 2630 for i=32 to 39:b(i)=40-i:next
 2640 for i=40 to 47:r(i)=48-i:b(i)=48-i:next
 2650 for i=48 to 55:g(i)=56-i:b(i)=56-i:next
 2660 for i=56 to 63:r(i)=64-i:g(i)=64-i:next
 2670 endfunc
 2680 /*
 2690 /*
 2700 /*
 2710 func ldnl3()
 2720 dim int c(63),col(63)
 2730 int x=0,y=0:str fn
 2740 apage(1)
 2750 locate 0,29:input"         ロードするファイル名を入力して下さい。";fn
 2760 error off
 2770   fp=fopen(fn+".NL3","r")
 2780   if fp=-1 then locate 0,29:print"         無効なファイル名を入力しました                        ";chr$(7);:error on:fcloseall():wait(1000):return()
 2790   locate 0,29:print "         ";fn;" をロード中です。               ";
 2800 fclose(fp):nloader(fn+".NL3"):fp=fopen(fn+".NL3","r")
 2810 for i=0 to 63
 2820   cl=fgetc(fp)
 2830   cl=pcalc(cl)
 2840   ch=fgetc(fp)
 2850   ch=pcalc(ch)
 2860 c(i)=ch*128+cl
 2870 r(i)=(c(i)\81)
 2880 g(i)=((c(i)-r(i)*81)\9)
 2890 b(i)=(c(i)-r(i)*81-g(i)*9)
 2900 plset(i)
 2910 next
 2920 fcloseall()
 2930 endfunc
 2940 /*
 2950 func pcalc(num)
 2960    if num>= 32 and num<=126 then num=num-32:return(num)
 2970    if num>=160 and num<=223 then num=num-65:return(num)
 2980    if num =253 or  num =254 then num=num-94:return(num)
 2990 num=fgetc(fp):goto 2960
 3000 return(num)
 3010 endfunc
 3020 /*
 3030 /*
 3040 /*
 3050 func svnl3()
 3060 int i,fp:str fn,yn:tot=0
 3070 locate 0,29:input"         セーブするファイル名を入力して下さい。";fn
 3080 locate 0,29:print"        ";fn;"<= このファイル名でよろしいですか (y/n)";:input yn
 3090 if yn<>"y" and yn<>"Y"then return()
 3100   locate 0,29:print "        ";fn;" をセーブ中です。しばらくおまちください。   ";
 3110   fp=fopen(fn+".nl3","c")
 3120 for i=0 to 63
 3130   co1=b(i)+g(i)*9+r(i)*81
 3140   hc=co1\128
 3150   lc=co1 mod 128
 3160   dput(lc)
 3170   dput(hc)
 3180 next
 3190 /*
 3200 putcr():tot=0
 3210 /*
 3220 x=0:y=0
 3230 while x<160 and y<100
 3240    co1=point(x*3,y*4)
 3250    nextp()
 3260    co2=point(x*3,y*4)
 3270    if co1=co2 then press() else nopress()
 3280 endwhile
 3290 putcr():fputc(&H1A,fp)
 3300 fcloseall()
 3310 endfunc
 3320 /*
 3330 func press()
 3340 int d1,n
 3350    d1=co1+64
 3360    n=-1
 3370    while co1=co2 and n<=157
 3380       nextp()
 3390       n=n+1
 3400       co2=point(x*3,y*4)
 3410    endwhile
 3420    dput(d1)
 3430    dput(n)
 3440    totch()
 3450 endfunc
 3460 /*
 3470 func nopress()
 3480    dput(co1):totch()
 3490 endfunc
 3500 /*
 3510 func totch()
 3520    if tot>=78 then tot=0:putcr()
 3530 endfunc
 3540 /*
 3550 func putcr()
 3560      fputc(&HD,fp)
 3570      fputc(&HA,fp)
 3580 endfunc
 3590 /*
 3600 func nextp()
 3610    y=y+1:if y=100 then y=0:x=x+1:locate 59,29:print 160-x
 3620 endfunc()
 3630 /*
 3640 func dput(num;int)
 3650     if num=159 or num=160 then num=num+94
 3660     if num>=95 and num<=158 then num=num+65
 3670     if num>=0 and num<=94 then num=num+32
 3680     fputc(num,fp)
 3690     tot=tot+1
 3700 endfunc

プログラムは以上です。TYPEコマンドで結合して一つのファイルにして下さい。