svnno****@sourc*****
svnno****@sourc*****
2011年 9月 15日 (木) 00:17:11 JST
Revision: 4634 http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=4634 Author: yutakapon Date: 2011-09-15 00:17:10 +0900 (Thu, 15 Sep 2011) Log Message: ----------- ã»è§£èª¬ã®æè¨ãä¿®æ£ã ã»ãµã³ãã«ãã¯ãã®è¿½å Modified Paths: -------------- trunk/doc/en/html/macro/command/intdim.html trunk/doc/en/html/macro/command/strdim.html trunk/doc/ja/html/macro/command/intdim.html trunk/doc/ja/html/macro/command/strdim.html -------------- next part -------------- Modified: trunk/doc/en/html/macro/command/intdim.html =================================================================== --- trunk/doc/en/html/macro/command/intdim.html 2011-09-14 01:01:12 UTC (rev 4633) +++ trunk/doc/en/html/macro/command/intdim.html 2011-09-14 15:17:10 UTC (rev 4634) @@ -24,15 +24,14 @@ <h2>Remarks</h2> <p> -<!-- -<array size>ÂÌvfð®zñ^ÌÏðé¾·éB<array size>ÌÅålÍ65536B<br /> -zñàÌevfÌúlÍ0B ---> +Defines the array of integer type having the <array size> entry. The <array size> range is from 1 to 65536 and the array index is 0-origin.<br /> +The default value of the array is 0. </p> <h2>Example</h2> <pre class="macro-example"> +; Fibonacci sequence intdim fibonacci 20 fibonacci[0] = 0 fibonacci[1] = 1 @@ -40,13 +39,96 @@ fibonacci[i] = fibonacci[i-2] + fibonacci[i-1] next -msg = "" +msg = "" for i 0 19 - sprintf2 msg "%s%d, " msg fibonacci[i] + sprintf2 msg "%s%d, " msg fibonacci[i] next -messagebox msg "result" +messagebox msg "result" </pre> + +<pre class="macro-example"> +; binary search tree +N = 10 +intdim a N +a[0] = 1 +a[1] = 2 +a[2] = 3 +a[3] = 7 +a[4] = 11 +a[5] = 32 +a[6] = 40 +a[7] = 68 +a[8] = 81 +a[9] = 99 + +inputbox 'Search data?' 'User Input' +str2int key inputstr + +flag = 0 +low = 0 +high = N - 1 +while low <= high + mid = (low + high) / 2 + if a[mid] == key then + sprintf "Your data %d found in index %d." key mid + messagebox inputstr 'Success' + flag = 1 + break + endif + if a[mid] < key then + low = mid + 1 + else + high = mid - 1 + endif +endwhile + +if flag == 0 then + messagebox 'Your data not found.' 'Failure' +endif +end +</pre> + + +<pre class="macro-example"> +; sieve of Eratosthenes +; +; Example of execution result +; 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 [18 primes] +; + +N = 30 +intdim flag N+1 +count = 1 +for i 0 N + flag[i] = 1 +next + +for i 0 N + if flag[i] =1 then + count = count + 1 + p = 2 * i + 3 + sprintf "%d " p + dispstr inputstr + + k = i + p + while k <= N + flag[k] = 0 + k = k + p + endwhile + endif +next + +sprintf "[%d primes]" count +dispstr inputstr + +end +</pre> + +<h2>See also</h2> + +<a href="..\syntax\types.html">Types</a><br> + </body> </html> Modified: trunk/doc/en/html/macro/command/strdim.html =================================================================== --- trunk/doc/en/html/macro/command/strdim.html 2011-09-14 01:01:12 UTC (rev 4633) +++ trunk/doc/en/html/macro/command/strdim.html 2011-09-14 15:17:10 UTC (rev 4634) @@ -24,10 +24,8 @@ <h2>Remarks</h2> <p> -<!-- -<array size>ÂÌvfð¶ñzñ^ÌÏðé¾·éB<array size>ÌÅålÍ65536B<br /> -zñàÌevfÌúlÍó¶ñB ---> +Defines the array of integer type having the <array size> entry. The <array size> range is from 1 to 65536 and the array index is 0-origin.<br /> +The default value of the array is an empty string. </p> <h2>Example</h2> @@ -49,5 +47,9 @@ messagebox msg "result" </pre> +<h2>See also</h2> + +<a href="..\syntax\types.html">Types</a><br> + </body> </html> Modified: trunk/doc/ja/html/macro/command/intdim.html =================================================================== --- trunk/doc/ja/html/macro/command/intdim.html 2011-09-14 01:01:12 UTC (rev 4633) +++ trunk/doc/ja/html/macro/command/intdim.html 2011-09-14 15:17:10 UTC (rev 4634) @@ -24,13 +24,14 @@ <h2>ðà</h2> <p> -<array size>ÂÌvfð®zñ^ÌÏðé¾·éB<array size>ÌÅålÍ65536B<br /> +<array size>ÂÌvfð®zñ^ÌÏðé¾·éB<array size>Í 1 ` 65536 ÌÍÍÌlð±ƪūAzñÌYÍ0IWÅ éB<br /> zñàÌevfÌúlÍ0B </p> <h2>á</h2> <pre class="macro-example"> +; tB{ib`ñ(Fibonacci sequence) intdim fibonacci 20 fibonacci[0] = 0 fibonacci[1] = 1 @@ -38,13 +39,97 @@ fibonacci[i] = fibonacci[i-2] + fibonacci[i-1] next -msg = "" +msg = "" for i 0 19 - sprintf2 msg "%s%d, " msg fibonacci[i] + sprintf2 msg "%s%d, " msg fibonacci[i] next -messagebox msg "result" +messagebox msg "result" </pre> + +<pre class="macro-example"> +; 2ªTõØ(binary search tree) +N = 10 +intdim a N +a[0] = 1 +a[1] = 2 +a[2] = 3 +a[3] = 7 +a[4] = 11 +a[5] = 32 +a[6] = 40 +a[7] = 68 +a[8] = 81 +a[9] = 99 + +inputbox 'Search data?' 'User Input' +str2int key inputstr + +flag = 0 +low = 0 +high = N - 1 +while low <= high + mid = (low + high) / 2 + if a[mid] == key then + sprintf "Your data %d found in index %d." key mid + messagebox inputstr 'Success' + flag = 1 + break + endif + if a[mid] < key then + low = mid + 1 + else + high = mid - 1 + endif +endwhile + +if flag == 0 then + messagebox 'Your data not found.' 'Failure' +endif +end +</pre> + + +<pre class="macro-example"> +; GgXelXÌÓé¢(sieve of Eratosthenes) +; +; Example of execution result +; 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 [18 primes] +; + +N = 30 +intdim flag N+1 +count = 1 +for i 0 N + flag[i] = 1 +next + +for i 0 N + if flag[i] =1 then + count = count + 1 + p = 2 * i + 3 + sprintf "%d " p + dispstr inputstr + + k = i + p + while k <= N + flag[k] = 0 + k = k + p + endwhile + endif +next + +sprintf "[%d primes]" count +dispstr inputstr + +end +</pre> + + +<h2>QÆ</h2> + +<a href="..\syntax\types.html">f[^^</a><br> + </body> </html> Modified: trunk/doc/ja/html/macro/command/strdim.html =================================================================== --- trunk/doc/ja/html/macro/command/strdim.html 2011-09-14 01:01:12 UTC (rev 4633) +++ trunk/doc/ja/html/macro/command/strdim.html 2011-09-14 15:17:10 UTC (rev 4634) @@ -24,7 +24,7 @@ <h2>ðà</h2> <p> -<array size>ÂÌvfð¶ñzñ^ÌÏðé¾·éB<array size>ÌÅålÍ65536B<br /> +<array size>ÂÌvfð®zñ^ÌÏðé¾·éB<array size>Í 1 ` 65536 ÌÍÍÌlð±ƪūAzñÌYÍ0IWÅ éB<br /> zñàÌevfÌúlÍó¶ñB </p> @@ -47,5 +47,9 @@ messagebox msg "result" </pre> +<h2>QÆ</h2> + +<a href="..\syntax\types.html">f[^^</a><br> + </body> </html>