【初心者】課題をクリアしていくスレ【講習会】at GAMEDEV
【初心者】課題をクリアしていくスレ【講習会】 - 暇つぶし2ch244:名前は開発中のものです。
04/07/05 01:37 o/9mlWPU
>>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