【初心者】課題をクリアしていくスレ【講習会】
at GAMEDEV
244:名前は開発中のものです。
04/07/05 01:37 o/9mlWPU.net
>>241を改良してみた。
; 素数判定 with HSP 何気に高速版
title "素数判定 - Calculating..."
#const MAX_COUNT 1000
ll_libload dll,"kernel32.dll" :ll_getproc func,"GetTickCount", dll
ll_libfree dll :ll_retset refunc
sdim log, 7 * MAX_COUNT :notesel log
dim result, MAX_COUNT
mesbox log, 640, 480
noteadd "2",0,1 :result.0 = 2 :count = 3 :i = 1
;測定
ll_callfunc temp,0,func
start = refunc
repeat
flg = 1;
repeat i
if count \ result.cnt = 0 : flg = 0 :break
loop
if flg {
noteadd ""+count, -1 :result.i = count
i++ :if i >= MAX_COUNT: break
await
}
count += 2
loop
ll_callfunc temp,0,func
refunc -= start :dialog "" + refunc + "ms"
objprm 0, log :title "素数判定"
stop
次ページ続きを表示1を表示最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
3915日前に更新/292 KB
担当:undef