;---------- ---------- ---------- ---------- ---------- ; 作成者のURL ---> http://www.setsuki.com/ ;---------- ---------- ---------- ---------- ---------- /* 100マス計算の 16進数バージョン */ #packopt type 0 #packopt name "16sin" #packopt runtime "hsp3c.hrt" #packopt hide 0 #packopt xsize 515 #packopt ysize 515 #ifdef _debug screen 0,515,515 #endif #define change(%1,%2) tmp = %1 : %1 = %2 : %2 = tmp #define ctype celx(%1) (%1)*selw+selw #define ctype cely(%1) (%1)*selh+selh title "FxF" #define selw 32 #define selh 32 randomize dim rndX,15 dim rndY,15 *begin_view cls 0 : pos ginfo_winx : mes "00" addy = (selh-ginfo_mesy)/2 addx = (selw-ginfo_mesx)/2 flag = (selw-ginfo_mesx/2*3)/2 max = 15 repeat 15 rndX.cnt = cnt+1 rndY.cnt = cnt+1 loop repeat 14 rows = rnd(max) cols = rnd(max) : max-- change rndY.rows, rndY.max change rndX.cols, rndX.max loop select = 0 : posy = selh repeat 15 posx = selw repeat 15 gosub *bg_boxf posx += selw : select++ loop color 0,0,0 pos cnt*selw+selw+flag,addy : mes strf("[%X]", rndX( cnt ) ) pos flag,posy+addy : mes strf("[%X]", rndY( cnt ) ) posy += selh loop select = 0 gosub *select_new_change onkey gosub *click_key stop *click_key ;dialog ""+wparam flag = -1 if( wparam >= 48 )&&( wparam <= 57 ): flag = wparam - 48 if( wparam >= 96 )&&( wparam <=105 ): flag = wparam - 96 if( wparam >= 65 )&&( wparam <= 70 ): flag = wparam - 55 if( flag != -1 ){ tmp = tmp\16*16 + flag gosub *bg_boxf color 0,0,0 pos posx+addx, posy+addy : mes strf("%2X", tmp) color 255,0,0 gosub *select_change } if( wparam != 32 )&&( wparam != 13 ){ return } gosub *bg_color gosub *select_change if( tmp != ans ){ gosub *bg_boxf color 255,0,0 pos posx+addx , posy+addy : mes strf("%02X", ans) pos posx+addx+1, posy+addy : mes strf("%02X", ans) } select++ if( select >= 15*15 ){ objsize selw*4, selh*2 pos (ginfo_winx-selw*4)/2-1, (ginfo_winy-selh*2)/2-1 : button "もう一度", *begin_view onkey 0 return ;dialog "終わり ",1,"強制終了" : end } *select_new_change rows = select/15 cols = select\15 posx = celx(cols) posy = cely(rows) ans = rndX.cols*rndY.rows tmp = 0 color 255,0,0 *select_change line posx, posy, posx+selw, posy : line posx, posy+selh line posx+selw, posy+selh : line posx+selw, posy return *bg_color if( select\2 == 0 ): color $FF,$FF,$FF : else : color $C0,$C0,$C0 return *bg_boxf gosub *bg_color boxf posx, posy, posx+selw, posy+selh return