½½¿ÊBASIC Âè2·Ç¼¨ÈÄ¡¡²áµî¥í¥° 1-1000




¿··Ç¼¨Èij«Àß

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2008ǯ 7·î21Æü(·î)09»þ38ʬ46ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ½½¿ÊBASICÂè2·Ç¼¨ÈĤò³«Àߤ·¤Þ¤·¤¿¡£
¥á¥¤¥ó¤Î·Ç¼¨ÈĤ¬ÉÔÄ´¤Î¤È¤­¡¤¤³¤Á¤é¤ò¤´ÍøÍѤ¯¤À¤µ¤¤¡£
¤Ê¤ª¡¤ºÇÂç500¹Ô¤Þ¤Ç½ñ¤­¹þ¤á¤ë¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¤¬¡¤
¼Â¸³Åª¤Ë¤Ï251¹Ô¤Þ¤Ç¤·¤«½ñ¤­¹þ¤á¤Ê¤¤¤è¤¦¤Ç¤¹¡£
Internet Explorer¤Ç¤â¥¤¥ó¥Ç¥ó¥È¤òÊÝ»ý¤·¤¿¤Þ¤Þɽ¼¨¤µ¤ì¤ë¤³¤È¡¤
Ʊ°ì¿Í¤Ë¤è¤ëϢ³½ñ¤­¹þ¤ß¤Ëµ¬À©¤¬¤«¤«¤ë¤³¤È¡Ê¥¹¥Ñ¥àÂкö¡Ë
¤Ê¤É¡¤ÍøÅÀ¤â¿¤¤¤Î¤Ç¡¤¾­ÍèŪ¤Ë¤ÏËܳÊŪ¤Ê°Üž¤â¤¢¤ê¤¨¤Þ¤¹¡£
 

Â裲·Ç¼¨ÈĤ˴¶¼Õ

 Åê¹Æ¼Ô¡§ËÌÀÝ»°ÂÀϺ  Åê¹ÆÆü¡§2008ǯ 7·î23Æü(¿å)10»þ27ʬ59ÉÃ
ÊÖ¿®¡¦°úÍÑ
  »ä¤Î¸©¤Î³Ø¹»¥Í¥Ã¥È¤Ç¤Ï¡¢µì½½¿Ê£Â£Á£Ó£É£Ã·Ç¼¨ÈĤϡ¢¤Ê¤¼¤«¡ÖÍ­³²¾ðÊó¡×¤È¤·¤Æ°·¤ï¤ì³Ø¹»¤«¤é¤Ï±ÜÍ÷¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£¡Ê¥Õ¥£¥ë¥¿¡¼¤Ë¤Ò¤Ã¤«¤«¤ë¤è¤¦¤Ç¤¹¡£¡Ë
¤³¤ÎÂ裲·Ç¼¨ÈĤϺ£¤Î¤È¤³¤í±ÜÍ÷¤Ç¤­¤Æ¤Þ¤¹¤Î¤Ç¡¢¤³¤Á¤é¤Ë°Üž¤·¤Æ¤¤¤¿¤À¤±¤ë¤È¤¢¤ê¤¬¤¿¤¤¤Ç¤¹¡£
 

¡Ú¼ÁÌä¡Ûchr$¤Ç¤Îʸ»úɽ¼¨¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§Bear  Åê¹ÆÆü¡§2008ǯ 9·î 2Æü(²Ð)04»þ49ʬ9ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¢¨¸½ºß¤Î½»¤Þ¤¤¤Î´Ø·¸¾å¡¢ÌµÎÁ¥á¡¼¥ë¤·¤«ÍøÍѤǤ­¤Ê¤¤¤¿¤á
¢¨¤³¤Á¤é¤Î·Ç¼¨ÈĤ˽ñ¤«¤»¤Æ¤¤¤¿¤À¤­¤Þ¤¹¡£

ÅöÊý¡¢WindowsXp + ½½¿ÊBASIC 7.2.7¤È¤¤¤¦´Ä¶­¤Ç¤¹¡£
Á°¤Ë½½¿ÊBASIC¤ÈUltraBASIC¤Î°ã¤¤¤ò¼ÁÌ䤷¤¿¼Ô¤Ç¤¹¡¢¤è¤í¤·¤¯¤ª´ê¤¤¤·¤Þ¤¹¡£

¡¡print chr$(...)

¤Æ¶ñ¹ç¤ËÈÖÃÏ»ØÄê¤Çʸ»úɽ¼¨¤µ¤»¤ëºÝ¤Ë
Windows¤ÎIME¥Ñ¥Ã¥É¤Ç¸«¤¨¤ëÈϰϤò»ØÄꤷ¤Æ¤ë¤Î¤Ë¤Á¤ç¤¯¤Á¤ç¤¯Îã³°¤¬È¯À¸¤·¤Þ¤¹¡£

¡á¤³¤³¤«¤é¡á
option character kanji
input prompt "Á´³Ñ¤Ç£±Ê¸»úÆþÎϤ·¤Æ¤¯¤À¤µ¤¤:":a$
let b=ord(a$)
let b$=str$(b)
let c$=bstr$(ord(a$),16)
let d$=right$(c$,2)&left$(c$,2)
print
print chr$(bval(c$,16))&"(JIS:"&c$&")"&" -> "&chr$(bval(d$,16))&"(JIS:"&d$&")"
end
¡á¤³¤³¤Þ¤Ç¡á

Îã¤È¤·¤Æ¡¢¾åµ­¥×¥í¥°¥é¥à¤Ça$¤Ë¡ÖÆü¡×¤ÈÆþÎϤ·¤¿¾ì¹ç¤Ë½ÐÎϤµ¤ì¤ëʸ»ú¤ò
¥Æ¥­¥¹¥È¥¦¥£¥ó¥É¥¦Æâ¤Ç¥³¥Ô¡¼¤·¤Æ¤«¤é¥×¥í¥°¥é¥à¤òºÆ¼Â¹Ô¤·¤Æ
2²óÌܤÎa$ÆþÎϤǥڡ¼¥¹¥È¤¹¤ì¤Ð¡Ö΢¤Î΢¤Ïɽ¡×¤È¤Ê¤ê¡¢º£Å٤ϡÖÆü¡×¤¬½ÐÎϤµ¤ì¤ë¤Ï¤º¤À¤È»×¤¦¤Î¤Ç¤¹¤¬
¤Ê¤¼¤«¤³¤³¤ÇÎã³°4002¤¬È¯À¸¤·¤Æ¤·¤Þ¤¤¤Þ¤¹¡£

ÅöÊý¤Îµ­½Ò¤Ë¤Þ¤º¤¤ÅÀ¤¬¤¢¤ì¤Ð¤´¶µ¼¨¤¤¤¿¤À¤±¤Þ¤»¤ó¤Ç¤·¤ç¤¦¤«¡£
¤½¤ì¤È¤âFull Basic¤Îµ¬³Ê¤Ë½àµò¤¹¤ë»ÅÍ;塢ÅöÁ³¤Î·ë²Ì¤Ê¤Î¤Ç¤·¤ç¤¦¤«¡©
 

Re: ¡Ú¼ÁÌä¡Ûchr$¤Ç¤Îʸ»úɽ¼¨¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ 9·î 2Æü(²Ð)22»þ32ʬ26ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.3[¸µµ­»ö¤Ø]

ºï½üÊÔ½¸¤Ç¤­¤Þ¤»¤ó¡£¢ª¡¡Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ 9·î 2Æü(²Ð)21»þ28ʬ28ÉÃ
ºï½ü¤·¤Æ²¼¤µ¤¤¡£


win98SE + ver7.2.7 ¤Ç¤Ï¡¢Îã³°¤¬È¯À¸¤»¤º¡¢°Ê²¼¤ÎÍͤË
´üÂԤɤ¦¤ê¤Ë¤Ê¤ê¤Þ¤¹¡£
¤·¤«¤·¡¢byte ȿž¤·¤¿ word ¤Ï¡¢´Á»ú¥³¡¼¥É¤Îµö¤µ¤ì¤ëÈϰϤò¡¢
¤¤¤ÄÈô½Ð¤¹¤«ÉÔÌÀ¤Ç¤¹¡£»þÀÞ¡¢ÉÔÀµ¥³¡¼¥É¤Ï¡¢È¯À¸¤·¤Æ¤¤¤ë¤Ï¤º¤Ç¤¹¡£
Ëô¡¢7C46 ¤Ï¡¢Â裱Â裲¿å½à°Ê³°¤Î¡¢³Èĥʸ»ú¥³¡¼¥É¤Ç¤¹¡£
¡¡¡¡(¶â+Äë ¤Î»ú¡¢¢¨¤³¤Î·Ç¼¨ÈĤϡ¢É½¼¨½ÐÍè¤Ê¤¤¤è¤¦¤Ç¤¹¡£)
IME¥Ñ¥Ã¥É¤â¡¢¥¢¥Æ¥Ë½ÐÍè¤Þ¤»¤ó¡£
¤³¤Î»ú¤ò¡¢IME¥Ñ¥Ã¥É¤Ç½¦¤¦¤È²¿¸Î¤«¡¢BSTR$( ORD("¶â+Äë"),16 ) ¢ª"1662" ¤Ë¤Ê¤ë¡©ÉÔÀµ¥³¡¼¥É¤Ç¤¹¡£
¤·¤«¤·¡¢w$=CHR$( BVAL("7C46",16) ) ¢ªBSTR$( ORD(w$),16 ) ¢ª"7C46" ¤Ë¤Ê¤ê¤Þ¤¹¤Î¤Ç¡¢
½½¿ÊBASIC ¤ÎÊý¤Ï¡¢Àµ¾ï¤Ç¤¹¡£


Á´³Ñ¤Ç£±Ê¸»úÆþÎϤ·¤Æ¤¯¤À¤µ¤¤:Æü

Æü(JIS:467C) -> (JIS:7C46)

¡¡¡¡(copy & paste)

Á´³Ñ¤Ç£±Ê¸»úÆþÎϤ·¤Æ¤¯¤À¤µ¤¤:

(JIS:7C46) -> Æü(JIS:467C)
 

Re: ¡Ú¼ÁÌä¡Ûchr$¤Ç¤Îʸ»úɽ¼¨¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§Bear  Åê¹ÆÆü¡§2008ǯ 9·î 3Æü(¿å)21»þ10ʬ48ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.5[¸µµ­»ö¤Ø]

¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
IME¥Ñ¥Ã¥É¤â¤¢¤Æ¤Ë¤Ç¤­¤Ê¤¤¤ó¤Ç¤¹¤Í¡¢º£¸å¤ÏÃí°Õ¤¹¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£

>win98SE + ver7.2.7 ¤Ç¤Ï¡¢Îã³°¤¬È¯À¸¤»¤º¡¢°Ê²¼¤ÎÍͤË
>´üÂԤɤ¦¤ê¤Ë¤Ê¤ê¤Þ¤¹¡£
¤ä¤Ã¤Ñ¤ê¤½¤¦¤Ç¤¹¤«¡£
¼«Ê¬¤âÁ°¤Ë 98SE + 5.0.8 ¤ÎÁȹ礻¤ÇƱ¤¸»ö¤ò»î¤·¤¿»þ¤Ï
Âè1¿å½à¡¢Âè2¿å½à¤«¤é³°¤ì¤ëʸ»úÈÖÃϤò¤«¤¹¤á¤Æ¤âÆä˻پã¤Ê¤«¤Ã¤¿¤Î¤Ç
¤³¤ì¤Ï¤¢¤ê¤Ê¤ó¤À¤È»×¤Ã¤Æ¤¿¤éº£²ó Xp + 7.2.7 ¤ÇÎã³°¤ò²óÈò¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£

ͱ¡¢Îã³°¤¬½Ð¤ëʸ»úÈÖÃϤò°ìÍ÷¤¹¤ë¤â¤Î½ñ¤¤¤Æ¤ß¤Þ¤·¤¿¡£
¡á¤³¤³¤«¤é¡á
rem -- Á´³Ñʸ»ú¤Î»ÏÅÀ:8481 (2121) / ½ªÃ¼:38700 (972C) --
rem -- ·ë²Ì½ÐÎϤϲèÌÌɽ¼¨¤è¤ê¥Õ¥¡¥¤¥ë¤Ë½ñ¤­½Ð¤·¤¿Êý¤¬Áᤤ¤«¤â --
option arithmetic decimal
option character kanji
do
input prompt "¤É¤³¤«¤é¸«¤ë?(Ⱦ³Ñ»ÏÅÀ=1,Á´³Ñ»ÏÅÀ=2)":start
if start=1 or start=2 then
exit do
elseif start=0 then
stop
else
end if
loop
select case start
case is =2
let start=8481
case else
end select
for count=start to 38700 step 1
let hcount$=bstr$(count,16)
let strcount$=str$(count)
when exception in
print chr$(39)+chr$(count)+chr$(39)+" chr$("+strcount$+") <-> JIS ["+hcount$+"]"
use
print chr$(7)+"Îã³°"+str$(extype)+chr$(7)+" chr$("+strcount$+") <-> JIS ["+hcount$+"]"
end when
next count
end
¡á¤³¤³¤Þ¤Ç¡á
 

Re: ¡Ú¼ÁÌä¡Ûchr$¤Ç¤Îʸ»úɽ¼¨¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2008ǯ 9·î 5Æü(¶â)20»þ59ʬ34ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.6[¸µµ­»ö¤Ø]

Windows XP (Windows2000) ¤Ïʸ»ú¥³¡¼¥É¤¬¥æ¥Ë¥³¡¼¥É¤ËÊѹ¹¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
¥·¥Õ¥ÈJIS¤Îʸ»ú¤Ï¥æ¥Ë¥³¡¼¥É¤ËÊÑ´¹¤µ¤ì¤Æɽ¼¨¤µ¤ì¤Þ¤¹¡£
¥·¥Õ¥ÈJIS¤ÈJIS¤ÎÂбþ¤Ï¡¤°ì±þ¡¤°ìÂаì¤È¤ß¤Ê¤»¤Þ¤¹¤¬¡¤
¥æ¥Ë¥³¡¼¥É¤ÈJIS¡Ê¤¢¤ë¤¤¤Ï¥·¥Õ¥ÈJIS¡Ë¤È¤ÎÂбþ¤Ï°ìÂаì¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
¥·¥Õ¥ÈJIS¢ª¥æ¥Ë¥³¡¼¥É¢ª¥·¥Õ¥ÈJIS¤ÈÊÑ´¹¤¹¤ë¤È¸µ¤ËÌá¤é¤Ê¤¤¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£
½½¿ÊBASIC¤Î¾ì¹ç¡¤¥Õ¥¡¥¤¥ëÆþ½ÐÎϤϥ·¥Õ¥ÈJIS¤Ê¤Î¤Ç¡¤
²èÌ̤Ëɽ¼¨¤·¤¿Ê¸»ú¤ò¥¯¥ê¥Ã¥×¥Ü¡¼¥É·Ðͳ¤Ç¼è¤ê½Ð¤¹¤Î¤Ç¤Ê¤¯¡¤
¥Õ¥¡¥¤¥ë¤Ë½ñ¤­½Ð¤·¤¿Ê¸»ú¤òÂоݤˤ¹¤ì¤Ð¡¤ÌäÂê¤Ïµ¯¤³¤ê¤Ë¤¯¤¯¤Ê¤ë¤È»×¤¤¤Þ¤¹¡£


100 OPTION CHARACTER KANJI
110 INPUT PROMPT "Á´³Ñ¤Ç£±Ê¸»úÆþÎϤ·¤Æ¤¯¤À¤µ¤¤:":a$
120 LET b=ORD(a$)
130 LET b$=STR$(b)
140 LET c$=BSTR$(ORD(a$),16)
150 LET d$=right$(c$,2)&left$(c$,2)
160 PRINT
170 PRINT CHR$(BVAL(c$,16))&"(JIS:"&c$&")"&" -> "&CHR$(BVAL(d$,16))&"(JIS:"&d$&")"
180 OPEN #1:NAME "A:TEST.TXT"
190 ERASE #1
200 PRINT #1:CHR$(BVAL(d$,16))
210 CLOSE #1
220 OPEN #2:NAME "A:TEST.TXT"
230 INPUT #2:s$
240 CLOSE #2
250 PRINT BSTR$(ORD(s$),16)
260 END

180¹Ô°Ê¹ß¤òÄɲ䷤Ƥ¤¤Þ¤¹¡£
 

Re: ¡Ú¼ÁÌä¡Ûchr$¤Ç¤Îʸ»úɽ¼¨¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2008ǯ 9·î 6Æü(ÅÚ)10»þ09ʬ11ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.6[¸µµ­»ö¤Ø]

JISʸ»ú¥³¡¼¥É¤Ï¡¤Âè2¥Ð¥¤¥È¡Ê²¼°Ì¥Ð¥¤¥È¡Ë¤¬16¿Ê¤Ç21¤«¤é7E¤Î´Ö¤Ç¤Î¤ßÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
¤Ê¤Î¤Ç¡¤Ê¸»ú¤ò½ç¤ËÀ¸À®¤¹¤ë¥×¥í¥°¥é¥à¤Ï¡¤²¼°Ì¥Ð¥¤¥È¤¬21¤«¤é7E¤Î´Ö¤Ë¤Ê¤ë¤è¤¦¤Ëµ­½Ò¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£


100 OPTION ARITHMETIC DECIMAL
110 OPTION CHARACTER KANJI
120 FOR hi=BVAL("21",16) TO BVAL("73",16)
130    FOR lo=BVAL("21",16) TO BVAL("7E",16)
140       LET count=hi*256+lo
150       LET hcount$=BSTR$(count,16)
160       LET strcount$=STR$(count)
170       WHEN EXCEPTION IN
180          PRINT CHR$(39)&CHR$(count)&CHR$(39)&" chr$("&strcount$&") <-> JIS ["&hcount$&"]"
190       USE
200          PRINT CHR$(7)&"Îã³°"&STR$(EXTYPE)&CHR$(7)&" chr$("&strcount$&") <-> JIS ["&hcount$&"]"
210       END WHEN
220    NEXT lo
230 NEXT hi
240 END
 

Re: ¡Ú¼ÁÌä¡Ûchr$¤Ç¤Îʸ»úɽ¼¨¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§Bear  Åê¹ÆÆü¡§2008ǯ 9·î 7Æü(Æü)22»þ07ʬ8ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ÇòÀÐÀèÀ¸¡¢¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£

Ä󼨤¤¤¿¤À¤¤¤¿¥½¡¼¥¹ÇÒ¸«¤·¤Þ¤·¤¿¡¢¼«Ê¬¤Ç¤âÆ°¤«¤·¤Æ¤ß¤Þ¤·¤¿¡£
¤Ê¤ë¤Û¤É¡¢¤³¤¦¤¹¤ì¤Ð¤¤¤¤¤ó¤Ç¤¹¤Í¡£
º£¸å¤Î»²¹Í¤Ë¤µ¤»¤Æ¤¤¤¿¤À¤­¡¢¤â¤Ã¤ÈÊÙ¶¯¤·¤è¤¦¤È»×¤¤¤Þ¤¹¡£

>¥·¥Õ¥ÈJIS¢ª¥æ¥Ë¥³¡¼¥É¢ª¥·¥Õ¥ÈJIS¤ÈÊÑ´¹¤¹¤ë¤È¸µ¤ËÌá¤é¤Ê¤¤¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£

ʸ»ú¤Î³äÅö¤Æ¤¬¤Ê¤¤ÈÖÃÏ(¡Ö¡¦¡×¤Èɽ¼¨¤µ¤ì¤ë¤È¤³¤í)¤ò
WindowsXp¾å¤Ç¥³¥Ô¡¼¤·¤Æ¤«¤é¥Ú¡¼¥¹¥È(¥¯¥ê¥Ã¥×¥Ü¡¼¥É·Ðͳ)¤¹¤ë¤È
ËÜÍè¤ÎÈÖÃϤ˴ط¸¤Ê¤¯JIS 2126ÈÖÃϤˤµ¤ì¤Æ¤·¤Þ¤¤¤Þ¤¹¡£
¤³¤Î¸½¾Ý¤ÏWindows98SE¤Ç¤Ï¸«¤é¤ì¤Ê¤¤¤â¤Î¤Ç¤·¤¿¤¬¡¢¤³¤ì¤Çµ¿Ì䤬À²¤ì¤Þ¤·¤¿¡£

¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
 

Âè1·Ç¼¨ÈĤ¬³«¤±¤Ê¤¤

 Åê¹Æ¼Ô¡§Åç¼1243  Åê¹ÆÆü¡§2008ǯ10·î 9Æü(ÌÚ)10»þ11ʬ32ÉÃ
ÊÖ¿®¡¦°úÍÑ
  Âè1·Ç¼¨ÈĤòÆɤޤ»¤Æ夤¤Æ¤ª¤ê¤Þ¤¹¤¬¡¢ÀèÆü¤«¤é¥¢¥¯¥»¥¹½ÐÍè¤Ê¤¯¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ÊĻߤǤ·¤ç¤¦¤«¡¢°¿¤¤¤ÏÉÔ¶ñ¹çȯÀ¸ÂнèÃæ¤Ç¤·¤ç¤¦¤«¡©  

Re: Âè1·Ç¼¨ÈĤ¬³«¤±¤Ê¤¤

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2008ǯ10·î 9Æü(ÌÚ)20»þ18ʬ21ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.12[¸µµ­»ö¤Ø]

around.ne.jpÁ´ÂΤ¬¥¢¥¯¥»¥¹ÉÔǽ¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
¤³¤Á¤é¤Î·Ç¼¨ÈĤϡ¤º£²ó¤Î¤è¤¦¤Ê»öÂÖ¤ËÈ÷¤¨¤Æ³«Àߤ·¤¿¤â¤Î¤Ç¤¹¡£
¤â¤¦¤·¤Ð¤é¤¯ÍͻҤò¸«¤Æ¡¤Éü³è¤·¤Ê¤¤¤è¤¦¤Ç¤¢¤ì¤Ð¡¤¤³¤Á¤é¤òÀµ¤Î·Ç¼¨ÈĤˤ·¤¿¤¤¤È»×¤¤¤Þ¤¹¡£
 

Re: Âè1·Ç¼¨ÈĤ¬³«¤±¤Ê¤¤

 Åê¹Æ¼Ô¡§Åç¼1243  Åê¹ÆÆü¡§2008ǯ10·î10Æü(¶â)10»þ07ʬ10ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.13[¸µµ­»ö¤Ø]

ÇòÀÐÀèÀ¸¡¢¤´²óÅúÍ­¤êÆñ¤¦¤´¤¶¤¤¤Þ¤¹¡£¤â¤¦¤·¤Ð¤é¤¯Éüµì¤µ¤ì¤ë¤«ÂԤäƤߤޤ¹¡£

»³ÃæÍͤ¬ºÇ¶áÂè1·Ç¼¨ÈĤ˷Ǻܤµ¤ì¤¿¥¯¥¦¥©¡¼¥¿¥Ë¥¢¥ó¤Î¥×¥í¥°¥é¥à¤ò¸«¤¿¤¤¡Ê¥³¥Ô¡¼Â»¤Í¤¿¡Ë
¤Î¤Ç¤¹¤¬¡¢¤É¤¦¤·¤Æ¤âÂè1·Ç¼¨ÈĤ¬Éüµì½ÐÍè¤Ê¤«¤Ã¤¿¾ì¹ç¤ÏÂ裲·Ç¼¨ÈĤؤΞºÜ¤Ï¤µ¤ì¤ë¤Ç¤·
¤ç¤¦¤«¡£
 

Re: Âè1·Ç¼¨ÈĤ¬³«¤±¤Ê¤¤

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2008ǯ10·î10Æü(¶â)16»þ52ʬ13ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.14[¸µµ­»ö¤Ø]

·Ç¼¨Èļ«ÂΤ¬Éüµì¤·¤Ê¤¤¤«¤®¤ê¡¤½ñ¤­¹þ¤ßÆâÍƤϥ¢¥¯¥»¥¹ÉÔǽ¤Ç¤¹¡£
 

Re: Âè1·Ç¼¨ÈĤ¬³«¤±¤Ê¤¤

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2008ǯ10·î11Æü(ÅÚ)09»þ27ʬ55ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.15[¸µµ­»ö¤Ø]

http://freebbs.around.ne.jp/
¤¬ÉÔÄ̤ˤʤäÆ3Æü¤¿¤Á¤Þ¤·¤¿¡£
ÅöÌÌ¡¤¤³¤Á¤é¤Î·Ç¼¨ÈĤò¥á¥¤¥ó¤Ë»È¤Ã¤Æ¤¤¤¯¤³¤È¤Ë¤·¤¿¤¤¤È»×¤¤¤Þ¤¹¡£
µì·Ç¼¨ÈĤÎ101¥Ú¡¼¥¸¤«¤é110¥Ú¡¼¥¸¤Î¥í¥°¤Ï¡¤µì·Ç¼¨ÈĤ¬Éü³è¤·¤Ê¤¤¸Â¤ê¼è¤ê½Ð¤»¤Þ¤»¤ó¡£

101¥Ú¡¼¥¸°Ê¹ß¤Ë½ñ¤­¹þ¤Þ¤ì¤¿Êý¤Ï¡¤ºÆ½ñ¤­¹þ¤ß¤Ê¤É¡¤¤´¶¨ÎϤò¤ª´ê¤¤¤·¤Þ¤¹¡£
¤Ê¤ª¡¤µì·Ç¼¨ÈIJáµî¥í¥° 12-100 ¤Ï¡¤
http://www.geocities.jp/thinking_math_education/log/logs.html
¤Ë¤¢¤ê¤Þ¤¹¡£
 

Re: Âè1·Ç¼¨ÈĤ¬³«¤±¤Ê¤¤

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ10·î11Æü(ÅÚ)10»þ56ʬ27ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.14[¸µµ­»ö¤Ø]

Åç¼1243¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> »³ÃæÍͤ¬ºÇ¶áÂè1·Ç¼¨ÈĤ˷Ǻܤµ¤ì¤¿¥¯¥¦¥©¡¼¥¿¥Ë¥¢¥ó¤Î¥×¥í¥°¥é¥à¤ò¸«¤¿¤¤¡Ê¥³¥Ô¡¼Â»¤Í¤¿¡Ë
> ¤Î¤Ç¤¹¤¬¡¢¤É¤¦¤·¤Æ¤âÂè1·Ç¼¨ÈĤ¬Éüµì½ÐÍè¤Ê¤«¤Ã¤¿¾ì¹ç¤ÏÂ裲·Ç¼¨ÈĤؤΞºÜ¤Ï¤µ¤ì¤ë¤Ç¤·
> ¤ç¤¦¤«¡£


¹ÔÎóɽ¸½¤Ë¤è¤ëÊ£ÁÇ¿ô¡¢¥¯¥©¡¼¥¿¥Ë¥ª¥ó¡Ê»Í¸µ¿ô¡Ë¤Î·×»»
¡¡http://www.urban.ne.jp/home/kz4ymnk/seminar/basic/mat.lzh

¤Ç¥À¥¦¥ó¥í¡¼¥É¤·¤Æ¤¯¤À¤µ¤¤¡£



¤Þ¤¿¡¢·Ç¼¨ÈĤÇȯɽ¤·¤¿¥×¥í¥°¥é¥à¤Î¥á¥ó¥Æ¥Ê¥ó¥¹¡Ê¥Ç¥Ð¥Ã¥°¡¢¥Ð¡¼¥¸¥ç¥ó¥¢¥Ã¥×¤Ê¤É¡Ë¤Ï¤³¤Á¤é¤Ç¤¹¡£

¡¡http://www.urban.ne.jp/home/kz4ymnk/seminar/basic/

£±¡Á£²½µ´Ö¸å¤Ë·ÇºÜ¤·¤Æ¤¤¤Þ¤¹¡£¥ê¥ó¥¯½¸¤Ë¤â·ÇºÜ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
 

Re: Âè1·Ç¼¨ÈĤ¬³«¤±¤Ê¤¤

 Åê¹Æ¼Ô¡§Åç¼1243  Åê¹ÆÆü¡§2008ǯ10·î11Æü(ÅÚ)11»þ27ʬ14ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.17[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¡¢Í­Æñ¤¦¸æºÂ¤¤¤Þ¤·¤¿¡£ÁᮥÀ¥¦¥ó¥í¡¼¥É´°Î»Ãפ·¤Þ¤·¤¿¡£
³Ú¤·¤ß¤ËÆɤޤ»¤Æ夭¤Þ¤¹¡£

> ¹ÔÎóɽ¸½¤Ë¤è¤ëÊ£ÁÇ¿ô¡¢¥¯¥©¡¼¥¿¥Ë¥ª¥ó¡Ê»Í¸µ¿ô¡Ë¤Î·×»»
> ¡¡http://www.urban.ne.jp/home/kz4ymnk/seminar/basic/mat.lzh
>
> ¤Ç¥À¥¦¥ó¥í¡¼¥É¤·¤Æ¤¯¤À¤µ¤¤¡£
>
>
>
> ¤Þ¤¿¡¢·Ç¼¨ÈĤÇȯɽ¤·¤¿¥×¥í¥°¥é¥à¤Î¥á¥ó¥Æ¥Ê¥ó¥¹¡Ê¥Ç¥Ð¥Ã¥°¡¢¥Ð¡¼¥¸¥ç¥ó¥¢¥Ã¥×¤Ê¤É¡Ë¤Ï¤³¤Á¤é¤Ç¤¹¡£
>
> ¡¡http://www.urban.ne.jp/home/kz4ymnk/seminar/basic/
>
> £±¡Á£²½µ´Ö¸å¤Ë·ÇºÜ¤·¤Æ¤¤¤Þ¤¹¡£¥ê¥ó¥¯½¸¤Ë¤â·ÇºÜ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
 

¥¹¥Ô¥í¥°¥é¥Õ¡Ê´ö²¿³Ø¥¢¡¼¥È¡Ë

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ10·î13Æü(·î)22»þ35ʬ55ÉÃ
ÊÖ¿®¡¦°úÍÑ
  !»²¹Í. ¥ê¥ó¥¯½¸¤è¤ê
!¡¡×Ç×ӤοÀÅ¡¡http://stillbe.web.fc2.com/compendium/basic/index.html

FUNCTION GCD(a,b) !ºÇÂç¸øÌó¿ô
   IF b=0 THEN LET GCD=a ELSE LET GCD=GCD(b, MOD(a,b))
END FUNCTION


LET r1=8 !¸ÇÄê±ß¤ÎȾ·Â
LET r2=5 !Æ°¤¯±ß¤ÎȾ·Â¡¡¢¨r1*r2>0¤Ê¤éÆ⦡¢r1*r2<0¤Ê¤é³°Â¦
LET r3=4 !ÅÀP¤Î°ÌÃÖ¡ÊÆ°¤¯±ß¤ÎÃæ¿´¤«¤é¡Ë¡¡¢¨r3=r2¤Ê¤é¥µ¥¤¥¯¥í¥¤¥É¡¢r3¡âr2¤Ê¤é¥È¥í¥³¥¤¥É

IF r1*r2>0 THEN
   LET sz=ABS(r1)+ABS(r3)+1
ELSE
   LET sz=ABS(r1)+ABS(r2)+ABS(r3)+1
END IF
SET WINDOW -sz,sz,-sz,sz !ɽ¼¨Îΰè

DRAW grid !ºÂɸ
DRAW circle WITH SCALE(r1) !Â礭¤Ê±ß

LET iter=r2/GCD(r1,r2) !¼þ²ó¿ô

FOR th=0 TO 360*iter !STEP 0.2 !¢¨Á¤ˤʤë¤Ê¤éÄ´À°
   DRAW p WITH ROTATE(r1/r2*RAD(th))*SHIFT(r1-r2,0)*ROTATE(-RAD(th)) !ÅÀP
NEXT th


PICTURE p !¸¶ÅÀ¡ÊÆ°¤¯±ß¤ÎÃæ¿´¡Ë¤ò´ð½à¤ËÅÀP¤òÉÁ¤¯
   DRAW disk WITH SCALE(0.1)*SHIFT(r3,0) !ÅÀP
END PICTURE

END
 

Re: ¥¹¥Ô¥í¥°¥é¥Õ¡Ê´ö²¿³Ø¥¢¡¼¥È¡Ë

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ10·î14Æü(²Ð)07»þ54ʬ28ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.19[¸µµ­»ö¤Ø]

ºî²è¤ÎÍͻҤò¥¢¥Ë¥á¡¼¥·¥ç¥ó¤µ¤»¤Æ¤ß¤Þ¤·¤¿¡£


FUNCTION GCD(a,b) !ºÇÂç¸øÌó¿ô
   IF b=0 THEN LET GCD=a ELSE LET GCD=GCD(b, MOD(a,b))
END FUNCTION


LET r1=8 !¸ÇÄê±ß¤ÎȾ·Â
LET r2=5 !Æ°¤¯±ß¤ÎȾ·Â¡¡¢¨r1*r2>0¤Ê¤éÆ⦡¢r1*r2<0¤Ê¤é³°Â¦
LET r3=4 !ÅÀP¤Î°ÌÃÖ¡ÊÆ°¤¯±ß¤ÎÃæ¿´¤«¤é¡Ë¡¡¢¨r3=r2¤Ê¤é¥µ¥¤¥¯¥í¥¤¥É¡¢r3¡âr2¤Ê¤é¥È¥í¥³¥¤¥É

!LET r1=8 !¸ÇÄê±ß¤Îľ·Â r1:r2=2:1
!LET r2=4
!LET r3=r2

!LET r1=12 !¥¢¥¹¥Æ¥í¥¤¥É 4:1
!LET r2=3
!LET r3=r2

!LET r1=5 !¥«¡¼¥¸¥ª¥¤¥É 1:1
!LET r2=-5
!LET r3=ABS(r2)

!LET r1=4 !¥Í¥Õ¥í¥¤¥É 2:1
!LET r2=-2
!LET r3=ABS(r2)


IF r1*r2>0 THEN
   IF ABS(r1)>ABS(r2) THEN
      LET sz=MAX(ABS(r1),ABS(r1-r2)+ABS(r3))+1
   ELSE
      LET sz=ABS(r1)+ABS(r3)+1
   END IF
ELSE
   LET sz=ABS(r1)+ABS(r2)+ABS(r3)+1
END IF
SET WINDOW -sz,sz,-sz,sz !ɽ¼¨Îΰè

DRAW grid !ºÂɸ
DRAW circle WITH SCALE(r1) !Â礭¤Ê±ß

LET iter=r2/GCD(r1,r2) !¼þ²ó¿ô

SET DRAW MODE NOTXOR

DIM w(4,4) !¥í¡¼¥«¥ëºÂɸ¤ò¥ï¡¼¥ë¥ÉºÂɸ¤ËÊÑ´¹¤¹¤ë
MAT w=SHIFT(r1-r2,0) !£±¤ÄÁ°
DRAW p(0) WITH w

FOR th=0 TO 360*iter !STEP 0.2 !¢¨Á¤ˤʤë¤Ê¤éÄ´À°
   DRAW p(0) WITH w !£±¤ÄÁ°¤ò¾Ã¤¹

   MAT w=ROTATE(-r1/r2*RAD(th)) * SHIFT(r1-r2,0)*ROTATE(RAD(th)) !»ÑÀª¤È°ÌÃÖ
   DRAW p(1) WITH w !¥ï¡¼¥ë¥ÉºÂɸ¤Ë¡¢Æ°¤¯±ß¤ÈÅÀP¤òÉÁ¤¯

   WAIT DELAY 0.02
NEXT th


PICTURE p(f) !¥í¡¼¥«¥ëºÂɸ¤Î¸¶ÅÀ¤ò´ð½à¤Ë¡¢Æ°¤¯±ß¤ÈÅÀP¤òÉÁ¤¯
   IF f=1 THEN !ÉÁ²è½ç¤ò¹Íθ¤·¤Æ¡¢Àè¤ËÅÀP¤òÉÁ¤¯
      SET DRAW MODE OVERWRITE !ÉÁ²èdisk¤ËNOTXOR¤òÈ¿±Ç¤µ¤»¤Ê¤¤
      DRAW disk WITH SCALE(0.2)*SHIFT(r3,0)
      SET DRAW MODE NOTXOR
   END IF
   DRAW circle WITH SCALE(r2) !Æ°¤¯±ß
   PLOT LINES: 0,0; r3,0
END PICTURE

END
 

²èÁü½Ì¾®ÊäÀµ¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2008ǯ10·î15Æü(¿å)19»þ32ʬ55ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  Âè2·Ç¼¨ÈĤǤϲèÁü¤Î¥¢¥Ã¥×¤â¤Ç¤­¤ë¤è¤¦¤Ê¤Î¤Ç¡¢»î¤·¤Ë²èÁü½Ì¾®¤ÎÊäÀµ¥×¥í¥°¥é¥à¤òÅê¹Æ¤·¤Þ¤¹¡£
MAT PLOT CELLS¤Ç²èÁü¤ò½Ì¾®¤·¤ÆÉÁ²è¤·¤¿¤È¤­¤ËÀ¸¤¸¤ë¥¸¥ã¥®¡¼(¥®¥¶¥®¥¶)¤òÊäÀµ¤¹¤ë¤â¤Î¤Ç¤¹¡£
½Ì¾®¤Ë¤è¤ê·ç»¤¹¤ë²èÁǤο§¾ðÊó¤ò¼þ°Ï¤Î²èÁǤȲýÅÊ¿¶Ñ¤·¤Þ¤·¤¿¡£
ÊäÀµ¤Ç¤­¤ë½Ì¾®Î¨¤Ï¼¡¤Î2Ä̤ê¤Ç¤¹¡£
¡¡1/2,1/3,1/4,...¤È¤¤¤Ã¤¿ 1/n ¤Î¥¿¥¤¥×¡£
¡¡2/3,3/4,4/5,...¤È¤¤¤Ã¤¿ (n-1)/n ¤Î¥¿¥¤¥×¡£
½Ì¾®Î¨¤òÆþÎϤ¹¤ë¤È¡¢¤Þ¤º²èÌ̱¦²¼¤ËÊäÀµ¤Ê¤·¤Î²èÁü¤¬ÉÁ²è¤µ¤ì¤Þ¤¹¡£
¥Ó¡¼¥×²»¤Î¸å¡¢²¿¤«¥­¡¼¤ò²¡¤¹¤Èº¸²¼¤ËÊäÀµ¤·¤¿²èÁü¤¬ÉÁ²è¤µ¤ì¤Þ¤¹¡£
¥×¥í¥°¥é¥à¤ÇÆɤ߹þ¤ó¤Ç¤¤¤ë²èÁü¤Ï½½¿ÊBASICźÉÕ¥Õ¥¡¥¤¥ë¤Ç¤¹¤¬¡¢¥µ¥¤¥º¤¬¾®¤µ¤¤¤¿¤á¤«ÊäÀµ¤Î¸ú²Ì¤ò¤¢¤Þ¤ê³Îǧ¤Ç¤­¤Þ¤»¤ó¡£
¤¼¤Ò¡¢¥¢¥Ã¥×¤·¤¿¼Ì¿¿¤ò¥Ç¥¹¥¯¥È¥Ã¥×¤Ë¤Ç¤â¥³¥Ô¡¼¡õ¥Ú¡¼¥¹¥È¤·¤Æ»î¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
¤³¤Î¼Ì¿¿¤Ï¸Ä¿Í¤¬»£±Æ¤·¤¿¤â¤Î¤ÇÃøºî¸¢¤ËÌäÂê¤Ï¤¢¤ê¤Þ¤»¤ó¡£

(JPEG·Á¼°¤ÇUp¤·¤¿¤Î¤Ç²è¼Á¤¬Íî¤Á¤Æ¤Þ¤¹¤¬¡¢DownLoad¤¹¤ë¤ÈBMP·Á¼°¤ÇÊݸ¤µ¤ì¤Þ¤¹¡£)
(·Ç¼¨¤µ¤ì¤Æ¤¤¤ë¥µ¥¤¥º¤Ï400¡ß300¡¢³ÈÂ礹¤ë¤È¸µ¤Î¥µ¥¤¥º800¡ß600¤Ë¤Ê¤ê¤Þ¤¹¡£¤É¤Á¤é¤Î¥µ¥¤¥º¤â¥À¥¦¥ó¥í¡¼¥É¤Ç¤­¤Þ¤¹)


REM ** ²èÁü½Ì¾®ÊäÀµ¥×¥í¥°¥é¥à **
OPTION ARITHMETIC NATIVE
DECLARE EXTERNAL SUB revision1,revision2
GLOAD "C:\Program Files\Decimal BASIC\BASICw32\SAMPLE\ZENKOUJI.JPG"
LET px0=PIXELX(1)
LET py0=PIXELY(1)
SET WINDOW 0,px0,0,py0
DIM pict0(0 TO px0,0 TO py0)    ! ¸µ²èÁü(ÇÛÎó¤Î²¼¸Â¤Ï0°Ê³°¤â²Ä)
SET COLOR MODE "NATIVE"
ASK PIXEL ARRAY (0,py0) pict0   ! ¸µ²èÁü¤Î¿§»Øɸ
DO
   LET err=0
   INPUT PROMPT "[½Ì¾®Î¨ÆþÎÏ] ʬ»Ò,ʬÊì (ʬ»Ò=1 or ʬ»Ò=ʬÊì-1)" : num,denom
   IF num<1 OR INT(num)<>num THEN LET err=1
   IF denom<2 OR INT(denom)<>denom THEN LET err=1
   IF num<>1 AND num<>denom-1 THEN LET err=1
LOOP UNTIL err=0
LET t0=TIME
LET kk=num/denom   ! ½Ì¾®Î¨
MAT PLOT CELLS, IN px0-px0*kk,py0*kk ; px0,0 : pict0  !! ÊäÀµ¤Ê¤·
!
LET px9=INT(SIZE(pict0,1)*kk+0.00001)-1  ! k=1/3,3*k<>1¤ËÂбþ
LET py9=INT(SIZE(pict0,2)*kk+0.00001)-1
DIM pict9(0 TO px9,0 TO py9)    ! ½Ì¾®ÊäÀµ²èÁü(ÇÛÎó¤Î²¼¸Â¤Ï0)
IF num=1 THEN
   CALL revision1(pict0,pict9,denom)   ! ½Ì¾®Î¨=1/n
ELSE
   CALL revision2(pict0,pict9,denom)   ! ½Ì¾®Î¨=(n-1)/n
END IF
IF TIME-t0<0.2 THEN WAIT DELAY 0.2
BEEP
SET TEXT COLOR "RED"
SET TEXT HEIGHT py0/30
PLOT TEXT ,AT 1,1 : "PUSH ANY KEY"
DO
   FOR i=8 TO 239
      IF GetKeyState(i)<0 THEN EXIT DO
   NEXT i
LOOP
MAT PLOT CELLS, IN 0,py9 ; px9,0 : pict9  !! ÊäÀµ¤¢¤ê
BEEP
END


REM  ½Ì¾®Î¨=1/n (1/2,1/3,1/4,...)
EXTERNAL SUB revision1(sp0(,),sp9(,),k)
OPTION ARITHMETIC NATIVE
LET kk=1/k
DIM c9(3)
LET lx0=LBOUND(sp0,1)
LET ly0=LBOUND(sp0,2)
LET ux0=UBOUND(sp0,1)
LET uy0=UBOUND(sp0,2)
LET ux9=UBOUND(sp9,1)
LET uy9=UBOUND(sp9,2)
FOR i=lx0 TO ux0-(k-1) STEP k
   FOR j=ly0 TO uy0-(k-1) STEP k
      MAT c9=ZER
      FOR ii=0 TO k-1
         FOR jj=0 TO k-1
            CALL acm(i+ii,j+jj)
         NEXT jj
      NEXT ii
      LET sp9((i-lx0)*kk,(j-ly0)*kk)=COLORINDEX(c9(1)/k^2,c9(2)/k^2,c9(3)/k^2)
   NEXT j
NEXT i
LET rm2=MOD(uy0,k)  ! ±ï(²£)¤Î½èÍý
IF rm2<>k-1 THEN
   FOR i=lx0 TO ux0-(k-1) STEP k
      MAT c9=ZER
      FOR j=0 TO rm2
         CALL acm(i,uy0-j)
      NEXT j
      LET sp9((i-lx0)*kk,uy9)=COLORINDEX(c9(1)/(rm2+1),c9(2)/(rm2+1),c9(3)/(rm2+1))
   NEXT i
END IF
LET rm1=MOD(ux0,k)  ! ±ï(½Ä)¤Î½èÍý
IF rm1<>k-1 THEN
   FOR j=ly0 TO uy0-(k-1) STEP k
      MAT c9=ZER
      FOR i=0 TO rm1
         CALL acm(ux0-i,j)
      NEXT i
      LET sp9(ux9,(j-ly0)*kk)=COLORINDEX(c9(1)/(rm1+1),c9(2)/(rm1+1),c9(3)/(rm1+1))
   NEXT j
END IF
IF rm1<>k-1 OR rm2<>k-1 THEN  ! ³Ñ¤Î½èÍý
   MAT c9=ZER
   FOR i=0 TO rm1
      FOR j=0 TO rm2
         CALL acm(ux0-i,uy0-j)
      NEXT j
   NEXT i
   LET rm12=(rm1+1)*(rm2+1)
   LET sp9(ux9,uy9)=COLORINDEX(c9(1)/rm12,c9(2)/rm12,c9(3)/rm12)
END IF
SUB acm(x0,y0)
   ASK COLOR MIX(sp0(x0,y0)) b,g,r
   LET c9(1)=c9(1)+b
   LET c9(2)=c9(2)+g
   LET c9(3)=c9(3)+r
END SUB
END SUB

REM  ½Ì¾®Î¨=(n-1)/n (2/3,3/4,4/5,...)
EXTERNAL SUB revision2(sp0(,),sp9(,),k)
OPTION ARITHMETIC NATIVE
DECLARE FUNCTION c_ave
LET kk=(k-1)/k
LET num1=(k-1)-1
LET lx0=LBOUND(sp0,1)
LET ly0=LBOUND(sp0,2)
LET ux0=UBOUND(sp0,1)
LET uy0=UBOUND(sp0,2)
LET ux9=UBOUND(sp9,1)
LET uy9=UBOUND(sp9,2)
FOR i=lx0 TO ux0-k STEP k
   FOR j=ly0 TO uy0-k STEP k
      CALL center
      CALL side1(i,j,1,0)
      CALL side1(i+k,j,-1,num1)
      CALL side2(i,j,1,0)
      CALL side2(i,j+k,-1,num1)
      CALL corner(i,j,1,1,0,0)
      CALL corner(i,j+k,1,-1,0,num1)
      CALL corner(i+k,j,-1,1,num1,0)
      CALL corner(i+k,j+k,-1,-1,num1,num1)
   NEXT j
NEXT i
LET x8=(i-lx0-k)*kk+num1
LET y8=(j-ly0-k)*kk+num1
IF uy9<>y8 THEN CALL edge1
IF ux9<>x8 THEN CALL edge2
IF ux9<>x8 AND uy9<>y8 THEN CALL edge_corner
FUNCTION c_ave(c1,c2)   ! ¿§¶¯ÅٲýÅÊ¿¶Ñ
   ASK COLOR MIX(c1) b1,g1,r1
   ASK COLOR MIX(c2) b2,g2,r2
   LET c_ave=COLORINDEX((b1+2*b2)/3,(g1+2*g2)/3,(r1+2*r2)/3)
END FUNCTION
SUB center
   FOR ii=2 TO num1
      FOR jj=2 TO num1
         LET sp9((i-lx0)*kk+ii-1,(j-ly0)*kk+jj-1)=sp0(i+ii,j+jj)
      NEXT jj
   NEXT ii
END SUB
SUB side1(x,y,ii,m)
   FOR jj=2 TO num1
      LET sp9((i-lx0)*kk+m,(j-ly0)*kk+jj-1)=c_ave(sp0(x,y+jj),sp0(x+ii,y+jj))
   NEXT jj
END SUB
SUB side2(x,y,jj,n)
   FOR ii=2 TO num1
      LET sp9((i-lx0)*kk+ii-1,(j-ly0)*kk+n)=c_ave(sp0(x+ii,y),sp0(x+ii,y+jj))
   NEXT ii
END SUB
SUB corner(x,y,ii,jj,m,n)
   ASK COLOR MIX(sp0(x,y)) b1,g1,r1
   ASK COLOR MIX(sp0(x,y+jj)) b2,g2,r2
   ASK COLOR MIX(sp0(x+ii,y)) b3,g3,r3
   ASK COLOR MIX(sp0(x+ii,y+jj)) b4,g4,r4
   LET bb=(b1+2*b2+2*b3+4*b4)/9
   LET gg=(g1+2*g2+2*g3+4*g4)/9
   LET rr=(r1+2*r2+2*r3+4*r4)/9
   LET sp9((i-lx0)*kk+m,(j-ly0)*kk+n)=COLORINDEX(bb,gg,rr)
END SUB
SUB edge1
   FOR i=lx0 TO ux0-k STEP k  ! ²¼ÊդνèÍý
      FOR ii=0 TO num1
         FOR jj=0 TO uy9-y8-2
            LET sp9((i-lx0)*kk+ii,uy9-jj)=sp0(i+ii+1,uy0-jj)
         NEXT jj
         LET sp9((i-lx0)*kk+ii,uy9-jj)=c_ave(sp0(i+ii+1,uy0-(jj+1)),sp0(i+ii+1,uy0-jj))
      NEXT ii
   NEXT i
END SUB
SUB edge2
   FOR j=ly0 TO uy0-k STEP k  ! ±¦ÊդνèÍý
      FOR jj=0 TO num1
         FOR ii=0 TO ux9-x8-2
            LET sp9(ux9-ii,(j-ly0)*kk+jj)=sp0(ux0-ii,j+jj+1)
         NEXT ii
         LET sp9(ux9-ii,(j-ly0)*kk+jj)=c_ave(sp0(ux0-(ii+1),j+jj+1),sp0(ux0-ii,j+jj+1))
      NEXT jj
   NEXT j
END SUB
SUB edge_corner
   FOR ii=ux9 TO x8+1 STEP-1
      FOR jj=uy9 TO y8+1 STEP-1
         LET sp9(ii,jj)=sp0(ux0-(ux9-ii),uy0-(uy9-jj))
      NEXT jj
   NEXT ii
END SUB
END SUB
 

Re: ²èÁü½Ì¾®ÊäÀµ¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ10·î18Æü(ÅÚ)20»þ06ʬ51ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.21[¸µµ­»ö¤Ø]

¥Ð¥¤¥ê¥Ë¥¢Ë¡¤Ç¤Ï¡¢²èÁü¤ò½Ì¾®¤¹¤ì¤Ð¥¨¥Ã¥¸Éôʬ¤¬¶¯Ä´¤µ¤ì¤ë·¹¸þ¤¬¤¢¤ê¤Þ¤¹¡£

°ìÈÌŪ¤Ê½Ì¾®Î¨¤Î¾ì¹ç¡¢²èÁü½èÍý¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤ÎÁàºî¤Î¤è¤¦¤Ë
½Ì¾®Î¨¤Ë±þ¤¸¤ÆÊ¿³ê²½¡Ê¤Ü¤«¤¹¡Ë¤·¤Æ¡¢¥Ð¥¤¥ê¥Ë¥¢Ë¡¤Ç½Ì¾®¤¹¤ì¤Ð¤è¤¤¤«¤È»×¤¤¤Þ¤¹¡£


Ê̲ò¡¡¢¨MATʸ¤ò»È¤Ã¤Æ½èÍý¤¬Â®¤¯¤Ê¤ê¤Þ¤·¤¿¡£


!Î¥»¶¥³¥µ¥¤¥óÊÑ´¹¡ÊDCT:Discrete Cosine Transform¡Ë¤Ë¤è¤ë³ÈÂç½Ì¾®

OPTION ARITHMETIC NATIVE

LET N=8 !¥Ö¥í¥Ã¥¯¥µ¥¤¥º

FUNCTION phi(k,i,N) !´ðÄì´Ø¿ô¦Õk(i)
   IF k=0 THEN
      LET phi=1/SQR(N)
   ELSE
      LET phi=SQR(2/N)*COS((2*i+1)*k*PI/(2*N))
   END IF
END FUNCTION

SUB DCT(f(,),TBL(,),iTBL(,), FF(,)) !DCTÊÑ´¹
   MAT FF=TBL*f
   MAT FF=FF*iTBL !F(k,l)=¦²[j=0,N-1]¦²[i=0,N-1]f(i,j)*¦Õk(i)*¦Õl(j)
END SUB
SUB iDCT(FF(,),TBL(,),iTBL(,), f(,)) !DCTµÕÊÑ´¹
   MAT f=iTBL*FF
   MAT f=f*TBL !f(i,j)=¦²[l=0,N-1]¦²[k=0,N-1]F(k,l)*¦Õk(i)*¦Õl(j)
END SUB

DIM TBLn(0 TO N-1,0 TO N-1) !ÊÑ´¹¹ÔÎó T
MAT TBLn=ZER
FOR k=0 TO N-1 !N¡ßN¥Ö¥í¥Ã¥¯¤Î¦Õk(i)¤Î¥Æ¡¼¥Ö¥ë¤ò¤Ä¤¯¤ë
   FOR i=0 TO N-1
      LET TBLn(k,i)=phi(k,i,N)
   NEXT i
NEXT k
!!!MAT PRINT TBLn;
DIM iTBLn(N,N) !¢¨T^-1=T^t¡¢¢è¥æ¥Ë¥¿¥ê¡¼¹ÔÎó
MAT iTBLn=TRN(TBLn)
!-------------------- ¤³¤³¤Þ¤Ç¤¬¥µ¥Ö¥ë¡¼¥Á¥ó


SET COLOR MODE "NATIVE"
!GLOAD "c:\BASICw32\SAMPLE\ZENKOUJI.JPG" !²èÁü¤òÆɤ߹þ¤à
GLOAD "c:\My Documents\test2.bmp" !²èÁü¤òÆɤ߹þ¤à
ASK PIXEL SIZE (0,0; 1,1) w,h !²èÁü¤Î½Ä²£¤ÎÂ礭¤µ(¥Ô¥¯¥»¥ëñ°Ì)¤òÄ´¤Ù¤ë
DIM p(w,h) !²èÁü¤ÎÂ礭¤µ¤ËÂбþ¤¹¤ëÇÛÎóÍ×ÁǤòÍÑ°Õ¤¹¤ë
ASK PIXEL ARRAY (0,1) p !²èÁü¤Î³ÆÅÀ¤Î¿§¾ðÊó¤òÇÛÎó¤Ë³ÊǼ¤¹¤ë
PRINT "²èÁü¤ÎÂ礭¤µ ½Ä:";h;" ²£:";w
!SET BITMAP SIZE w,h !¥¦¥£¥ó¥É¥¦¤ÎÂ礭¤µ¤ò²èÁü¤Ë¹ç¤ï¤»¤ë


LET A=5 !³ÈÂç½Ì¾®Î¨ A/N
!LET A=11 !³ÈÂç½Ì¾®Î¨

LET ww=INT(w*A/N+0.5) !ÊÑ´¹¸å¤Î²èÁü¤ÎÂ礭¤µ
LET hh=INT(h*A/N+0.5)
PRINT A;"/";N;"ÇܡʽIJ£Èæ¤Ï¸ÇÄê¡Ë ½Ä:";hh;" ²£:";ww
IF ww<=0 OR hh<=0 THEN
   PRINT "²èÁü¤ÎÂ礭¤µ¤¬£°¤Þ¤¿¤ÏÉé¤Ë¤Ê¤ê¤Þ¤¹¡£"
   STOP
END IF
DIM q(ww,hh) !ÊÑ´¹¸å¤Î²èÁü¤ò³ÊǼ¤¹¤ëÇÛÎó


LET t0=TIME


DIM TBLa(0 TO A-1,0 TO A-1)
MAT TBLa=ZER
FOR k=0 TO A-1 !A¡ßA¥Ö¥í¥Ã¥¯¤Î¦Õk(i)¤Î¥Æ¡¼¥Ö¥ë¤ò¤Ä¤¯¤ë
   FOR i=0 TO A-1
      LET TBLa(k,i)=phi(k,i,A)
   NEXT i
NEXT k
DIM iTBLa(0 TO A-1,0 TO A-1)
MAT iTBLa=TRN(TBLa)

FOR by=0 TO INT((h-1)/N) !¥Ö¥í¥Ã¥¯Ã±°Ì¤Ëʬ³ä¤¹¤ë
   FOR bx=0 TO INT((w-1)/N)

      FOR j=1 TO N !¥Ö¥í¥Ã¥¯Æâ¤Î²èÁü
         LET y=by*N+j
         IF y>h THEN EXIT FOR !²¼Ã¼¤Ê¤é
         FOR i=1 TO N
            LET x=bx*N+i
            IF x>w THEN EXIT FOR !±¦Ã¼¤Ê¤é
            !!!PRINT x;y,i;j

            LET c=p(x,y)
            ASK COLOR MIX(c) r,g,b !RGB¤ò¼èÆÀ¤¹¤ë

            DIM Br(N,N),Bg(N,N),Bb(N,N) !²èÁǤο§Ç»ÅÙ¡¡¢¨²èÁü¿®¹æ f(i,j)
            LET Br(i,j)=r
            LET Bg(i,j)=g
            LET Bb(i,j)=b
         NEXT i
      NEXT j

      DIM BVr(N,N),BVg(N,N),BVb(N,N) !DCT·¸¿ô F(k,l)
      CALL DCT(Br,TBLn,iTBLn, BVr)
      CALL DCT(Bg,TBLn,iTBLn, BVg)
      CALL DCT(Bb,TBLn,iTBLn, BVb)

      !¢¨½Ì¾®¤Ê¤é¹â¼þÇÈÀ®Ê¬¤Î¹Ô¤ÈÎó¤ò½ü¤¯¡¢³ÈÂç¤Ê¤éÉÔ­Éôʬ¤Ï£°¤òÊ䤦
      DIM Tr(A,A),Tg(A,A),Tb(A,A)
      IF A>N THEN !³ÈÂç¤Ê¤é
         MAT Tr=ZER(A,A)
         MAT Tg=ZER(A,A)
         MAT Tb=ZER(A,A)
      END IF
      FOR j=1 TO MIN(N,A) !copy it
         FOR i=1 TO MIN(N,A)
            LET Tr(i,j)=BVr(i,j)
            LET Tg(i,j)=BVg(i,j)
            LET Tb(i,j)=BVb(i,j)
         NEXT i
      NEXT j

      DIM iBr(A,A),iBg(A,A),iBb(A,A) !²èÁǤο§Ç»ÅÙ¡¡¢¨²èÁü¿®¹æ f(i,j)
      CALL iDCT(Tr,TBLa,iTBLa, iBr)
      CALL iDCT(Tg,TBLa,iTBLa, iBg)
      CALL iDCT(Tb,TBLa,iTBLa, iBb)

      FOR j=1 TO A !²èÁü¤Ë³äÅö¤Æ¤ë
         LET yy=by*A+j
         IF yy>hh THEN EXIT FOR !²¼Ã¼¤Ê¤é
         FOR i=1 TO A
            LET xx=bx*A+i
            IF xx>ww THEN EXIT FOR !±¦Ã¼¤Ê¤é

            LET r=MIN(iBr(i,j)*A/N,1) !µ±ÅÙÄ´À°
            LET g=MIN(iBg(i,j)*A/N,1)
            LET b=MIN(iBb(i,j)*A/N,1)

            LET q(xx,yy)=colorindex(r,g,b) !»ØÄê°ÌÃ֤βèÁǤ˽ñ¤­¹þ¤à
         NEXT i
      NEXT j

   NEXT bx
NEXT by


SET BITMAP SIZE ww,hh !¥¦¥£¥ó¥É¥¦¤ÎÂ礭¤µ¤ò²èÁü¤Ë¹ç¤ï¤»¤ë
MAT PLOT CELLS, IN 0,1; 1,0 :q !²èÁü¤òɽ¼¨¤¹¤ë


PRINT
PRINT "·×»»»þ´Ö=";TIME-t0

END
 

¼ÁÌä

 Åê¹Æ¼Ô¡§¤æ¤¦  Åê¹ÆÆü¡§2008ǯ10·î19Æü(Æü)09»þ43ʬ19ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¥°¥é¥Õ¤òÉÁ¤¤¤Æ¤¤¤Þ¤¹¡£
2¤Ä¤Î´Ø¿ôf(x)¤Èg(x)¤Ë¤è¤Ã¤Æ°Ï¤Þ¤ì¤¿¿Þ·Á¤òÅɤê¤Ä¤Ö¤·¤¿¤¤¤Î¤Ç¤¹¤¬¡¢¤É¤¦¤ä¤Ã¤Æ¤ä¤Ã¤¿¤é½ÐÍè¤Þ¤¹¤«¡©²óÅú¤ª´ê¤¤¤·¤Þ¤¹¡£
 

Re: ¼ÁÌä

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ10·î19Æü(Æü)11»þ51ʬ12ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.23[¸µµ­»ö¤Ø]

¤æ¤¦¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£


!ϢΩÉÔÅù¼°f(x)>0¡¢g(x,y)<0¤ÎÎΰè

DEF f(x)=x^2-3*x-1 !´Ø¿ô¤ÎÄêµÁ y=f(x)
DEF g(x,y)=5*x^2-6*x*y+5*y^2-25 !´Ø¿ô¤ÎÄêµÁ f(x,y)=0

LET a=-5 !x=[a,b]¡¡¢¨xyºÂɸ¤Îɽ¼¨Îΰè
LET b=5
LET c=a !y=[c,d]
LET d=b


SET WINDOW a,b,c,d !ɽ¼¨Îΰè¤òÀßÄꤹ¤ë
DRAW grid(1,1) !ºÂɸ¤òÉÁ¤¯
ASK PIXEL SIZE (a,c; b,d) w,h !²èÁü¤Î½Ä²£¤ÎÂ礭¤µ(¥É¥Ã¥Èñ°Ì)¤òÄ´¤Ù¤ë
PRINT w;h

LET cEps=(b-a)/(w-1) !ºÂɸ´Ö³Ö
PRINT cEps

DEF ha(f)=MOD(f,cEps*10) !ɾ²Á´Ø¿ô
SUB hatch(t, x,y,c) !¥Ï¥Ã¥Á·Á¾õ¤Ê¤éÅÀ(x,y)¤òÉÁ¤¯
   LET flg=0
   IF (t=1 OR t=5) AND ha(y)<cEps THEN LET flg=1 !²£
   IF (t=2 OR t=5) AND ha(x)<cEps THEN LET flg=1 !½Ä
   IF (t=3 OR t=6) AND ha(x+y)<cEps THEN LET flg=1 !º¸¼Ð¤á
   IF (t=4 OR t=6) AND ha(x-y)<cEps THEN LET flg=1 !±¦¼Ð¤á
   IF t=0 OR flg=1 THEN !t=0¤Ï¥Ù¥¿Åɤê
      SET POINT COLOR c
      PLOT POINTS: x,y
   END IF
END SUB


!¾ò·ï¤òËþ¤¿¤¹Îΰè¤òÉÁ¤¯
SET POINT STYLE 1 !¥É¥Ã¥È·Á¼°
FOR j=1 TO h !²èÌÌÁ´ÂΤòÁöºº¤¹¤ë
   LET y=WORLDY(j) !¥É¥Ã¥È¤òxyºÂɸ¤ËÊÑ´¹¤¹¤ë
   FOR i=1 TO w
      LET x=WORLDX(i)

      WHEN EXCEPTION IN
      !ÉÔÅù¼°¤¬¼¨¤¹Îΰ衡¢¨y>f(x)¤Ïf(x)>0¡¢y<f(x)¤Ïf(x)<0¤ò°ÕÌ£¤¹¤ë
         IF y>f(x) THEN CALL hatch(4, x,y,4) !¾ò·ï¤òËþ¤¿¤¹¤Ê¤é
         IF g(x,y)<0 THEN CALL hatch(3, x,y,2)

         !ϢΩÉÔÅù¼°¤¬¼¨¤¹Îΰè
         !IF y>f(x) AND g(x,y)<0 THEN CALL hatch(5, x,y,2) !¾ò·ï¤òËþ¤¿¤¹¤Ê¤é
      USE
      END WHEN

   NEXT i
NEXT j



!¶ÊÀþ¤òÉÁ¤¯¡¡¢¨y=f(x)
FOR x=a TO b STEP cEps
   WHEN EXCEPTION IN
      PLOT LINES: x,f(x); !ÀÞ¤ìÀþ¤Ç¶á»÷¤¹¤ë
   USE
      PLOT LINES
   END WHEN
NEXT x
PLOT LINES
PLOT TEXT ,AT -2,4: "f(x)"


!¶ÊÀþ¤òÉÁ¤¯¡¡¢¨Ï¢Â³¤Êf(x,y)=0
SET POINT COLOR 1
FOR y=c TO d STEP cEps
   LET x=a
   LET z=g(x,y)
   FOR x=a TO b STEP cEps
      LET z0=z
      LET z=g(x,y)
      IF z0*z<0 THEN  PLOT POINTS: x,y !Éä¹æ¤¬ÊѤï¤ì¤Ð
   NEXT x
NEXT y
PLOT TEXT ,AT -3,-3: "g(x)"


END
 

(̵Âê)

 Åê¹Æ¼Ô¡§¤À¤¤  Åê¹ÆÆü¡§2008ǯ10·î21Æü(²Ð)13»þ50ʬ23ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ½½¿Êbasic¤ò¥À¥¦¥ó¥í¡¼¥É¤·¤¿¤¤¤ó¤Ç¤¹¤¬¡¢¤É¤¦¤·¤¿¤é¤¤¤¤¤«¶µ¤¨¤Æ¤¯¤À¤µ¤¤¡£  

Re: (̵Âê)

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2008ǯ10·î21Æü(²Ð)17»þ56ʬ20ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.25[¸µµ­»ö¤Ø]

¤À¤¤¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ½½¿Êbasic¤ò¥À¥¦¥ó¥í¡¼¥É¤·¤¿¤¤¤ó¤Ç¤¹¤¬¡¢¤É¤¦¤·¤¿¤é¤¤¤¤¤«¶µ¤¨¤Æ¤¯¤À¤µ¤¤¡£

¤³¤ÎÊǤΰìÈÖ²¼¤Î¤Û¤¦¤Ë¤¢¤ë¡Ö½½¿ÊBASIC¤Î¥Û¡¼¥à¥Ú¡¼¥¸¡×¤Ø¤Î¥ê¥ó¥¯¤ò¥¯¥ê¥Ã¥¯¤·¡¤
½½¿ÊBASIC¤Î¥Û¡¼¥à¥Ú¡¼¥¸¤ÇOSÊ̤ËÍÑ°Õ¤µ¤ì¤¿¥À¥¦¥ó¥í¡¼¥É¤ÎÊǤ˿ʤó¤Ç¤¯¤À¤µ¤¤¡£
 

Re: ²èÁü½Ì¾®ÊäÀµ¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2008ǯ10·î26Æü(Æü)12»þ08ʬ13ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.22[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¥¢¥É¥Ð¥¤¥¹¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
²èÁü½èÍý¤ËÂФ·¤Æ¤ÎÃ챤â¤Ê¤¯»×¤¤¤Ä¤­¤Çºî¤Ã¤¿¥×¥í¥°¥é¥à¤Ç¤¹¡£
Î¥»¶¥³¥µ¥¤¥óÊÑ´¹¤Ê¤ëÍѸì¤â½é¤á¤ÆÌܤˤ¹¤ë¤â¤Î¤Ç¡¢¥Í¥Ã¥ÈÅù¤Ç¼«Ê¬¤Ê¤ê¤ËÄ´¤Ù¤Þ¤·¤¿¤¬»ÄÇ°¤Ê¤¬¤é¹Å¤¯¤Ê¤Ã¤¿Æ¬¤Ç¤Ï¸¶Íý¤òÍý²ò¤¹¤ë¤Þ¤Ç¤Ï¤¤¤¿¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£

²èÁü´Ø·¸¤Ç¤Ï¤Ê¤¤¤Ç¤¹¤¬¡¢¤¤¤¯¤Ä¤«Åê¹Æ¤·¤è¤¦¤«¤È»×°Æ¤·¤Æ¤¤¤ë¤â¤Î¤¬¤¢¤ê¤Þ¤¹¡£
¤Þ¤¿¥¢¥É¥Ð¥¤¥¹¤ª´ê¤¤¤·¤Þ¤¹¡£
 

ÉÔÅù¹æ¤ò¥¿¥°¤È¸íǧ¼±

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2008ǯ10·î27Æü(·î)08»þ31ʬ49ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  Âè2·Ç¼¨ÈĤǤÏHTML¥¿¥°¤ò»È¤¨¤Þ¤¹¤¬¡¢ÉÔÅù¹æ¤ò¥¿¥°¤È¸íǧ¼±¤¹¤ë¤³¤È¤¬¤¢¤ë¤è¤¦¤Ê¤Î¤ÇÊó¹ð¤·¤Þ¤¹¡£
¡Ö±¦³«¤­ÉÔÅù¹æ(<)+¥¿¥°ÍѸì+¶õÇò¡×¤Ç¥¿¥°¤Èǧ¼±¤·¡¢¼¡¤Îº¸³«¤­ÉÔÅù¹æ(>)¤Þ¤Ç¤Î´Ö¤Ë¤¢¤ëʸ»ú¤¬É½¼¨¤µ¤ì¤Þ¤»¤ó¡£
¡Ê¸µ¤Îʸ¤È¤·¤Æɽ¼¨¤·¤Æ¤¤¤ë¤Î¤ÏÉÔÅù¹æ¤òÁ´³Ñ¤Ë¤·¤Æ¤¤¤Þ¤¹¡£¡Ë
Åê¹Æ¤¹¤ëºÝ¤Ï¡¢ÊÑ¿ô̾¤ò¥¿¥°ÍѸì¤ÈÊѤ¨¤ë¤«¡¢j<p+0 ¤ÎÍͤˤ·¤ÆÉÔÅù¹æ¤Ë³¤¯ÊÑ¿ô¤Î¸å¤í¤ò¶õÇò¤Ë¤·¤Ê¤¤¡¢¤Þ¤¿¤ÏÉÔÅù¹æ¤Î¸þ¤­¤òÊѤ¨¤ë¤È¤¤¤Ã¤¿¹©Éפ¬É¬Íפˤʤê¤Þ¤¹¡£
»²¹Í¤Þ¤Ç¤Ë1ʸ»ú¤Î¥¿¥°¤Ï¡¢a,b,i,p,q,s,u¡£h1¡Áh6¤â¸«½Ð¤·¤Èǧ¼±¤µ¤ì¤Þ¤¹¡£(ÄûÀµ;·Ç¼¨ÈÄÆâ¤Ç¤Ï¸«½Ð¤·¥¿¥°¤Ï»È¤¨¤Ê¤¤¤è¤¦¤Ç¤¹)

¤³¤ÎÌäÂê¤Î¸¶°ø¤Ï¥ì¥ó¥¿¥ë·Ç¼¨ÈĤˤ¢¤ë¤Î¤Ç¤É¤¦¤·¤è¤¦¤â¤Ê¤¤¤Ç¤¹¤è¤Í¡©



Îã1 : ¥Õ¥©¥ó¥È(font)
10 IF ac THEN LET font=1

¸µ1 :
10 IF a¡ãfont AND b¡äc THEN LET font=1


Îã2 : ²þ¹Ô(br)
20 IF x
z THEN LET br=2

¸µ2 :
20 IF x¡ãbr OR y¡äz THEN LET br=2


Îã3 : ¥Ï¥¤¥Ñ¡¼¥ê¥ó¥¯(a)
30 IF di THEN LET h=5

¸µ3 :
30 IF d¡ãa THEN LET d=3
40 LET e=e+1
50 IF f¡ãg THEN LET f=4
60 IF h¡äi THEN LET h=5


Îã4 : ÃÊÍî(p)
70 IF j

l THEN LET j=6

¸µ4 :
70 IF j¡ãp OR k¡äl THEN LET j=6


Îã5 : ¥Ü¡¼¥ë¥ÉÂÎ(b)
80 IF mo THEN LET m=7

¸µ5 :
80 IF m¡ãb AND n¡äo THEN LET m=7


ÌäÂê¤Ê¤· :
10 a<fontx AND b>c THEN LET fontx=1
70 IF j<p+0 OR k>l THEN LET j=6
80 IF b>m AND n>o THEN LET m=7


(¡ãb ¤ÇÂÀ»ú¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿¤Î¤Ç¡ã/b¡ä
¤Èµ­½Ò¤µ¤ì¤ë¤Þ¤Çľ¤ê¤Þ¤»¤ó¡£)

 

Re: ÉÔÅù¹æ¤ò¥¿¥°¤È¸íǧ¼±

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ10·î27Æü(·î)12»þ59ʬ39ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.28[¸µµ­»ö¤Ø]

µ¤¤Ë¤Ê¤ëÆüìʸ»ú¤Î½ñ¤­¹þ¤ß»î¸³¤Ç¤¹¡£

PRINT "¡õ£Ì£Ô¡¨"
PRINT "¡õ£ì£ô¡¨"
PRINT "123"¡õ£ì£ô$
PRINT "123"¡õ£ì£ô£õ£ö£÷$
IF a¡ãfont AND b>c THEN LET font=1

¤Èµ­½Ò¤·¤¿¥×¥í¥°¥é¥à¤òÅê¹Æ¤·¤¿¤È¤¹¤ë¡£



PRINT "<"
PRINT "<"
PRINT "123"<$
PRINT "123"&ltuvw$
IF ac THEN LET font=1



PRE¥¿¥°¤ò»ØÄꤷ¤Æ¤ß¤ë
PRINT "<"
PRINT "<"
PRINT "123"<$
PRINT "123"&ltuvw$
IF ac THEN LET font=1


¤È¤¤¤¦¤³¤È¤Ï¡¢¡ã¤È¡õ¤ò¡õ£ì£ô¡¨¡¤¡õ£á£í£ð¡¨¤ËÊÑ´¹¤·¤Æ¤ª¤±¤Ð¤¤¤¤¤Î¤Ç¤·¤ç¤¦¤«¡ª¡©
 

Re: ÉÔÅù¹æ¤ò¥¿¥°¤È¸íǧ¼±

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2008ǯ10·î28Æü(²Ð)08»þ04ʬ13ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.29[¸µµ­»ö¤Ø]

½½¿ÊBASIC FAQ ·Ç¼¨ÈĤλȤ¤Êý¤Ë & ¡¤< ¤ÎÃÖ´¹¼ê½ç¤òÄɲä·¤Þ¤·¤¿¡£
¤Ê¤ª¡¤¤Û¤«¤Ë¤ªµ¤¤Å¤­¤ÎÅÀ¤¬¤¢¤ì¤Ð¤ªÃΤ餻¤¯¤À¤µ¤¤¡£
 

¥â¥ó¥Æ¥«¥ë¥íË¡¤Ë¤è¤ë¿ôÃÍÀÑʬ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ10·î28Æü(²Ð)11»þ14ʬ32ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  !¥â¥ó¥Æ¥«¥ë¥íË¡¡ÊMonte Carlo Method¡Ë¤Ë¤è¤ë¿ôÃÍÀÑʬ

DEF f(x)=1/(1+x) !ÈïÀÑʬ´Ø¿ô

!¡üÆþÌçŪ¥â¥ó¥Æ¥«¥ë¥íË¡
!¡¡¢é[0,1]f(x)dx=¦²[i=1,N]f(i/N)/N=1/N*¦²[i=1,N]f(xi)
!
!¡¡x=[a,b]ÈϰϤǰìÍÍÍð¿ô¤ÇÅÀ(x,y)¤òN¸ÄȯÀ¸¤µ¤»¤ë¤È
!¡¡¢é[a,b]f(x)dx=(b-a)/N*¦²[i=1,N]f(xi)

LET N=500000 !Íð¿ô¤ÎȯÀ¸¸Ä¿ô

LET a=0
LET b=1

LET ba=b-a
LET h=0
FOR i=1 TO N
   LET x=RND*ba+a !N¸Ä¤Î°ìÍÍÍð¿ô
   LET h=h+f(x) !¦²f
NEXT i
LET S=h*ba/N

PRINT S, LOG(2)



!¡ü¡Ö¤¢¤¿¤ê¤Ï¤º¤ì¡×¤Î¥â¥ó¥Æ¥«¥ë¥íË¡
!¡¡x=[a,b]¡¢y=[0,c]¡¢0<f(x)<c¤ÎÈϰϤÇ
!¡¡°ìÍÍÍð¿ô¤ÇÅÀ(x,y)¤òN¸ÄȯÀ¸¤µ¤»¤Æ¡¢y<f(x)¤Î¿ô¤òn¤È¤¹¤ë¤È
!¡¡¢é[a,b]f(x)dx=c*(b-a)*n/N

LET N=500000 !Íð¿ô¤ÎȯÀ¸¸Ä¿ô

LET a=0
LET b=1
LET c=1

LET ba=b-a
LET hit=0
FOR i=1 TO N
   LET x=RND*ba+a !N¸Ä¤Î°ìÍÍÍð¿ô
   LET y=RND*c
   IF y<f(x) THEN LET hit=hit+1 !f¤è¤ê²¼¤ÎÎΰè
NEXT i
LET S=c*ba * hit/N !ĹÊý·Á¤È¤ÎÌÌÀÑÈæ

PRINT S, LOG(2)


END
 

¡ã ¡õ ¤Îľ¸å¤Ë¤Ï¡¢È¾³Ñ¥¹¥Ú¡¼¥¹¤òɬ¤ºÃÖ¤¯¡£

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ10·î28Æü(²Ð)13»þ02ʬ40ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  £±¡Ë¡ã¤Îľ¸å¤Ë¤Ï¡¢È¾³Ñ¥¹¥Ú¡¼¥¹¤òÃÖ¤¯¡£( ÉÔÅù¹æ¡ã¡ä¤Ï¡¢¤½¤Î¤Þ¤Þ¤ÇÎɤ¤¤è¤¦¤Ç¤¹¡£)
£²¡Ë¡õ¤Îľ¸å¤Ë¤Ï¡¢È¾³Ñ¥¹¥Ú¡¼¥¹¤òÃÖ¤¯¡£

¤ÎÍͤˤ¹¤ë¤È¡¢
¥¿¥°¤È¡¢Ê¸»ú»²¾È¡¢¤Î¥·¡¼¥±¥ó¥¹¤¬»ß¤á¤é¤ì¤Þ¤¹¡£·Ç¼¨ÍѤΥꥹ¥È¤Ç¡Ö¼Â¹Ô¡×¤â·óÍÑ¡£

¥¹¥Ú¡¼¥¹ÁÞÆþ¸ú²Ì¤Î»î¸³¤Ç¤¹¡£

PRINT "¡õ £Ì£Ô¡¨"
PRINT "¡õ £ì£ô¡¨"
PRINT "123"¡õ £ì£ô$
PRINT "123"¡õ £ì£ô£õ£ö£÷$
IF a¡ã font AND b>c THEN LET font=1
IF a¡ã¡äb THEN LET font=2

¤Èµ­½Ò¤·¤¿¥×¥í¥°¥é¥à¤òÅê¹Æ¤·¤¿¤È¤¹¤ë¡£

PRINT "& LT;"
PRINT "& lt;"
PRINT "123"& lt$
PRINT "123"& ltuvw$
IF a< font AND b>c THEN LET font=1
IF a<>b THEN LET font=2

ʸ»ú»²¾È¡¡¤Î»î¸³¤ò¡¢¤â¤¦¾¯¤·Äɲá£(±¦Â¦¤Ï¡¢¥¹¥Ú¡¼¥¹Ìµ¤·¤ÎƱʸ)

print "& #34; & quot;"    ! print "" ""
print "& #38; & amp;"     ! print "& &"
print "& #60; & lt;"      ! print "< <"
print "& #62; & gt;"      ! print "> >"
print "& #160; & nbsp;"   ! print "   "
print "& #161; & iexcl;"  ! print "Ž¸AÁþŽ¸A¢
print "& #162; & cent;"   ! print "¡ñ ¡ñ"
print "& #163; & pound;"  ! print "¡ò ¡ò"
print "& #164; & curren;" ! print "Ž¸AïþŽ¸Að¢
print "& #165; & yen;"    ! print "\ \"
print "& #166; & brvbar;" ! print "üü üü"
print "& #167; & sect;"   ! print "¡ø ¡ø"
print "& #168; & uml;"    ! print "¡¯ ¡¯"
print "& #169; & copy;"   ! print "Ž¸AíþŽ¸Aí¢

--------------------------------------------------
&& ¤Î»î¸³¡£

LET copy$="&& ¤ò»ÈÍѤ·¤Æ£±¹Ô¤Ë"

PRINT "£±¹Ô¤Ë½ñ¤­ÀÚ¤ì¤Ê¤¯¤Æ¡¢²þ¹Ô¤·¤Æ¤·¤Þ¤Ã¤¿¤¬¡¢"&
&Ž¸Aí¤ & "¤Ä¤Ê¤¤¤Ç¡¢¤³¤Î¹Ô¤ò¡¢²þ¹Ô¤·¤Æ¤¤¤Ê¤¤£±¹Ô¤Îʸ»úÎó¤Ë¤·¤¿¡£"

PRINT "£±¹Ô¤Ë½ñ¤­ÀÚ¤ì¤Ê¤¯¤Æ¡¢²þ¹Ô¤·¤Æ¤·¤Þ¤Ã¤¿¤¬¡¢"&
&& copy$ & "¤Ä¤Ê¤¤¤Ç¡¢¤³¤Î¹Ô¤ò¡¢²þ¹Ô¤·¤Æ¤¤¤Ê¤¤£±¹Ô¤Îʸ»úÎó¤Ë¤·¤¿¡£"
  ¢¬
¤³¤Î¥¹¥Ú¡¼¥¹¤¬Ìµ¤¤¾ì¹ç(¾å)¤È¡¢Í­¤ë¾ì¹ç(²¼)¡£

--------------------------------------------------
¡ã¤Î»î¸³¡¡¤òÄɲá£(Ⱦ³Ñ¥¹¥Ú¡¼¥¹¸åÉÕ¤±¤Î½ÐÍè¤Ê¤¤¥±¡¼¥¹)

IF X ¡ã¡á 10 THEN PRINT USING "¡ã###" : 123
IF X ¡ã¡ä 10 THEN PRINT USING "¡ã%%%" : 123
IF X¡ã¡á10 THEN PRINT USING "¡ã###":123
IF X¡ã¡ä10 THEN PRINT USING "¡ã%%%":123
PRINT USING "#¡ã" : w10, w1
PRINT USING "#¡ã":w10, w1

¡¡¤È½ñ¤¤¤¿¤È¤¹¤ë¡£

IF X <= 10 THEN PRINT USING "<###" : 123
IF X <> 10 THEN PRINT USING "<%%%" : 123
IF X<=10 THEN PRINT USING "<###":123
IF X<>10 THEN PRINT USING "<%%%":123
PRINT USING "#<" : w10, w1
PRINT USING "#<":w10, w1
 

À¤³¦¤Î¥Ê¥Ù¥¢¥Ä¤ËBASIC¤ÇÄ©À¡¡¤ª¤â¤í¡Á

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ10·î29Æü(¿å)11»þ14ʬ24ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  °ÊÁ°¡¢¥×¥í¥°¥é¥ß¥ó¥°¤ÎÎý½¬¤Ë¡Ö£³¤ÎÇÜ¿ô¡×¤È¡Ö£³¤ÎÉÕ¤¯¿ô¡×¤ÎȽÄêÊýË¡¤ò¸¡Æ¤¤·¤Æ¤ß¤Þ¤·¤¿¡£
º£²ó¤Ï¡¢¿ô¤ò¿¹à¼°¤ä¥Ù¥¯¥È¥ë¤ä¹ÔÎó¤Çɽ¸½¤·¤Æ¡¢¤½¤Î±é»»¤ÇȽÄꤷ¤Æ¤ß¤Þ¤¹¡£


!¼«Á³¿ôn¤Î³Æ°Ì¤ÎÃͤ¬·¸¿ô¤È¤Ê¤ë¿¹à¼°p(x)=k1+k2*x+k3*x^2+ ¡Ä¤Çɽ¤¹¡£
!21¤Î¾ì¹ç
!¡¡p(x)=1+2*x+0*x^2+0*x^3+ ¡Ä
!¸µ¤În¤ËÌ᤹¤Ë¤Ï¡¢x=10¤È¤·¤Æ´Ø¿ôÃͤò·×»»¤¹¤ì¤Ð¤è¤¤¡£
!¡¡p(10)=1*1+2*10+0*100+0*1000+ ¡Ä =21

DEF p(x)=k1+k2*x+k3*x^2+k4*x^3 !¿¹à¼°

FOR k2=0 TO 9 !½½¤Î°Ì
   FOR k1=0 TO 9 !°ì¤Î°Ì

      IF MOD(p(1),3)=0 THEN !³Æ·å¤ÎϤ¬£³¤ÎÇÜ¿ô¤Ê¤é
         PRINT p(10) !x=k1+k2*10+k3*100+ ¡Ä
      ELSEIF k1=3 OR k2=3 THEN !¤¤¤º¤ì¤«¤¬£³¤È¤Ê¤ë
         PRINT p(10) !x=k1+k2*10+k3*100+ ¡Ä
      END IF

   NEXT k1
NEXT k2





!¼«Á³¿ôn¤Î³Æ°Ì¤ÎÃͤ¬À®Ê¬¤È¤Ê¤ë¥Ù¥¯¥È¥ë¤Çɽ¤¹¡£
!21¤Î¾ì¹ç
!¡¡(1 2)
!¸µ¤În¤ËÌ᤹¤Ë¤Ï¡¢10¤Î¤Ù¤­¾è¤òÀ®Ê¬¤È¤¹¤ë¥Ù¥¯¥È¥ë¤ÈÆâÀѤò¤È¤ì¤Ð¤è¤¤¡£
!¡¡(1 2)¡¦(1 10)=1*1+2*10=21

LET K=4 !·å¿ô

DIM CC(K) !Äê¿ô (1 1 1 ¡Ä)
MAT CC=CON
DIM BB(K) !Äê¿ô (1 10 100 ¡Ä)
FOR i=1 TO K
   LET BB(i)=10^(i-1) !°Ì
NEXT i
DIM V(K) !¥Ù¥¯¥È¥ë
FOR k2=0 TO 9 !½½¤Î°Ì
   LET V(2)=k2
   FOR k1=0 TO 9 !°ì¤Î°Ì
      LET V(1)=k1

      IF MOD(DOT(V,CC),3)=0 THEN !³Æ·å¤ÎϤ¬£³¤ÎÇÜ¿ô¤Ê¤é
         PRINT DOT(V,BB) !x=k1+k2*10+k3*100+ ¡Ä
      ELSEIF V(1)=3 OR V(2)=3 THEN !¤¤¤º¤ì¤«¤¬£³¤È¤Ê¤ë
         PRINT DOT(V,BB) !x=k1+k2*10+k3*100+ ¡Ä
      END IF

   NEXT k1
NEXT k2





!¼«Á³¿ôn¤Î³Æ°Ì¤ÎÃͤ¬Í×ÁǤȤʤëÂгѹÔÎó¤Çɽ¤¹¡£
!21¤Î¾ì¹ç
!¡¡¨£ 1 0 ¨¤
!¡¡¨¦ 0 2 ¨¥
!¸µ¤În¤ËÌ᤹¤Ë¤Ï¡¢10¤Î¤Ù¤­¾è¤òÍ×ÁǤȤ¹¤ë¹ÔÎó¤ò¤«¤±¤ì¤Ð¤è¤¤¡£
!¡¡¨£ 1 0 ¨¤¨£ £± ¨¤
!¡¡¨¦ 0 2 ¨¥¨¦ 10 ¨¥
!¡¡¡á¨£ £± ¨¤
!¡¡¡¡¨¦ 20 ¨¥
!¤µ¤é¤Ë¡¢¤¹¤Ù¤Æ¤ÎÍ×ÁǤ¬£±¤Î¹ÔÎó¤ò¤«¤±¤ì¤Ð¤è¤¤¡£
!¡¡[1 1]¨£ £± ¨¤¡á[21]
! ¡¡¡¡¡¡¨¦ 20 ¨¥

FUNCTION tr(A(,)) !¹ÔÎóA¤Î¥È¥ì¡¼¥¹
   LET t=0 !ÂгÑÀ®Ê¬¤ÎÏÂ
   FOR m=1 TO MIN(UBOUND(A,1),UBOUND(A,2))
      LET t=t+A(m,m)
   NEXT m
   LET tr=t
END FUNCTION


LET K=4 !·å¿ô

DIM B(K,1) !Äê¿ô t[1 10 100 ¡Ä]
FOR i=1 TO K
   LET B(i,1)=10^(i-1) !°Ì
NEXT i

DIM C(1,K) !Äê¿ô [1 1 1 ¡Ä]
MAT C=CON

DIM TT(K,1),X(1,1) !ºî¶ÈÍÑ

DIM A(K,K) !ÂгѹÔÎó
MAT A=ZER
FOR k2=0 TO 9 !½½¤Î°Ì
   LET A(2,2)=k2
   FOR k1=0 TO 9 !°ì¤Î°Ì
      LET A(1,1)=k1

      IF MOD(tr(A),3)=0 THEN !³Æ·å¤ÎϤ¬£³¤ÎÇÜ¿ô¤Ê¤é
         MAT TT=A*B !x=k1+k2*10+k3*100+ ¡Ä
         MAT X=C*TT
         MAT PRINT X; !PRINT X(1,1)
      ELSEIF A(1,1)=3 OR A(2,2)=3 THEN !¤¤¤º¤ì¤«¤¬£³¤È¤Ê¤ë
         MAT TT=A*B !x=k1+k2*10+k3*100+ ¡Ä
         MAT X=C*TT
         MAT PRINT X;
      END IF

   NEXT k1
NEXT k2


END
 

µì·Ç¼¨ÈĤÎÅê¹Æ¤ò¥­¥ã¥Ã¥·¥å¤«¤é¥µ¥ë¥Ù¡¼¥¸

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2008ǯ10·î30Æü(ÌÚ)08»þ04ʬ4ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ½½¿ÊBASIC¤Îµì·Ç¼¨ÈĤ¬10·î¾å½Ü¤«¤é±¿±Ä²ñ¼Òaround¤Î³èÆ°Ää»ß¤Ë¤è¤ê»ö¼Â¾åÊĺ¿¤µ¤ì¤Þ¤·¤¿¡£
¡Ö·Ç¼¨ÈIJáµî¥í¥°¡×¤ËÊݴɤµ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿101¡Á110¥Ú¡¼¥¸¤ÎÅê¹Æ¤ò¸¡º÷¥µ¥¤¥È¤Î¥­¥ã¥Ã¥·¥å¤«¤é½¦¤¤½Ð¤¹ÊýË¡¤ò¾Ò²ð¤·¤Þ¤¹¡£
¤¿¤À¤·¥­¥ã¥Ã¥·¥å¤Ç¤¹¤«¤é¡¢¤¹¤Ù¤Æ¤Î¥Ú¡¼¥¸¤¬Êݸ¤µ¤ì¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
ʬ³ä¤·¤ÆÅê¹Æ¤µ¤ì¤¿¥×¥í¥°¥é¥à¤Ê¤É¤Ï¡¢ÉôʬŪ¤Ë¤·¤«½¦¤¨¤Ê¤¤¤«¤â¤·¤ì¤Þ¤»¤ó¡£
¤Þ¤¿¡¢¥­¥ã¥Ã¥·¥å¤ÏÆü¡¹¹¹¿·¤µ¤ì¤Þ¤¹¤Î¤Ç¤¢¤È1,2¥ö·î¤â¤·¤¿¤é¤Û¤È¤ó¤É¤Î¥Ú¡¼¥¸¤¬ºï½ü¤µ¤ì¤ë¤È»×¤¤¤Þ¤¹¡£
¿ôÆüÁ°¤ÈÈæ³Ó¤·¤Æ¤â¥Ò¥Ã¥È¿ô¤¬¸º¤Ã¤Æ¤¤¤Þ¤¹¡£
ɬÍפÊÅê¹Æ¤ÏÁá¤á¤Ë¥Ñ¥½¥³¥ó¤ËÊݸ¤·¤Æ¤ª¤¯¤³¤È¤ò¤ª´«¤á¤·¤Þ¤¹¡£


1.¸¡º÷¥µ¥¤¥ÈGoogle¤Ç "½½¿ÊBASIC·Ç¼¨ÈÄ" ¤ò¸¡º÷¤·¤Þ¤¹¡£
  (;·×¤Ê¾ðÊó¤òÇÓ½ü¤¹¤ë¤¿¤á¥À¥Ö¥ë¥¯¥©¥Æ¡¼¥·¥ç¥ó(")¤Ç°Ï¤ß¤Þ¤·¤ç¤¦)

2.¸¡º÷·ë²Ì¤ÎºÇ¸å¤Ë¡¢
    ºÇ¤âŪ³Î¤Ê·ë²Ì¤òɽ¼¨¤¹¤ë¤¿¤á¤Ë¡¢¾å¤Î¡û¡û·ï¤È»÷¤¿¥Ú¡¼¥¸¤Ï½ü³°¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
    ¸¡º÷·ë²Ì¤ò¤¹¤Ù¤Æɽ¼¨¤¹¤ë¤Ë¤Ï¡¢¤³¤³¤«¤éºÆ¸¡º÷¤·¤Æ¤¯¤À¤µ¤¤¡£

  ¤È¤¢¤ë¤Î¤Ç¥¯¥ê¥Ã¥¯¤·¤Æ²¼¤µ¤¤¡£

3.¸¡º÷·ë²Ì¤Î¤¦¤Á¡¢URL¤¬ freebbs.around.ne.jp ¤Ç»Ï¤Þ¤ë¤â¤Î¤¬µì·Ç¼¨ÈĤÎÅê¹Æ¤Ç¤¹¡£
  /basic/ ¤Þ¤¿¤Ï &pg= ¤Î¸å¤í¤Ë¤¢¤ë¿ô»ú¤¬µì·Ç¼¨ÈĤΥڡ¼¥¸ÈÖ¹æ¤Ç¤¹¡£
  ¡ÊURL¤¬ www.geocities.jp ¤È¤¢¤ë¤Î¤Ï¡Ö·Ç¼¨ÈIJáµî¥í¥°¡×¤Ë¤¢¤ë¤Î¤Ç¤½¤Á¤é¤ò¤´Í÷¤¯¤À¤µ¤¤¡Ë

4.ÆâÍƤò¸«¤ë¤Ë¤Ïɬ¤º¥­¥ã¥Ã¥·¥å¤ò¥¯¥ê¥Ã¥¯¤·¤Æ²¼¤µ¤¤¡£
  ¡Ê¸«½Ð¤·¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤ÈÀܳ¥¨¥é¡¼¤Ë¤Ê¤ê¤Þ¤¹¡Ë

5.²¼¤Î¸ì¶ç¤«¤é¤â¸¡º÷¤Ç¤­¤Þ¤¹¡£Â¾¤Î¸¡º÷¥µ¥¤¥È¤«¤é¤â¸¡º÷¤·¤Æ¤ß¤Æ²¼¤µ¤¤¡£
    "freebbs.around.ne.jp/article/b/basic/"

    "freebbs.around.ne.jp/kyview","basic"
 

Re: µì·Ç¼¨ÈĤÎÅê¹Æ¤ò¥­¥ã¥Ã¥·¥å¤«¤é¥µ¥ë¥Ù¡¼¥¸

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ10·î31Æü(¶â)18»þ20ʬ1ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.34[¸µµ­»ö¤Ø]

Ìܼ¡¤À¤±¤Ç¡¢Ä¾ÀܤËÃæÌ£¤Ï¸«¤ì¤Þ¤»¤ó¤¬¡¢¸ÄÊ̸¡º÷¤Î¥­¡¼¥ï¡¼¥É¤Ë¡£

Page : 101~110 Á´¥Ú¡¼¥¸¡Ê¥Ä¥ê¡¼É½¼¨¡Ë¤Î¥­¥ã¥Ã¥·¥å¤¬¡¢¤¢¤ê¤Þ¤·¤¿¡£
Live Search ¤Ç¡¢²¼¤Î¥­¡¼¥ï¡¼¥É

"½é¿´¼Ô´¿·Þ¡ª ½½¿ÊBASIC·Ç¼¨ÈÄ" "Page : 110"
  (
   )
"½é¿´¼Ô´¿·Þ¡ª ½½¿ÊBASIC·Ç¼¨ÈÄ" "Page : 101"

¡Ê¤¹¤Ç¤Ë¾Ãµî¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢Êݸ¤·¤Æ¤¢¤ê¤Þ¤¹¤Î¤Ç¸æÍ×˾¤¬¤¢¤ì¤Ð¥³¥³¤Ë·Ç¼¨¤·¤Þ¤¹¡£¡Ë
 

Re: µì·Ç¼¨ÈĤÎÅê¹Æ¤ò¥­¥ã¥Ã¥·¥å¤«¤é¥µ¥ë¥Ù¡¼¥¸

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2008ǯ10·î31Æü(¶â)18»þ36ʬ7ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.35[¸µµ­»ö¤Ø]

¥á¡¼¥ëÅù¤Ç¥Ç¡¼¥¿¤ò¤¤¤¿¤À¤±¤ì¤Ð¡¤½½¿ÊBASIC²áµî¥í¥°¤ÎÊǤ˷Ǻܤ·¤Þ¤¹¡£
 

¥×¥í¥°¥é¥à¤Î¤ª´ê¤¤

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î 1Æü(ÅÚ)10»þ51ʬ27ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¥ª¥¤¥é¡¼Êý¿Ø¤¬£¶¼¡¤Ç¤Ï¹½À®ÉÔ²Äǽ¤Ç¤¢¤ë¤³¤È¤ò¡¢¤·¤é¤ß¤Ä¤Ö¤·¤Ë¤è¤ê
³Îǧ¤¹¤ë¤³¤È¤ò¤ä¤Ã¤Æ¤ß¤¿¤¤¤Î¤Ç¤¹¡£
¤É¤Ê¤¿¤«½½¿ÊBASIC¤Ë¤Æ¥×¥í¥°¥é¥à¤òÁȤó¤Ç¤¤¤¿¤À¤±¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡©
¥ª¥¤¥é¡¼Êý¿Ø¤È¤Ï5¼¡¤Ê¤é¡Ê£²¼¡¤È£¶¼¡°Ê³°¤Ï¹½À®²Äǽ¤È¾ÚÌÀ¤µ¤ì¤Æ¤¤¤ë¡£¡Ë
12 23 34 45 51
53 14 25 31 42
44 55 11 22 33
35 41 52 13 24
21 32 43 54 15
¤Î¤è¤¦¤Ë¡¢½½°Ì¤È°ì°Ì¤Ë¤¯¤ë¿ô¡Ê£±¡Á£µ¡Ë¤¬
³Æ¹Ô¡¢³ÆÎó¤Ë½ÅÊ£¤¹¤ë¤³¤È¤¬µ¯¤­¤Ê¤¤¡£
¡Ê¤¿¤À¤·£²£µ¸Ä¤Î¿ô»ú¤ÏÁ´¤Æ°Û¤Ê¤ë¤â¤Î¤È¤¹¤ë¡£¡Ë
¼«Ê¬¤Ç¤ä¤Ã¤Æ¤¤¤Æ¡¢¤Ê¤«¤Ê¤«¿ÊŸ¤·¤Ê¤¤¤â¤Î¤Ç¤¹¤Î¤Ç¤è¤í¤·¤¯¤ª´ê¤¤¤·¤Þ¤¹¡£
 

Re: ¥×¥í¥°¥é¥à¤Î¤ª´ê¤¤

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2008ǯ11·î 1Æü(ÅÚ)20»þ58ʬ48ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.37[¸µµ­»ö¤Ø]

1¡Á6¤Î¿ô»ú¤Çºî¤é¤ì¤ë2·å¤Î¿ô¤ÏÁ´Éô¤Ç36¸Ä¤¢¤ê¤Þ¤¹¡£
¤Ê¤Î¤Ç¡¤¤³¤ì¤é36¸Ä¤Î¿ô¤Î½çÎ󤹤٤ƤˤĤ¤¤Æ¾ò·ï¤òËþ¤¿¤¹¤«¤É¤¦¤«Ä´¤Ù¤ì¤Ð¤è¤¤¤Ï¤º¤Ç¤¹¡£
¤¿¤À¤·¡¤
36!¡á371993326789901217467999448150835200000000 ¢â3.7E41
¤Ê¤Î¤Ç¡¤1ÉäË1Ëü·ï¥Æ¥¹¥È¤·¤¿¤È¤·¤Æ¤â3.7E37Éââ1.12E30ǯ¤«¤«¤ê¤Þ¤¹¡£
 

Re: ¥×¥í¥°¥é¥à¤Î¤ª´ê¤¤

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î 1Æü(ÅÚ)22»þ13ʬ32ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.38[¸µµ­»ö¤Ø]

ÇòÀС¡ÏÂÉפµ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£
/* £¶¼¡¤Î¥ª¥¤¥é¡¼Êý¿Ø¤¬Â¸ºß¤·¤Ê¤¤¤³¤È¤ò³Îǧ¤¹¤ë. */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define N 6

char lb[9408][N][N];
/* N=1¡Á7: 1,1,1,4,56,9408,16942080 N=7¤ÏÈ󸽼ÂŪ */

int lbs;
char wb[N][N];
int p, q;
char xidx[N], yidx[N];

void check1(int n);

void makelb(int x, int y)
{
int i, j;

for(i = 0; i < N; ++i){
for(j = 0; j < x; ++j)
if((char)i == wb[y][j])
break;
if(j >= x){
for(j = 0; j < y; ++j)
if((char)i == wb[j][x])
break;
if(j >= y){
wb[y][x] = (char)i;
if(y == N - 1 && x == N - 1){
memcpy(lb[lbs++], wb, sizeof(wb));
return;
}
if(y == N - 1)
makelb(x + 1, 1);
else
makelb(x, y + 1);
}
}
}
}

void echk(void)
{
static char fb[N][N];
int i, j;

memset(fb, 0, sizeof(fb));
for(i = 0; i < N; ++i)
for(j = 0; j < N; ++j){
if(fb[lb[p][i][j]][lb[q][yidx[i]][xidx[j]]])
return;
fb[lb[p][i][j]][lb[q][yidx[i]][xidx[j]]] = 1;
}
for(i = 0; i < N; ++i)
for(j = 0; j < N; ++j)
printf("%c%c%c", lb[p][i][j] + '0', lb[q][yidx[i]][xidx[j]] + '0',
j == N - 1 ? '\n' : ' ');
exit(0);
}

void check2(int n)
{
int i;
char c;

for(i = n; i < N; ++i){
c = yidx[i];
yidx[i] = yidx[n];
yidx[n] = c;
if(yidx[n] != xidx[n] && (n != 1 || yidx[n] < xidx[n]))
if(n == N - 1)
echk();
else
check1(n + 1);
c = yidx[i];
yidx[i] = yidx[n];
yidx[n] = c;
}
}

void check1(int n)
{
int i;
char c;

for(i = n; i < N; ++i){
c = xidx[i];
xidx[i] = xidx[n];
xidx[n] = c;
check2(n);
c = xidx[i];
xidx[i] = xidx[n];
xidx[n] = c;
}
}

int main(void)
{
int i, count;

for(i = 0; i < N; ++i)
wb[0][i] = wb[i][0] = (char)i;
lbs = 0;
makelb(1, 1);

count = 0;
for(p = 0; p < lbs; ++p)
for(q = p; q < lbs; ++q){
if(++count % 1000 == 0)
printf("%d\r", count);
for(i = 0; i < N; ++i)
xidx[i] = yidx[i] = (char)i;
check1(1);
}
printf("²ò¤Ï¸«¤Ä¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿.\n");
return 0;
}
¤¬£ã¸À¸ì¤Ç¤Î¥×¥í¥°¥é¥à¤Ç¤Î²ò·èË¡¡Ê£µ»þ´Ö¤Û¤É¤ÇOK¡ª¡Ë¤Ç¤¹¡£
¤³¤ì¤òBASIC¤Ç½ñ¤­Ä¾¤»¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£¡Ê¼«Ê¬¤ÏC¸À¸ì¤ËÉÔÊÙ¶¯¤Ê¤Î¤Ç¡Ë
 

Re: ¥×¥í¥°¥é¥à¤Î¤ª´ê¤¤

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î 2Æü(Æü)08»þ22ʬ9ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.38[¸µµ­»ö¤Ø]

ÁíÅö¤ê¤Î²¦Æ»¤È¤·¤Æ¥Ð¥Ã¥¯¥È¥é¥Ã¥¯Ë¡¤¬¤¢¤ê¤Þ¤¹¡£
¤¿¤À¤·¡¢ÉÔŬ°Ê¹ß¤Ï̵»ë¡Ê»Þ´¢¤ê¡Ë¤¹¤ë¤Î¤Ç¸¡¾Ú¤¹¤ë¾ì¹ç¤Î¿ô¤¬¤¤¤¯¤é¤«¸º¤ê¤Þ¤¹¡£

¤¦¡Á¤ó¡¢¸½¼ÂŪ¤Ç¤Ï¤Ê¤¤¡ª
·ÇºÜ¤µ¤ì¤¿£Ã¸À¸ì¤Î¤è¤¦¤Ëɸ½à·Á¤Î¥é¥Æ¥óÊý¿Ø¤«¤é¤Î¥¢¥×¥í¡¼¥Á¤ò¸¡Æ¤¤·¤Æ¤Û¤·¤¤¡£


LET N=5 !Â礭¤µ N¡ßN

PUBLIC NUMERIC ANSWER_COUNT !²òÅú¿ô
LET ANSWER_COUNT=0

PUBLIC STRING num$
LET num$="0123456789ABCDEF" !N¿ÊË¡¤Î¿ô»ú

DIM M(0 TO N-1,0 TO N-1) !Ê¿Êý¤ÎÊý¿Ø
MAT M=(-1)*CON

SET WINDOW -1,N+1,N+1,-1
DRAW grid

LET t0=TIME
CALL BackTrack(N,M,0) !º¸¾å¤«¤é
PRINT "·×»»»þ´Ö=";TIME-t0

END


EXTERNAL SUB BackTrack(N,M(,),p) !¡Êº¸¾å¤«¤é¤ÎÏ¢ÈÖ¡Ë°ÌÃÖp¤òÄ´ºº¤¹¤ë
IF p<N*N THEN !¤¹¤Ù¤Æ¤¬Ëä¤Þ¤ë¤Þ¤Ç
   LET row=INT(p/N) !¹Ô¤ÈÎó¤Ë´¹»»¤¹¤ë
   LET col=MOD(p,N)

   FOR k=0 TO N*N-1 !£°¡ÁN*N-1ÈϰϤοô»ú¤ò
      CALL CheckRule(N,M, row,col,k, rc)!Ì·½â¤Ê¤¯ÃÖ¤±¤ì¤Ð
      IF rc=1 THEN
         SET TEXT COLOR 1
         PLOT TEXT ,AT col+0.5,row+0.5: STR$(k)

         LET M(row,col)=k !¤³¤³¤ËÃÖ¤¤¤Æ¤ß¤ë
         CALL BackTrack(N,M,p+1) !¼¡¤Ø
         LET M(row,col)=-1 !¼è¤ê¾Ã¤¹

         SET TEXT COLOR 0
         PLOT TEXT ,AT col+0.5,row+0.5: STR$(k)
      END IF
   NEXT k

ELSE !¤¹¤Ù¤ÆËä¤Þ¤Ã¤¿¤é
   LET ANSWER_COUNT=ANSWER_COUNT+1 !²òÅú¿ô
   PRINT ANSWER_COUNT

   FOR i=0 TO N-1
      FOR j=0 TO N-1
         LET t=M(i,j)
         LET k1=MOD(t,N)+2 !N¿ÊË¡¤Ç¤Î³Æ·å¤ÎÃÍ¡Êʸ»ú°ÌÃÖ¤ò²ÃÌ£¡Ë
         LET k2=INT(t/N)+2
         PRINT num$(k2:k2); num$(k1:k1); " "; !²ò¤òɽ¼¨¤¹¤ë
      NEXT j
      PRINT
   NEXT i
   PRINT

END IF
END SUB


EXTERNAL SUB CheckRule(N,M(,), row,col,K, rc) !Ʊ¤¸¿ô¤¬¤¢¤ë¤«¤É¤¦¤«³Îǧ¤¹¤ë
LET rc=0

FOR y=0 TO N-1 !Ëä¤Þ¤Ã¤Æ¤¤¤ëÈϰϤÇ̤»ÈÍѤοô»ú¤«
   FOR x=0 TO N-1
      IF y>=row AND x>=col THEN EXIT FOR
      IF M(y,x)=K THEN EXIT SUB !¸«¤Ä¤«¤Ã¤¿¤Î¤Ç¡¢£Î£Ç¡ª
   NEXT x
NEXT y

LET k1=MOD(K,N) !N¿ÊË¡¤Ç¤Î£±·åÌÜ
LET k2=INT(K/N) !N¿ÊË¡¤Ç¤Î£²·åÌÜ
FOR y=0 TO row-1 !Îó
   LET t=M(y,col)
   IF MOD(t,N)=k1 THEN EXIT SUB
   IF INT(t/N)=k2 THEN EXIT SUB
NEXT y

FOR x=0 TO col-1 !¹Ô
   LET t=M(row,x)
   IF MOD(t,N)=k1 THEN EXIT SUB
   IF INT(t/N)=k2 THEN EXIT SUB
NEXT x

LET rc=1 !¸«¤Ä¤«¤é¤Ê¤¤¤Î¤Ç¡¢£Ï£Ë¡ª
END SUB
 

Re: ¥×¥í¥°¥é¥à¤Î¤ª´ê¤¤

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î 2Æü(Æü)13»þ12ʬ5ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.40[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¤Þ¤µ¤Ë¤³¤ó¤Ê¤³¤È¤¬¤Ç¤­¤ë¥×¥í¥°¥é¥à¤ò¹½À®¤·¤¿¤«¤Ã¤¿¤Î¤Ç¤¹¡£
¼«Ê¬¤À¤±¤Ç¤¢¤¯¤»¤¯Ï©Æ¬¤Ë̤¦¤è¤ê¡¢Ã¯¤«¤Ë¿Ò¤Í¤ë¤ÈÀ¤¤ÎÃæ
ºÍǽ¤¢¤ë¿Í¤¬É¬¤º¤¤¤ë¤â¤Î¤Ç¡¢¤³¤Á¤é¤¬£±¥ö·î¤«¤«¤Ã¤Æ¤â¤Ç¤­¤Ê¤¤
¤³¤È¤Ç¤â¡¢£±»þ´Ö¤â¤¢¤ì¤Ð¸«Ä̤»¤ë¿Í¤¬¤¤¤ë¤Ê¤ó¤Æ´¶Æ°¤Ç¤¹¡£
¥×¥í¥°¥é¥à¤ò¥³¥Ô¡¼¤µ¤»¤Æ¤â¤é¤¤¡¢Ãæ¿È¤Î»ÅÁȤߤòʬÀϤ·¤Æ¤¤¤­¤Þ¤¹¡£
¤É¤¦¤â¼«Ê¬¤Ï¥³¥ó¥Ô¥å¡¼¥¿¡¼¤Ë»È¤ï¤ì¤Æ¤¤¤ë´¶³Ð¤Ç¤¹¤¬¡¢
»³Ã椵¤ó¤Î¤è¤¦¤Ê¿Í¤Ï¤Þ¤µ¤Ë¥³¥ó¥Ô¥å¡¼¥¿¡¼¤ò¤³¤­»È¤Ã¤Æ¤¤¤ëÊ·°Ïµ¤¤Ç¤¹¡£
»ä¤â¡¢¥³¥ó¥Ô¥å¡¼¥¿¡¼¤ò»×¤¤¤Î¤Þ¤ÞÆ°¤«¤¹¤³¤È¤¬½ÐÍè¤ë¥×¥í¥°¥é¥à¹½À®¤Î
ÎϤò¸þ¾å¤Ç¤­¤ë¤è¤¦Àº¿Ê¤·¤Æ¤¤¤­¤¿¤¤¤Ç¤¹¡£
»³Ã椵¤ó¤Ï¼ñÌ£¤Ç¤ä¤é¤ì¤Æ¤­¤¿¤Î¤Ç¤¹¤«¡©
¤½¤ì¤È¤â¤ª»Å»ö¤ÇɬÍפǥޥ¹¥¿¡¼¤µ¤ì¤Æ¤­¤¿¤Î¤Ç¤¹¤«¡©
¤Ç¤­¤¿¤é¥³¥ó¥Ô¥å¡¼¥¿¡¼Îò¤ò¤ªÊ¹¤«¤»¤¯¤À¤µ¤¤¡£
 

Re: ¥×¥í¥°¥é¥à¤Î¤ª´ê¤¤

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î 2Æü(Æü)20»þ25ʬ34ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.41[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

»Å»ö¤È¼ñÌ£¤Ç¥³¥ó¥Ô¥å¡¼¥¿¤Ï°·¤Ã¤Æ¤¤¤Þ¤¹¡£
¤³¤ÎBASIC¤Ï¹â¹»¿ô³Ø¡¢¹©¶È¤òÂêºà¤Ë¥×¥í¥°¥é¥ß¥ó¥°¤ò³Ú¤·¤ó¤Ç¤¤¤Þ¤¹¡£


¡ü·ÇºÜ¤Î£Ã¸À¸ì¥×¥í¥°¥é¥à¤ÎÀâÌÀ
¥é¥Æ¥óÊý¿Ø¤«¤é¤Î¥¢¥×¥í¡¼¥Á
ºî¶È¼ê½ç
Step1. ɸ½à·Á¥é¥Æ¥óÊý¿Ø¤òµá¤á¤ë¡£
¡¡Îã. £³¡ß£³¤Î¾ì¹ç
¡¡¡¡1 2 3
¡¡¡¡2 3 1
¡¡¡¡3 1 2
Step2. £²¤Ä¤Î¥é¥Æ¥óÊý¿Ø¤ÎÁȹ礻¤ë¡£
¡¡É¸½à·Á¥é¥Æ¥óÊý¿Ø¤«¤éÂоΡ¢²óž¤ò´Þ¤ó¤Ç¤¹¤Ù¤Æ¤Î¥é¥Æ¥óÊý¿Ø¤òµá¤á¤ë¡£
¡¡¥ª¥¤¥é¡¼Êý¿Ø¤¬À®Î©¤¹¤ë¤â¤Î¤òºÎÍѤ¹¤ë¡£
¡¡Îã. £³¡ß£³¤Î¾ì¹ç
¡¡¡¡1 2 3¡¡¡¡3 1 2¡¡¡¡13 21 32
¡¡¡¡2 3 1¡¡¡¡2 3 1¡¡¡¡22 33 11
¡¡¡¡3 1 2¡¡¡¡1 2 3¡¡¡¡31 12 23
¡¡¥ª¥¤¥é¡¼Êý¿Ø¤¬À®Î©¤¹¤ë¤Î¤Ç¡¢ºÎÍÑ¡£

¤¿¤È¤¨¤Ð¡¢£³¡ß£³¤Î¾ì¹ç¤Ïɸ½à·Á¤¬£±Ä̤ꡢ¤½¤ÎŸ³«¤¬£±£²Ä̤ꤢ¤ë¤«¤é
1£È2¡ß£±£²Ä̤ê¤ò¸¡¾Ú¤¹¤ëɬÍפ¬¤¢¤ë¡£

¡¡N=1¡¢1=1!¡ß0!¡ß1
¡¡N=2¡¢2=2!¡ß1!¡ß1
¡¡N=3¡¢12=3!¡ß2!¡ß1
¡¡N=4¡¢576=4!¡ß3!¡ß4
¡¡N=5¡¢161,280=5!¡ß4!¡ß56
¡¡N=6¡¢812,851,200=6!¡ß5!¡ß9,408
¡¡N=7¡¢6,147,941,990,400=7!¡ß6!¡ß16,942,080

¡¡¢¨É¸½à·Á¥é¥Æ¥óÊý¿Ø¡Ê£±¹ÔÌܤȣ±ÎóÌܤ¬À°Î󤷤Ƥ¤¤ë¤â¤Î¡Ë¤Ï
¡¡¡¡N=1,2,3,4,5,6,7,¡Ä¤Ê¤é¡¢1,1,1,4,56,9408,16942080,¡Ä¤È¤Ê¤ë¡£

Êý¿Ø¤¬Â礭¤¯¤Ê¤ì¤Ð¤½¤ì¤Ëȼ¤¤ÁýÂ礷¤ÆÍÆÎÌ¡¢·×»»Î̤¬Áý¤¨¤ë¡£


¥¤¥ó¥¿¥×¥ê¥¿·Ï¸À¸ìBASIC¤Ç½èÍý¤ò¹Í¤¨¤ë¤È¡¢
ÍÆÎ̤ÎÌäÂ꤫¤é·ÇºÜ¤µ¤ì¤¿£Ã¸À¸ì¤Î¼ê½ç¤Î¤è¤¦¤ËÁȹ礻¤´¤È¤Ëɸ½à·Á¥é¥Æ¥óÊý¿Ø¤òŸ³«¤·¤¿¤¤¡£
¤Ç¤â¡¢¸¡¾Ú¤¹¤ë¡Ö¾ì¹ç¤Î¿ô¡×¤¬Â¿¤¤¤¿¤á¡¢½èÍý»þ´Ö¤ÎÌäÂ꤫¤é¡¢¥é¥Æ¥óÊý¿Ø¤ò¤½¤Î¤Þ¤Þµ­Ï¿¤·¤¿¤¤¡£

¤³¤ì¤ÏǺ¤Þ¤·¤¤ÌäÂê¤Ç¤¢¤ë¡£



!¡Êɸ½à·Á¡Ë¥é¥Æ¥óÊý¿Ø¤òµá¤á¤ë

LET N=5 !Â礭¤µ N¡ßN

PUBLIC NUMERIC CntOfLM !¤½¤Î¿ô
LET CntOfLM=0

PUBLIC STRING num$
LET num$="0123456789ABCDEF" !N¿ÊË¡¤Î¿ô»ú

DIM M(0 TO N*N-1) !Ê¿Êý¤ÎÊý¿Ø
MAT M=(-1)*CON

FOR i=0 TO N-1 !ɸ½à·Á¤Î¾ì¹ç¡¡¢¨£±¹ÔÌܤȣ±ÎóÌܤ¬À°Î󤷤Ƥ¤¤ë
   LET M(i*N+0)=i
   LET M(0*N+i)=i
NEXT i

LET t0=TIME
CALL BackTrack(N,M,0) !º¸¾å¤«¤é
PRINT "·×»»»þ´Ö=";TIME-t0

END


EXTERNAL SUB BackTrack(N,M(),p) !¡Êº¸¾å¤«¤é¤ÎÏ¢ÈÖ¡Ë°ÌÃÖp¤òÄ´ºº¤¹¤ë
IF p<N*N THEN !¤¹¤Ù¤Æ¤¬Ëä¤Þ¤ë¤Þ¤Ç
   IF M(p)>=0 THEN !´û¤ËÃÖ¤¤¤Æ¤¢¤ì¤Ð
      CALL BackTrack(N,M,p+1) !¼¡¤Ø
   ELSE
      FOR k=0 TO N-1 !¿ô»ú£°¡ÁN-1¤ò
         CALL CheckRule(N,M, p,k, rc)!Ì·½â¤Ê¤¯ÃÖ¤±¤ì¤Ð
         IF rc=1 THEN
            LET M(p)=k !¤³¤³¤ËÃÖ¤¤¤Æ¤ß¤ë
            CALL BackTrack(N,M,p+1) !¼¡¤Ø
            LET M(p)=-1 !¼è¤ê¾Ã¤¹
         END IF
      NEXT k
   END IF

ELSE !¤¹¤Ù¤ÆËä¤Þ¤Ã¤¿¤é
   LET CntOfLM=CntOfLM+1 !²òÅú¿ô
   PRINT CntOfLM

   FOR i=0 TO N-1
      FOR j=0 TO N-1
         LET t=M(i*N+j)+1
         PRINT num$(t+1:t+1); " "; !²ò¤òɽ¼¨¤¹¤ë
      NEXT j
      PRINT
   NEXT i
   PRINT

END IF
END SUB


EXTERNAL SUB CheckRule(N,M(), p,K, rc) !Ʊ¤¸¿ô¤¬¤¢¤ë¤«¤É¤¦¤«³Îǧ¤¹¤ë
LET rc=0

LET row=INT(p/N) !¹Ô¤ÈÎó¤Ë´¹»»¤¹¤ë
LET col=MOD(p,N)

FOR i=0 TO row-1 !Îó
   IF M(i*N+col)=K THEN EXIT SUB
NEXT i

FOR i=0 TO col-1 !¹Ô
   IF M(row*N+i)=K THEN EXIT SUB
NEXT i

LET rc=1 !¸«¤Ä¤«¤é¤Ê¤¤¤Î¤Ç¡¢£Ï£Ë¡ª
END SUB
 

»³Ã椵¤ó¤Ø¤ªÎé¤È´¶ÁÛ

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î 2Æü(Æü)23»þ33ʬ46ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ºÆÅ٤ηǺܤ¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
Îã¤Î¿ô»ú¡§£±¡¤£±¡¤£±¡¤£´¡¤£µ£¶¡¤£¹£´£°£¸¡¦¡¦¡¦¤È¤Ï¤É¤¦¤ä¤Ã¤Æ·è¤Þ¤Ã¤Æ¤¤¤ë¤ó¤À¤í¤¦¡©
¤Ê¤Ë¤«¸ø¼°¤Ç¤â¤¢¤ë¤Î¤«¤·¤é¡¢¤Èµ¿Ìä¤Ë»×¤Ã¤Æ¤¤¤Þ¤·¤¿¤¬¤Ä¤Þ¤ê¤³¤ì¤Ï¼ÂºÝ¤Ë¹½À®
¤·¤¿¤È¤­¤Ë¡¢¤³¤Î¿ô¤·¤«ºî¤ì¤Ê¤¤¤È¤¤¤¦¤â¤Î¤Ê¤Î¤Ç¤¹¤Í¡£
¤³¤ì¤Ï·×»»¤«¤éµá¤Þ¤ëÃͤǤϤʤ¤¤Ç¤¹¤è¤Í¡£
¤³¤Î¥×¥í¥°¥é¥à¤Ç¤Ï¤Ã¤­¤ê¤È¤½¤Î¿ô¤Î°ÕÌ£¤¹¤ë¤â¤Î¤òÍý²ò¤Ç¤­¤Þ¤·¤¿¡£
¡¡N=1¡¢1=1!¡ß0!¡ß1
¡¡N=2¡¢2=2!¡ß1!¡ß1
¡¡N=3¡¢12=3!¡ß2!¡ß1
¡¡N=4¡¢576=4!¡ß3!¡ß4
¡¡N=5¡¢161,280=5!¡ß4!¡ß56
¡¡N=6¡¢812,851,200=6!¡ß5!¡ß9,408
¡¡N=7¡¢6,147,941,990,400=7!¡ß6!¡ß16,942,080
¤Î·×»»¤«¤éN=6¤Ç¤Ï£¸²¯°Ê¾å¤ÎÁȤ߹ç¤ï¤»¤òÄ´ºº¤»¤Í¤Ð¤Ê¤é¤Ê¤¤¤È¤¤¤¦¤³¤È¤Ë
¤Ê¤ë¤ï¤±¤Ç¤¹¤«¡©
Ëܤˤè¤ë¤È¡¢£¶¼¡¤Î¥ª¥¤¥é¡¼Êý¿Ø¤¬ÉÔ²Äǽ¤Ç¤¢¤ë¤³¤È¤òÍýÏÀ¤Ç¤Ï¤Ê¤¯¡¢¾ì¹çÎóµó¤Î
ÊýË¡¤Ç¾ÚÌÀ¤·¤¿¡Ê£±£¹£°£°Ç¯º¢G.TARRY¤È¤¤¤¦¿Íʪ¡Ë¤È½ñ¤«¤ì¤Æ¤¤¤Þ¤·¤¿¡£
Åö»þ¹â®¥³¥ó¥Ô¥å¡¼¥¿¡¼¤â¤Ê¤¤»þÂå¤Ë¤³¤ó¤Ê¤³¤È¤¬¤Ç¤­¤ë¤ó¤Ç¤·¤ç¤¦¤«¡©
¤â¤·¤³¤ó¤Ê¤Ë²ÄǽÀ­¤¬ÂçÎ̤ËȯÀ¸¤¹¤ëÌäÂê¤Ë·×»»µ¡Ìµ¤·¤Ë·èÃå¤ò¤Ä¤±¤¿¤È¤·¤¿¤é
¤½¤Îº¬À­¤Ï¤È¤ó¤Ç¤â¤Ê¤¤¤â¤Î¤À¤È¶Ãس¤·¤Þ¤¹¡£
Àè¿Í¤ÎÃηä伹ǰ¤ò³À´Ö¸«¤¿´¶³´¤Ç¤¹¡£
¤½¤ì¤Ë¤·¤Æ¤â¥ª¥¤¥é¡¼¤È¤¤¤¦¿Íʪ¤Ï¡¢¤µ¤é¤Ë²øʪ¤Ë¸«¤¨¤Þ¤¹¡£
 

Re: »³Ã椵¤ó¤Ø¤ªÎé¤È´¶ÁÛ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î 4Æü(²Ð)13»þ38ʬ41ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.43[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

C¸À¸ìÈǤò°Ü¿¢¤·¤Æ¤ß¤Þ¤·¤¿¡£¤¿¤À¤·¡¢Ä¾Ìõ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
Á´²òµá¤á¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢C¸À¸ìÈǤΤ褦¤ËºÇ½é¤Î²ò¤Î¤ß¤Ï¡¢
¥×¥í¥°¥é¥à¤ÎºÇ¸å¤ÎSTOPʸ¤òÍ­¸ú¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£

N=5¤¬¤¹¤Ç¤Ë¸·¤·¤¤¤è¤¦¤Ç¤¹¡£100ÇÜ!?¤°¤é¤¤¤Î®¤µ¤Îº¹¤ò´¶¤¸¤Þ¤¹¡£
Á°²ó¾Ò²ð¤·¤¿¥Ð¥Ã¥¯¥È¥é¥Ã¥¯Ë¡¤è¤ê¤ÏÎɹ¥¤Ç¤¹¡£


!¥ª¥¤¥é¡¼Êý¿Ø¤òµá¤á¤ë

LET N=5 !Â礭¤µ N¡ßN

!¢¨N=1,2,3,4,5,6,7,¡Ä¤Ê¤é¡¢1,1,1,4,56,9408,16942080,¡Ä¤È¤Ê¤ë¡£
PUBLIC NUMERIC LM(9408,0 TO 35) !ɸ½à·Á¥é¥Æ¥óÊý¿Ø N=6

PUBLIC NUMERIC CntOfLM !¤½¤Î¿ô
LET CntOfLM=0

DIM M(0 TO N*N-1) !Ê¿Êý¤ÎÊý¿Ø
MAT M=(-1)*CON
FOR i=0 TO N-1 !ɸ½à·Á¡¡¢¨£±¹ÔÌܤȣ±ÎóÌܤ¬À°Î󤷤Ƥ¤¤ë
   LET M(i*N+0)=i
   LET M(0*N+i)=i
NEXT i

LET t0=TIME
CALL BackTrack(N,M,0) !º¸¾å¤«¤é
PRINT CntOfLM
PRINT "·×»»»þ´Ö=";TIME-t0



LET t0=TIME

PUBLIC NUMERIC ANSWER_COUNT !²òÅú¿ô
LET ANSWER_COUNT=0

LET cnt=0 !¸¡¾Ú²ó¿ô
LET cc=comb(CntOfLM+2-1,2)

DIM A(0 TO N-1,0 TO N-1),B(0 TO N-1,0 TO N-1)
FOR i=1 TO CntOfLM !ɸ½à·ÁA¤Èɸ½à·ÁB¤ÎŸ³«¤È¤Î½ÅÊ£Áȹ礻 56H2
   FOR y=0 TO N-1 !A¤ò»ØÄꤹ¤ë
      FOR x=0 TO N-1
         LET A(y,x)=LM(i,y*N+x)
      NEXT x
   NEXT y

   FOR j=i TO CntOfLM

      LET cnt=cnt+1 !¿ÊĽ
      PRINT cnt;"/";cc

      FOR y=0 TO N-1 !B¤ò»ØÄꤹ¤ë
         FOR x=0 TO N-1
            LET B(y,x)=LM(j,y*N+x)
         NEXT x
      NEXT y

      DIM R(N) !½çÎó¤Î½é´üÃÍ
      FOR k=1 TO N
         LET R(k)=k
      NEXT k
      CALL RPerm(N,A,B, R,2) !¤Þ¤º¹Ô½ç¤ò»ØÄꤹ¤ë¡¡¢¨£±¹ÔÌܤϸÇÄê
   NEXT j
NEXT i
IF ANSWER_COUNT=0 THEN PRINT "²ò¤Ê¤·"

PRINT "·×»»»þ´Ö=";TIME-t0


END


EXTERNAL SUB BackTrack(N,M(),p) !¡Êº¸¾å¤«¤é¤ÎÏ¢ÈÖ¡Ë°ÌÃÖp¤òÄ´ºº¤¹¤ë
IF p<N*N THEN !¤¹¤Ù¤Æ¤¬Ëä¤Þ¤ë¤Þ¤Ç
   IF M(p)>=0 THEN !´û¤ËÃÖ¤¤¤Æ¤¢¤ì¤Ð
      CALL BackTrack(N,M,p+1) !¼¡¤Ø
   ELSE
      FOR k=0 TO N-1 !¿ô»ú£°¡ÁN-1¤ò
         CALL CheckRule(N,M, p,k, rc)!Ì·½â¤Ê¤¯ÃÖ¤±¤ì¤Ð
         IF rc=1 THEN
            LET M(p)=k !¤³¤³¤ËÃÖ¤¤¤Æ¤ß¤ë
            CALL BackTrack(N,M,p+1) !¼¡¤Ø
            LET M(p)=-1 !¼è¤ê¾Ã¤¹
         END IF
      NEXT k
   END IF

ELSE !¤¹¤Ù¤ÆËä¤Þ¤Ã¤¿¤é
   LET CntOfLM=CntOfLM+1 !¿ô¤ÈÇÛÃÖ¤òµ­Ï¿¤¹¤ë
   FOR i=0 TO N*N-1
      LET LM(CntOfLM,i)=M(i)
   NEXT i

END IF
END SUB


EXTERNAL SUB CheckRule(N,M(), p,K, rc) !Ʊ¤¸¿ô¤¬¤¢¤ë¤«¤É¤¦¤«³Îǧ¤¹¤ë
LET rc=0

LET row=INT(p/N) !¹Ô¤ÈÎó¤Ë´¹»»¤¹¤ë
LET col=MOD(p,N)

FOR i=0 TO row-1 !Îó
   IF M(i*N+col)=K THEN EXIT SUB
NEXT i

FOR i=0 TO col-1 !¹Ô
   IF M(row*N+i)=K THEN EXIT SUB
NEXT i

LET rc=1 !¸«¤Ä¤«¤é¤Ê¤¤¤Î¤Ç¡¢£Ï£Ë¡ª
END SUB


EXTERNAL SUB RPerm(N,A(,),B(,), P(),i) !½çÎó¤òÀ¸À®¤·¤Æ¹Ô¤ÎʤÓÂؤ¨¡¡¢¨¼­½ñ¼°½ç¤Ç¤Ï¤Ê¤¤
IF I<N THEN
   FOR j=i TO N
      LET t=P(i) !iÈÖÌܤÈjÈÖÌܤò¸ò´¹¤¹¤ë
      LET P(i)=P(j)
      LET P(j)=t
      CALL RPerm(N,A,B, P,i+1) !ºÆµ¢¸Æ½Ð¤·
      LET t=P(i) !¸µ¤ËÌ᤹
      LET P(i)=P(j)
      LET P(j)=t
   NEXT j

ELSE !´°Î»¤Ê¤é
   DIM C(N) !½çÎó¤Î½é´üÃÍ
   FOR j=1 TO N
      LET C(j)=j
   NEXT j
   CALL CPerm(N,A,B,P,C,1) !º£ÅÙ¤ÏÎó½ç¤ò»ØÄꤹ¤ë

END IF
END SUB


EXTERNAL SUB CPerm(N,A(,),B(,),R(), P(),i) !½çÎó¤òÀ¸À®¤·¤ÆÎó¤ÎʤÓÂؤ¨¡¡¢¨¼­½ñ¼°½ç¤Ç¤Ï¤Ê¤¤
IF I<N THEN
   FOR j=i TO N
      LET t=P(i) !iÈÖÌܤÈjÈÖÌܤò¸ò´¹¤¹¤ë
      LET P(i)=P(j)
      LET P(j)=t
      CALL CPerm(N,A,B,R, P,i+1) !ºÆµ¢¸Æ½Ð¤·
      LET t=P(i) !¸µ¤ËÌ᤹
      LET P(i)=P(j)
      LET P(j)=t
   NEXT j

ELSE !¥ª¥¤¥é¡¼Êý¿Ø¤ò¤Ä¤¯¤Ã¤Æ¸¡¾Ú¤¹¤ë

   DIM EM(N,N) !»ÈÍѤǤ­¤ë¿ô»ú¤ÎÁȤȻÈÍѾõ¶·
   MAT EM=ZER

   !¢¨¥é¥Æ¥óÊý¿Ø¤ÎÁȹ礻¤Ê¤Î¤Ç¡¢¹Ô¤ÈÎó¤Î½ÅÊ£¤Ï¤Ê¤¤¡£
   FOR i=0 TO N-1 !Êý¿ØÁ´ÂΤÇƱ¤¸¿ô¤¬¤¢¤ë¤«¤É¤¦¤«³Îǧ¤¹¤ë
      FOR j=0 TO N-1
         LET rr=A(i,j)+1 !¥ª¥¤¥é¡¼Êý¿Ø¤ò¤Ä¤¯¤ë
         LET cc=B(R(i+1)-1,P(j+1)-1)+1
         IF EM(rr,cc)=1 THEN EXIT SUB !¤½¤Î¿ô»ú¤Ï»ÈÍÑÃæ¤Ê¤Î¤Ç£Î£Ç¡ª
         LET EM(rr,cc)=1
      NEXT j
   NEXT i


   LET ANSWER_COUNT=ANSWER_COUNT+1 !²òÅú¿ô
   PRINT ANSWER_COUNT

   FOR i=0 TO N-1 !Åú¤¨¤òɽ¼¨¤¹¤ë
      FOR j=0 TO N-1
         PRINT (A(i,j)+1)*10 + B(R(i+1)-1,P(j+1)-1)+1 ;
      NEXT j
      PRINT
   NEXT i

   !!!STOP !ºÇ½é¤Ë¸«¤Ä¤±¤¿Åú¤¨

END IF
END SUB
 

Re: ¥×¥í¥°¥é¥à¤Î¤ª´ê¤¤

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ11·î 4Æü(²Ð)14»þ32ʬ41ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.39[¸µµ­»ö¤Ø]

!·Ç¼¨¤Î£Ã¸À¸ì¤Î¥ê¥¹¥È¤ò¡¢½½¿ÊBASICÈǤ˽ñ¤­Ä¾¤·¤¿¤â¤Î¤Ç¡¢²¿¤âÊѤï¤Ã¤Æ¤¤¤Þ¤»¤ó¡£
!Á´¤¯Æ±¤¸¤â¤Î¤À¤È¡¢»×¤¤¤Þ¤¹¡£°ã¤Ã¤Æ¤¤¤¿¤é¸æÌȤʤµ¤¤¡£

!check1¡¢check2 ¤Î¸òÈÖ¤¹¤ëºÆµ¢¥³¡¼¥ë¤Ï¡¢¸«¤º¤é¤¤¤Î¤Ç¡¢
!check1 £±ËܤÎÃæ¤ËÅý¹ç¤·¤¿¤¬¡¢ÆâÍƤÏƱ¤¸¤Ç¤¹¡£

OPTION BASE 0
LET N= 3 !¡¡2,3,4,5,6
DIM lb(9408,N,N) !¡¡N=1¡Á7: 1,1,1,4,56,9408,16942080 N=7¤ÏÈ󸽼ÂŪ
DIM wb(N,N), xidx(N), yidx(N), fb(N,N)
!
CALL main

SUB makelb(x, y)
   local i,j
   FOR i=0 TO N-1
      FOR j=0 TO x-1
         IF i=wb(y,j) THEN EXIT FOR ! break;
      NEXT j
      IF j>x-1 THEN
         FOR j=0 TO y-1
            IF i=wb(j,x) THEN EXIT FOR ! break;
         NEXT j
         IF j>y-1 THEN
            LET wb(y,x)= i
            IF y=N-1 AND x=N-1 THEN
            !----memcpy(lb[lbs++], wb, sizeof(wb));
               FOR a=0 TO N
                  FOR b=0 TO N
                     LET lb(lbs,a,b)=wb(a,b)
                  NEXT b
               NEXT a
               LET lbs=lbs+1
               !---------------
               EXIT SUB ! return;
            END IF
            IF y=N-1 THEN CALL makelb(x+1, 1) ELSE CALL makelb((x),y+1)
         END IF
      END IF
   NEXT i
END SUB


SUB echk
   local i,j
   MAT fb=ZER ! memset(fb, 0, sizeof(fb));
   FOR i= 0 TO N-1
      FOR j= 0 TO N-1
         IF fb( lb(p,i,j), lb(q,yidx(i),xidx(j)) )>0 THEN EXIT SUB ! return;
         LET fb( lb(p,i,j), lb(q,yidx(i),xidx(j)) )=1
      NEXT j
   NEXT i
   FOR i= 0 TO N-1
      FOR j= 0 TO N-1
         PRINT USING "%#": lb(p,i,j)+1, lb(q,yidx(i),xidx(j))+1;
         IF j=N-1 THEN PRINT ELSE PRINT " ";
      NEXT j
   NEXT i
   STOP ! exit(0);
END SUB


SUB check1(n_)
   local i
   FOR i=n_ TO N-1
      swap xidx(i),xidx(n_)
      !-----check2(n_)
      local i_
      FOR i_= n_ TO N-1
         swap yidx(i_),yidx(n_)
         IF ( yidx(n_)<>xidx(n_)) AND (n_<>1 OR yidx(n_)< xidx(n_) ) THEN
            IF n_=N-1 THEN CALL echk ELSE CALL check1(n_+1)
         END IF
         swap yidx(i_),yidx(n_)
      NEXT i_
      !------
      swap xidx(i),xidx(n_)
   NEXT i
END SUB


SUB main
   FOR i= 0 TO N-1
      LET wb(i,0)= i
      LET wb(0,i)= i
   NEXT i
   LET lbs = 0
   PRINT "N=";N; ! Äɲä·¤¿É½¼¨
   CALL makelb(1,1)
   PRINT "lbs=";lbs !ÄɲÃ
   MAT PRINT wb !¡¡¡¡ÄɲÃ
   LET count= 0
   FOR p=0 TO lbs-1
      FOR q=p TO lbs-1
         LET count=count+1
         IF MOD(count,1000)=0 THEN PRINT count
         FOR i= 0 TO N-1
            LET yidx(i)= i
            LET xidx(i)= i
         NEXT i
         CALL check1(1)
      NEXT q
   NEXT p
   PRINT "²ò¤Ï¸«¤Ä¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿."
END SUB

END

!Ãí°Õ¡§¤³¤Î¥ê¥¹¥È¤Ï¡¢for~next¤ÎÃ椫¤éºÆµ¢¥³¡¼¥ë¤ò¤·¤Æ¤¤¤ë¤Î¤Ç¡¢½½¿ÊBASIC¤Î
!¡¡¡¡¡¡Ver7.2.0 °Ê¹ß ¤Î¥Ð¡¼¥¸¥ç¥ó¤¬É¬ÍפǤ¹¡£
 

Re: ¥×¥í¥°¥é¥à¤Î¤ª´ê¤¤

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î 4Æü(²Ð)16»þ27ʬ16ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.45[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

SECOND¤µ¤ó¡¢¤ªµ×¤·¤Ö¤ê¤Ç¤¹¡£

£Ã¸À¸ìÈǤΥ³¡¼¥É¤ò¤ß¤Æ»×¤Ã¤¿¤Î¤Ç¤¹¤¬

¡¦N=1¤¬µá¤Þ¤é¤Ê¤¤
¡¦½çÎó¤ÎÀ¸À®¤¬¤ª¤«¤·¤¤¡Ê¹Ô¤äÎó¤Î¸ò´¹¤¬ÉÔ½½Ê¬¡Ë
¡¡¢ªÉ¸½à·Á¤«¤é¤¹¤Ù¤ÆŸ³«¤µ¤ì¤Æ¤¤¤Ê¤¤
¡¡¢ªexit¤Î²Õ½ê¤ò¥³¥á¥ó¥È¡Ê̵¸ú¡Ë¤Ë¤·¤Æ¤âÁ´²ò¤¬ÆÀ¤é¤ì¤Ê¤¤
¡¡¢ªN=6¤Ç¸¡¾Ú¤·¤Æ¤¤¤Ê¤¤²Õ½ê¤¬¤¢¤ë
¤Îµ¿Ì䤬¤¢¤ê¤Þ¤¹¡£

GAI¤µ¤ó¤ò·Ðͳ¤·¤Æ£Ã¸À¸ìÈǤκî¼Ô¤Ëʹ¤¯¤Î¤¬¶Ú¤È»×¤¤¤Þ¤¹¤¬¡¢
SECOND¤µ¤ó¤Ï¡¢¤É¤Î¤è¤¦¤Ë´¶¤¸¤Æ¤¤¤Þ¤¹¤«¡©
 

Re: ¥×¥í¥°¥é¥à¤Î¤ª´ê¤¤

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ11·î 4Æü(²Ð)17»þ00ʬ31ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.46[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

Á´¤¯Æ±´¶¤Ç¤¹¡£¤½¤ÎÍͤˤ·¤Æ失¤ì¤Ð¤È¡¢»×¤¤¤Þ¤¹¡£
 

¥«¡¼¥É¥Þ¥¸¥Ã¥¯¤Ç½Ð²ñ¤Ã¤¿¸½¾Ý

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î 4Æü(²Ð)22»þ52ʬ56ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¤ªÆó¿Í¤Î¶¯ÎÏ¤Ê¥×¥í¥°¥é¥Þ¡¼¤Î½Ð¸½¤Ë¤è¤ê¡¢C¸À¸ì¤ÈBASIC¸À¸ì¤È¤ÎÈæ³Ó¤ò¤·¤Ê¤¬¤é¤È¤Ã¤Æ¤â¤¤¤¤ÊÙ¶¯¤¬¤Ç¤­¤Æ¤¤¤Þ¤¹¡£
C¤Î¥¹¥Ô¡¼¥É¤ÏÌ¥ÎÏŪ¤Ç¤¹¤¬¡¢¤É¤¦¤âÌó«»ö¤¬Â¿¤¯¤ÆÆëÀ÷¤ßÆñ¤¤¤Î¤Ç¤¹¡£
¤½¤ÎÅÀBASIC¤Îµ­½Ò¤Ç¤Ï²¿¤ò¤·¤¿¤¤¤Î¤«¤¬C¤Ë³Ó¤Ù¤ë¤ÈÆɤ߼è¤ê°×¤¤µ¤¤¬¤·¤Þ¤¹¡£
C¸À¸ì¤Ç¥×¥í¥°¥é¥à¤ò½ñ¤¤¤Æ¤¤¤¿¤À¤¤¤¿Êý¤Ë¤Ï¸å¤Û¤É¼ÁÌä¤ò¤·¤Æ¤ª¤­¤Þ¤¹¡£
ÏäÏÊѤï¤ê¤Þ¤¹¤¬¡¦¡¦¡¦
¤³¤Î¾ì¤ò¼Ú¤ê¤ÆÆüº¢µ¿Ìä¤Ë´¶¤¸¤Æ¤¤¤ë¤³¤È¤ò²òÀϤ·¤Æ¤Û¤·¤¤¤ó¤Ç¤¹¤¬¼Â¤Ï¼«Ê¬¤Ï¥«¡¼¥É¥Þ¥¸¥Ã¥¯¤¬Âç¹¥¤­¤Ç¤½¤ì¤Ë´ØÏ¢¤·¤¿ËܤòÆɤó¤Ç¤¤¤Æ½Ð²ñ¤Ã¤¿µ­½Ò¤Ç¤·¤Æ¡¢¼¡¤Î¤è¤¦¤Ê»ö¤¬µ¯¤­¤Þ¤¹¡£
¤¼¤Ò¡¢¥È¥é¥ó¥×¤Ç³Îǧ¤ò¡ª
¥Ï¡¼¥È¤È¥¹¥Ú¡¼¥É¤ò½ç¤ËA¡¢£²¡¢£³¡¦¡¦¡¦Q¤È½Å¤Í¤ë¡£
¥Ï¡¼¥È¥Ñ¥±¥Ã¥È¤Ï¥Æ¡¼¥Ö¥ë¤Ë΢¸þ¤­¡ÊA¤¬¾å¡Ë¤ÇÃÖ¤¯¡£
´ÑµÒ¤Ë1¡Á£±£²¤Þ¤Ç¤Î¹¥¤­¤Ê¿ô»ú¤ò·è¤á¼ê¤â¤é¤¦¡£
¥¹¥Ú¡¼¥É¥Ñ¥±¥Ã¥È¤ò¼ê¤Ë΢¸þ¤­¡ÊA¤¬¾å¡Ë¤Ë»ý¤Á¡¢¾å¤«¤éɽ¸þ¤­¤Ë¤·¤Ê¤¬¤é¥Æ¡¼¥Ö¥ë¤Øº¸¡¢±¦¡¢º¸¡¢¡¦¡¦¡¦¤È£²¤Ä¤Î»³¤òºî¤ê¤Ê¤¬¤é¥«¡¼¥É¤ò½Å¤Í¤Æ¤¤¤¯¡£
µÒ¤¬·è¤á¤¿¿ô»ú¤ÎËç¿ôÌܤλþ¡¢¤³¤Î¥«¡¼¥É¤Ï¥Æ¡¼¥Ö¥ë¤ÎÊ̤ξì½ê¤Ë¼Î¤Æ¤é¤ì¤¿»¥¤È¤·¤Æ¡¢É½¸þ¤­¤Î¤Þ¤Þ½ü¤¯¡£¤½¤ÎÂå¤ï¤ê¤È¤·¤Æ¡¢¥Ï¡¼¥È¥Ñ¥±¥Ã¥È¤Î°ìÈÖ¾å¤Î¥«¡¼¥É¤ò¤³¤Î¥«¡¼¥É¤ÎÃÖ¤¯¤Ù¤­¤À¤Ã¤¿»³¤Øɽ¸þ¤­¤Ë¤Î¤»¤ë¡£¸å³¤±¤Æ¤¤¤­¼ê»ý¤Á¤Î¥«¡¼¥É¤¬Ìµ¤¯¤Ê¤ë¤Þ¤Ç¿Ê¤à¡£
º¸¤Î»³¤ò»ý¤Á¾å¤²¡¢±¦¤Î»³¤Ø½Å¤Í¡¢°ì¤Ä¤Ë¤Ê¤Ã¤¿¥Ñ¥±¥Ã¥È¤ò¼ê¤Ë¤È¤ê¡¢Î¢¸þ¤­¤Ç»ý¤Ä¡£
Ʊ¤¸¤³¤È¤ò¤¯¤êÊÖ¤·¡¢ºÇ½ªÅª¤Ë¼ê¤Ë¤Ï¥Ï¡¼¥È¡¢¼Î¤Æ¾ì¤Ë¤Ï¥¹¥Ú¡¼¥É¤¬½¸¤Þ¤ë¡£
¤³¤ÎÆó¤Ä¤Î»³¤ò¥Æ¡¼¥Ö¥ë¤Ëʤ٤ÆÃÖ¤¯¡£
´ÑµÒ¤Ë¥Ï¡¼¥È¤Þ¤¿¤Ï¥¹¥Ú¡¼¥É¤«¤é¹¥¤­¤Ê¥«¡¼¥É¡ÊA¡ÁQ¤Þ¤Ç¤ÎÃ椫¤é¡Ë¤Î̾Á°¤ò¸À¤Ã¤Æ¤â¤é¤¦¡£¡ÊÎã¥Ï¡¼¥È¤Î£¸¤ò´ÑµÒ¤¬Áª¤ó¤À¤È¤·¤ÆÀâÌÀ¤·¤Þ¤¹¡£¡Ë
µÒ¤¬¥Ï¡¼¥È¤òÁªÂò¤·¤¿¤Î¤Ê¤é¡¢¤Þ¤º¥¹¥Ú¡¼¥É¤Î»³¤«¤é¡¢¾å¤è¤ê£¸ËçÌܤΥ«¡¼¥É¤ò°ú¤­½Ð¤¹¡£
¡Ê¤â¤·µÒ¤¬¥¹¥Ú¡¼¥É¤ÎÁªÂò¤ò¤·¤¿¤Î¤Ê¤é¥Ï¡¼¥È¤Î»³¤«¤é¥«¡¼¥É¤ò°ú¤­½Ð¤¹¤³¤È¤Ë¤Ê¤ë¡£¡Ë
°ú¤­½Ð¤·¤¿¥«¡¼¥É¤Î¿ô»ú¤Ë½¾¤¤¡¢º£Å٤ϥϡ¼¥È¥Ñ¥±¥Ã¥È¤Î¾å¤«¤é¤½¤Î¿ô»ú¤ÎËç¿ôÌܤΥ«¡¼¥É¤òɽ¸þ¤­¤Ë¤¹¤ë¡£
¤³¤³¤«¤éµÒ¤¬»ØÄꤷ¤Æ¤ª¤¤¤¿¥Ï¡¼¥È¤Î£¸¤¬½Ð¸½¤¹¤ë¡£
¡ã¤ï¤«¤êÆñ¤¤¤Ç¤·¤ç¤¦¤«¡©¡ä
¤³¤ÎµÒ¤ËǤ°Õ¤ÇÁªÂò¤µ¤»¤Æ¤¤¤ë»ö¡Ê£±¡Á£±£²¤òÁª¤Ð¤»¤¿¤ê¡¢¹¥¤­¤Ê¥«¡¼¥É¤ò»ØÄꤵ¤»¤¿¤ê¡Ë¤ò¤ä¤Ã¤Æ¤ª¤­¤Ê¤¬¤é¡¢Åª³Î¤ËµÒ¤Î¥«¡¼¥É¤òÅö¤Æ¤Æ¤·¤Þ¤¦»ÅÁȤߤϤȤäƤâ¿ô³ØŪ¤Ë¹ª¤¯·×»»¤µ¤ì¤Æ¤¤¤ë¤È»×¤ï¤ì¤Þ¤¹¡£
£±£²¤È¤¤¤¦¿ô»ú¤¬²¿¤«¥­¡¼¤Ë¤Ê¤ëÀ­¼Á¤òÍ­¤·¤Æ¤¤¤ë¤«¤é¤À¤í¤¦¤Èͽ´¶¤µ¤ì¤Þ¤¹¡£
¤³¤Î¤³¤È¤ò¥×¥í¥°¥é¥à¤Ç²òÌÀ¤·¤ÆÍߤ·¤¤¤ó¤Ç¤¹¤¬¡¦¡¦¡¦
 

Re: ¥«¡¼¥É¥Þ¥¸¥Ã¥¯¤Ç½Ð²ñ¤Ã¤¿¸½¾Ý

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î 5Æü(¿å)16»þ23ʬ20ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.48[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¤¿¤Ö¤ó¤³¤ì¤ÇÂç¾æÉפǤ·¤ç¤¦¡£
¾ê;¡Êmod¡Ë¤¬´Ø·¸¤·¤Æ¤¤¤ë¤Î¤Ç¤·¤ç¤¦¤«¡©¡Ê°ì¼ï¤Î¥·¥ã¥Ã¥Õ¥ë¤Ç¤¹¤«¤é¡Ë


LET mk$="SCHD" !¥Þ¡¼¥¯

SUB dec(C(),p, w) !¥Ñ¥±¥Ã¥ÈÆâ¾å¤«¤ép°ÌÃ֤Υ«¡¼¥É¤òºï½ü¤¹¤ë
   LET w=C(p)
   FOR i=p TO C(0)-1 !Á°¤ËµÍ¤á¤ë
      LET C(i)=C(i+1)
   NEXT i
   LET C(0)=C(0)-1
END SUB
SUB inc(C(),p,w) !¥Ñ¥±¥Ã¥ÈÆâ¾å¤«¤ép°ÌÃ֤˥«¡¼¥É¤òÄɲ乤ë
   IF p<=C(0) THEN
      FOR i=C(0) TO p STEP -1 !¸å¤í¤Ë¤º¤é¤¹
         LET C(i+1)=C(i)
      NEXT i
   ELSE
      LET p=C(0)+1 !ºÇ¸å
   END IF
   LET C(p)=w
   LET C(0)=C(0)+1
END SUB
DIM TT(0 TO 13*4+1)
SUB add(C1(),C2(), C()) !C1¤ò¾å¡¢C2¤ò²¼¤Ë¥Ñ¥±¥Ã¥È¤ò½Å¤Í¤ë
   FOR i=1 TO C1(0)
      LET TT(i)=C1(i)
   NEXT i
   FOR i=1 TO C2(0) !³¤±¤Æ
      LET TT(C1(0)+i)=C2(i)
   NEXT i
   LET C(0)=C1(0)+C2(0)
   FOR i=1 TO C(0)
      LET C(i)=TT(i)
   NEXT i
END SUB
SUB clr(C()) !¥Ñ¥±¥Ã¥È¤ò¥¯¥ê¥¢¤¹¤ë
   LET C(0)=0
END SUB
SUB rev(C()) !¥Ñ¥±¥Ã¥È¤ò΢ÊÖ¤¹
   FOR i=1 TO INT(C(0)/2)
      swap C(i),C(C(0)-i+1)
   NEXT i
END SUB
SUB disp(C(),m$) !¥Ñ¥±¥Ã¥È¤ò¾å¤«¤é½ç¤Ëɽ¼¨¤¹¤ë
   PRINT m$;"(";C(0);"Ëç)";
   FOR i=1 TO C(0)
      PRINT C(i);
   NEXT i
   PRINT
END SUB
!-------------------- ¤³¤³¤Þ¤Ç¤¬¥µ¥Ö¥ë¡¼¥Á¥ó


LET N=12 !Ëç¿ô

DIM S(0 TO N),H(0 TO N) !¥¹¥Ú¡¼¥É¡¢¥Ï¡¼¥È¥Ñ¥±¥Ã¥È¤Î½é´ü²½
FOR i=1 TO N !À°Îó
   LET S(i)=i !¥¹¥Ú¡¼¥É 1¡Á13
   LET H(i)=i+13*2 !¥Ï¡¼¥È 27¡Á39
NEXT i
LET H(0)=N !Ëç¿ô
LET S(0)=N

!¥Æ¡¼¥Ö¥ë¤Î½é´ü²½
DIM Y1(0 TO N),Y2(0 TO N),Y3(0 TO N) !»³£±¡¢»³£²¡¢¼Î¤Æ¾ì
CALL clr(Y1) !»³¤Î¥¯¥ê¥¢
CALL clr(Y2)
CALL clr(Y3)

CALL dump !ÆâÍƤò³Îǧ¤¹¤ë

SUB dump
   CALL disp(S,"¥¹¥Ú¡¼¥É") !¥È¥ì¡¼¥¹
   CALL disp(H,"¥Ï¡¼¥È")
   CALL disp(Y1,"»³£±")
   CALL disp(Y2,"»³£²")
   CALL disp(Y3,"¼Î¤Æ¾ì")
   PRINT
END SUB


!£±²óÌÜ
INPUT PROMPT "¹¥¤­¤Ê¿ô»ú(2¡ÁN)¡©": K !¹¥¤­¤Ê¿ô»ú 1¡ÁN

CALL routine

SUB routine !ºî¶È¤ÎÄêµÁ
   FOR x=1 TO N !¼ê»ý¤Á¤Î¥«¡¼¥É¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç
      PRINT x;"ËçÌܤò¥Æ¡¼¥Ö¥ë¤Ø"
      CALL dec(S,1,w) !ºï½ü¤¹¤ë
      IF x=K THEN !°ìÃפ¹¤ëËç¿ôÌܤʤé¼Î¤Æ¾ì¤Ø
      !IF MOD(x,K)=0 THEN !°ìÃפ¹¤ëËç¿ôÌܤʤé¼Î¤Æ¾ì¤Ø
         CALL inc(Y3,1,w)
         CALL dec(H,1,w) !ÂåÂؤȤ·¤Æ¾ì¤«¤é
      END IF

      IF MOD(x,2)=0 THEN !º¸±¦¸ò¸ß¤Ç»³¤ËÃÖ¤¯
         CALL inc(Y2,1,w)
      ELSE
         CALL inc(Y1,1,w)
      END IF

      CALL dump !ÆâÍƤò³Îǧ¤¹¤ë
   NEXT x
   PRINT
END SUB




!£²²óÌܰʹß
DO
   CALL add(Y1,Y2, S) !»³¤ò½Å¤Í¤Æ¼ê¤Ë»ý¤Ä
   CALL rev(S)
   CALL disp(S,"¥¹¥Ú¡¼¥É")
   PRINT

   IF H(0)=0 THEN EXIT DO !¥Ï¡¼¥È¥Ñ¥±¥Ã¥È¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç

   CALL clr(Y1) !»³¤Î¥¯¥ê¥¢
   CALL clr(Y2)

   CALL routine
LOOP


MAT H=Y3
CALL rev(H)
CALL disp(H,"¥Ï¡¼¥È")


INPUT PROMPT "¥«¡¼¥É¤Î¥Þ¡¼¥¯¡©": c$
INPUT PROMPT "¿ô»ú(1¡ÁN)¡©": K

IF UCASE$(c$)="H" THEN
   LET w=H(K) !¥¹¥Ú¡¼¥É¤ÎÎó¤Ë¤Ê¤Ã¤Æ¤¤¤ë
   LET w=S(w)
ELSE
   LET w=MOD(S(K),13) !¥Ï¡¼¥È¤ÎÎó¤Ë¤Ê¤Ã¤Æ¤¤¤ë
   LET w=H(w)
END IF
PRINT mid$(mk$,INT(w/13)+1,1); MOD(w,13)


END
 

Re: ¥«¡¼¥É¥Þ¥¸¥Ã¥¯¤Ç½Ð²ñ¤Ã¤¿¸½¾Ý

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ11·î 5Æü(¿å)17»þ59ʬ39ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.48[¸µµ­»ö¤Ø]

!¥È¥é¥ó¥× ¤Ï¡¢¤É¤Î¿ô¤òÁª¤ó¤Ç¤â¡¢
!¸ß¤¤¤Ë ¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ë¡¡¤Ê¤Ã¤Æ¤·¤Þ¤¦¤è¤¦¤Ç¤¹¡£Æñ²ò¡£

DIM s(12),h(12),w(12),t(12)

PRINT "----- ºÇ½é¤Î¾õÂÖ -----"
CALL ready
CALL printa(s) !¡¡¥¹¥Ú¡¼¥É
CALL printa(h) !¡¡¥Ï¡¼¥È
PRINT
!
FOR R=1 TO 12
   PRINT "----- Request";R;"¤Î¾ì¹ç-----"
   CALL ready
   LET k=1
   DO WHILE k< 13
      FOR i=1 TO 12
         LET j=MOD(i,2)*7+INT(i/2) !¡¡Ê¬¤±¤¿£²¤Ä¤ò½Å¤Í¤¿»þ¤Î°ÌÃÖ¡£
         IF i=R THEN
            LET t(j)=h(k) !¡¡¥Ï¡¼¥È¤ò¥Æ¡¼¥Ö¥ë¤Ø
            LET w(k)=s(i) !¡¡¼ê¸µ(ºÇ½é¥¹¥Ú¡¼¥É)¤ò¡Ö¼Î¤Æ¡×¤Ø
            LET k=k+1
         ELSE
            LET t(j)=s(i) !¡¡¼ê¸µ(ºÇ½é¥¹¥Ú¡¼¥É)¤ò¥Æ¡¼¥Ö¥ë¤Ø
         END IF
      NEXT i
      MAT s=t !¡¡¥Æ¡¼¥Ö¥ë¤ò¼ê¸µ(ºÇ½é¥¹¥Ú¡¼¥É)¤Ø
   LOOP
   CALL printa(s) !¡¡Èæ³Ó¡¦¡¦¡¦¼ê¸µ(ºÇ½é¥¹¥Ú¡¼¥É)
   CALL printa(w) !¡¡Èæ³Ó¡¦¡¦¡¦¡Ö¼Î¤Æ¡×¤Î½Å¤Ê¤ê
   PRINT
NEXT R

SUB printa(a())
   FOR n=1 TO 12
      PRINT USING "## ":a(n);
   NEXT n
   PRINT "¡¡¡Ä¸ß¤¤¤Ë Index."
END SUB

SUB ready
   FOR i=1 TO 12
      LET s(i)=i
      LET h(i)=i
   NEXT i
END SUB

END
 

Re: ¥«¡¼¥É¥Þ¥¸¥Ã¥¯¤Ç½Ð²ñ¤Ã¤¿¸½¾Ý

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î 5Æü(¿å)21»þ53ʬ27ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.49[¸µµ­»ö¤Ø]

¥ê¥Õ¥ë¥·¥ã¥Ã¥Õ¥ë¤ÎÀ­¼Á¤òÍøÍѤ·¤Æ¤¤¤ë¤È»×¤¤¤Þ¤¹¡£

¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤Æɽ¼¨¤µ¤ì¤ë£Ë¤Ï¡¢
¡Ö¼ê»ý¤Á¤Î¥«¡¼¥É¤òº¸±¦¤Î»³¤Ëʬ¤±¤Æ¡¢º¸±¦¤È½Å¤Í£±¤Ä¤Î»³¤Ë¤¹¤ë¡×¤ÎÁàºî¤Ë³ºÅö¤·¤Þ¤¹¡£
°ìÈÖ¾å¤Îº÷°úÈֹ椬ºÇ½é¤Ëʹ¤¤¤¿¹¥¤­¤ÊÈÖ¹æ¤Ç¤¹¡£¤É¤ÎÎó¤Ç¤â¹½¤¤¤Þ¤»¤ó¤¬¡¢
¤½¤ÎÎó¤ò¾å¤«¤é½ç¤Ë¸«¤Æ¤¤¤¯¤È¡¢¼Î¤Æ¾ì¤ËÀѤޤì¤ë¡Ê¥¹¥Ú¡¼¥É¤Î¡Ë¥«¡¼¥É¤Î½ç¤Ë¤Ê¤ê¤Þ¤¹¡£

¤È¤³¤í¤ÇÃÖ¤­´¹¤¨¤¿¥Ï¡¼¥È¤Î¥«¡¼¥É¤Ï¡¢¤³¤ÎÈÖ¹æ°ÌÃÖ¤ËÃÖ¤­´¹¤ï¤ê¤Þ¤¹¤¬¡¢
ºÇ½ªÅª¤Ë¡¢12²ó¤ÎÁàºî¤Ç¥¹¥Ú¡¼¥É¤Î¥«¡¼¥É¤ËÂбþ¤·¤¿°ÌÃÖ¤ËÀ°Î󤵤ì¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£

¤³¤ì¤Ç»²¾È°ÌÃ֤Ȥ½¤ÎÇÛÃÖ°ÌÃÖ¤ò¤¦¤Þ¤¯Íí¤Þ¤»¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

¤Á¤ç¤¦¤ÉN²óÌܤǤâ¤È¤ËÌá¤ë¾ì¹ç¡¢¤¿¤È¤¨¤ÐN=2,4,10,12¤¬¤³¤ÎÌäÂê¤òËþ¤¿¤¹¤È»×¤¤¤Þ¤¹¡£



!ÃÖ´¹¡ÊPermutation¡Ë¤Î·×»»

!Êä½õ¥ë¡¼¥Á¥ó
SUB PermPrintOut(A()) !ɽ¼¨¤¹¤ë¡¡¢¨É¸½à·Á¡Ê£²¹Ô£îÎó¤Î¹ÔÎóɽµ­¤¹¤ë¡Ë
!PRINT "¨£";
!FOR i=1 TO UBOUND(A)
!   PRINT USING "###": i;
!NEXT i
!PRINT " ¨¤"
!PRINT "¨¦";
   FOR i=1 TO UBOUND(A)
      PRINT USING "###": A(i);
   NEXT i
   !PRINT " ¨¥";
   PRINT
END SUB

!ÃÖ´¹
SUB PermIdentity(A()) !¹±ÅùÃÖ´¹
   FOR i=1 TO UBOUND(A)
      LET  A(i)=i
   NEXT i
END SUB
SUB PermMultiply(A(),B(), AB()) !ÀÑAB¡¡¢¨AB¡âBA¡¢A(BC)=(AB)C
   LET  ua=UBOUND(A)
   LET  ub=UBOUND(B)
   IF ua=ub THEN
      FOR i=1 TO ua
         LET  AB(i)=A(B(i)) !¢¨¹çÀ®¼ÌÁü(AB)(i)=A(B(i))
      NEXT i
   ELSE
      PRINT "¼¡¸µ¤¬°ã¤¤¤Þ¤¹¡£A=";ua;" B=";ub
      STOP
   END IF
END SUB
!-------------------- ¤³¤³¤Þ¤Ç¤¬¥µ¥Ö¥ë¡¼¥Á¥ó


!main

LET N=12 !¢¨2,4,10,12

!A=¨£ 1 2 3 4 ¨¤=(1 2 4 3)¡¡¢¨£±¹ÔÌܤνçÈ֤ϸÇÄê¤È¤¹¤ë
!¡¡¨¦ 2 4 1 3 ¨¥
DATA 2,4,6,8,10,12,1,3,5,7,9,11 !ÇÛÎóÊÑ¿ô¤Î¡Öź¤¨»ú¤ÈÃ͡פËÂбþ¤µ¤»¤ë
!DATA 2,4,6,8,10,1,3,5,7,9 !N=10
!DATA 2,4,1,3 !N=4
!DATA 2,1 !N=2
DIM A(N)
MAT READ A

FOR i=1 TO N
   PRINT USING "###": i;
NEXT i
PRINT

DIM B(N)
CALL PermIdentity(B) !½é´üÃÍ

DIM c(N)
FOR k=1 TO N !²ó¿ô
   CALL PermMultiply(B,A,c) !¥·¥ã¥Ã¥Õ¥ë
   PRINT "K=";k
   CALL PermPrintOut(c) !²¿²ó¤«¼Â¹Ô¤¹¤ë¤È¸µ¤ËÌá¤ë
   MAT B=c
NEXT k


END
 

Re: ¥×¥í¥°¥é¥à¤Î¤ª´ê¤¤

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î 5Æü(¿å)22»þ07ʬ8ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.46[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> £Ã¸À¸ìÈǤΥ³¡¼¥É¤ò¤ß¤Æ»×¤Ã¤¿¤Î¤Ç¤¹¤¬
>
> ¡¦N=1¤¬µá¤Þ¤é¤Ê¤¤
> ¡¦½çÎó¤ÎÀ¸À®¤¬¤ª¤«¤·¤¤¡Ê¹Ô¤äÎó¤Î¸ò´¹¤¬ÉÔ½½Ê¬¡Ë
> ¡¡¢ªÉ¸½à·Á¤«¤é¤¹¤Ù¤ÆŸ³«¤µ¤ì¤Æ¤¤¤Ê¤¤
> ¡¡¢ªexit¤Î²Õ½ê¤ò¥³¥á¥ó¥È¡Ê̵¸ú¡Ë¤Ë¤·¤Æ¤âÁ´²ò¤¬ÆÀ¤é¤ì¤Ê¤¤
> ¡¡¢ªN=6¤Ç¸¡¾Ú¤·¤Æ¤¤¤Ê¤¤²Õ½ê¤¬¤¢¤ë
> ¤Îµ¿Ì䤬¤¢¤ê¤Þ¤¹¡£


¤³¤Î¤³¤È¤òÀ½ºî¼Ô¤ÎÊý¤Ë¤ª¿Ò¤Í¤·¤Þ¤·¤¿¤È¤³¤í¡¢¼¡¤Î¤è¤¦¤Ê¥á¡¼¥ë¤ò夭¤Þ¤·¤¿¡£

¡¦N=1¤¬µá¤Þ¤é¤Ê¤¤

  N=1¤ËÂн褹¤ë¤È¥×¥í¥°¥é¥à¤¬ÌÌÅݤˤʤë¤À¤±¤Ç¤¹¤Î¤Ç
̵»ë¤·¤Æ¤¤¤Þ¤¹¡Ê¼ê´Ö¤ò¤«¤±¤ÆN=1¤Ë¤ï¤¶¤ï¤¶Âн褷¤Æ¤â¡¢
¤Þ¤Ã¤¿¤¯Ìµ°ÕÌ£¤Ç¤¹¤è¤Í¡©¡Ë¡£

> ¡¦½çÎó¤ÎÀ¸À®¤¬¤ª¤«¤·¤¤¡Ê¹Ô¤äÎó¤Î¸ò´¹¤¬ÉÔ½½Ê¬¡Ë
> ¡¡¢ªÉ¸½à·Á¤«¤é¤¹¤Ù¤ÆŸ³«¤µ¤ì¤Æ¤¤¤Ê¤¤
> ¡¡¢ªexit¤Î²Õ½ê¤ò¥³¥á¥ó¥È¡Ê̵¸ú¡Ë¤Ë¤·¤Æ¤âÁ´²ò¤¬ÆÀ¤é¤ì¤Ê¤¤
> ¡¡¢ªN=6¤Ç¸¡¾Ú¤·¤Æ¤¤¤Ê¤¤²Õ½ê¤¬¤¢¤ë

  ¤ª¤«¤·¤¯¤Ê¤¤¤Ï¤º¤Ç¤¹¡£
  ¤¹¤Ù¤Æ¤ò¸¡¾Ú¤¹¤ë¤ÈÈó¾ï¤ËŤ¤»þ´Ö¤¬¤«¤«¤ê¤Þ¤¹¤Î¤Ç¡¢
¿ô³ØŪ¤Ë¹Í¤¨¤Æ¸¡¾Ú¤¬É¬Íפʤ¤¤â¤Î¤Ï¾Ê¤¤¤Æ¤¤¤Þ¤¹¡£
¡Ê¾Ê¤«¤Ê¤¤¤È¡¢¸½¼ÂŪ¤Ê»þ´Ö¤Çµá¤Þ¤ê¤Þ¤»¤ó¡£¡Ë

¤È¤Î²óÅú¤Ç¤·¤¿¡£Ï¢Íí¤Þ¤Ç
 

Re: ¥×¥í¥°¥é¥à¤Î¤ª´ê¤¤

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î 6Æü(ÌÚ)07»þ10ʬ30ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.52[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¤ª¼ê¿ô¤ª¤«¤±¤·¤Þ¤·¤¿¡£¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
 

¥«¡¼¥É¥Þ¥¸¥Ã¥¯¤Î³¤­

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î 6Æü(ÌÚ)10»þ47ʬ33ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¤È¤¤¤¦¤³¤È¤Ï¡¢£±£²Ë示¤Ä·×£²£´Ëç¤Î¥«¡¼¥É¤Ç¤Ê¤¯¤Æ¤â¡¢
£²¡¤£´¡¤£±£°¡¤£±£²¡¤£±£¸¡¤£³£¶¡¤£µ£²¡¤£µ£¸¡¤£¶£°¡¤£¶£¶¡¤£¸£²¡¤£±£°£°¡¤¡¦¡¦¡¦
Ë示¤Ä¤Î¾ì¹ç¤Ç¤âƱÍͤʸ½¾Ý¤¬µ¯¤³¤»¤ë¤È¤¤¤¦¤³¤È¤Ê¤ó¤Ç¤·¤ç¤¦¤«¡©

¤³¤Î¼êÉʤˤϳ¤­¤¬¤¢¤ê¤Þ¤·¤Æ¡¢°ìÅÙ¤³¤Î¸½¾Ý¤ò¸«¤»¤Æ¤âµÒ¤Ï¤¿¤Þ¤¿¤ÞÅö¤¿¤Ã¤¿¤È¤·¤«´¶¤¸¤Æ¤¯¤ì¤Ê¤¤¤Î¤Ç¡¢¼¡¤Î¤è¤¦¤Ë¤µ¤é¤Ë¥«¡¼¥É¤òº®¤¼¤¿¤è¤¦¤Ë¸«¤»¤Æ¤¤¤¯¡£
¤Þ¤º¡¢°ìÊý¤Î¥Ñ¥±¥Ã¥È¡ÊÎã¤È¤·¤Æ¥Ï¡¼¥È¤ÎÊý¤òÁª¤Ö¡Ë¤ËK¡Ê£±£³¡Ë¥«¡¼¥É¤ò°ìËç¤ò¥Ü¥È¥à¤Ë
ÉÕ¤±²Ã¤¨¤ë¡£¡Ê¥Ñ¥±¥Ã¥È¤Ï΢¸þ¤­¾õÂÖ¡Ë
¤³¤ì¤ò¿ô²ó¥«¥Ã¥È¡ÊǤ°Õ¤Î¾ì½ê¤«¤éʬ¤±¡¢¾å¡¢²¼¤Î°ÌÃÖ´Ø·¸¤òµÕ¤Ë¤¹¤ë¡£¡Ë¤·¤¿¸å¡¢
µÒ¤Ë£²¡Á£±£²¤ÎÃ椫¤é¹¥¤­¤Ê¿ô»ú¤ò¸À¤Ã¤Æ¤â¤é¤¦¡£¡ÊÎ㡧£¹¤ò¸À¤Ã¤¿¤È¤·¤Æ°Ê²¼ÀâÌÀ¡Ë
¥Ñ¥±¥Ã¥È¤òɽ¸þ¤­¤Ë¤·¤Æ¾å¤«¤é°ìË示¤Ä¥Æ¡¼¥Ö¥ë¤Ø£¹¤Ä¤Î»³¤òºî¤Ã¤Æ¤¤¤¯¡£(º¸¤«¤é±¦¤Ø)
»Ä¤ê¤Î¥«¡¼¥É¤Ï»Ï¤á¤Î»³¤ËÌá¤ê¡¢£²ËçÌܤȤ·¤Æ½Å¤Í¤Æ¤¤¤¯¡£¡Êº¸¤è¤ê£´¤ÄÌܤλ³¤Ç½ª¤ë¡Ë
¤³¤ÎºÇ¸å¤ËÃÖ¤¤¤¿¥«¡¼¥É¤¬°ìÈÖ±¦¤Î»³¤«¤é¿ô¤¨¤Æ²¿ÈÖÌܤξì½ê¤Ç½ª¤ï¤Ã¤¿¤Î¤«¤òÌ©¤«¤Ë³Ð¤¨¤ë¡£
¡Ê£¹¤Î¾ì¹ç¤Ï±¦²ó¤ê¤Ë¥«¥¦¥ó¥È¤¹¤ë¤È£´ÈÖÌÜ¡¢º¸²ó¤ê¤Ë¥«¥¦¥ó¥È¤¹¤ë¤È£µÈÖÌܤȤ¤¤¦¤³¤È¤Ë¤Ê¤ë¡£¡Ë
º¸¤«±¦²ó¤ê¤Ï´Ø·¸¤»¤º¡¢¾¯¤Ê¤¤Êý¤Î¿ô¤ò¥­¡¼¿ô»ú¡Ê£¹¤Ê¤é£´¤È¤Ê¤ë¡£¡Ë¤È¤¹¤ë¡£
¤³¤³¤Ç¡¢µÒ¤Ë£¹¤Ä¤Î»³¤Î°ì¤Ä¤òǤ°Õ¤ËÁª¤Ð¤»¤ë¡£
±é¼Ô¤Ï¤³¤Î»³¤«¤é¼è¤ê¾å¤²¡¢±¦¤Ø¡Ê±¦²ó¤ê¤Ë¥«¥¦¥ó¥È¤·¤ÆÆÀ¤¿¿ô»ú¤À¤«¤é¡Ë£´¤º¤Ä¿Ê¤ó¤Ç
¹Ô¤Ã¤¿»³¤Î¾å¤Ë½Å¤Í¤ë¡£
Ʊ¤¸¤¯½Å¤Ê¤Ã¤¿»³¤ò»ý¤Á¾å¤²¡¢¼¡¤Î£´±¦¤Ø¿Ê¤ó¤À»³¤Î¾å¤Ë½Å¤Í¤ë¡£¡Ê°ìÈÖ±¦¤Þ¤Ç¤­¤¿¤é¡¢°ìÈÖº¸¤Î»³¤Ø¿Ê¤ó¤Ç¥«¥¦¥ó¥È¤¹¤ë¡£¡Ë
¤³¤ì¤ò³¤±¤Æ¤¤¤¯¡£¡Ê¤¿¤À¤·½Å¤Í¤ë»³¤Ï¡¢ºÇ½é¤ËÃÖ¤¤¤Æ¤¤¤¿»³¤Î°ÌÃ֤ǥ«¥¦¥ó¥È¤¹¤ë¤³¤È¡£¡¡½¾¤Ã¤Æ¤â¤¦¥«¡¼¥É¤ò¼è¤êµî¤Ã¤¿°ÌÃ֤⥫¥¦¥ó¥È¤ÎÂоݤˤʤ롣¡Ë
¡ãµÒ¤«¤é¤Ï¥«¡¼¥É¤Î½¸¤áÊý¤¬¥é¥ó¥À¥à¤Ë½¸¤á¤Æ¤¤¤ë¤è¤¦¤Ë´¶¤¸¤ë¡£¡ä
°ì¤Ä¤Ë¤Þ¤È¤Þ¤Ã¤¿¥Ñ¥±¥Ã¥È¡Êɽ¸þ¤­¡Ë¤ò¿ô²ó¥«¥Ã¥È¤¹¤ë¤¬¡¢ºÇ¸å¤Î¥«¥Ã¥È¤ÇK¡Ê£±£³¡Ë¥«¡¼¥É¤¬¥Ü¥È¥à¤Ë¡Êɽ¸þ¤­¤Ê¤é°ìÈÖ¾å¡Ë¤Ê¤ë¤è¤¦¤Ë¡¢Ä´Àᤷ΢¸þ¤­¤Ç¥Æ¡¼¥Ö¥ë¤ËÃÖ¤¯¡£
¤³¤Î¤È¤­¡¢°ìÈÖ²¼¡Ê΢¸þ¤­¤Î¾õÂ֤ʤé°ìÈÖ¾å¡Ë¤Ë¤¯¤ë¥«¡¼¥É¤òÅð¤ß¸«¤·¤Æ¡Ê¿ô»ú¡Ë³Ð¤¨¤Æ¤ª¤¯¡£
¼¡¤Ë¥¹¥Ú¡¼¥É¤Î¥Ñ¥±¥Ã¥È¡Ê¤³¤Á¤é¤Ï£±£²Ëç¡Ë¤ò¼è¤ê¾å¤²¡¢¥¨¡¼¥¹¥«¡¼¥É¤¬Åð¤ß¸«¤ò¤·¤¿¿ô¤Ë¾å¤«¤é¿ô¤¨¤Æ¤ÎËç¿ôÌܤˤʤë¤è¤¦¤Ë¡¢°ÌÃÖ¤òÄ´Àᤷ¤Æ°ìÅÙ¥«¥Ã¥È¤ò¤¹¤ë¡£
΢¸þ¤­¾õÂ֤ǥơ¼¥Ö¥ë¤ËÃÖ¤¯¡£¡Ê¤³¤ì¤Ç¡¢Á´¤Æ¤Î¥«¡¼¥É°ÌÃ֤Ȼؼ¨°ÌÃÖ¤¬Âбþ¤·¤Æ¤¤¤ë¡Ë

¤³¤Îºî¶È¤Ïµ¤¤¬ºÑ¤à¤Þ¤Ç¡¢¤¯¤êÊÖ¤·¤Æ¹Ô¤Ã¤Æ¤è¤¤¡£
¡Ê¤À¤ì¤Ç¤â¥Ï¡¼¥È¤Î¥«¡¼¥É¤Ï¤¬¤Ã¤«¤ê¤¹¤ë¤¯¤é¤¤¤è¤¯º®¤¼¤é¤ì¤¿¤È´¶¤¸¤ë¤À¤í¤¦¡£¡Ë

ºÆ¤Ó¡¢µÒ¤Î¥ê¥¯¥¨¥¹¥È¤ËÁêÅö¤¹¤ë¥«¡¼¥É¤òõ¤·¤À¤¹¤³¤È¤¬¤Ç¤­¤ë¡£
¡Ê¤Þ¤¿¤Þ¤¿¡¢Ê¬¤«¤êÆñ¤¤¤Ç¤·¤ç¤¦¤«¡©¡Ë
 

Re: ¥«¡¼¥É¥Þ¥¸¥Ã¥¯¤Î³¤­

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î 7Æü(¶â)07»þ31ʬ4ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.54[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

>£²¡¤£´¡¤£±£°¡¤£±£²¡¤£±£¸¡¤£³£¶¡¤£µ£²¡¤£µ£¸¡¤£¶£°¡¤£¶£¶¡¤£¸£²¡¤£±£°£°¡¤¡¦¡¦¡¦

¤¿¤Ö¤ó£Ï£Ë¤À¤È»×¤¤¤Þ¤¹¡£


>³¤­¤Î¥Þ¥¸¥Ã¥¯¤Ë¤Ä¤¤¤Æ

¥×¥í¥°¥é¥à¥ß¥¹¤È»×¤¤¤Þ¤¹¤¬¡¢°ìÃפ¹¤ë¤È¤­¤È°ìÃפ·¤Ê¤¤¤È¤­¤¬¤¢¤ê¤Þ¤¹¡£
¸å¤Ç¥×¥í¥°¥é¥à¤ò·ÇºÜ¤·¤Þ¤¹¡£¡ÊĹÊԤǤ¹¡Ë


>³¤­¤Î¥Þ¥¸¥Ã¥¯¤Î¥Æ¡¼¥Ö¥ë¤Ç¤Î¥Ï¡¼¥È¥Ñ¥±¥Ã¥È¤Î¥·¥ã¥Ã¥Õ¥ë¤Ë¤Ä¤¤¤Æ

¥·¥ã¥Ã¥Õ¥ë¤Ë¤è¤Ã¤Æ¸µ¤Î¿ô»ú¤¬¤É¤³¤Ë°ÜÆ°¤¹¤ë¤«³Îǧ¤·¤Æ¤ß¤Þ¤·¤¿¡£
£±²óÌܡʺî¤ë»³¤Î¿ô¡Ë¤Î¹¥¤­¤Ê¿ô»ú¤Ë¤è¤Ã¤Æ¡¢¼¡¤Î¥×¥í¥°¥é¥à¤Çɽ¼¨¤µ¤ì¤ëɽ¤Î¿ô»úÎó¡Ê²£¤Ë¤ß¤ë¡Ë¤Î¤¤¤º¤ì¤«¤Ë¤Ê¤ë¤è¤¦¤Ç¤¹¡£
£²²óÌÜ¡Ê»³¤ÎÁªÂò¡Ë¤Ï¡¢£±£³¤òÄì¤Ë°ÜÆ°¤µ¤»¤ëÄ´À°¥«¥Ã¥È¤Ç̵¸ú¤Ë¤Ê¤ê¤Þ¤¹¡£

1  2  3  4  5  6  7  8  9 10 11 12 13
2  4  6  8 10 12  1  3  5  7  9 11 13
3  6  9 12  2  5  8 11  1  4  7 10 13
4  8 12  3  7 11  2  6 10  1  5  9 13
5 10  2  7 12  4  9  1  6 11  3  8 13
6 12  5 11  4 10  3  9  2  8  1  7 13
7  1  8  2  9  3 10  4 11  5 12  6 13
8  3 11  6  1  9  4 12  7  2 10  5 13
9  5  1 10  6  2 11  7  3 12  8  4 13
10  7  4  1 11  8  5  2 12  9  6  3 13
11  9  7  5  3  1 12 10  8  6  4  2 13
12 11 10  9  8  7  6  5  4  3  2  1 13

¤¿¤È¤¨¤Ð¡¢¹¥¤­¤Ê¿ô»ú¤Ë£³¤ò»ØÄꤹ¤ë¤È13-3=£±£°ÈÖÌܤˤʤê¤Þ¤¹¡£
10  7  4  1 11  8  5  2 12  9  6  3 13¡¡¡Ä (1)


¤³¤ì¤¬¥¹¥Ú¡¼¥É¥Ñ¥±¥Ã¥È¤ÎÄ´À°¥«¥Ã¥È¤È¤Î´Ø·¸¤¬¸«¤¨¤Þ¤»¤ó¡£¡ÊÄ´ººÃæ¡Ë
£±ÎóÌܤοô»ú¡Ê10¡Ë¤«¡¢£±¤Î°ÌÃÖ¡Ê4ÈÖÌܡˤ«¡¢²¿¤«¡¢¡¢¡¢



¡ü¥×¥í¥°¥é¥à

!£±£³°Ê³°¤Î¿ô£Î¤Ë¡¢¼«Ê¬¼«¿È£Î¤ò²Ã¤¨¤Æ¿·¤·¤¤¿ô¤òºî¤ë¡£
!¤½¤Î¿ô¤¬£±£³¤è¤êÂ礭¤¤¤È¤­¤Ï¡¢£±£³¤ò°ú¤¯¡£
DIM A(13),B(13)
FOR k=1 TO 12
   LET A(k)=k
   LET B(k)=0
NEXT k
FOR i=1 TO 12
   FOR k=1 TO 12
      LET B(k)=MOD(B(k)+A(k),13)
   NEXT k
   LET B(13)=13
   MAT PRINT B;
NEXT i
END
 

Re: ¥«¡¼¥É¥Þ¥¸¥Ã¥¯¤Î³¤­

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î 7Æü(¶â)09»þ24ʬ8ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.55[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¥×¥í¥°¥é¥à¥ß¥¹¤È»×¤¤¤Þ¤¹¤¬¡¢°ìÃפ¹¤ë¤È¤­¤È°ìÃפ·¤Ê¤¤¤È¤­¤¬¤¢¤ê¤Þ¤¹¡£

³¤¤¤Æ¼êÉʤò¹Ô¤¦¤È¤¤¤¦¤³¤È¤Ï¡¢ºÇ½é¤Î¥Þ¥¸¥Ã¥¯¤ò½ªÎ»¤·¤¿¤â¤Î¤Î¥Ñ¥±¥Ã¥È¤ò¤½¤Î¤Þ¤Þ
¤Î½ç½ø¤ÇÍøÍѤ¹¤ë¤È¤¤¤¦¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£
¡Ê´Ø·¸¤Ê¤¤¤Ç¤¹¤«¤Í¡©¡Ë
¤Ê¤ª¡¢µÒ¤¬»ØÄꤹ¤ë»³¤Î¿ô¤ËÂбþ¤·¤Æ¥«¡¼¥É¤ò½¸¤á¤ë¸þ¤­¤È¤º¤é¤·¿ô¤Ï
£²¡§±¦¤Ø£±
£³¡§±¦¤Ø£±
£´¡§±¦¤Ø£±
£µ¡§º¸¤Ø£²
£¶¡§±¦¤Ø£±
£·¡§º¸¤Ø£±
£¸¡§º¸¤Ø£³
£¹¡§±¦¤Ø£´
£±£°¡§±¦¤Ø£³
£±£±¡§±¦¤Ø£²
£±£²¡§±¦¤Ø£±
¤È¤Ê¤ê¤Þ¤¹¡£
¡Ê¤Þ¤µ¤Ë¤³¤ì¤Ï¡¢£±£³¤¬ÁÇ¿ô¤Ç¤¢¤ë¤³¤È¤ò¾å¼ê¤ËÍøÍѤ·¤¿ÊýË¡¤Ç¤¹¤Í¡£¡Ë
 

Re: ¥«¡¼¥É¥Þ¥¸¥Ã¥¯¤Î³¤­

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î 7Æü(¶â)09»þ25ʬ35ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.55[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

Æ°ºîÉÔÎɤǤ¹¡£´Ö°ã¤Ã¤¿Áàºî¤ò»ØŦ¤·¤Æ¤¯¤À¤µ¤¤¡£
1000 !¥È¥é¥ó¥×¤Î¥Þ¥¸¥Ã¥¯
1010
1020 !¥Ñ¥±¥Ã¥ÈÁàºî¤Î¥·¥ß¥å¥ì¡¼¥·¥ç¥ó
1030
1040 SUB dec(C(),p, w) !¾å¤«¤ép°ÌÃ֤Υ«¡¼¥É¤òºï½ü¤¹¤ë¡¡¢¨1¡åp
1050    LET w=C(p)
1060    FOR i=p TO C(0)-1 !Á°¤ËµÍ¤á¤ë
1070       LET C(i)=C(i+1)
1080    NEXT i
1090    LET C(0)=C(0)-1 !Ëç¿ô
1100 END SUB
1110 SUB inc(C(),p,w) !¾å¤«¤ép°ÌÃ֤˥«¡¼¥É¤òÄɲ乤ë
1120    IF p<=C(0) THEN
1130       FOR i=C(0) TO p STEP -1 !¸å¤í¤Ë¤º¤é¤¹
1140          LET C(i+1)=C(i)
1150       NEXT i
1160    ELSE
1170       LET p=C(0)+1 !ºÇ¸å¤Ø
1180    END IF
1190    LET C(p)=w
1200    LET C(0)=C(0)+1 !Ëç¿ô
1210 END SUB
1220 DIM TT(0 TO 13*4+1) !ºî¶ÈÍÑ¡¡¢¨£±¥Ç¥Ã¥­Ê¬
1230 SUB add(C1(),C2(), C()) !C1¤ò¾å¡¢C2¤ò²¼¤Ë½Å¤Í¤ë
1240    FOR i=1 TO C1(0) !C1
1250       LET TT(i)=C1(i)
1260    NEXT i
1270    FOR i=1 TO C2(0) !³¤±¤ÆC2
1280       LET TT(C1(0)+i)=C2(i)
1290    NEXT i
1300    LET TT(0)=C1(0)+C2(0) !Ëç¿ô
1310    CALL copy(TT,TT(0), C)
1320 END SUB
1330 SUB clr(C()) !¶õ¤Ë¤¹¤ë
1340    LET C(0)=0
1350 END SUB
1360 SUB rev(C()) !΢ÊÖ¤¹
1370    FOR i=1 TO INT(C(0)/2)
1380       swap C(i),C(C(0)-i+1) !¾å²¼¤òÆþ¤ìÂؤ¨¤ë
1390    NEXT i
1400 END SUB
1410 SUB del(C(),p,q) !p°ÌÃÖ¤«¤éq°ÌÃ֤ޤǤΥ«¡¼¥É¤òºï½ü¤¹¤ë¡¡¢¨1¡åp¡åq
1420    IF p>C(0) THEN
1430       PRINT "̵¸ú¤Ç¤¹¡£";p;q
1440    ELSE
1450       IF p>q THEN
1460          PRINT "p>q¤Ç̵¸ú¤Ç¤¹¡£";p;q
1470       ELSE
1480          LET q=MIN(q,C(0))
1490          FOR i=q+1 TO C(0) !»Ä¤ê¤ò·Ò¤²¤ë
1500             LET C(p+i-q-1)=C(i)
1510          NEXT i
1520          LET C(0)=C(0)-(q-p+1) !Ëç¿ô
1530       END IF
1540    END IF
1550 END SUB
1560 SUB shuffle(C()) !¥ê¥Õ¥ë¥·¥ã¥Ã¥Õ¥ë¤ò¹Ô¤¦¡¡¢¨¸åȾ¡¢Á°È¾¤Î½ç¤Ë½Å¤Í¤ë
1570    FOR i=1 TO C(0)
1580       LET TT(i)=C(INT(i/2)+MOD(i,2)*(INT(C(0)/2)+1))
1590       !LET TT(i)=C(INT((i-1)/2)+MOD(i-1,2)*INT(C(0)/2)+1) !¢¨Á°È¾¡¢¸åȾ¤Î½ç
1600    NEXT i
1610    LET TT(0)=C(0) !Ëç¿ô
1620    CALL copy(TT,TT(0), C)
1630 END SUB
1640 SUB cut(C(),p) !¥«¥Ã¥È¤¹¤ë¡¡¢¨p°ÌÃְʹߤ¬¾å¤Ë¤Ê¤ë
1650    LET p=MIN(p,C(0))
1660    FOR i=1 TO p-1 !Á°È¾Éôʬ¤ò¸å¤Ø
1670       LET TT(C(0)+i-p+1)=C(i)
1680    NEXT i
1690    FOR i=p TO C(0) !¸åȾÉôʬ¤òÁ°¤Ø
1700       LET TT(i-p+1)=C(i)
1710    NEXT i
1720    LET TT(0)=C(0) !Ëç¿ô
1730    CALL copy(TT,TT(0), C)
1740 END SUB
1750 SUB copy(C1(),p, C()) !¾å¤«¤ép°ÌÃ֤ޤǤò¥³¥Ô¡¼¤¹¤ë
1760    LET p=MIN(p,C1(0))
1770    FOR i=1 TO p !copy it
1780       LET C(i)=C1(i)
1790    NEXT i
1800    LET C(0)=p !Ëç¿ô
1810 END SUB
1820 SUB move(C1(),p, C()) !¾å¤«¤ép°ÌÃ֤ޤǤò°ÜÆ°¤¹¤ë
1830    CALL copy(C1,p,C)
1840    CALL del(C1,1,p)
1850 END SUB
1860 SUB disp(C(),m$) !¾å¤«¤é½ç¤Ëɽ¼¨¤¹¤ë
1870    PRINT m$;"(";C(0);"Ëç)";
1880    FOR i=1 TO C(0)
1890       PRINT C(i);
1900    NEXT i
1910    PRINT
1920 END SUB
1930
1940
1950 DEF MarkOfCard$(w)=mid$(mk$,INT(w/13)+1,1) !¥«¡¼¥É¤òɽ¼¨¤¹¤ë
1960 DEF NumOfCard(w)=MOD(w,13)
1970 DEF CntOfPacket(C())=C(0) !¥Ñ¥±¥Ã¥ÈÆâ¤Î¥«¡¼¥É¤ÎËç¿ô
1980
1990 LET mk$="SCHD" !¥Þ¡¼¥¯
2000 LET nm$=" A 1 2 3 4 5 6 7 8 910 J Q K" !¢¨£²Ê¸»ú¤º¤Ä
2010
2020 !¥¹¥Ú¡¼¥É¡¢¥¯¥é¥Ö¡¢¥Ï¡¼¥È¡¢¥À¥¤¥ä¥Ñ¥±¥Ã¥È¤ò½é´ü²½¤¹¤ë
2030 DIM cS(0 TO 13),cC(0 TO 13),cH(0 TO 13),cD(0 TO 13)
2040 FOR i=1 TO 13 !À°Îó
2050    LET cS(i)=i !¥¹¥Ú¡¼¥É 1¡Á13
2060    LET cC(i)=i+13 !¥¯¥é¥Ö 14¡Á16
2070    LET cH(i)=i+13*2 !¥Ï¡¼¥È 27¡Á39
2080    LET cD(i)=i+13*3 !¥À¥¤¥ä 40¡Á52
2090 NEXT i
2100 LET cS(0)=13 !Ëç¿ô
2110 LET cC(0)=13
2120 LET cH(0)=13
2130 LET cD(0)=13
2140 !-------------------- ¤³¤³¤Þ¤Ç¤¬¥µ¥Ö¥ë¡¼¥Á¥ó
2150
2160
2170 LET N=12 !Ëç¿ô
2180
2190 DIM Y1(0 TO N+1),Y2(0 TO N+1),Y3(0 TO N+1),Y4(0 TO N+1) !»³£±¡Á12
2200 DIM Y5(0 TO N+1),Y6(0 TO N+1),Y7(0 TO N+1),Y8(0 TO N+1)
2210 DIM Y9(0 TO N+1),Y0(0 TO N+1),Yj(0 TO N+1),Yq(0 TO N+1)
2220
2230 DIM S(0 TO N+1),H(0 TO N+1) !¥¹¥Ú¡¼¥É¡¢¥Ï¡¼¥È¥Ñ¥±¥Ã¥È¤Î½é´ü²½
2240 CALL copy(cS,N, S)
2250 CALL copy(cH,N, H)
2260
2270 CALL dump !ÆâÍƤò³Îǧ¤¹¤ë
2280 SUB dump
2290    CALL disp(S,"¥¹¥Ú¡¼¥É") !¥È¥ì¡¼¥¹
2300    CALL disp(H,"¥Ï¡¼¥È")
2310    CALL disp(Y1,"»³£±")
2320    CALL disp(Y2,"»³£²")
2330    CALL disp(Y3,"¼Î¤Æ¾ì")
2340    PRINT
2350 END SUB
2360
2370
2380 !£±²óÌÜ
2390 INPUT PROMPT "¹¥¤­¤Ê¿ô»ú(1¡ÁN)¡©": K !¹¥¤­¤Ê¿ô»ú 1¡ÁN
2400
2410 CALL routine
2420 SUB routine !ºî¶È¤ÎÄêµÁ
2430    FOR x=1 TO N !¼ê»ý¤Á¤Î¥«¡¼¥É¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç
2440    !!!PRINT x;"ËçÌܤò¥Æ¡¼¥Ö¥ë¤Ø"
2450       CALL dec(S,1,w) !ºï½ü¤¹¤ë
2460       IF x=K THEN !°ìÃפ¹¤ëËç¿ôÌܤʤé¼Î¤Æ¾ì¤Ø
2470          CALL inc(Y3,1,w)
2480          CALL dec(H,1,w) !ÂåÂؤȤ·¤Æ¾ì¤«¤é
2490       END IF
2500
2510       IF MOD(x,2)=0 THEN !º¸±¦¸ò¸ß¤Ç»³¤ËÃÖ¤¯
2520          CALL inc(Y2,1,w)
2530       ELSE
2540          CALL inc(Y1,1,w)
2550       END IF
2560
2570       !!!CALL dump !ÆâÍƤò³Îǧ¤¹¤ë
2580    NEXT x
2590    !!!PRINT
2600 END SUB
2610
2620
2630 !£²²ó¡Á£Î²ó¤Þ¤Ç
2640 DO
2650    CALL add(Y1,Y2, S) !»³¤ò½Å¤Í¤Æ¼ê¤Ë»ý¤Ä
2660    CALL rev(S)
2670
2680    CALL clr(Y1) !»³¤Î¥¯¥ê¥¢
2690    CALL clr(Y2)
2700
2710    IF CntOfPacket(H)=0 THEN EXIT DO !¥Æ¡¼¥Ö¥ë¾å¤Î¥Ï¡¼¥È¥Ñ¥±¥Ã¥È¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç
2720
2730    CALL routine
2740 LOOP
2750
2760
2770 CALL move(Y3,99, H) !ºÇ½ª¤Î¾õÂÖ
2780 CALL rev(H)
2790
2800 PRINT
2810 CALL dump !ÆâÍƤò³Îǧ¤¹¤ë
2820
2830
2840 CALL surprise
2850 SUB surprise
2860    INPUT PROMPT "¥«¡¼¥É¤Î¥Þ¡¼¥¯(S,H)¡©": c$
2870    INPUT PROMPT "¿ô»ú(1¡ÁN)¡©": K
2880
2890    IF UCASE$(c$)="H" THEN
2900       LET w=H(K) !¥¹¥Ú¡¼¥É¤ÎÎó¤Ë¤Ê¤Ã¤Æ¤¤¤ë
2910       LET w=S(w)
2920    ELSE
2930       LET w=MOD(S(K),13) !¥Ï¡¼¥È¤ÎÎó¤Ë¤Ê¤Ã¤Æ¤¤¤ë
2940       LET w=H(w)
2950    END IF
2960    PRINT MarkOfCard$(w); NumOfCard(w) !¥«¡¼¥É¤òɽ¼¨¤¹¤ë
2970 END SUB
2980
2990 !---------- ¢¬¢¬¢¬¢¬¢¬ ---------- Á°È¾¤Î¥Þ¥¸¥Ã¥¯
3000
3010
¤³¤³¤Þ¤Ç¤¬Á°È¾¤Î¥Þ¥¸¥Ã¥¯¤Ç¤¹¡£¡Ê³¤¯¡Ë
 

Re: ¥«¡¼¥É¥Þ¥¸¥Ã¥¯¤Î³¤­

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î 7Æü(¶â)09»þ28ʬ59ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.55[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¡Ê³¤­¡Ë£²²óÌܤΥޥ¸¥Ã¥¯Éôʬ¡¡¢¨N0.56µ­»ö¤òÈ¿±Ç¡¢¹ÔÈÖ¹æ¤ÎÉÕ²Ã
3020
3030
3040
3050 !CALL copy(cS,12, S) !!!!!°ÜÆ°Àè¤ÎÄ´ºº¡¡<-----¤³¤³
3060 !CALL copy(cS,12, H) !!!!!¡¡<-----¤³¤³
3070 PRINT
3080
3090 CALL inc(H,99, 13) !£Ë¡Ê¥­¥ó¥°¡Ë¤òÄì¤ËÄɲ乤ë
3100
3110
3120 PRINT "¡Ê¥Ï¡¼¥È¥Ñ¥±¥Ã¥È¤ò¡Ë¿ô²ó¥«¥Ã¥È¤¹¤ë¡£"
3130 FOR x=1 TO 5
3140    CALL cut(H,INT(RND*(N+1))+1)
3150 NEXT x
3160
3170 CALL dump2 !ÆâÍƤò³Îǧ¤¹¤ë
3180 SUB dump2
3190    CALL disp(S,"¥¹¥Ú¡¼¥É") !¥È¥ì¡¼¥¹
3200    CALL disp(H,"¥Ï¡¼¥È")
3210    CALL disp(Y1,"»³£±")
3220    CALL disp(Y2,"»³£²")
3230    CALL disp(Y3,"»³£³")
3240    CALL disp(Y4,"»³£´")
3250    CALL disp(Y5,"»³£µ")
3260    CALL disp(Y6,"»³£¶")
3270    CALL disp(Y7,"»³£·")
3280    CALL disp(Y8,"»³£¸")
3290    CALL disp(Y9,"»³£¹")
3300    CALL disp(Y0,"»³10")
3310    CALL disp(Yj,"»³11")
3320    CALL disp(Yq,"»³12")
3330    PRINT
3340 END SUB
3350
3360
3370
3380 INPUT PROMPT "¹¥¤­¤Ê¿ô»ú¡Ê2¡Á12¡Ë": K
3390
3400 CALL routine2_1(H) !³Æ»³¤ØʬÇÛ¤¹¤ë
3410 SUB routine2_1(C())
3420    FOR x=1 TO N+1
3430       CALL dec(C,1,w) !£±Ë示¤Ä
3440       !SELECT CASE K-MOD(x-1,K) !¤½¤ì¤¾¤ì¤Î»³¤Ø
3450       SELECT CASE MOD(x-1,K)+1 !¤½¤ì¤¾¤ì¤Î»³¤Ø
3460       CASE 1
3470          CALL inc(Y1,1,w)
3480       CASE 2
3490          CALL inc(Y2,1,w)
3500       CASE 3
3510          CALL inc(Y3,1,w)
3520       CASE 4
3530          CALL inc(Y4,1,w)
3540       CASE 5
3550          CALL inc(Y5,1,w)
3560       CASE 6
3570          CALL inc(Y6,1,w)
3580       CASE 7
3590          CALL inc(Y7,1,w)
3600       CASE 8
3610          CALL inc(Y8,1,w)
3620       CASE 9
3630          CALL inc(Y9,1,w)
3640       CASE 10
3650          CALL inc(Y0,1,w)
3660       CASE 11
3670          CALL inc(Yj,1,w)
3680       CASE 12
3690          CALL inc(Yq,1,w)
3700       CASE ELSE
3710          PRINT "ÃÖ¤¯»³¤¬¤¢¤ê¤Þ¤»¤ó¡£"
3720          STOP
3730       END SELECT
3740    NEXT x
3750    CALL dump2 !ÆâÍƤò³Îǧ¤¹¤ë
3760 END SUB
3770
3780
3790 PRINT "±¦¤«¤é";MOD(N+1,K);"ÈÖÌܤ˺Ǹå¤Î¥«¡¼¥É¤òÃÖ¤­¤Þ¤·¤¿¡£"
3800 PRINT
3810
3820
3830
3840 INPUT PROMPT "¹¥¤­¤Ê»³¤òÁª¤Ö¡Ê1¡ÁK¡Ë": x
3850
3860 DIM dx(N)
3870 DATA 1,1,1,1,-2,1,-1,-3,4,3,2,1 !²ó¼ýÊýË¡¡¡¢¨£±¤Ê¤é±¦¤Ø£±¡¢¡Ý£²¤Ê¤éº¸¤Ø£²¤Î°Õ
3880 MAT READ dx
3890
3900 DIM yy(0 TO N+1)
3910 CALL routine2_2 !³Æ»³¤«¤é²ó¼ý¤¹¤ë
3920 SUB routine2_2
3930    DO
3940       SELECT CASE MOD(x-1,K)+1
3950       CASE 1
3960          CALL move(Y1,99, yy)
3970       CASE 2
3980          CALL move(Y2,99, yy)
3990       CASE 3
4000          CALL move(Y3,99, yy)
4010       CASE 4
4020          CALL move(Y4,99, yy)
4030       CASE 5
4040          CALL move(Y5,99, yy)
4050       CASE 6
4060          CALL move(Y6,99, yy)
4070       CASE 7
4080          CALL move(Y7,99, yy)
4090       CASE 8
4100          CALL move(Y8,99, yy)
4110       CASE 9
4120          CALL move(Y9,99, yy)
4130       CASE 10
4140          CALL move(Y0,99, yy)
4150       CASE 11
4160          CALL move(Yj,99, yy)
4170       CASE 12
4180          CALL move(Yq,99, yy)
4190       CASE ELSE
4200          PRINT "ÃÖ¤¯»³¤¬¤¢¤ê¤Þ¤»¤ó¡£"
4210          STOP
4220       END SELECT
4230
4240       IF CntOfPacket(yy)=13 THEN EXIT SUB !£±¤Ä¤Ë¤Þ¤È¤Þ¤ë¤Þ¤Ç
4250
4260       PRINT "»³";x;"¤«¤é";
4270       CALL disp(yy,"²ó¼ý¤·¤¿¥«¡¼¥É")
4280       LET x=x+dx(K) !±¦¤Þ¤¿¤Ïº¸¤Ø°ÜÆ°¤µ¤»¤Æ³ºÅö¤¹¤ë»³¤Ø½Å¤Í¤ë
4290       PRINT "»³";x;"¤Ë½Å¤Í¤Þ¤¹¡£"
4300       SELECT CASE MOD(x-1,K)+1
4310       CASE 1
4320          CALL add(yy,Y1, Y1)
4330       CASE 2
4340          CALL add(yy,Y2, Y2)
4350       CASE 3
4360          CALL add(yy,Y3, Y3)
4370       CASE 4
4380          CALL add(yy,Y4, Y4)
4390       CASE 5
4400          CALL add(yy,Y5, Y5)
4410       CASE 6
4420          CALL add(yy,Y6, Y6)
4430       CASE 7
4440          CALL add(yy,Y7, Y7)
4450       CASE 8
4460          CALL add(yy,Y8, Y8)
4470       CASE 9
4480          CALL add(yy,Y9, Y9)
4490       CASE 10
4500          CALL add(yy,Y0, Y0)
4510       CASE 11
4520          CALL add(yy,Yj, Yj)
4530       CASE 12
4540          CALL add(yy,Yq, Yq)
4550       CASE ELSE
4560       END SELECT
4570
4580       CALL dump2 !ÆâÍƤò³Îǧ¤¹¤ë
4590    LOOP
4600 END SUB
4610
4620
4630 PRINT "¡Ê²ó¼ý¤·¤¿¥Ï¡¼¥È¥Ñ¥±¥Ã¥È¤ò¡Ë¿ô²ó¥«¥Ã¥È¤¹¤ë¡£"
4640 FOR x=1 TO 5 !¿ô²ó¥«¥Ã¥È¤¹¤ë
4650    CALL cut(yy,INT(RND*(N+1))+1)
4660 NEXT x
4670 CALL disp(yy,"")
4680
4690
4700 PRINT "£Ë¡Ê¥­¥ó¥°¡Ë¤òÄì¤Ø°ÜÆ°¤µ¤»¤ë¤¿¤á¤ËÄ´À°¥«¥Ã¥È¤¹¤ë¡£"
4710 FOR x=1 TO N !°ÌÃÖ¤òõ¤¹
4720    IF MOD(yy(x),N+1)=0 THEN EXIT FOR
4730 NEXT x
4740 IF x=13 THEN !´û¤ËÄì¤Î¾ì¹ç¤Ï²¿¤â¤·¤Ê¤¤
4750 ELSE
4760    CALL cut(yy,x+1) !º¹Ê¬¤ò¥«¥Ã¥È¤¹¤ë
4770 END IF
4780 CALL disp(yy,"")
4790
4800
4810 CALL move(yy,99, H) !ºÇ½ª¤Î¾õÂÖ
4820
4830 LET KEY2=MOD(H(1),N+1) !°ìÈÖ¾å¤Î¿ô»ú¤òµ­²±¤¹¤ë
4840
4850 CALL dump2 !ÆâÍƤò³Îǧ¤¹¤ë
4860
4870
4880
4890
4900 PRINT KEY2;"¤Î°ÌÃ֤ˡ֣±¡×¤Î¥«¡¼¥É¤¬¤¯¤ë¤è¤¦¤Ë¡Ê¥¹¥Ú¡¼¥É¥Ñ¥±¥Ã¥È¤ò¡Ë¥«¥Ã¥È¤¹¤ë¡£"
4910 FOR x=1 TO N !°ÌÃÖ¤òõ¤¹
4920    IF MOD(S(x),N+1)=1 THEN EXIT FOR
4930 NEXT x
4940 PRINT "¸½ºß¤Î°ÌÃÖ";x
4950 IF x>KEY2 THEN !º¹Ê¬¤ò¥«¥Ã¥È¤¹¤ë
4960    CALL cut(S,x-KEY2+1)
4970 ELSEIF x<KEY2 THEN
4980    CALL cut(S,N-(KEY2-x)+1)
4990 END IF
5000
5010 CALL dump2 !ÆâÍƤò³Îǧ¤¹¤ë
5020
5030
5040 CALL surprise
5050
5060 !---------- ¢¬¢¬¢¬¢¬¢¬ ----------¡¡¸åȾ¤Î¥Þ¥¸¥Ã¥¯
5070
5080
5090 END
°Ê¾å¡¢Ä¹ÊÔÎϺ
 

´¶ÁÛ

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î 7Æü(¶â)19»þ00ʬ44ÉÃ
ÊÖ¿®¡¦°úÍÑ
  »ä¤Ï¤è¤¯¥×¥í¥°¥é¥à¤¬ºî¤ì¤Ê¤¤¤ó¤Ç¤¹¤¬¡¢´¶³Ð¤È¤·¤Æ¤º¤ì¤òÀ¸¤¸¤Æ¤¤¤ë²Õ½ê¤È¤·¤Æ
»³¤òºî¤é¤»¤ë¿ô»ú¤Ï£²¡Á£±£²¤ÎÈϰϤǤ·¤«¤Ê¤¤¤«¤é¡¢²¼µ­¤ÎÊÕ¤ê¤ÎÄ´À°¤«

¡É
INPUT PROMPT "¹¥¤­¤Ê¿ô»ú¡Ê2¡ÁN:N<=12¡Ë": K
2450
2460 CALL routine2_1(H) !³Æ»³¤ØʬÇÛ¤¹¤ë
2470 SUB routine2_1(C())
2480    FOR x=1 TO N+1
2490       CALL dec(C,1,w) !£±Ë示¤Ä
2500       SELECT CASE MOD(x-1,K)+1 !¤½¤ì¤¾¤ì¤Î»³¤Ø
¡É
¹¥¤­¤Ê»³¤òÁªÂò¤¹¤ë¤È¤­¤Ï¡¢£±¤Ê¤éÆ°¤­¤Ï¤Ê¤¤¤«¤éDATA ¤ÎºÇ½é¤Ï£°¡©
¤¢¤È2920¹Ô¤Ç¤Ï¡¡wlk(K)¢ªwlk(x)?


2870 INPUT PROMPT "¹¥¤­¤Ê»³¤òÁª¤Ö¡Ê1¡ÁK:K<=N,¤¿¤À¤·0¤Ï½ªÎ»¡Ë": x
2880
2890 DIM wlk(N)
2900 DATA 1,1,1,1,-2,1,-1,-3,4,3,2,1 !²ó¼ýÊýË¡¡¡¢¨£±¤Ê¤é±¦¤Ø£±¡¢¡Ý£²¤Ê¤éº¸¤Ø£²¤Î°Õ
2910 MAT READ wlk
2920 LET KEY1=wlk(K) !½ªÃ¼°ÌÃÖ¤òµ­²±¤¹¤ë
2930
2940 DIM yy(0 TO N+1)
2950 CALL routine2_2 !³Æ»³¤«¤é²ó¼ý¤¹¤ë

¤Î¤è¤¦¤Êµ¤¤¬¤·¤Þ¤¹¡£
¤Ç¤â¤É¤³¤¬¤É¤¦Ä¾¤¹¤«¤Ï¤Þ¤Ã¤¿¤¯¤ï¤«¤ê¤Þ¤»¤ó¡£
 

Re: ´¶ÁÛ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î 7Æü(¶â)19»þ21ʬ52ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.59[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

£²²óÌܤΥޥ¸¥Ã¥¯Éôʬ¡ÊNo.58µ­»ö¡Ë¤ÎÀèƬ²Õ½ê¤Î¥³¥á¥ó¥È¤òºï½ü¤·¤Æ¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£
¥¹¥Ú¡¼¥É¡¢¥Ï¡¼¥È¤È¤â¡¢1,2,3,4,5,6,7,8,9,10,11,12¤Ç¥«¡¼¥É¤ÎÆ°¤­¤¬¤ï¤«¤ê¤Þ¤¹¡£
¤³¤ì¤¬¼ÂºÝ¤ÎÆ°¤­¤ÈƱ¤¸¤Ç¤Ê¤¤²Õ½ê¤¬¥×¥í¥°¥é¥à¥ß¥¹¤È¤Ê¤ê¤Þ¤¹¡£

¤ª¼ê¿ô¤Ç¤¹¤¬¡¢³Îǧ¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£



!CALL copy(cS,12,S) !!!!!°ÜÆ°Àè¤ÎÄ´ºº¡¡<----- ¤³¤³
!CALL copy(cS,12,H) !!!!!¡¡<----- ¤³¤³
PRINT

CALL inc(H,99, N+1) !£Ë¡Ê¥­¥ó¥°¡Ë¤òÄì¤ËÄɲ乤ë


PRINT "¡Ê¥Ï¡¼¥È¥Ñ¥±¥Ã¥È¤ò¡Ë¿ô²ó¥«¥Ã¥È¤¹¤ë¡£"
FOR x=1 TO 5
   CALL cut(H,INT(RND*(N+1))+1)
NEXT x

¡Ê°Ê²¼Î¬¡Ë
 

£±£¸¼¡¤Î¥ª¥¤¥é¡¼Êý¿Ø

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î 7Æü(¶â)19»þ31ʬ26ÉÃ
ÊÖ¿®¡¦°úÍÑ
              £±£¸¼¡¤Î¥ª¥¤¥é¡¼Ä¾¸òÊý¿Ø

0X AB T9 W7 Z5 BT 8W 5C 2A Y8 X6 6Z 3Y 92 C3 11 40 74
BY 8X 56 T4 W2 Z0 6T 3W 07 A5 Y3 X1 1Z 4A 7B 99 C8 2C
9Z 6Y 3X 01 TC WA Z8 1T BW 82 50 YB X9 C5 26 44 73 A7
X4 4Z 1Y BX 89 T7 W5 Z3 9T 6W 3A 08 Y6 70 A1 CC 2B 52
Y1 XC CZ 9Y 6X 34 T2 W0 ZB 4T 1W B5 83 28 59 77 A6 0A
3B Y9 X7 7Z 4Y 1X BC TA W8 Z6 CT 9W 60 A3 04 22 51 85
18 B6 Y4 X2 2Z CY 9X 67 T5 W3 Z1 7T 4W 5B 8C AA 09 30
CW 93 61 YC XA AZ 7Y 4X 12 T0 WB Z9 2T 06 37 55 84 B8
AT 7W 4B 19 Y7 X5 5Z 2Y CX 9A T8 W6 Z4 81 B2 00 3C 63
ZC 5T 2W C6 94 Y2 X0 0Z AY 7X 45 T3 W1 39 6A 88 B7 1B
W9 Z7 0T AW 71 4C YA X8 8Z 5Y 2X C0 TB B4 15 33 62 96
T6 W4 Z2 8T 5W 29 C7 Y5 X3 3Z 0Y AX 78 6C 90 BB 1A 41
23 T1 WC ZA 3T 0W A4 72 Y0 XB BZ 8Y 5X 17 48 66 95 C9
80 38 B3 6B 16 91 49 C4 7C 27 A2 5A 05 XX YY ZZ WW TT
7A 25 A0 58 03 8B 36 B1 69 14 9C 47 C2 YT ZX WY TZ XW
57 02 8A 35 B0 68 13 9B 46 C1 79 24 AC ZW WT TX XY YZ
65 10 98 43 CB 76 21 A9 54 0C 87 32 BA WZ TW XT YX ZY
42 CA 75 20 A8 53 0B 86 31 B9 64 1C 97 TY XZ YW ZT WX

£¶¼¡¤Ç¤Ï¹½À®ÉÔ²Äǽ¤Ç¤¢¤ë¤Î¤ËÂФ·¡¢£±£¸¼¡¤â¤ÎÂ礭¤µ¤Ç¤Ï
¤³¤Î¤è¤¦¤Ë¤Ç¤­¤Æ¤·¤Þ¤¦¤³¤È¤Ë£¶¤ÎÉԻ׵Ĥµ¤ò´¶¤¸¤Þ¤¹¡£
£²¼¡¤È£¶¼¡¤À¤±¤Ïºî¤ì¤º¡¢¤½¤ì°Ê³°¤Ç¤Ï²Äǽ¤Ç¤¢¤ë¤³¤È¤¬
¤µ¤é¤ËÉԻ׵ĤǤ¹¡£
 

Re: ´¶ÁÛ

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î 7Æü(¶â)20»þ14ʬ51ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.60[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> £²²óÌܤΥޥ¸¥Ã¥¯Éôʬ¡ÊNo.58µ­»ö¡Ë¤ÎÀèƬ²Õ½ê¤Î¥³¥á¥ó¥È¤òºï½ü¤·¤Æ¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£
> ¥¹¥Ú¡¼¥É¡¢¥Ï¡¼¥È¤È¤â¡¢1,2,3,4,5,6,7,8,9,10,11,12¤Ç¥«¡¼¥É¤ÎÆ°¤­¤¬¤ï¤«¤ê¤Þ¤¹¡£
> ¤³¤ì¤¬¼ÂºÝ¤ÎÆ°¤­¤ÈƱ¤¸¤Ç¤Ê¤¤²Õ½ê¤¬¥×¥í¥°¥é¥à¥ß¥¹¤È¤Ê¤ê¤Þ¤¹¡£



¥¹¥Ú¡¼¥É»¥¤È¥Ï¡¼¥È»¥¤¬µÕ¤Ë¤Ê¤Ã¤¿¾õÂ֤ˤ¢¤ë¤è¤¦¤Êµ¤¤¬¤·¤Þ¤¹¡£
¥Ï¡¼¥È¤ÎK¡Ê£±£³¡Ë¤òÉÕ¤±²Ã¤¨¤ë¤È¤­¤Ë¡¢¤Ê¤Ë¤«¥¹¥Ú¡¼¥É»¥¤ÎÊý¤Ë²Ã¤ï¤Ã¤Æ¤¤¤ë¤è¤¦¤Ë
´¶¤¸¤Þ¤¹¡£
ºÇ½é¤Î»¥¤Î¸ò´¹¤Î¤È¤­¡¢¸µ¡¹¼ê¤Ë¤·¤Æ¤¤¤¿¥¹¥Ú¡¼¥É¥Ñ¥±¥Ã¥È¤¬¡¢·ë²ÌŪ¤Ë¥Ï¡¼¥È¥«¡¼¥É
¤Î½¸¤Þ¤ê¤ËÊѲ½¤·¤Æ¤·¤Þ¤¦¤³¤È¤¬±Æ¶Á¤·¤Æ¤¤¤ë¤Î¤Ç¤·¤ç¤¦¤«¡©
 

ÄɲÃ

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î 7Æü(¶â)20»þ37ʬ36ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.62[¸µµ­»ö¤Ø]

¥Ï¡¼¥È¥«¡¼¥É¤È¤·¤Æ½èÍý¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤ò¥¹¥Ú¡¼¥É¤ËÆɤßÂؤ¨¤Æ¥«¡¼¥É¤ÎʤӤò¤ß¤Æ¤ß¤Þ¤¹¤È¡¢ºÇ¸å ¤ÎK¤ò²Ã¤¨»³¤ò¹½À®¤·¤Æ¡¢½¸¤á¤Æ°ì¤Ä¤Ë¤·¤¿¥Ñ¥±¥Ã¥È¤ÇK¤ò°ìÈÖ²¼¤Ë¥³¥ó¥È¥í¡¼¥ë¤·¤¿¥«¥Ã¥È¤Î¸å¤Î¿ô¤ÎʤӤ¬¡¢K¤À¤±¤Ï£±£³ÈÖÌܤÇÀµ¤·¤¤¤Ç¤¹¤¬¡¢£±¡Á£±£²ÈÖ Ìܤˤ¢¤ë¥«¡¼¥É°ÌÃÖ¤¬¤Þ¤Ã¤¿¤¯µÕ¤Ç£±ÈÖ¤¬£±£²ÈÖÌÜ¡¢£²ÈÖÌܤ¬£±£±ÈÖÌÜ¡¢£³ÈÖ¤¬£±£°ÈÖÌÜ¡¢¡¦¡¦¡¦
¤È¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤Æ¤¤¤ë¤è¤¦¤Ç¤¹¡£
 

Re: ÄɲÃ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î 7Æü(¶â)20»þ53ʬ27ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.63[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¥¹¥Ú¡¼¥É»¥¤È¥Ï¡¼¥È»¥¤¬µÕ¤Ë¤Ê¤Ã¤¿¾õÂ֤ˤ¢¤ë¤è¤¦¤Êµ¤¤¬¤·¤Þ¤¹¡£
> ¥Ï¡¼¥È¤ÎK¡Ê£±£³¡Ë¤òÉÕ¤±²Ã¤¨¤ë¤È¤­¤Ë¡¢¤Ê¤Ë¤«¥¹¥Ú¡¼¥É»¥¤ÎÊý¤Ë²Ã¤ï¤Ã¤Æ¤¤¤ë¤è¤¦¤Ë
> ´¶¤¸¤Þ¤¹¡£
> ºÇ½é¤Î»¥¤Î¸ò´¹¤Î¤È¤­¡¢¸µ¡¹¼ê¤Ë¤·¤Æ¤¤¤¿¥¹¥Ú¡¼¥É¥Ñ¥±¥Ã¥È¤¬¡¢·ë²ÌŪ¤Ë¥Ï¡¼¥È¥«¡¼¥É

¤Ï¤¤¡¢¤½¤¦¤Ç¤¹¡£
¥¹¥Ú¡¼¥É¡¢¥Ï¡¼¥È¥Ñ¥±¥Ã¥È¤ÏÏÀÍýŪ¤Ê̾¤Þ¤¨¤È¤·¤Æ°·¤Ã¤Æ¤¯¤À¤µ¤¤¡£
¡ÊÊ̤ˤɤÁ¤é¤½¤¦¤À¤È¸À¤¦É¬ÍפϤʤ¤¤Ï¤º¤Ç¤¹¡£¸ß¤¤¤Ë»²¾È¤µ¤ì¹ç¤Ã¤Æ¤¤¤Þ¤¹¤«¤é¡Ë
¼ÂºÝ¤ÎÁàºî¤Ï¡¢¥«¡¼¥É¤Ç¤Î¥Þ¡¼¥¯¤Ç½èÍý¤¹¤ë¤Î¤Ç¤¹¤Í¡©
³«»Ï¤¹¤ëÁ°¤ËSWAP¤µ¤ì¤ì¤Ð¤¤¤¤¤À¤±¤Ç¤¹¤Î¤Ç¡¢¥×¥í¥°¥é¥à¤Ïľ¤·¤Þ¤¹¡£


> ¥Ï¡¼¥È¥«¡¼¥É¤È¤·¤Æ½èÍý¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤ò¥¹¥Ú¡¼¥É¤ËÆɤßÂؤ¨¤Æ¥«¡¼¥É¤ÎʤӤò¤ß¤Æ¤ß¤Þ¤¹¤È¡¢ºÇ¸å¤ÎK¤ò²Ã¤¨»³¤ò¹½À®¤·¤Æ¡¢½¸¤á¤Æ°ì¤Ä¤Ë¤·¤¿¥Ñ¥±¥Ã¥È¤ÇK¤ò °ìÈÖ²¼¤Ë¥³¥ó¥È¥í¡¼¥ë¤·¤¿¥«¥Ã¥È¤Î¸å¤Î¿ô¤ÎʤӤ¬¡¢K¤À¤±¤Ï£±£³ÈÖÌܤÇÀµ¤·¤¤¤Ç¤¹¤¬¡¢£±¡Á£±£²ÈÖÌܤˤ¢¤ë¥«¡¼¥É°ÌÃÖ¤¬¤Þ¤Ã¤¿¤¯µÕ¤Ç£±ÈÖ¤¬£±£²ÈÖÌÜ¡¢£²ÈÖÌÜ ¤¬£±£±ÈÖÌÜ¡¢£³ÈÖ¤¬£±£°ÈÖÌÜ¡¢¡¦¡¦¡¦
> ¤È¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤Æ¤¤¤ë¤è¤¦¤Ç¤¹¡£


¶ñÂÎŪ¤Ë¡Ö¹¥¤­¤Ê¿ô¡×¡ÖÁªÂò¤·¤¿»³¤ÎÈÖ¹æ¡×¤Ê¤É¤ò¶µ¤¨¤Æ¤¯¤À¤µ¤¤¡£
Á°½Ð¤Î¡Ö£±£³¤Î¥Æ¡¼¥Ö¥ë¡×¤Î¿ô¤À¤±Ê¤ÓÂؤ¨¤¬µ¯¤³¤ê¤Þ¤¹¤Î¤Ç¡¢¶èÊ̤¹¤ë¤¿¤á¤Ë¡£

¤½¤ì¤¬¼ÂºÝ¤Î¥«¡¼¥É¤Ç¤ÎÆ°¤­¤È°ã¤¤¤¬¤¢¤ê¤Þ¤¹¤«¡©
 

ÅÀ¸¡

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î 7Æü(¶â)22»þ18ʬ20ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ºÇ½é¤ÎÃʳ¬¤ÎµÒ¤ÎÁª¤ó¤À¿ô¤ò£µ
¸åȾ¤Ç¤Î¹¥¤­¤Ê¿ô¤ò£³
¤È¤·¤Æ¥«¡¼¥É¤¬ÇÛ¤é¤ì¤Æ¤¤¤¯»³¤Î½ç½ø¤ò¸«¤¿¤é¡¢£±¡¤£²¡¤£³¡¤£±¡¤£²¡¤£³¤È¥«¡¼¥É¤òÇÛ¤é¤Í¤Ð¤Ê¤é¤Ì¤È¤³¤í¤ò¡¢£±¡¤£³¡¤£²¡¤£±¡¤£³¡¤£²¡¦¡¦¡¦¤ÈÇÛ¤é¤ì¤Æ¤¤¤Ã¤Æ¤¤¤ë¤è¤¦¤ÊÍͻҤǤ¹¡£
¤¿¤Ö¤ó¤³¤Î½ç½ø¤Ï¥«¡¼¥É¤òÇۤ꽪¤ï¤Ã¤¿¤È¤­¡¢»³¤ò²ó¼ý¤·¤Æ¤¤¤¯½ç½ø¤È»×¤ï¤ì¤Þ¤¹¡£
 

ÄɲÃ

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î 7Æü(¶â)22»þ47ʬ46ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¤½¤·¤Æ»³¤Ë¤Ê¤Ã¤¿¥«¡¼¥É¤ò½Å¤Í¤ë¤È¤­¡¢»³¤Î¥«¡¼¥É¤ò¤º¤é¤·¤¿°ÌÃ֤λ³¤Î¾å¤Ë½Å¤Í¤ë¤È¤³¤í¤¬¡¢»³¤Î²¼¤Ë¤Ê¤Ã¤Æ½Å¤Ê¤Ã¤Æ¤¤¤¯½ç½ø¤Ë¸«¤¨¤Þ¤¹¡£¡Ê²èÌ̤ǥ«¡¼¥É¤Î¿ô»ú¤ÎʤӤòº¸¤«¤é½ç¤Ë¸«¤ë¤È¤­¡¢Î¢¸þ¤­¤Ë¤·¤Æ¾å¤Ë¤Ê¤ë½çÈ֤Ȥ·¤Æ²ò¼á¤·¤Æ¸«¤Æ¤¤¤Þ¤¹¡£¡Ë  

Re: ÅÀ¸¡

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î 7Æü(¶â)22»þ53ʬ41ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.65[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ºÇ½é¤ÎÃʳ¬¤ÎµÒ¤ÎÁª¤ó¤À¿ô¤ò£µ
> ¸åȾ¤Ç¤Î¹¥¤­¤Ê¿ô¤ò£³


¥³¥á¥ó¥È¤Ï̵¸ú¤·¤Æ¡¢º£·ÇºÜ¤·¤Æ¤¤¤ë¥×¥í¥°¥é¥à¤Ç¼Â¹Ô¤·¤Æ¤ß¤Þ¤·¤¿¡£
¡¡3050 CALL copy(cS,12, S) !!!!!°ÜÆ°Àè¤ÎÄ´ºº¡¡<-----¤³¤³
¡¡3060 CALL copy(cS,12, H) !!!!!¡¡<-----¤³¤³

¥È¥ì¡¼¥¹¤Î¤É¤³¤«¶ñÂÎŪ¤Ë»ØŦ¤·¤Æ¤¯¤À¤µ¤¤¡£
¥¹¥Ú¡¼¥É( 12 Ëç) 1  2  3  4  5  6  7  8  9  10  11  12
¥Ï¡¼¥È( 12 Ëç) 27  28  29  30  31  32  33  34  35  36  37  38
»³£±( 0 Ëç)
»³£²( 0 Ëç)
¼Î¤Æ¾ì( 0 Ëç)

¹¥¤­¤Ê¿ô»ú(1¡ÁN)¡©5¡¡<-----¢¨

¥¹¥Ú¡¼¥É( 12 Ëç) 30  31  34  32  27  35  29  33  38  28  37  36
¥Ï¡¼¥È( 12 Ëç) 5  10  7  1  2  4  8  3  6  12  11  9
»³£±( 0 Ëç)
»³£²( 0 Ëç)
¼Î¤Æ¾ì( 0 Ëç)

¥«¡¼¥É¤Î¥Þ¡¼¥¯(S,H)¡©s¡¡<-----¢¨
¿ô»ú(1¡ÁN)¡©3¡¡<-----¢¨
S 3

¡Ê¥Ï¡¼¥È¥Ñ¥±¥Ã¥È¤ò¡Ë¿ô²ó¥«¥Ã¥È¤¹¤ë¡£
¥¹¥Ú¡¼¥É( 12 Ëç) 1  2  3  4  5  6  7  8  9  10  11  12
¥Ï¡¼¥È( 13 Ëç) 8  9  10  11  12  13  1  2  3  4  5  6  7
»³£±( 0 Ëç)
»³£²( 0 Ëç)
»³£³( 0 Ëç)
»³£´( 0 Ëç)
»³£µ( 0 Ëç)
»³£¶( 0 Ëç)
»³£·( 0 Ëç)
»³£¸( 0 Ëç)
»³£¹( 0 Ëç)
»³10( 0 Ëç)
»³11( 0 Ëç)
»³12( 0 Ëç)

¹¥¤­¤Ê¿ô»ú¡Ê2¡Á12¡Ë3¡¡<-----¢¨
¥¹¥Ú¡¼¥É( 12 Ëç) 1  2  3  4  5  6  7  8  9  10  11  12
¥Ï¡¼¥È( 0 Ëç)
»³£±( 5 Ëç) 7  4  1  11  8 ¡¡<-----¢¨¤³¤³¤¬¤ª¤«¤·¤¤¤Î¤Ç¤¹¤«¡ª¡©
»³£²( 4 Ëç) 5  2  12  9
»³£³( 4 Ëç) 6  3  13  10
»³£´( 0 Ëç)
»³£µ( 0 Ëç)
»³£¶( 0 Ëç)
»³£·( 0 Ëç)
»³£¸( 0 Ëç)
»³£¹( 0 Ëç)
»³10( 0 Ëç)
»³11( 0 Ëç)
»³12( 0 Ëç)

±¦¤«¤é 1 ÈÖÌܤ˺Ǹå¤Î¥«¡¼¥É¤òÃÖ¤­¤Þ¤·¤¿¡£

¹¥¤­¤Ê»³¤òÁª¤Ö¡Ê1¡ÁK¡Ë2
»³ 2 ¤«¤é²ó¼ý¤·¤¿¥«¡¼¥É( 4 Ëç) 5  2  12  9
»³ 3 ¤Ë½Å¤Í¤Þ¤¹¡£
¥¹¥Ú¡¼¥É( 12 Ëç) 1  2  3  4  5  6  7  8  9  10  11  12
¥Ï¡¼¥È( 0 Ëç)
»³£±( 5 Ëç) 7  4  1  11  8
»³£²( 0 Ëç)
»³£³( 8 Ëç) 5  2  12  9  6  3  13  10
»³£´( 0 Ëç)
»³£µ( 0 Ëç)
»³£¶( 0 Ëç)
»³£·( 0 Ëç)
»³£¸( 0 Ëç)
»³£¹( 0 Ëç)
»³10( 0 Ëç)
»³11( 0 Ëç)
»³12( 0 Ëç)

»³ 3 ¤«¤é²ó¼ý¤·¤¿¥«¡¼¥É( 8 Ëç) 5  2  12  9  6  3  13  10
»³ 4 ¤Ë½Å¤Í¤Þ¤¹¡£
¥¹¥Ú¡¼¥É( 12 Ëç) 1  2  3  4  5  6  7  8  9  10  11  12
¥Ï¡¼¥È( 0 Ëç)
»³£±( 13 Ëç) 5  2  12  9  6  3  13  10  7  4  1  11  8
»³£²( 0 Ëç)
»³£³( 0 Ëç)
»³£´( 0 Ëç)
»³£µ( 0 Ëç)
»³£¶( 0 Ëç)
»³£·( 0 Ëç)
»³£¸( 0 Ëç)
»³£¹( 0 Ëç)
»³10( 0 Ëç)
»³11( 0 Ëç)
»³12( 0 Ëç)

¡Ê²ó¼ý¤·¤¿¥Ï¡¼¥È¥Ñ¥±¥Ã¥È¤ò¡Ë¿ô²ó¥«¥Ã¥È¤¹¤ë¡£
( 13 Ëç) 8  5  2  12  9  6  3  13  10  7  4  1  11
£Ë¡Ê¥­¥ó¥°¡Ë¤òÄì¤Ø°ÜÆ°¤µ¤»¤ë¤¿¤á¤ËÄ´À°¥«¥Ã¥È¤¹¤ë¡£
( 13 Ëç) 10  7  4  1  11  8  5  2  12  9  6  3  13
¥¹¥Ú¡¼¥É( 12 Ëç) 1  2  3  4  5  6  7  8  9  10  11  12
¥Ï¡¼¥È( 13 Ëç) 10  7  4  1  11  8  5  2  12  9  6  3  13
»³£±( 0 Ëç)
»³£²( 0 Ëç)
»³£³( 0 Ëç)
»³£´( 0 Ëç)
»³£µ( 0 Ëç)
»³£¶( 0 Ëç)
»³£·( 0 Ëç)
»³£¸( 0 Ëç)
»³£¹( 0 Ëç)
»³10( 0 Ëç)
»³11( 0 Ëç)
»³12( 0 Ëç)

 10 ¤Î°ÌÃ֤ˡ֣±¡×¤Î¥«¡¼¥É¤¬¤¯¤ë¤è¤¦¤Ë¡Ê¥¹¥Ú¡¼¥É¥Ñ¥±¥Ã¥È¤ò¡Ë¥«¥Ã¥È¤¹¤ë¡£
¸½ºß¤Î°ÌÃÖ 1
¥¹¥Ú¡¼¥É( 12 Ëç) 4  5  6  7  8  9  10  11  12  1  2  3
¥Ï¡¼¥È( 13 Ëç) 10  7  4  1  11  8  5  2  12  9  6  3  13
»³£±( 0 Ëç)
»³£²( 0 Ëç)
»³£³( 0 Ëç)
»³£´( 0 Ëç)
»³£µ( 0 Ëç)
»³£¶( 0 Ëç)
»³£·( 0 Ëç)
»³£¸( 0 Ëç)
»³£¹( 0 Ëç)
»³10( 0 Ëç)
»³11( 0 Ëç)
»³12( 0 Ëç)

¥«¡¼¥É¤Î¥Þ¡¼¥¯(S,H)¡©s
¿ô»ú(1¡ÁN)¡©5
S 2
 

¿·È¯¸«

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î 7Æü(¶â)23»þ35ʬ17ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ºÇ½é¤ÎÃʳ¬¤ÎµÒ¤Î¿ô»ú¤ò£µ¤È¤·¤Æ¡¢¥Ï¡¼¥È¤È¥¹¥Ú¡¼¥É¤Î¥Ñ¥±¥Ã¥È¤Î¹½À®¤ò¤·¤Æ¤ß¤ë¤È
¥Ï¡¼¥È¡§£´,£µ,£¸,£¶,£±¡¤£¹¡¤£³¡¤£·¡¤£±£²¡¤£²¡¤£±£±¡¤£±£°
¥¹¥Ú¡¼¥É¡§£µ,£±£°,£·,£±,£²¡¤£´¡¤£¸¡¤£³¡¤£¶¡¤£±£²¡¤£±£±¡¤£¹
¤È¤Ê¤ê¤Þ¤¹¡£¡Ê¿ô»ú¤Ïº¸¤è¤ê΢¸þ¤­¤Ç½Å¤Í¤¿¤È¤­¾å¤«¤é¤Î½çÈ֤Ǥ¹¡£¡Ë
¤³¤³¤ÇÌÌÇò¤¤¤³¤È¤Ëµ¤¤¬¤Ä¤­¤Þ¤·¤¿¡£
¥Ï¡¼¥È¤Î¥Ü¥È¥à¤ËK¤òÄɲ䷤ơ¢Å¬Åö¤Ë¿ô²ó¥«¥Ã¥È¸å
µÒ¤Î¿ô»ú¤ò£³¤È¤·¤Æ¡¢£³¤Ä¤Î»³¤ËÇÛ¤ê¡Ê¥Ñ¥±¥Ã¥È¤Ïɽ¸þ¤­¤Ë»ý¤Ã¤ÆÇۤ뤳¤È¤Ë¤Ê¤ë¡Ë
»ØÄꤹ¤ë»³¤ò£²¤È¤·¤Æ¡¢²ó¼ý¤·¤Æ¡¢ºÇ¸å¤Î¥«¥Ã¥È¤ÇK¤ò¥Ü¥È¥à¤ËÇÛÃÖ¤¹¤ë¤È
¥Ï¡¼¥È¡§£²,£³,£¶,£´,£±£±¡¤£·¡¤£±¡¤£µ¡¤£±£°¡¤£±£²¡¤£¹¡¤£¸¡¤£±£³
A¤ÎÄ´À°¤Ç¥¹¥Ú¡¼¥É¥Ñ¥±¥Ã¥È¤Î¥«¥Ã¥È¡ÊA¤ò£²ËçÌܤ˻ý¤Ã¤ÆÍè¤ë¡Ë¸å¤Ï
¥¹¥Ú¡¼¥É¡§£·,£±,£²,£´,£¸¡¤£³¡¤£¶¡¤£±£²¡¤£±£±¡¤£¹¡¤£µ¡¤£±£°
¤ÎÇÛÎó¤ò¤Ê¤·¤Æ¡¢¤ª¸ß¤¤¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬Âбþ¤¹¤ë¡£
¤·¤«¤·¡¢
¥¹¥Ú¡¼¥É¤ÎÇÛÎó¤ÎºÇ¸å¤ËK¤ò²Ã¤¨¡¢Æ±¤¸Íͤ˿ôÅ٤Υ«¥Ã¥È¸å
£³¤Ä¤Î»³¤ò¤Ä¤¯¤ê¡¢£²¤Î»³¤«¤é²ó¼ý¤ò»Ï¤á°ì¤Ä¤Ë¤Þ¤È¤á¡¢K¤ò¥Ü¥È¥à¤Ç¥«¥Ã¥È¤¹¤ë¤È
¥¹¥Ú¡¼¥É¡§£±£²,£¸,£±,£µ,£±£±¡¤£³¡¤£²¡¤£±£°¡¤£¹¡¤£¶¡¤£´¡¤£·¡¤£±£³
¤³¤ì¤Ë¹ç¤ï¤»¤Æ¥Ï¡¼¥È¥Ñ¥±¥Ã¥È¤òA¤¬£±£²ËçÌܤˤʤë¤è¤¦¤Ë¥«¥Ã¥È¤·¤Æ¤ä¤ë¤È
¥Ï¡¼¥È¡§£¹,£³,£·,£±£²¡¤£²¡¤£±£±¡¤£±£°¡¤£´¡¤£µ¡¤£¸¡¤£¶¡¤£±
¤Ç¤³¤ì¤Ï¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ë¤Ï¤Ê¤ó¤Î´Ø·¸¤âÊݸ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£¡ÊÉԻ׵ġª¡ª¡ª¡Ë

¤¹¤Ê¤ï¤Á¡¢Áê¸ßƱÃͤ˸«¤¨¤Æ¼Â¤Ï¤Þ¤Ã¤¿¤¯°Û¤Ê¤ë¹½Â¤¤Ç¤¢¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£
Äɲ乤٤­¤Ï¥Ï¡¼¥È¤ÎK¤Ç¤¢¤ê¡¢¤³¤Î¤³¤È¤¬º®Í𤷤Ƥ¤¤ë¸¶°ø¤È»×¤¤¤Þ¤¹¡£
 

Re: ÅÀ¸¡

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î 8Æü(ÅÚ)00»þ14ʬ26ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.67[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£
>
> > ºÇ½é¤ÎÃʳ¬¤ÎµÒ¤ÎÁª¤ó¤À¿ô¤ò£µ
> > ¸åȾ¤Ç¤Î¹¥¤­¤Ê¿ô¤ò£³
>
>
> ¥³¥á¥ó¥È¤Ï̵¸ú¤·¤Æ¡¢º£·ÇºÜ¤·¤Æ¤¤¤ë¥×¥í¥°¥é¥à¤Ç¼Â¹Ô¤·¤Æ¤ß¤Þ¤·¤¿¡£
> ¡¡3050 CALL copy(cS,12, S) !!!!!°ÜÆ°Àè¤ÎÄ´ºº¡¡<-----¤³¤³
> ¡¡3060 CALL copy(cS,12, H) !!!!!¡¡<-----¤³¤³
>
> ¥È¥ì¡¼¥¹¤Î¤É¤³¤«¶ñÂÎŪ¤Ë»ØŦ¤·¤Æ¤¯¤À¤µ¤¤¡£
>
> <PRE>
> ¥¹¥Ú¡¼¥É( 12 Ëç) 1  2  3  4  5  6  7  8  9  10  11  12
> ¥Ï¡¼¥È( 12 Ëç) 27  28  29  30  31  32  33  34  35  36  37  38
> »³£±( 0 Ëç)
> »³£²( 0 Ëç)
> ¼Î¤Æ¾ì( 0 Ëç)
>
> ¹¥¤­¤Ê¿ô»ú(1¡ÁN)¡©5¡¡<-----¢¨
>
> ¥¹¥Ú¡¼¥É( 12 Ëç) 30  31  34  32  27  35  29  33  38  28  37  36
> ¥Ï¡¼¥È( 12 Ëç) 5  10  7  1  2  4  8  3  6  12  11  9
> »³£±( 0 Ëç)
> »³£²( 0 Ëç)¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ö¥Ï¡¼¥È¥Ñ¥±¥Ã¥È¤Î¿ô»ú¤ÎʤÓ
> ¼Î¤Æ¾ì( 0 Ëç)¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡        ¡¡4,5,8,6,1,9,3,7,12,2,11,10
>                                       ¤³¤³¤Ç¤Ï¥¹¥Ú¡¼¥É¤Î30,31,34,¡¦¡¦¤Ç¥È¥ì¡¼¥¹
> ¥«¡¼¥É¤Î¥Þ¡¼¥¯(S,H)¡©s¡¡<-----¢¨¡¡¡¡¡¡¡¡¡ö¥¹¥Ú¡¼¥É¥Ñ¥±¥Ã¥È¤Î¿ô»ú¤ÎʤÓ
> ¿ô»ú(1¡ÁN)¡©3¡¡<-----¢¨¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡5,10,7,1,2,4,8,3,6,12,11,9
> S 3                                 ¤³¤³¤Ç¤Ï¥Ï¡¼¥È¤ÎÎó¤È¤·¤Æ¥È¥ì¡¼¥¹¤µ¤ì¤Æ¤¤¤ë
>
> ¡Ê¥Ï¡¼¥È¥Ñ¥±¥Ã¥È¤ò¡Ë¿ô²ó¥«¥Ã¥È¤¹¤ë¡£
> ¥¹¥Ú¡¼¥É( 12 Ëç) 1  2  3  4  5  6  7  8  9  10  11  12
> ¥Ï¡¼¥È( 13 Ëç) 8  9  10  11  12  13  1  2  3  4  5  6  7
> »³£±( 0 Ëç)¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ö¤³¤³¤Ï¥«¡¼¥É¤¬1,2,3,¡¦¡¦¤È½ç½ø¤è¤¯¤Ê¤Ã¤Æ¤¤¤Þ
> »³£²( 0 Ëç)¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¤¹¤¬¡¢¤µ¤­¤Î¥«¡¼¥É¤Î½çÈ֤dz¤­¤ò¤ä¤ë¤³¤È¤Ë
> »³£³( 0 Ëç)¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¤Ê¤ê¤Þ¤¹¡£
> »³£´( 0 Ëç)
> »³£µ( 0 Ëç)
> »³£¶( 0 Ëç)
> »³£·( 0 Ëç)
> »³£¸( 0 Ëç)
> »³£¹( 0 Ëç)
> »³10( 0 Ëç)
> »³11( 0 Ëç)
> »³12( 0 Ëç)
>
> ¹¥¤­¤Ê¿ô»ú¡Ê2¡Á12¡Ë3¡¡<-----¢¨
> ¥¹¥Ú¡¼¥É( 12 Ëç) 1  2  3  4  5  6  7  8  9  10  11  12
> ¥Ï¡¼¥È( 0 Ëç)
> »³£±( 5 Ëç) 7  4  1  11  8 ¡¡<-----¢¨¤³¤³¤¬¤ª¤«¤·¤¤¤Î¤Ç¤¹¤«¡ª¡©
> »³£²( 4 Ëç) 5  2  12  9¡¡¡¡¡¡¡¡¡¡É½¸þ¤­¤ÇÇÛ¤ê¤Þ¤¹¤«¤é¡¢»³£±¡¤£²¡¤£³¤Ë¤Ï
> »³£³( 4 Ëç) 6  3  13  10¡¡¡¡¡¡¡¡¡¡7,6,5,¡¦¡¦¡¦¤È¥«¡¼¥É¤¬Æþ¤ë¤È»×¤¤¤Þ¤¹¡£
> »³£´( 0 Ëç)
> »³£µ( 0 Ëç)
> »³£¶( 0 Ëç)
> »³£·( 0 Ëç)
> »³£¸( 0 Ëç)
> »³£¹( 0 Ëç)
> »³10( 0 Ëç)
> »³11( 0 Ëç)
> »³12( 0 Ëç)
>
> ±¦¤«¤é 1 ÈÖÌܤ˺Ǹå¤Î¥«¡¼¥É¤òÃÖ¤­¤Þ¤·¤¿¡£
>
> ¹¥¤­¤Ê»³¤òÁª¤Ö¡Ê1¡ÁK¡Ë2
> »³ 2 ¤«¤é²ó¼ý¤·¤¿¥«¡¼¥É( 4 Ëç) 5  2  12  9
> »³ 3 ¤Ë½Å¤Í¤Þ¤¹¡£
> ¥¹¥Ú¡¼¥É( 12 Ëç) 1  2  3  4  5  6  7  8  9  10  11  12
> ¥Ï¡¼¥È( 0 Ëç)
> »³£±( 5 Ëç) 7  4  1  11  8
> »³£²( 0 Ëç)
> »³£³( 8 Ëç) 5  2  12  9  6  3  13  10¡¡¡¡¡¡¡ö»³¤ò¾å¤Ë½Å¤Í¤Þ¤¹¤«¤é¤³¤³¤Ï
> »³£´( 0 Ëç)¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡6,3,13,10,5,2,12,9
> »³£µ( 0 Ëç)                                 ¤Î½ç½ø¤Ë¤Ê¤ë¤È»×¤¤¤Þ¤¹¡£
> »³£¶( 0 Ëç)
> »³£·( 0 Ëç)
> »³£¸( 0 Ëç)
> »³£¹( 0 Ëç)
> »³10( 0 Ëç)
> »³11( 0 Ëç)
> »³12( 0 Ëç)
>
> »³ 3 ¤«¤é²ó¼ý¤·¤¿¥«¡¼¥É( 8 Ëç) 5  2  12  9  6  3  13  10
> »³ 4 ¤Ë½Å¤Í¤Þ¤¹¡£
> ¥¹¥Ú¡¼¥É( 12 Ëç) 1  2  3  4  5  6  7  8  9  10  11  12
> ¥Ï¡¼¥È( 0 Ëç)
> »³£±( 13 Ëç) 5  2  12  9  6  3  13  10  7  4  1  11  8 ¡¡¡öƱÍͤˤ³¤³¤â¤½¤¦¤Ç¤¹
> »³£²( 0 Ëç)
> »³£³( 0 Ëç)
> »³£´( 0 Ëç)
> »³£µ( 0 Ëç)
> »³£¶( 0 Ëç)
> »³£·( 0 Ëç)
> »³£¸( 0 Ëç)
> »³£¹( 0 Ëç)
> »³10( 0 Ëç)
> »³11( 0 Ëç)
> »³12( 0 Ëç)
>
> ¡Ê²ó¼ý¤·¤¿¥Ï¡¼¥È¥Ñ¥±¥Ã¥È¤ò¡Ë¿ô²ó¥«¥Ã¥È¤¹¤ë¡£
> ( 13 Ëç) 8  5  2  12  9  6  3  13  10  7  4  1  11
> £Ë¡Ê¥­¥ó¥°¡Ë¤òÄì¤Ø°ÜÆ°¤µ¤»¤ë¤¿¤á¤ËÄ´À°¥«¥Ã¥È¤¹¤ë¡£
> ( 13 Ëç) 10  7  4  1  11  8  5  2  12  9  6  3  13
> ¥¹¥Ú¡¼¥É( 12 Ëç) 1  2  3  4  5  6  7  8  9  10  11  12
> ¥Ï¡¼¥È( 13 Ëç) 10  7  4  1  11  8  5  2  12  9  6  3  13
> »³£±( 0 Ëç)
> »³£²( 0 Ëç)
> »³£³( 0 Ëç)
> »³£´( 0 Ëç)
> »³£µ( 0 Ëç)
> »³£¶( 0 Ëç)
> »³£·( 0 Ëç)
> »³£¸( 0 Ëç)
> »³£¹( 0 Ëç)
> »³10( 0 Ëç)
> »³11( 0 Ëç)
> »³12( 0 Ëç)
>
>  10 ¤Î°ÌÃ֤ˡ֣±¡×¤Î¥«¡¼¥É¤¬¤¯¤ë¤è¤¦¤Ë¡Ê¥¹¥Ú¡¼¥É¥Ñ¥±¥Ã¥È¤ò¡Ë¥«¥Ã¥È¤¹¤ë¡£
> ¸½ºß¤Î°ÌÃÖ 1
> ¥¹¥Ú¡¼¥É( 12 Ëç) 4  5  6  7  8  9  10  11  12  1  2  3
> ¥Ï¡¼¥È( 13 Ëç) 10  7  4  1  11  8  5  2  12  9  6  3  13
> »³£±( 0 Ëç)
> »³£²( 0 Ëç)
> »³£³( 0 Ëç)
> »³£´( 0 Ëç)
> »³£µ( 0 Ëç)
> »³£¶( 0 Ëç)
> »³£·( 0 Ëç)
> »³£¸( 0 Ëç)
> »³£¹( 0 Ëç)
> »³10( 0 Ëç)
> »³11( 0 Ëç)
> »³12( 0 Ëç)
>
> ¥«¡¼¥É¤Î¥Þ¡¼¥¯(S,H)¡©s
> ¿ô»ú(1¡ÁN)¡©5
> S 2
> </PRE>
 

Re: ÅÀ¸¡

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î 8Æü(ÅÚ)08»þ04ʬ0ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.69[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¤ª¼ê¿ô¤ª¤«¤±¤·¤Þ¤·¤¿¡£¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
 

Re: ¿·È¯¸«

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î 8Æü(ÅÚ)11»þ49ʬ44ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.68[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¥Ï¡¼¥È¤Î£Ë¡Ê¥­¥ó¥°¡Ë¤Ë¤è¤ë¥·¥ã¥Ã¥Õ¥ë¤ò¤¹¤Ù¤ÆÄ´¤Ù¤Æ¸«¤Þ¤·¤¿¡£
¤¹¤Ù¤Æ´Ø·¸À­¤ÏÊݤ¿¤ì¤ë¤è¤¦¤Ç¤¹¡£

·ë²Ì¤«¤é¡Ö£±£³¤Ç¤Î¥·¥ã¥Ã¥Õ¥ë¡×¤È¡Ö¤½¤Î¥«¥Ã¥È¡×¡Ê¤½¤¦¸Æ¤Ö¤³¤È¤Ë¤·¤Þ¤¹¡Ë¤Î´Ø·¸À­¤Ï
³Îǧ¤Ç¤­¤Þ¤¹¤¬¡¢¿ôÍýŪ¤Ë¤Ï¤¦¤Þ¤¯ÀâÌÀ¤Ç¤­¤Þ¤»¤ó¡£¡Ê¹çƱ¼°¤«¤Ê¡©¡Ë

¤Þ¤¿¥¹¥Ú¡¼¥É¤ÎÊý¤â³Îǧ¤Ï¤Ç¤­¤Þ¤¹¡£

!ÃÖ´¹¡ÊPermutation¡Ë¤Î·×»»
!¢¨µ»½Ñ¥á¥â
!¡¡A=¨£ 1 2 3 4 ¨¤=(1 2 4 3)¡¡¢¨£±¹ÔÌܤνçÈ֤ϸÇÄê¤È¤¹¤ë
!¡¡¡¡¨¦ 2 4 1 3 ¨¥
!¤Î¾ì¹ç¡¢
!¡¡DATA 2,4,1,3 !ÇÛÎóÊÑ¿ô¤Î¡Öź¤¨»ú¤ÈÃ͡פËÂбþ¤µ¤»¤ë
!¡¡MAT READ A
!¤È¥×¥í¥°¥é¥à¤Ç¤Ïµ­½Ò¤¹¤ë¡£

SUB PermPrintOut(A()) !ɽ¼¨¤¹¤ë¡¡¢¨É¸½à·Á¡Ê£²¹Ô£îÎó¤Î¹ÔÎóɽµ­¤¹¤ë¡Ë
   MAT PRINT USING(REPEAT$(" ##",UBOUND(A))): A;
   PRINT
END SUB
SUB PermIdentity(A()) !¹±ÅùÃÖ´¹
   FOR i=1 TO UBOUND(A)
      LET  A(i)=i
   NEXT i
END SUB
SUB PermInverse(A(), iA()) !µÕÃÖ´¹¡¡¢¨iA¤ÏA°Ê³°¤ÎÇÛÎó¤ò»ØÄꤹ¤ë¤³¤È
   FOR i=1 TO UBOUND(A)
      LET  iA(A(i))=i
   NEXT i
END SUB
SUB PermMultiply(A(),B(), AB()) !ÀÑAB¡¡¢¨AB¤ÏA¤«¤ÄB°Ê³°¤ÎÇÛÎó¤ò»ØÄꤹ¤ë¤³¤È
   LET  ua=UBOUND(A)
   LET  ub=UBOUND(B)
   IF ua=ub THEN
      FOR i=1 TO ua
         LET  AB(i)=A(B(i)) !¢¨¹çÀ®¼ÌÁü(AB)(i)=A(B(i))
      NEXT i
   ELSE
      PRINT "¼¡¸µ¤¬°ã¤¤¤Þ¤¹¡£A=";ua;" B=";ub
      STOP
   END IF
END SUB

SUB PermReverse(A()) !ʤӽç¤òȿž¤µ¤»¤ë
   LET  ua=UBOUND(A)
   FOR i=1 TO INT(ua/2)
      swap A(i),A(ua-i+1)
   NEXT i
END SUB
!-------------------- ¤³¤³¤Þ¤Ç¤¬¥µ¥Ö¥ë¡¼¥Á¥ó



!main

LET N=12 !¢¨¸ÇÄê

DIM cc(N)
SUB check(SS(),HH()) !»²¾È¤ò³Îǧ¤¹¤ë¡¡¢¨¶¦¤ËÏ¢ÈÖ¤Çɽ¼¨¤µ¤ì¤ì¤Ð£Ï£Ë
   PRINT "check!"
   CALL PermMultiply(HH,SS,cc) !AB=BA=I¡¡¢¨¹±ÅùÃÖ´¹
   CALL PermPrintOut(cc)

   CALL PermMultiply(SS,HH,cc)
   CALL PermPrintOut(cc)
END SUB


DIM Rev(N) !ȿž¤ËÁêÅö¤¹¤ëÃÖ´¹
CALL PermIdentity(Rev)
CALL PermReverse(Rev)

DIM shuffle(N) !¥ê¥Õ¥ë¥·¥ã¥Ã¥Õ¥ë¤ËÁêÅö¤¹¤ëÃÖ´¹
DATA 2,4,6,8,10,12,1,3,5,7,9,11
MAT READ shuffle


DIM H(N),S(N) !¥Ï¡¼¥È¡¢¥¹¥Ú¡¼¥É¤Î«

FOR R1=1 TO N !Á°È¾¤Î¥Þ¥¸¥Ã¥¯¤Ç¤Î¡Ö¹¥¤­¤Ê¿ô¡×

   PRINT "----- Request";R1;"¤Î¾ì¹ç-----"

   !¡ü¥¹¥Ú¡¼¥É¤ò¥·¥ã¥Ã¥Õ¥ë¤¹¤ë
   DIM B(N),c(N)
   CALL PermIdentity(B) !½é´üÃÍ
   FOR k=1 TO 12 !²ó¿ô¡¡¢¨²¿²ó¤«¼Â¹Ô¤¹¤ë¤È¸µ¤ËÌá¤ë
      LET S(k)=B(R1)
      CALL PermMultiply(B,shuffle,c)
      MAT B=c
   NEXT k
   CALL PermInverse(S,H) !SH=HS=I¤è¤ê

   DIM RH(N)
   CALL PermMultiply(H,Rev,RH) !¥Ï¡¼¥È¤ò£Ë¡Ê¥­¥ó¥°¡Ë¤Ç¥·¥ã¥Ã¥Õ¥ë¤¹¤ë¾ì¹ç
   !!!CALL PermMultiply(S,Rev,RH) !¥¹¥Ú¡¼¥É¤ò£Ë¡Ê¥­¥ó¥°¡Ë¤Ç¥·¥ã¥Ã¥Õ¥ë¤¹¤ë¾ì¹ç
   !!!MAT S=H


   FOR R2=1 TO N
      PRINT "ɽ";R2;"¤Î¾ì¹ç"

      !¡ü¥Ï¡¼¥È¤ò¥·¥ã¥Ã¥Õ¥ë¤¹¤ë
      DIM M(N) !¸åȾ¤Î¥Þ¥¸¥Ã¥¯¤Ç¤Î¡Ö¹¥¤­¤Ê¿ô¡×¡Ö»³¤ÎÁªÂò¡×
      MAT M=ZER
      FOR i=1 TO R2 !RÈÖÌÜ
         FOR k=1 TO 12
            LET M(k)=MOD(M(k)+k,13)
         NEXT k
      NEXT i
      !¢¨¡Ö»³¤ÎÁªÂò¡×¤Ï¡¢£±£³¤òÄì¤Ë°ÜÆ°¤µ¤»¤ëÄ´À°¥«¥Ã¥È¤Ç̵¸ú¤Ë¤Ê¤ë¤Î¤Ç¡¢¤³¤Î¤¤¤º¤ì¤«¤Ë¤Ê¤ë¡£

      DIM c1(N)
      CALL PermMultiply(RH,M,c1)
      CALL PermPrintOut(c1)

      !¡ü¥¹¥Ú¡¼¥É¤ò¥«¥Ã¥È¤¹¤ë
      LET KEY2=c1(1) !°ÜÆ°Àè
      FOR x=1 TO N !¸½ºß°ÌÃÖ¤òõ¤¹
         IF S(x)=1 THEN EXIT FOR
      NEXT x
      PRINT x;"¤«¤é";KEY2;"¤Ø"
      DIM cut(N) !¥«¥Ã¥È¤ËÁêÅö¤¹¤ëÃÖ´¹
      FOR i=1 TO N
         LET cut(i)=MOD(i+(x-KEY2)-1,12)+1
      NEXT i
      !!!MAT PRINT cut;
      DIM c2(N)
      CALL PermMultiply(S,cut,c2)
      CALL PermPrintOut(c2)

      CALL check(c1,c2)
   NEXT R2

NEXT R1

END



!-----Á°È¾¤Î¥Þ¥¸¥Ã¥¯¤Ç¤Î¡Ö¹¥¤­¤Ê¿ô¡×¤¬ 1 ¤Î¾ì¹ç¤Î¥·¥ã¥Ã¥Õ¥ë·ë²Ì-----
!DATA 1, 2, 5, 3,10, 6,12, 4, 9,11, 8, 7 !¥Ï¡¼¥È
!DATA 1, 2, 4, 8, 3, 6,12,11, 9, 5,10, 7 !¥¹¥Ú¡¼¥É
!----- 2 ¤Î¾ì¹ç-----
!DATA 12, 1, 4, 2, 9, 5,11, 3, 8,10, 7, 6
!DATA  2, 4, 8, 3, 6,12,11, 9, 5,10, 7, 1
!----- 3 ¤Î¾ì¹ç-----
!DATA 9,10, 1,11, 6, 2, 8,12, 5, 7, 4, 3
!DATA 3, 6,12,11, 9, 5,10, 7, 1, 2, 4, 8
!----- 4 ¤Î¾ì¹ç-----
!DATA 11,12, 3, 1, 8, 4,10, 2, 7, 9, 6, 5
!DATA  4, 8, 3, 6,12,11, 9, 5,10, 7, 1, 2
!----- 5 ¤Î¾ì¹ç-----
!DATA 4, 5, 8, 6, 1, 9, 3, 7,12, 2,11,10 !¢¨ÂåÂؤȤ·¤Æº®¤¶¤é¤ì¤ë°ÌÃÖ
!DATA 5,10, 7, 1, 2, 4, 8, 3, 6,12,11, 9 !¢¨¼Î¤Æ¾ì¤Ø°Ü¤µ¤ì¤ë½ç
!----- 6 ¤Î¾ì¹ç-----
!DATA 8, 9,12,10, 5, 1, 7,11, 4, 6, 3, 2
!DATA 6,12,11, 9, 5,10, 7, 1, 2, 4, 8, 3
!----- 7 ¤Î¾ì¹ç-----
!DATA 2, 3, 6, 4,11, 7, 1, 5,10,12, 9, 8
!DATA 7, 1, 2, 4, 8, 3, 6,12,11, 9, 5,10
!----- 8 ¤Î¾ì¹ç-----
!DATA 10,11, 2,12, 7, 3, 9, 1, 6, 8, 5, 4
!DATA  8, 3, 6,12,11, 9, 5,10, 7, 1, 2, 4
!----- 9 ¤Î¾ì¹ç-----
!DATA 5, 6, 9, 7, 2,10, 4, 8, 1, 3, 12,11
!DATA 9, 5,10, 7, 1, 2, 4, 8, 3, 6, 12,11
!----- 10 ¤Î¾ì¹ç-----
!DATA  3, 4, 7, 5,12, 8, 2, 6,11, 1,10, 9
!DATA 10, 7, 1, 2, 4, 8, 3, 6,12,11, 9, 5
!----- 11 ¤Î¾ì¹ç-----
!DATA  6, 7,10, 8, 3,11, 5, 9, 2, 4, 1,12
!DATA 11, 9, 5,10, 7, 1, 2, 4, 8, 3, 6,12
!----- 12 ¤Î¾ì¹ç-----
!DATA  7, 8,11, 9, 4,12, 6,10, 3, 5, 2, 1
!DATA 12,11, 9, 5,10, 7, 1, 2, 4, 8, 3, 6




!¸åȾ¤Î¥Þ¥¸¥Ã¥¯¤Ç¤Î¥·¥ã¥Ã¥Õ¥ë¤ËÁêÅö¤¹¤ëÃÖ´¹
!DATA  1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12 !¡Ö£±£³¤Ç¤Î¥·¥ã¥Ã¥Õ¥ë¡×
!DATA  2, 4, 6, 8,10,12, 1, 3, 5, 7, 9,11
!DATA  3, 6, 9,12, 2, 5, 8,11, 1, 4, 7,10
!DATA  4, 8,12, 3, 7,11, 2, 6,10, 1, 5, 9
!DATA  5,10, 2, 7,12, 4, 9, 1, 6,11, 3, 8
!DATA  6,12, 5,11, 4,10, 3, 9, 2, 8, 1, 7
!DATA  7, 1, 8, 2, 9, 3,10, 4,11, 5,12, 6
!DATA  8, 3,11, 6, 1, 9, 4,12, 7, 2,10, 5
!DATA  9, 5, 1,10, 6, 2,11, 7, 3,12, 8, 4
!DATA 10, 7, 4, 1,11, 8, 5, 2,12, 9, 6, 3
!DATA 11, 9, 7, 5, 3, 1,12,10, 8, 6, 4, 2
!DATA 12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1

 

Re: ¿·È¯¸«

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î 8Æü(ÅÚ)12»þ24ʬ29ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.71[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£


¡¡³Îǧºî¶È¸æÈè¤ì¤µ¤ó¤Ç¤·¤¿¡£

> ¤Þ¤¿¥¹¥Ú¡¼¥É¤ÎÊý¤â³Îǧ¤Ï¤Ç¤­¤Þ¤¹¡£   ¡ö¥¨¡¼¡ª¡ª¥¹¥Ú¡¼¥É¤Ç¤â²Äǽ¤Ç¤¹¤«¡©
>
>
>
> !ÃÖ´¹¡ÊPermutation¡Ë¤Î·×»»
> !¢¨µ»½Ñ¥á¥â
> !¡¡A=¨£ 1 2 3 4 ¨¤=(1 2 4 3)¡¡¢¨£±¹ÔÌܤνçÈ֤ϸÇÄê¤È¤¹¤ë
> !¡¡¡¡¨¦ 2 4 1 3 ¨¥
> !¤Î¾ì¹ç¡¢
> !¡¡DATA 2,4,1,3 !ÇÛÎóÊÑ¿ô¤Î¡Öź¤¨»ú¤ÈÃ͡פËÂбþ¤µ¤»¤ë
> !¡¡MAT READ A
> !¤È¥×¥í¥°¥é¥à¤Ç¤Ïµ­½Ò¤¹¤ë¡£
>
> SUB PermPrintOut(A()) !ɽ¼¨¤¹¤ë¡¡¢¨É¸½à·Á¡Ê£²¹Ô£îÎó¤Î¹ÔÎóɽµ­¤¹¤ë¡Ë
>    MAT PRINT USING(REPEAT$(" ##",UBOUND(A))): A;
> END SUB
>
> SUB PermMultiply(A(),B(), AB()) !ÀÑAB¡¡¢¨AB¡âBA¡¢A(BC)=(AB)C
>    LET  ua=UBOUND(A)
>    LET  ub=UBOUND(B)
>    IF ua=ub THEN
>       FOR i=1 TO ua
>          LET  AB(i)=A(B(i)) !¢¨¹çÀ®¼ÌÁü(AB)(i)=A(B(i))
>       NEXT i
>    ELSE
>       PRINT "¼¡¸µ¤¬°ã¤¤¤Þ¤¹¡£A=";ua;" B=";ub
>       STOP
>    END IF
> END SUB
> !-------------------- ¤³¤³¤Þ¤Ç¤¬¥µ¥Ö¥ë¡¼¥Á¥ó
>
>
>
> !main
>
> LET N=12 !¢¨¸ÇÄê
>
> DIM TT(N)
> SUB cut(C(),p) !¥«¥Ã¥È¤¹¤ë¡¡¢¨p°ÌÃְʹߤ¬¾å¤Ë¤Ê¤ë
>    FOR i=1 TO p-1 !Á°È¾Éôʬ¤ò¸å¤Ø
>       LET TT(N+i-p+1)=C(i)
>    NEXT i
>    FOR i=p TO N !¸åȾÉôʬ¤òÁ°¤Ø
>       LET TT(i-p+1)=C(i)
>    NEXT i
>    FOR i=1 TO N !copy it
>       LET C(i)=TT(i)
>    NEXT i
> END SUB
>
>
> !----- Á°È¾¤Î¥Þ¥¸¥Ã¥¯¤Ç¤Î¡Ö¹¥¤­¤Ê¿ô¡×¤¬ 1 ¤Î¾ì¹ç-----
> DATA 1, 2, 5, 3,10, 6,12, 4, 9,11, 8, 7 !¥Ï¡¼¥È
> DATA 1, 2, 4, 8, 3, 6,12,11, 9, 5,10, 7 !¥¹¥Ú¡¼¥É
>
> !----- 2 ¤Î¾ì¹ç-----
> DATA 12, 1, 4, 2, 9, 5,11, 3, 8,10, 7, 6
> DATA  2, 4, 8, 3, 6,12,11, 9, 5,10, 7, 1
>
> !----- 3 ¤Î¾ì¹ç-----
> DATA 9,10, 1,11, 6, 2, 8,12, 5, 7, 4, 3
> DATA 3, 6,12,11, 9, 5,10, 7, 1, 2, 4, 8
>
> !----- 4 ¤Î¾ì¹ç-----
> DATA 11,12, 3, 1, 8, 4,10, 2, 7, 9, 6, 5
> DATA  4, 8, 3, 6,12,11, 9, 5,10, 7, 1, 2
>
> !----- 5 ¤Î¾ì¹ç-----
> DATA 4, 5, 8, 6, 1, 9, 3, 7,12, 2,11,10 !¢¨ÂåÂؤȤ·¤Æº®¤¶¤é¤ì¤ë¥¹¥Ú¡¼¥É¥Ñ¥±¥Ã¥È¤Î°ÌÃÖ
> DATA 5,10, 7, 1, 2, 4, 8, 3, 6,12,11, 9 !¢¨¼Î¤Æ¾ì¤Ø°Ü¤µ¤ì¤ë½ç
>
> !----- 6 ¤Î¾ì¹ç-----
> DATA 8, 9,12,10, 5, 1, 7,11, 4, 6, 3, 2
> DATA 6,12,11, 9, 5,10, 7, 1, 2, 4, 8, 3
>
> !----- 7 ¤Î¾ì¹ç-----
> DATA 2, 3, 6, 4,11, 7, 1, 5,10,12, 9, 8
> DATA 7, 1, 2, 4, 8, 3, 6,12,11, 9, 5,10
>
> !----- 8 ¤Î¾ì¹ç-----
> DATA 10,11, 2,12, 7, 3, 9, 1, 6, 8, 5, 4
> DATA  8, 3, 6,12,11, 9, 5,10, 7, 1, 2, 4
>
> !----- 9 ¤Î¾ì¹ç-----
> DATA 5, 6, 9, 7, 2,10, 4, 8, 1, 3, 12,11
> DATA 9, 5,10, 7, 1, 2, 4, 8, 3, 6, 12,11
>
> !----- 10 ¤Î¾ì¹ç-----
> DATA  3, 4, 7, 5,12, 8, 2, 6,11, 1,10, 9
> DATA 10, 7, 1, 2, 4, 8, 3, 6,12,11, 9, 5
>
> !----- 11 ¤Î¾ì¹ç-----
> DATA  6, 7,10, 8, 3,11, 5, 9, 2, 4, 1,12
> DATA 11, 9, 5,10, 7, 1, 2, 4, 8, 3, 6,12
>
> !----- 12 ¤Î¾ì¹ç-----
> DATA  7, 8,11, 9, 4,12, 6,10, 3, 5, 2, 1
> DATA 12,11, 9, 5,10, 7, 1, 2, 4, 8, 3, 6
>


¤³¤ÎÁ°È¾¤Î¥Ñ¥¿¡¼¥ó¤Îɽ¤Ï¤Ê¤ó¤È¤«¼ê¤Ë¤·¤Þ¤·¤¿¡£

¸åȾ¤Î´°À®¤µ¤ì¤¿¥×¥í¥°¥é¥à¤ÎÁ´ÂΤ¬¸«¤¿¤¤¤Ç¤¹¡£
Îã¤Î¥«¡¼¥É¥·¥å¥ß¥ì¡¼¥·¥ç¥ó¤Î¡ÊÁ°È¾¤â´Þ¤à¡Ë¥ê¥¹¥È¤òÁ÷¤Ã¤Æ¤¯¤À¤µ¤¤¡£
 

¼ÁÌä

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î 8Æü(ÅÚ)15»þ32ʬ9ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.71[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£


request£²¤Ç¤Îɽ£²¤Î¾ì¹ç¤ÎºÇ½ª¥Ñ¥±¥Ã¥È¤ÎÇÛÎó¤¬
¥È¥é¥ó¥×¤Ç¼Â¸³¤·¤Æ¤ß¤ë¤È¡Êº¸¤è¤ê΢¸þ¤­¤Ë¤·¤¿¾ì¹ç¤Ë¾å¤«¤éʤֽç¤ÇÆɤࡣ¡Ë
¥Ï ¡¼ ¥È¡§7,8,11,9,4,12,6,10,3,5,2,1,(13)
¥¹¥Ú¡¼¥É¡§12,11,9,5,10,7,1,2,4,8,3,6
¤Ç¤¢¤Ã¤¿¤Î¤ËÂФ·
ÃÖ´¹¤Î¥×¥í¥°¥é¥à¤Çɽ¼¨¤µ¤ì¤¿·ë²Ì¤Îɽ¤Ç¤Ï
¥Ï ¡¼ ¥È¡§1,2,5,3,10,6,12,4,9,11,8,7,(13)
¥¹¥Ú¡¼¥É¡§2,4,8,3,6,12,11,9,5,10,7,1
¤È¤Ê¤ê¤Þ¤·¤¿¡£
¤Ç¤â¥Á¥§¥Ã¥¯¤Ç¤ÏOK¤Ç¹ç¤Ã¤Æ¤Ï¤¤¤ë¤Î¤Ç¤¹¤¬¡¦¡¦¡¦

¾¤Ë¤â
request5,
ɽ£µ¤Î¾ì¹ç¤Ç
¼Â¸³¤Ç¤Ï
¥Ï ¡¼ ¥È¡§7,8,11,9,4,12,6,10,3,5,2,1,(13)
¥¹¥Ú¡¼¥É¡§12,11,9,5,10,7,1,2,4,8,3,6
½ÐÎϤÎɽ¤Ç¤Ï
----- Request 5 ¤Î¾ì¹ç-----

ɽ 4 ¤Î¾ì¹ç
  6  7 10  8  3 11  5  9  2  4  1 12
11  9  5 10  7  1  2  4  8  3  6 12
check!
1  2  3  4  5  6  7  8  9  10  11  12
1  2  3  4  5  6  7  8  9  10  11  12
ɽ 5 ¤Î¾ì¹ç
  1  2  5  3 10  6 12  4  9 11  8  7¡¡¡¡¡Ê¥Ï¡¼¥ÈÎó¡Ë
  1  2  4  8  3  6 12 11  9  5 10  7¡¡¡¡¡Ê¥¹¥Ú¡¼¥ÉÎó¡Ë
check!
1  2  3  4  5  6  7  8  9  10  11  12
1  2  3  4  5  6  7  8  9  10  11  12

¤ÈºÇ½ª·ë²Ì¤ÈÈù̯¤Ë¤º¤ì¤Æ¤¤¤Þ¤¹¡£
 

Re: ¼ÁÌä

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î 8Æü(ÅÚ)17»þ27ʬ15ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.73[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£


> request£²¤Ç¤Îɽ£²¤Î¾ì¹ç¤ÎºÇ½ª¥Ñ¥±¥Ã¥È¤ÎÇÛÎó¤¬
> ¥È¥é¥ó¥×¤Ç¼Â¸³¤·¤Æ¤ß¤ë¤È¡Êº¸¤è¤ê΢¸þ¤­¤Ë¤·¤¿¾ì¹ç¤Ë¾å¤«¤éʤֽç¤ÇÆɤࡣ¡Ë
> ¥Ï ¡¼ ¥È¡§7,8,11,9,4,12,6,10,3,5,2,1,(13)
> ¥¹¥Ú¡¼¥É¡§12,11,9,5,10,7,1,2,4,8,3,6
> ¤Ç¤¢¤Ã¤¿¤Î¤ËÂФ·
> ÃÖ´¹¤Î¥×¥í¥°¥é¥à¤Çɽ¼¨¤µ¤ì¤¿·ë²Ì¤Îɽ¤Ç¤Ï
> ¥Ï ¡¼ ¥È¡§1,2,5,3,10,6,12,4,9,11,8,7,(13)
> ¥¹¥Ú¡¼¥É¡§2,4,8,3,6,12,11,9,5,10,7,1
> ¤È¤Ê¤ê¤Þ¤·¤¿¡£

¼ºÎ餷¤Þ¤·¤¿¡£¤³¤³¤Ç¤âʤӽç¤ÎȽÃǥߥ¹¤Ç¤·¤¿¡£
¥×¥í¥°¥é¥à¤ò½¤Àµ¤·¤Æ¤ª¤­¤Þ¤·¤¿¡£
 

Re: ¿·È¯¸«

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î 9Æü(Æü)11»þ52ʬ0ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.72[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¸åȾ¤Î´°À®¤µ¤ì¤¿¥×¥í¥°¥é¥à¤ÎÁ´ÂΤ¬¸«¤¿¤¤¤Ç¤¹¡£
> Îã¤Î¥«¡¼¥É¥·¥å¥ß¥ì¡¼¥·¥ç¥ó¤Î¡ÊÁ°È¾¤â´Þ¤à¡Ë¥ê¥¹¥È¤òÁ÷¤Ã¤Æ¤¯¤À¤µ¤¤¡£

ÃÙ¤¯¤Ê¤ê¤Þ¤·¤¿¡£
¸½¾õ¤Î¥×¥í¥°¥é¥à¤Ï¤³¤³¤«¤é¥À¥¦¥ó¥í¡¼¥É¤·¤Æ¤¯¤À¤µ¤¤¡£

¤Þ¤¿¿ôÍýŪ¤ÊÀâÌÀ¤È¤·¤Æ¤Ï¡¢ÃÖ´¹¤Çɽ¸½¡Ê¥×¥í¥°¥é¥à No.71µ­»ö¡Ë¤·¤¿¤³¤È¤ò¤â¤Ã¤ÆÂ夨¤µ¤»¤Æ¤¤¤¿¤À¤­¤Þ¤¹¡£

¿ô³ØŪ¤Ë£±¤Ä¤Î¤³¤È¤ò¡¢¤¿¤È¤¨¤Ð
¼ê¤ÎÃæ¤Ç¥·¥ã¥Ã¥Õ¥ë¤·¤¿¤ê¡¢¾ì¤Ç¥·¥ã¥Ã¥Õ¥ë¤·¤¿¤ê
ÌÜÀè¤òÊѤ¨¤Æ¤¢¤¿¤«¤â°ã¤Ã¤¿¤³¤È¤ä¤Ã¤Æ¤¤¤ë¤è¤¦¤Ë¸«¤»¤ë¤Î¤¬¥Þ¥¸¥Ã¥¯¤Î£±¤Ä¤Î¾ïÅå¼êÃʤǤ¹¤Í¡£
 

¤ªÎé

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î 9Æü(Æü)13»þ12ʬ40ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¤¹¤´¤¤¡ª
¥È¥é¥ó¥×¤ò¤¤¤Á¤¤¤ÁÁàºî¤¹¤ë¤³¤È¤Ê¤¯¡¢¸½¾Ý¤òÄÉÀפǤ­¤ë¤Ê¤ó¤Æ¡¦¡¦¡¦
¤³¤ó¤Ê¤Ë¼«Í³¤Ë¥³¥ó¥Ô¥å¡¼¥¿¡¼¤ò»È¤¤¤³¤Ê¤»¤¿¤é³Ú¤·¤¤¤À¤í¤¦¤Ê¡¼¡Ê»ä¤â´èÄ¥¤í¤¦¡ª¡Ë
¤Ò¤ç¤ó¤Ê¼ÁÌ䤫¤é¤³¤³¤Þ¤Ç¥×¥í¥°¥é¥à¤òÁȤó¤Ç¤¯¤ì¤¿¤³¤È¤Ë´¶¼Õ¤¤¤¿¤·¤Þ¤¹¡£
¤³¤Î¥½¥Õ¥È¤Ï»ä¤ÎÊõʪ¤Ë¤Ê¤ê¤Þ¤¹¡£
¤¤¤í¤¤¤í¤Ê¼ÁÌä¤Ë¤ªÅú¤¨Äº¤­¡¢À¿¤Ë¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
 

¼ÁÌä¤Ç¤¹¡¦¡¦¡¦

 Åê¹Æ¼Ô¡§NINA  Åê¹ÆÆü¡§2008ǯ11·î 9Æü(Æü)22»þ54ʬ19ÉÃ
ÊÖ¿®¡¦°úÍÑ
  Âç³Ø¤Î¿ô³Ø¤Î²ÝÂê¤Ç¡¢

¡Ö1¡¤2¡¤3¡¤¡Ä¡¤£î¡¡¤Î½ç¤Ëʤó¤Ç¤¤¤ë¿ôÎó¤Î¤Ê¤«¤Ç¡¢¡È¡Ü¡É¤È¡È¡á¡É¤òÆþ¤ì¤Æ¼°¤ò´°À®¤µ¤»¤è¡£¡×

¤È¤¤¤¦¤è¤¦¤Ê¡¢²ÝÂ꤬¤Ç¤Þ¤·¤¿¡£ÌäÂê¤ÎÅú¤¨¤ÎÎã¤È¤·¤Æ¤Ï

1¡Ü2¡á3
1¡Ü2¡Ü3¡Ü¡Ä¡Ü14¡á15¡Ü16¡Ü17¡Ü¡Ä¡Ü20¡¡¡Ê¡á105¡Ë

¤È¤¤¤¦Íͤʴ¶¤¸¤Ç¤¹¡£


¤³¤ì¤ò½½¿ÊBASIC¤Ç1,000,000·å¤Þ¤Ç¤¯¤é¤¤¤ÎÅù¼°¤ò¤Ä¤¯¤ì¡¡¤È¤¤¤¦¤³¤È¸À¤ï¤ì¡¢¤ä¤Ã¤Æ¤ß¤¿¤Î¤Ç¤¹¤¬¡¢
BASIC¤ò»È¤¦¤Î¤Ï½é¤á¤Æ¤Ê¤Î¤Ç¡¢¤É¤ó¤ÊÉ÷¤Ë¥×¥í¥°¥é¥à¤òºî¤ì¤Ð¤¤¤¤¤Î¤«¤ï¤«¤ê¤Þ¤»¤ó¡£

¤É¤Ê¤¿¤«¤´»ØƳ¤¤¤¿¤À¤±¤ì¤Ð¤È»×¤¤¡¢Åê¹Æ¤µ¤»¤Æ¤¤¤¿¤À¤­¤Þ¤·¤¿¡£
¤ï¤«¤ë¤«¤¿¡¢¤¼¤Ò¤è¤í¤·¤¯¤ª´ê¤¤¤·¤Þ¤¹¡ª¡ª
 

Re: ¼ÁÌä¤Ç¤¹¡¦¡¦¡¦

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2008ǯ11·î10Æü(·î)14»þ45ʬ25ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.77[¸µµ­»ö¤Ø]

NINA¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¤Þ¤º¡¢1,000,000·å¤Ç¤Ï¤Ê¤¯n=1,000,000¤Þ¤Ç¤Î´Ö°ã¤¤¤Ç¤¹¤è¤Í¡£

Åù¼°

  1+2+¡Ä+(k-1)+k=(k+1)+(k+2)+¡Ä+(n-1)+n

¤ò¡¢¼¡¤Î¤è¤¦¤Ën¤Ë¤Ä¤¤¤Æ¤Î2¼¡ÊýÄø¼°¤È¹Í¤¨¤ì¤Ð

  (k^2+k)/2=(n^2+n)/2-(k^2+k)/2

n¤¬À°¿ô²ò¤ò»ý¤Æ¤ÐÅù¼°¤ÏÀ®¤êΩ¤Á¤Þ¤¹¡£

  FOR k=1 TO 1000000 ¡Á NEXT k

¤È¤·¤Æ¡¢n¤¬À°¿ô²ò¤ò»ý¤Ä¤«Ä´¤Ù¤ì¤Ð¤è¤¤¤Î¤Ç¤Ï¡£
(1,000,000¤Þ¤Ç¤Ë8¸Ä¤¢¤ê¤Þ¤·¤¿)
 

Re: ¼ÁÌä¤Ç¤¹¡¦¡¦¡¦

 Åê¹Æ¼Ô¡§NINA  Åê¹ÆÆü¡§2008ǯ11·î10Æü(·î)23»þ39ʬ46ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.78[¸µµ­»ö¤Ø]

¹ÓÅĹÀÆ󤵤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£



> NINA¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£
>
> ¤Þ¤º¡¢1,000,000·å¤Ç¤Ï¤Ê¤¯n=1,000,000¤Þ¤Ç¤Î´Ö°ã¤¤¤Ç¤¹¤è¤Í¡£

¤½¤¦¤Ç¤·¤¿¡£¤´»ØŦ¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£


> Åù¼°
>
>   1+2+¡Ä+(k-1)+k=(k+1)+(k+2)+¡Ä+(n-1)+n
>
> ¤ò¡¢¼¡¤Î¤è¤¦¤Ën¤Ë¤Ä¤¤¤Æ¤Î2¼¡ÊýÄø¼°¤È¹Í¤¨¤ì¤Ð
>
>   (k^2+k)/2=(n^2+n)/2-(k^2+k)/2
>
> n¤¬À°¿ô²ò¤ò»ý¤Æ¤ÐÅù¼°¤ÏÀ®¤êΩ¤Á¤Þ¤¹¡£
>
>   FOR k=1 TO 1000000 ¡Á NEXT k
>
> ¤È¤·¤Æ¡¢n¤¬À°¿ô²ò¤ò»ý¤Ä¤«Ä´¤Ù¤ì¤Ð¤è¤¤¤Î¤Ç¤Ï¡£
> (1,000,000¤Þ¤Ç¤Ë8¸Ä¤¢¤ê¤Þ¤·¤¿)


¤È¤Æ¤â¤ï¤«¤ê¤ä¤¹¤¤²òÀ⤢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡ªµá¤áÊý¡¢¼°¤Î½ñ¤­Êý¤ÏÍý²ò¤Ç¤­¤Þ¤·¤¿¡£

¤µ¤Ã¤½¤¯¤ä¤Ã¤Æ¤ß¤¿¤Î¤Ç¤¹¤¬¡¢ (k^2+k)/2=(n^2+n)/2-(k^2+k)/2¡¡¤ÈÂǤ俤Ȥ³¤í¡¢¥¨¥é¡¼¤Îɽ¼¨¤¬¤Ç¤Æ¤·¤Þ¤¤¤Þ¤·¤¿¡£
¤½¤Î¤Þ¤ÞÆþÎϤ·¤¿¤Î¤¬¤¤¤±¤Ê¤«¤Ã¤¿¤Î¤Ç¤·¤ç¤¦¤«¡©¡©

¤Þ¤¿¡¢À°¿ô²ò¤ò¤â¤Ä¤«Ä´¤Ù¤ë¤Î¤ÏIFʸ¤ÇÎɤ¤¤Î¤Ç¤·¤ç¤¦¤«¡©¡©

¶µ¤¨¤Æ¤¤¤¿¤À¤±¤Þ¤¹¤Ç¤·¤ç¤¦¤«¡©¡©
 

Re: ¼ÁÌä¤Ç¤¹¡¦¡¦¡¦

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î11Æü(²Ð)11»þ10ʬ6ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.77[¸µµ­»ö¤Ø]

NINA¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> Âç³Ø¤Î¿ô³Ø¤Î²ÝÂê¤Ç¡¢
> ¡Ö1¡¤2¡¤3¡¤¡Ä¡¤£î¡¡¤Î½ç¤Ëʤó¤Ç¤¤¤ë¿ôÎó¤Î¤Ê¤«¤Ç¡¢¡È¡Ü¡É¤È¡È¡á¡É¤òÆþ¤ì¤Æ¼°¤ò´°À®¤µ¤»¤è¡£¡×

Ê̲ò¤ò¾Ò²ð¤·¤Æ¤ª¤­¤Þ¤¹¡£

¡ü²ò¤­Êý
¤¿¤È¤¨¤ÐN=10¤Î¾ì¹ç¡¢1¡û2¡û3¡û4¡û5¡û6¡û7¡û8¡û9¡û10 ¤È¿ôÎ󤬤Ǥ­¤ë¡£
¡û¡Ê±é»»µ­¹æ¡á¤òÆþ¤ë¾ì½ê¡Ë¤Î¿ô¤Ï¡¢10-1=9¸Ä¤¢¤ë¤«¤é¾ì½ê¤Î²ÄǽÀ­¤Ï£±¡Á£¹¤Ç¤¢¤ë¡£

¼¡¤Ë¾ò·ï¤òËþ¤¿¤¹È½ÃÇÊýË¡¤Ï¡¢¤¿¤È¤¨¤Ð¡¢£³ÈÖÌܤȤ¹¤ë¤È
¡¡1¡û2¡û3=4¡û5¡û6¡û7¡û8¡û9¡û10
¤È¤Ê¤ë¤«¤é¡¢¡á¤Ç¸µ¤Î¿ôÎó¤Ï¡Öº¸Êաפȡֱ¦Êաפˣ²Ê¬³ä¤µ¤ì¤ë¡£
¤·¤¿¤¬¤Ã¤Æ¡¢1¡û2¡û3¡¡¤È¡¡4¡û5¡û6¡û7¡û8¡û9¡û10¡¡¤Î£²¤Ä¤ÎÅùº¹¿ôÎó¤ÎϤòµá¤á¤Æ¡Öº¸ÊաᱦÊաפÇȽÃǤ¹¤ì¤Ð¤è¤¤¡£
¤³¤³¤Ç¤Ïº¸Êդȱ¦ÊÕ¤ÎϤòµá¤á¤ë¤Î¤Ç¤Ï¤Ê¤¯¡Öº¸ÊÕ¤¬Á´ÂΤÎϤÎȾʬ¤ËÅù¤·¤¤¡×¤È¤¤¤¦¤³¤È¤Ç¾ò·ï¤òËþ¤¿¤¹¤ÈȽÃǤ¹¤ë¡£
¦²k=n*(n+2)/2¤Î¸ø¼°¤ò»È¤Ã¤Æ¤½¤ì¤¾¤ìµá¤á¤ë¡£

¤³¤³¤Ç¡¢S1=1¡¢S2=1+2¡¢S3=1+2+3¡¢¡Ä ¡¢Sn=1+2+3+ ¡Ä +n¡¢¤¹¤Ê¤ï¤Á¥Ç¡¼¥¿Îó{Sn}¤ò¹Í¤¨¤ë¡£
¤³¤ì¤Ïº¸ÊÕ¤ÎϤ¬½ç¤Ëʤó¤À¤â¤Î¤Ç¤¢¤ë¡£
¤·¤¿¤¬¤Ã¤Æ¡¢¡Öº¸ÊÕ¤¬Á´ÂΤÎϤÎȾʬ¤ËÅù¤·¤¤¡×¤Ï
¡¡¤³¤Î1¡Án¸Ä¤Î¥Ç¡¼¥¿Î󤫤顢Sn/2¤ÎÃͤò¸«¤Ä¤±¤ë¡Öõº÷¡×¤ÎÌäÂê
¤ËÃÖ¤­´¹¤¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
Ã༡õº÷¤¹¤ë¤ÈËè²ó¤ÎÁöºº¤¬É¬Íפǻþ´Ö¤¬¤«¤«¤ë¡£
S1,S2,¡Ä,Sn¤ÏÀ°Î󤵤줿¡Ê¾®¤µ¤¤½ç¡Ë¥Ç¡¼¥¿Îó¤À¤«¤é¡¢£²Ê¬Ãµº÷¤¬²Äǽ¤Ç¤¢¤ë¡£

¡ü¡Ö´ðËÜ¥¢¥ë¥´¥ê¥º¥à¤Î²ÝÂê¡×¤È¤·¤Æ¤Î¥µ¥ó¥×¥ë
!OPTION ARITHMETIC decimal_high

LET t0=TIME

DIM S(1000000) !S1,S2,¡Ä,Sn
LET S(1)=1
FOR k=2 TO 1000000
   LET S(k)=S(k-1)+k !º¸ÊÕ 1+ ¡Ä +(k-1)+k ¤ÎÃÍ
NEXT k


LET c=0 !¸Ä¿ô
FOR n=1 TO 1000000

   LET key=S(n)/2 !¡ÖÁ´ÂΤÎȾʬ¤ÎÃ͡פò¸«¤Ä¤±¤ë

   LET L=1 !²¼¸Â
   LET H=n !¾å¸Â
   DO WHILE L<=H !µÕž¤·¤¿¤é½ªÎ»
      LET M=INT((L+H)/2) !Ãæ±û
      IF S(M)<=key THEN LET L=M+1 !¹Ê¤ê¹þ¤à
      IF S(M)>=key THEN LET H=M-1
   LOOP
   !!!PRINT n;L;H

   IF L=H+2 THEN !¸«¤Ä¤«¤Ã¤¿¤é
      LET c=c+1
      PRINT c;"¸ÄÌÜ"

      PRINT "1 + ¡Ä +";M;"=";M+1; !º¸Êդȡá
      IF M<n-1 THEN !À°·Á¤Î¤¿¤á
         PRINT "+ ¡Ä +";n; !±¦ÊÕ
      END IF
      PRINT "¡Ê=";S(M);"¡Ë" !ÏÂ
   END IF

NEXT n


PRINT "·×»»»þ´Ö=";TIME-t0

END

¡Ê¼Â¹Ô·ë²Ì¡Ë
 1 ¸ÄÌÜ
1 + ¡Ä + 2 = 3 ¡Ê= 3 ¡Ë
 2 ¸ÄÌÜ
1 + ¡Ä + 14 = 15 + ¡Ä + 20 ¡Ê= 105 ¡Ë
 3 ¸ÄÌÜ
1 + ¡Ä + 84 = 85 + ¡Ä + 119 ¡Ê= 3570 ¡Ë
 4 ¸ÄÌÜ
1 + ¡Ä + 492 = 493 + ¡Ä + 696 ¡Ê= 121278 ¡Ë
 5 ¸ÄÌÜ
1 + ¡Ä + 2870 = 2871 + ¡Ä + 4059 ¡Ê= 4119885 ¡Ë
 6 ¸ÄÌÜ
1 + ¡Ä + 16730 = 16731 + ¡Ä + 23660 ¡Ê= 139954815 ¡Ë
 7 ¸ÄÌÜ
1 + ¡Ä + 97512 = 97513 + ¡Ä + 137903 ¡Ê= 4754343828 ¡Ë
 8 ¸ÄÌÜ
1 + ¡Ä + 568344 = 568345 + ¡Ä + 803760 ¡Ê= 161507735340 ¡Ë


¡ü¡Ö£²¼¡ÊýÄø¼°¤ò²ò¤¯¡×¤ÎÊ̲ò¤È¤·¤Æ¤Î¥µ¥ó¥×¥ë
FOR k=1 TO 1000000
¡¡£î¤Ë¤Ä¤¤¤Æ¤Î£²¼¡ÊýÄø¼° n^2+n-2*(k^2+k)=0 ¤ò²ò¤¤¤ÆÀµ¤ÎÀ°¿ô²ò¤òÆÀ¤ë
NEXT k
¤³¤ì¤Ï¡¢¿ôÎó{Sk,Sk+1,¡Ä}¤ÎÃ椫¤é¡¢2*Sk¤òõ¤¹¤³¤È¤Ç¤¹¡£
̵¸Â¸Ä¤ÎÃæ¤òõº÷¤Ç¤­¤Ê¤¤¤Î¤Ç¡¢¡Ê¼ÂºÝ¤Ï¾®¤µ¤¤½ç¤ËÀ°Î󤷤Ƥ¤¤ë¤Î¤ÇÅÓÃæ¤ÇÃæ»ß¤¹¤ë¡Ë

¡¡Sk,Sk+1,¡Ä,Sn-1,Sn,Sn+1,¡Ä
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¢¬
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2*Sk¡©
¤³¤ÎÌð°õ¤Î¤Î°ÌÃÖ¤ò£²¼¡ÊýÄø¼°¤ò²ò¤¯¤³¤È¤Ç¿äÄꤷ¤Æ¤¤¤ë¡£


¼ÂºÝ¤É¤³¤Ë¥Ç¡¼¥¿¤¬¤¢¤ë¤«¤Ï¡¢S=¦²k=n*(n+2)/2¤è¤êSQR(S)¤Î°ÌÃ֤ȿäÄꤵ¤ì¤ë¤Î¤Ç¡¢
¾åµ­¥µ¥ó¥×¥ëƱÍͤ˿ôÎó{S1,S2,¡Ä,Sn}¤ÇSn/2¤òõ¤¹¥¢¥×¥í¡¼¥Á¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤ë¡£
!OPTION ARITHMETIC decimal_high

LET t0=TIME


LET c=0 !¸Ä¿ô
FOR N=2 TO 1000000

   LET S=N*(N+1)/2 !Á´Éô¤ÎÏÂ

   LET a=INT(SQR(S)) !¡á¤¬Æþ¤ë²Õ½ê¤Î²ÄǽÀ­
   FOR k=a TO a+1
      LET L=k*(k+1)/2 !º¸ÊÕ¤ÎÏÂ

      IF 2*L=S THEN !2*º¸ÊÕ¡áÁ´Éô¤ÎϤʤ顢¾ò·ï¤ò¤ß¤¿¤¹
         LET c=c+1
         PRINT c;"¸ÄÌÜ"

         PRINT "1 + ¡Ä +";k;"="; !º¸Êդȡá
         IF i=N-1 THEN !À°·Á¤Î¤¿¤á
            PRINT k+1;"¡Ê=";L;"¡Ë" !±¦ÊÕ¤ÈÏÂ
         ELSE
            PRINT k+1;"+ ¡Ä +";N;"¡Ê=";L;"¡Ë"
         END IF
      END IF
   NEXT k

NEXT N


PRINT "·×»»»þ´Ö=";TIME-t0

END
 

Re: ¼ÁÌä¤Ç¤¹¡¦¡¦¡¦

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2008ǯ11·î11Æü(²Ð)18»þ32ʬ18ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.79[¸µµ­»ö¤Ø]

NINA¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£


> ¤µ¤Ã¤½¤¯¤ä¤Ã¤Æ¤ß¤¿¤Î¤Ç¤¹¤¬¡¢ (k^2+k)/2=(n^2+n)/2-(k^2+k)/2¡¡¤ÈÂǤ俤Ȥ³¤í¡¢¥¨¥é¡¼¤Îɽ¼¨¤¬¤Ç¤Æ¤·¤Þ¤¤¤Þ¤·¤¿¡£


¡¡BASIC¤Ç¤Ï¡¢Åù¹æ¤ÏÊÑ¿ô¤Ë¿ôÃͤòÍ¿¤¨¤ë¤È¤­¤Ë»È¤¤¤Þ¤¹(ÂåÆþʸ)¡£

¤¿¤È¤¨¤Ð¡ÖLET a=b+3¡×¤È¤¤¤¦Ê¸¤Ï¡¢ÊÑ¿ôa¤Ë¿ôÃͼ°b+3¤ÎÃͤòÂåÆþ¤¹¤ë¤È¤¤¤¦°ÕÌ£¤Ç¤¹¡£(ÊÑ¿ôb¤¬4¤Ê¤é¤Ða¤ÎÃͤÏ7¤Ë¤Ê¤ê¤Þ¤¹)

º¸Êդϰì¤Ä¤ÎÊÑ¿ô¤Ç¤Ê¤±¤ì¤Ð¤¤¤±¤Þ¤»¤ó¡£¡ÖLET b+3=a¡×¤Èµ­½Ò¤¹¤ë¤Èʸˡ¥¨¥é¡¼¤Ë¤Ê¤ê¤Þ¤¹¡£
(½½¿ÊBASIC¤Î¥Ø¥ë¥×¤Î[ÆþÌç][ÊÑ¿ô][letʸ]¤ò»²¾È¤·¤Æ²¼¤µ¤¤)


  ¤Þ¤¿¡¢BASIC¤Ï¼°¤ÎÊÑ·Á¤äÊýÄø¼°¤ò²ò¤¯¤È¤¤¤Ã¤¿¿ô¼°½èÍý¤Ë¤ÏÂбþ¤·¤Æ¤¤¤Þ¤»¤ó¡£
¤½¤ÎÉôʬ¤Ï¼«Ê¬¤Ç²ò¤¯¤«¡¢²ò¤¯¤¿¤á¤Î¥×¥í¥°¥é¥à¤òºî¤é¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£

Á°½Ð¤ÎÌäÂê¤Ç¸À¤¨¤Ð¡¢

  (k^2+k)/2=(n^2+n)/2-(k^2+k)/2

¤ò²¼¤Î¤è¤¦¤ËÊÑ·Á¤¹¤ë¤³¤È¤ÏBASIC¤Ï¤·¤Æ¤¯¤ì¤Þ¤»¤ó¡£

  n^2+n-2*(k^2+k)=0

¤³¤Î²ò¤òµá¤á¤ë¤Î¤â¡¢¤½¤Î¤¿¤á¤Î¥×¥í¥°¥é¥à¤òºî¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£


¡¡²¼¤Ï¡¢2¼¡ÊýÄø¼° a*x^2+b*x+c=0 ¤Î²ò¤Î°ì¤Ä¤òµá¤áÀ°¿ôÀ­¤òȽÄꤹ¤ë¥×¥í¥°¥é¥à¤Ç¤¹¡£»²¹Í¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£

  10 LET a=1
  20 LET b=3
  30 LET c=-4
  40 LET D=b^2-4*a*c  ! ȽÊ̼°
  50 LET x=(-b+SQR(D))/(2*a)  ! ²ò¤Î¸ø¼°
  60 PRINT x
  70 IF INT(x)=x THEN PRINT "À°¿ô"
  80 END

*70¹Ô¤ÎIFʸ¤ÇÀ°¿ô¤ÎȽÄê¤ò¤·¤Æ¤¤¤Þ¤¹¡£(IFʸ¤Ç¤ÎÅù¹æ¤ÏξÊÕ¤¬Åù¤·¤¤¤«¤ÎȽÄê¤Ë»È¤ï¤ì¤ë¤Î¤Çº¸ÊÕ¤¬ÊÑ¿ô¤Ç¤¢¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡Ë
*INT(x)¤äSQR(D)¤ÏÁȹþ¤ß´Ø¿ô¤Ç¤¹¡£(¥Ø¥ë¥×[¿ôÃÍ][Áȹþ¤ß´Ø¿ô][¿ôÃÍ´Ø¿ô]»²¾È)
*40¹Ô¤È50¹Ô¤Î¡Ö!¡×¤ÏÃí¼áµ­¹æ¤Ç¤¹¡£¤³¤Îµ­¹æ°Ê¹ß¤Ï²¿¤ò½ñ¤¤¤Æ¤â¥×¥í¥°¥é¥à¤Î¼Â¹Ô¤Ë±Æ¶Á¤òÍ¿¤¨¤Þ¤»¤ó¡£
 

³Îǧ

 Åê¹Æ¼Ô¡§¾®ÄÍÄçŵ  Åê¹ÆÆü¡§2008ǯ11·î12Æü(¿å)14»þ25ʬ6ÉÃ
ÊÖ¿®¡¦°úÍÑ
  £Ç£Í£Ï¡Ê¥°¥í¡¼¥Ð¥ë¥á¥Ç¥¤¥¢¥ª¥ó¥é¥¤¥ó¡Ë¤Ï³°ÀǤǤ¹¡£  

Re: ¼ÁÌä¤Ç¤¹¡¦¡¦¡¦

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î13Æü(ÌÚ)15»þ53ʬ38ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.77[¸µµ­»ö¤Ø]

NINA¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> Âç³Ø¤Î¿ô³Ø¤Î²ÝÂê¤Ç¡¢
>
> ¡Ö1¡¤2¡¤3¡¤¡Ä¡¤£î¤Î½ç¤Ëʤó¤Ç¤¤¤ë¿ôÎó¤Î¤Ê¤«¤Ç¡¢¡È¡Ü¡É¤È¡È¡á¡É¤òÆþ¤ì¤Æ¼°¤ò´°À®¤µ¤»¤è¡£¡×

¥Ç¡¼¥¿Îó¤Î½èÍý¤È¤·¤Æ¡¢¤â¤¦£±¤ÄÊ̲ò¤ò¾Ò²ð¤·¤Æ¤ª¤­¤Þ¤¹¡£


¡ü¡Ö´ðËÜ¥¢¥ë¥´¥ê¥º¥à¤Î²ÝÂê¡×¤È¤·¤Æ¤Î¥µ¥ó¥×¥ë¡Ê¤½¤Î£²¡Ë

ÊýÄø¼° n*(n+1)/2=2*k*(k+1)/2 ¤è¤ê
£²¤Ä¤Î¿ôÎó
¡¡¿ôÎó S1={1,3,6,10,15,21,¡Ä,n*(n+1)/2,¡Ä}¡¢n=1¡Á1000000
¡¡¿ôÎó S2={2,6,12,20,30,42,¡Ä,2*k*(k+1)/2,¡Ä}¡¢k=1¡Á1000000-1
¤ò¹Í¤¨¤ë¡£
¤³¤Î£²¤Ä¤Î¿ôÎó¡Ê¥Ç¡¼¥¿Îó¡Ë¤Ï¾®¤µ¤¤½ç¤ËÀ°Î󤵤ì¤Æ¤¤¤ë¤Î¤Ç¡¢
£±¤Ä¤ÎÀ°Î󤵤줿¥Ç¡¼¥¿Îó¤ËÊ»¹ç¡Ê¥Þ¡¼¥¸¡Ë¤¹¤ë¤³¤È¤ËÃåÌܤ¹¤ë¡£
!OPTION ARITHMETIC decimal_high

LET t0=TIME

LET a=1000000

LET n=1 !ÀèƬ¤«¤é
LET k=1

LET c=0 !¸Ä¿ô
DO UNTIL n>a OR k>a-1 !¤É¤Á¤é¤«¤Î¥Ç¡¼¥¿Î󤬽ª¤ï¤ë¤Þ¤Ç
   LET s1=n*(n+1)/2 !¥Ç¡¼¥¿Îó¤òÆÀ¤ë
   LET s2=2*k*(k+1)/2

   IF s1=s2 THEN !¥Þ¡¼¥¸¤¹¤ë
      LET c=c+1
      PRINT c;"¸ÄÌÜ"

      PRINT "1 + ¡Ä +";k;"=";k+1; !º¸Êդȡá
      IF k<n-1 THEN !À°·Á¤Î¤¿¤á
         PRINT "+ ¡Ä +";n; !±¦ÊÕ
      END IF
      PRINT "¡Ê=";s1/2;"¡Ë" !ÏÂ

      LET k=k+1
      LET n=n+1
   ELSEIF s1>s2 THEN
      LET k=k+1
   ELSE
      LET n=n+1
   END IF
LOOP

PRINT "·×»»»þ´Ö=";TIME-t0

END

 

µ¿Ìä

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î16Æü(Æü)07»þ09ʬ52ÉÃ
ÊÖ¿®¡¦°úÍÑ
  £±¤«¤é£³¤ò¡¡¡¡¡¡£±¡¡£³
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£²
¤ÈÇÛÎ󤹤ì¤Ð¡¢¾å¤ÎÃʤΣ²¿ô¤Îº¹¤¬¡Ê¤¿¤À¤·Â礭¤¤Êý¤«¤é¾®¤µ¤¤Êý¤ò°ú¤¯¡££³¡Ý£±¡Ë
²¼¤Î¿ô¤È¤Ê¤ë¡£
¤³¤Îµ¬Â§¤òÉßÞ§¤·
£±¤«¤é£¶¤Þ¤Ç¤Î¿ô»ú¤ò°ìÅÙ¤À¤±»ÈÍѤ·¤Æ
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ü¡¡¡ü¡¡¡ü
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ü¡¡¡ü
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ü
¤Î°ÌÃÖ¤ËÆþ¤ì¤¿¤¤¡£
»î¹Ôºø¸í¤Î¸å¡¢£¶¡¡£²¡¡£µ
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£´¡¡£³
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£±
¤Ê¤ëÇÛÎ󤬡ʤâ¤Á¤í¤ó¾¤Î¥Ñ¥¿¡¼¥ó¤â¸ºß¤¹¤ë¤È»×¤¦¡£¡Ëµá¤á¤é¤ì¤ë¡£
¤·¤«¤·¡¢
¼¡¤«¤é¤¬¿Í´Ö¤Ë¤Ï¸Â³¦¤¬½Ð¤Æ¤­¤Æ¡¢
¤Ç¤Ï¡¢£±¡Á£±£°¤Î¿ô»ú¤ò°ìÅÙ¤À¤±»ÈÍѤ·¤Æ
¡¡¡¡¡¡¡¡¡¡¡¡¡ü¡¡¡ü¡¡¡ü¡¡¡ü
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ü¡¡¡ü¡¡¡ü
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ü¡¡¡ü
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ü
¤ÎÇÛÎó¤ò¹½À®
¤µ¤é¤Ë¡¢£±¡Á£±£µ¤Î¿ô»ú¤Ç
¡¡¡¡¡¡¡¡¡¡¡ü¡¡¡ü¡¡¡ü¡¡¡ü¡¡¡ü
¡¡¡¡¡¡¡¡¡¡¡¡¡ü¡¡¡ü¡¡¡ü¡¡¡ü
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ü¡¡¡ü¡¡¡ü
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ü¡¡¡ü
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ü
£±¡Á£²£±¤Ç
¡¡¡¡¡¡¡¡¡ü¡¡¡ü¡¡¡ü¡¡¡ü¡¡¡ü¡¡¡ü
¡¡¡¡¡¡¡¡¡¡¡ü¡¡¡ü¡¡¡ü¡¡¡ü¡¡¡ü
¡¡¡¡¡¡¡¡¡¡¡¡¡ü¡¡¡ü¡¡¡ü¡¡¡ü
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ü¡¡¡ü¡¡¡ü
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ü¡¡¡ü
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ü
¡¦¡¦¡¦¡¦
¡¦¡¦¡¦¡¦
¤Ï¹½À®²Äǽ¤Ê¤Î¤À¤í¤¦¤«¡©
¤³¤ÎÌäÂê¤ò²ò·è¤·¤Æ¤â¤é¤¤¤¿¤¤¡£
 

Re: µ¿Ìä

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2008ǯ11·î16Æü(Æü)12»þ05ʬ29ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.84[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

n=10¤Ç¤Ï¸ºß¤·¤Þ¤·¤¿¡£

  9  10   3   8
    1   7   5
      6   2
        4

¼¡¤Î¥×¥í¥°¥é¥à¤Çȯ¸«¤·¤Þ¤·¤¿¤¬¡¢¾¯¤·¹©Éפ¹¤ì¤ÐÁ´¿ôÄ´ºº¤â²Äǽ¤Ç¤Ï¤Ê¤¤¤«¤È»×¤¤¤Þ¤¹¡£

LET k=4  ! 4¹Ô
LET n=k*(k+1)/2  ! n=10
DIM a(k,k),check(n)
FOR maxn=1 TO CEIL(k/2)
   FOR r=1 TO n^(n/2)
      MAT check=ZER
      LET a(1,maxn)=n
      LET check(n)=1
      FOR i=1 TO k
         FOR j=1 TO k+1-i
            IF NOT (i=1 AND j=maxn) THEN
               DO
                  LET num=INT((n-1)*RND)+1
               LOOP UNTIL check(num)=0
               LET a(i,j)=num
               LET check(num)=1
            END IF
         NEXT j
      NEXT i
      !MAT PRINT a
      CALL diff
      IF p=0 THEN MAT PRINT a
      LET p=0
   NEXT r
NEXT maxn
SUB diff
   FOR i=1 TO k-1
      FOR j=1 TO k-i
         IF ABS(a(i,j)-a(i,j+1))<>a(i+1,j) THEN
            LET p=1
            EXIT SUB
         END IF
      NEXT j
   NEXT i
END SUB
END
 

½õ¤±¤Æ²¼¤µ¤¤¡£

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î16Æü(Æü)20»þ54ʬ54ÉÃ
ÊÖ¿®¡¦°úÍÑ
  Áᮥꥹ¥È¤ò¥³¥Ô¡¼¤·¤ÆÆ°¤«¤·¤Æ¤ß¤¿¤é¡¢OK¤Ç¤·¤¿¡£
k=5 ¤Ç¤ä¤Ã¤Æ¤¤¤Þ¤¹¤¬¡¢Ä«¤«¤éÆ°¤«¤·¤Æ¤¤¤Þ¤¹¤¬¤Þ¤À½ª¤ï¤ê¤Þ¤»¤ó¡£¡Ê£±£²»þ´Ö¶á¤¯¡£¡Ë
¤»¤á¤Æ¡¢£±»þ´Ö°Ì¤ÇÄ´ºº¤Ç¤­¤Ê¤¤¤â¤Î¤Ç¤·¤ç¤¦¤«¡©
¤É¤³¤ò¤É¤¦²þÎɤ·¤¿¤é¤è¤¤¤Î¤«¡¦¡¦¡¦¡¢Ã¯¤«½õ¤±½®¤¬Íߤ·¤¤¡ª¡ª¡ª
 

Re: ½õ¤±¤Æ²¼¤µ¤¤¡£

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2008ǯ11·î16Æü(Æü)22»þ07ʬ56ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.86[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£


¤´¤á¤ó¤Ê¤µ¤¤¡£
¤¢¤ì¤Ï20ʬ¤¯¤é¤¤¤Ç¼è¤ê¹ç¤¨¤ººî¤Ã¤¿¤â¤Î¤Ç¡¢ºî¤ê¤Ê¤¬¤é¤â¡Ö̵Â̤¬Â¿¤¤¡×¤È¹Í¤¨¤Æ¤Ï¤¤¤Þ¤·¤¿¡£
¥é¥ó¥À¥àÄ´ºº¤Ç»î¹Ô²ó¿ô¤¬CEIL(k/2)*SQR(n^n)¤Ç¤¹¤«¤é¡¢n=15¤Ç¤Ï¤Ê¤«¤Ê¤«½ª¤ï¤é¤Ê¤¤¤È»×¤¤¤Þ¤¹¡£

¤µ¤Ã¤½¤¯²þÎÉÈǤòºî¤ê¤Þ¤¹¡£
ÌÀÆü¤Þ¤Ç¤Ë¤Ï¤Ç¤­¤ë¤«¤È»×¤¤¤Þ¤¹¡£
 

Re: µ¿Ìä

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î17Æü(·î)09»þ14ʬ59ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.84[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¡ü¥µ¥ó¥×¥ë¡¡¤½¤Î£±
Á°²ó¾Ò²ð¤·¤¿¥Ð¥Ã¥¯¥È¥é¥Ã¥¯Ë¡¤Ë¤è¤ëÁíÅö¤ê¤Ç¤¹¡£
KÃʤξì¹ç¡¢K*(K+1)/2¤Î³¬¾è¤Ë¤Ê¤ê¤Þ¤¹¡£¡ÊK=5¡¢15!=1,307,674,368,000¡Ë

¤³¤Î¼ê¤Î¥Ñ¥º¥ë¤Ï¥Ð¥Ã¥¯¥È¥é¥Ã¥¯Ë¡¤Ç²ò¤±¤Þ¤¹¡Ê»þ´Ö¤Ï¤«¤«¤ë¡Ë¤Î¤Ç¡¢¤¼¤Ò¥Þ¥¹¥¿¡¼¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
PUBLIC NUMERIC ANSWER_COUNT !²òÅú¿ô
LET ANSWER_COUNT=0

LET K=5 !ÃÊ¿ô¡¡¢¨1¡Á

LET N=K*(K+1)/2 !£±¡Á£Ë¤Þ¤Ç¤Î¿ô»ú
DIM A(N)
MAT A=ZER

LET t0=TIME
PRINT K;"ÃÊ"
PRINT "1 ¡Á";N;"¤Þ¤Ç¤Î¿ô»ú"
CALL backtrack(1,K,N,A)
IF ANSWER_COUNT=0 THEN PRINT "²ò¤Ê¤·"
PRINT "·×»»»þ´Ö=";TIME-t0

END


EXTERNAL SUB backtrack(p,K,N,A())
FOR nm=1 TO N
   LET A(p)=nm !²¾¤ËÀßÄꤷ¤Æ¤ß¤ë

   CALL checkrule(p,nm,N,A, rc) !¾ò·ï¤òËþ¤¿¤¹¤Ê¤é
   IF rc=1 THEN

      IF p=N THEN !¤¹¤Ù¤ÆËä¤Þ¤Ã¤¿¤é
         LET ANSWER_COUNT=ANSWER_COUNT+1
         PRINT ANSWER_COUNT;"¸ÄÌÜ"

         FOR i=K TO 1 STEP -1 !¾åÃʤ«¤é
            PRINT REPEAT$(" ",K-i); !±¦¤Ø¥·¥Õ¥È
            FOR j=1 TO i !¤³¤ÎÃʤοô»ú¤Î¿ô
               PRINT USING "###": A((i-1)*i/2+j);
            NEXT j
            PRINT
         NEXT i
         !!!MAT PRINT A;

      ELSE
         CALL backtrack(p+1,K,N,A) !¼¡¤Ø

      END IF

   END IF
   LET A(p)=0 !¸µ¤ËÌ᤹
NEXT nm
END SUB


EXTERNAL SUB checkrule(p,nm,N,M() ,rc) !¾ò·ï¤¬Ëþ¤¿¤¹¤«¤É¤¦¤«³Îǧ¤¹¤ë
LET rc=0

!¡ü¿ô»ú¤Ï½ÅÊ£¤·¤Æ¤¤¤Ê¤¤¤«¡©
FOR i=1 TO p-1
   IF nm=M(i) THEN EXIT SUB !¸«¤Ä¤«¤Ã¤¿¤Î¤Ç£Î£Ç¡ª
NEXT i

!¡ü¾åÃʤΣ²¿ô¤Îº¹¡©
!M(p)¤Îź¤¨»úÈÖ¹æ¤ÈÇÛÃÖ
!11 12 ¡Ä¡¡¡¡¡¡£µÃÊÌÜ s=11
!¡¡7 8 9 10¡¡¡¡£´ÃÊÌÜ s=7
!¡¡ 4 5 6¡¡¡¡¡¡£³ÃÊÌÜ s=4
!¡¡¡¡2 3¡¡¡¡¡¡ £²ÃÊÌÜ s=2
!¡¡¡¡ 1¡¡¡¡¡¡¡¡£±ÃÊÌÜ s=1
!
!M(p-1)¡¡M(p)¡¡¡¡xÃÊÌÜ
!¡¡¡¡M(p-x)

LET a=1/2 !ÃÊ¿ô¤òÆÀ¤ë¡¡¢¨x¤Î£²¼¡ÊýÄø¼°(x-1)*x/2+1-p=0¤Î²ò
LET b=-1/2
LET c=1-p
LET D=b^2-4*a*c !ȽÊ̼°¡¡¢¨¤³¤Î²ò¤Ï¼Â¿ô¤Î¤ß
LET x=INT((-b+SQR(D))/(2*a))

IF x>1 THEN !£²ÃÊÌܰʹߤʤé
   IF p>(x-1)*x/2+1 THEN !¤³¤ÎÃʤΣ²ÎóÌܰʹߤʤé
      IF ABS(M(p-1)-M(p))<>M(p-x) THEN EXIT SUB !ÉÔÀ®Î©¤Ê¤Î¤Ç£Î£Ç¡ª
   END IF
END IF

!¡üº¸±¦ÂоÎ
IF p=N AND M(p)<M(p-x+1) THEN EXIT SUB !¾åÃʤκ¸Ã¼¤È±¦Ã¼

LET rc=1 !£Ï£Ë¡ª
END SUB
¡Ê¼Â¹Ô·ë²Ì¡Ë
 5 ÃÊ
1 ¡Á 15 ¤Þ¤Ç¤Î¿ô»ú
 1 ¸ÄÌÜ
  6 14 15  3 13
   8  1 12 10
    7 11  2
     4  9
      5
·×»»»þ´Ö= 36.36
¢¨WindowsME¡¢CPU Pentium­·700MHz¤Ë¤Æ
 

Re: µ¿Ìä

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î17Æü(·î)10»þ46ʬ44ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.88[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¡ü¥µ¥ó¥×¥ë¡¡¤½¤Î£²
KÃʤξì¹ç¡¢»ÈÍѤ¹¤ë¿ô»ú¤Ï1¡ÁN=K*(K+1)/2¤È¤Ê¤ë¡£
¾åÃʤοô»ú¤Î¤ß¤¬¼«Í³¤ËÀßÄê¤Ç¤­¤ë¡£¤¿¤À¤·¡¢½ÅÊ£¤Ï¤·¤Ê¤¤¡£
¤³¤Î¾åÃʤοô»úÎó¤Ï¡¢½çÎóP(N,K)¤Ç·è¤á¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
¤½¤ì¤Ë¤è¤Ã¤Æ¡¢²¼Ãʤϳ¬º¹¤È¤·¤Æ½ç¤Ë·è¤Þ¤ë¡£
¤³¤Î¤È¤­¡¢¿ô»ú¤Î½ÅÊ£¤¬¤Ê¤¤¤«³Îǧ¤¹¤ë¡£

K=3¤Ê¤é¡¢N=3*(3+1)/2=6¡£
¾åÃÊ 2 4 5 ¤È¤¹¤ë¤È

¡¡2 4 5
¡¡ 2 1¡¡¢«¾åÃÊ£²¤Ä¤Îº¹
¡¡¡¡1¡¡¢«¾åÃÊ£²¤Ä¤Îº¹

¤¿¤È¤¨¤Ð¡¢£²ÃÊÌÜ£±ÈÖÌܤΣ²¤¬½ÅÊ£¤·¤Æ¤¤¤ë¤¿¤á¡¢£Î£Ç¤È¤Ê¤ë¡£

£²ÃÊ¡¡3P2=          6
£³ÃÊ¡¡6P3=        120
£´ÃÊ¡¡10P4=     5,040
£µÃÊ¡¡15P5=   360,360
£¶ÃÊ¡¡21P6=39,070,080¡¡¢«¤«¤Ê¤ê¥­¥Ä¥¤
¡¡¡§
¤Î¿ô¤ò³Îǧ¤¹¤ë¡£
PUBLIC NUMERIC ANSWER_COUNT !²òÅú¿ô
LET ANSWER_COUNT=0

LET K=5 !ÃÊ¿ô¡¡¢¨1¡Á

LET N=K*(K+1)/2 !£±¡Á£Î¤Þ¤Ç¤Î¿ô»ú
DIM F(N),FF(N),B(K),BB(K)
MAT F=ZER
MAT B=ZER

LET t0=TIME

PRINT K;"ÃÊ"
PRINT "1 ¡Á";N;"¤Þ¤Ç¤Î¿ô»ú"
CALL perm(1,N,K, F,B,FF,BB)
IF ANSWER_COUNT=0 THEN PRINT "²ò¤Ê¤·"

PRINT "·×»»»þ´Ö=";TIME-t0

END


EXTERNAL SUB perm(p,N,R, F(),B(),FF(),BB()) !½çÎónPr¤òÀ¸À®¤¹¤ë
FOR nm=1 TO N !¾åÃʤΣ˸Ĥοô¤ò·è¤á¤ë

   IF F(nm)=0 THEN !¿ô»ú¤Ï½ÅÊ£¤Ê¤·¤ËËä¤á¤ë

      LET F(nm)=1 !»ÈÍÑÃæ¤È¤¹¤ë
      LET B(p)=nm !²¾¤ËÀßÄꤷ¤Æ¤ß¤ë

      IF p=R THEN !¤¹¤Ù¤ÆËä¤Þ¤Ã¤¿¤é
         CALL checkrule(R,F,B,FF,BB, rc) !¾ò·ï¤òËþ¤¿¤¹¤Ê¤é
         IF rc=1 THEN

            LET ANSWER_COUNT=ANSWER_COUNT+1
            PRINT ANSWER_COUNT;"¸ÄÌÜ"

            MAT BB=B
            FOR j=1 TO R !¾åÃÊ
               PRINT USING "###": BB(j);
            NEXT j
            PRINT
            FOR i=R-1 TO 1 STEP -1 !²¼ÃʤØ
               PRINT REPEAT$(" ",R-i); !±¦¤Ø¥·¥Õ¥È
               FOR j=1 TO i !¤³¤ÎÃʤοô»ú¤Î¿ô
                  LET BB(j)=ABS(BB(j)-BB(j+1))
                  PRINT USING "###": BB(j);
               NEXT j
               PRINT
            NEXT i

         END IF
      ELSE
         CALL perm(p+1,N,R, F,B,FF,BB) !¼¡¤Ø
      END IF

      LET B(p)=0 !¸µ¤ËÌ᤹
      LET F(nm)=0

   END IF

NEXT nm
END SUB


EXTERNAL SUB checkrule(K,F(),B(),FF(),BB(), rc) !¾ò·ï¤¬Ëþ¤¿¤¹¤«¤É¤¦¤«³Îǧ¤¹¤ë
LET rc=0

!¡üº¸±¦ÂоÎ
IF B(1)>B(K) THEN EXIT SUB !¾åÃʤκ¸Ã¼¤È±¦Ã¼

!¡ü¾åÃʤΣ²¿ô¤Îº¹¡©
MAT BB=B !ºî¶ÈÇÛÎó¤Ø
MAT FF=F
FOR x=K-1 TO 1 STEP -1 !xÃÊÌÜ
   FOR j=1 TO x !£±¤Ä²¼¤ÎÃÊ
      LET p=ABS(BB(j)-BB(j+1))
      IF FF(p)=1 THEN EXIT SUB !¿ô»ú¤¬½ÅÊ£¤·¤Æ¤¤¤Ê¤¤¤«
      LET BB(j)=p
      LET FF(p)=1 !»ÈÍÑÃæ¤È¤¹¤ë
   NEXT j
NEXT x

LET rc=1 !£Ï£Ë¡ª
END SUB

¡Ê¼Â¹Ô·ë²Ì¡Ë
¡ü  5 ÃÊ
1 ¡Á 15 ¤Þ¤Ç¤Î¿ô»ú
 1 ¸ÄÌÜ
  6 14 15  3 13
   8  1 12 10
    7 11  2
     4  9
      5
·×»»»þ´Ö= 23.13 ¡¡¢«Â¿¾¯Á᤯¤Ê¤Ã¤¿


¡ü  6 ÃÊ
1 ¡Á 21 ¤Þ¤Ç¤Î¿ô»ú
²ò¤Ê¤·
·×»»»þ´Ö= 2978.17
¢¨WindowsME¡¢CPU Pentium­·700MHz¤Ë¤Æ



¡ü²þÎÉ°Æ
¿ô»úN¤Ïɬ¤º¾åÃʤ˸ºß¤¹¤ë¡£¤³¤ÎÇÛÃÖ¤ÏKÄ̤ꡣ
»Ä¤êK-1²Õ½ê¤Ë»Ä¤ê¤Î¿ô»ú¤òËä¤á¤ë½çÎó¤ÏP(N-1,K-1)¤È¤Ê¤ë¡£
¤³¤ì¤Ë¤è¤Ã¤Æ¡¢

£²ÃÊ¡¡2¡ß2P1=             4
£³ÃÊ¡¡3¡ß5P2=            30
£´ÃÊ¡¡4¡ß9P3=         2,016
£µÃÊ¡¡5¡ß14P4=      120,120
£¶ÃÊ¡¡6¡ß20P5=   11,162,880
£·ÃÊ¡¡7¡ß27P6=1,491,890,400¡¡¢«¤«¤Ê¤ê¥­¥Ä¥¤

¤È¤Ê¤ê¡¢£·Ãʤεá²ò¤¬¸½¼Â¤È¤Ê¤ë¡©¡ª
 

¤ªÎé

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î17Æü(·î)15»þ17ʬ47ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¿§¡¹Ä´¤Ù¤Þ¤·¤¿¤é£µÃʤޤǤϹ½À®¤Ç¤­¤ë¤¬¡¢£¶ÃʰʹߤÏÉÔ²Äǽ¡Ê¾ÚÌÀ¤Ï¤É¤¦¤ä¤ë¤Î¤À¤í¤¦¤«¡©¡Ë¤È¤Î¤³¤È¤Ç¤·¤¿¡£
·ë²Ì¤ò¤ß¤ë¤È¤Ê¡¼¤ó¤À¡ª¤Ê¤ó¤Ç¤¹¤¬¤³¤ì¤ò»î¹Ôºø¸í¤À¤±¤Ç¤ä¤Ã¤Æ¤ß¤ë¤È¡¢ºÇ½é¤Î£µ¤Ä¤Î¿ô»ú¤òÈù̯¤ËÊѲ½¤µ¤»¤Ê¤¬¤é¤¤¤¯¤é¤ä¤Ã¤Æ¤â¡¢¿ôÃʸå¤Ë¤Ï½ÅÊ£¤¹¤ë¿ô»ú¤¬½Ð¸½¤·¤Æ¤¯¤ë¤Î¤Ç¤¹¡£
¤Þ¤µ¤ËÀ®¸ù¤¹¤ë¤Ë¤Ïº¬À­¤Î²¿¼Ô¤Ç¤â¤¢¤ê¤Þ¤»¤ó¡£¡Ê»ä¤â£³Æü¤Û¤É¼è¤êÁȤߤޤ·¤¿¤¬¤É¤¦¤·¤Æ¤â£µÃʤòȯ¸«¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£¥È¥Û¥Û¡¦¡¦¡¦¡Ë
¤³¤Î¥Ñ¥º¥ë¤Ïï¤Ë¤Ç¤â¤Ç¤­¡¢¤¢¤­¤é¤á¤Ê¤¤µ¤»ý¤Á¤È¿¾¯¤Î¹¬±¿¤È¤¤¤¦¥®¥ã¥ó¥Ö¥ëŪÍ×ÁǤò´Þ¤ó¤À¤È¤Ã¤Æ¤â¤¤¤¤¥Ñ¥º¥ë¤À¤È»×¤¤¤Þ¤·¤¿¡£
¤À¤ì¤¬¤³¤ó¤Êȯ¸«¤ò¤·¤ÆÀ¤¤ÎÃæ¤Ë¾Ò²ð¤·¤Æ¤¤¤ë¤ó¤Ç¤·¤ç¤¦¤«¡©
¤Þ¤¿¤³¤ì¤¬£µÃʤǽª¤ï¤ê¤È¤¤¤¦¤³¤È¤â¤¢¤ê¤¬¤¿¤¤¤Ç¤¹¡£
¤â¤¦¤³¤ì°Ê¾å¹Í¤¨¤¿¤¯¤â¤¢¤ê¤Þ¤»¤ó¤â¤Î¡¦¡¦¡¦
¤·¤«¤·
¾ÚÌÀ¤µ¤ì¤¿¤È¤Ï¥Û¥ó¥È¤Ï¥¦¥½¤Ç¡¢Í¾¤ê¤Ë¤â¥Ñ¥¿¡¼¥ó¿ô¤¬Â¿¤¯£¶¡¤£·¡¤£¸¡¦¡¦¡¦¤Þ¤Ç¹½À®¤Ç¤­¤Ê¤¤¤«¤é°Ê¹ß¤â¤¢¤êÆÀ¤Ê¤¤¤À¤í¤¦¤È¤Î´¶³Ð¤À¤±¤«¤é¤½¤¦·ëÏÀ¤ò½Ð¤·¤Æ¤¤¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
¤¢¤ë»×¤¤¤¬¤±¤Ê¤¤Ãʤˤª¤¤¤Æ¹½À®²Äǽ¤Ç¤Ï¤Ê¤«¤í¤¦¤«¤È¤¤¤¦»×¤¤¤â¤É¤³¤«¤Ë»Ä¤ê¤Þ¤¹¡£
¤É¤Ê¤¿¤«¿ô³ØŪ¤Ê¾ÚÌÀ¤ò½Ð¤·¤Æ²¼¤µ¤¤¡£
 

Re: ½õ¤±¤Æ²¼¤µ¤¤¡£

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2008ǯ11·î17Æü(·î)23»þ52ʬ29ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.86[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£


Á´¿ôÄ´ººÍÑ¥×¥í¥°¥é¥à´°À®¤·¤Þ¤·¤¿¡£

¤Þ¤º1¹ÔÌܤò·è¤á¤Æ¡¢º¹¤ò¼è¤Ã¤Æ¤¤¤­¿ô»ú¤Î½ÅÊ£¤¬¤Ê¤¤¤«Ä´ºº¤·¤Þ¤¹¡£

k¹Ô¤Çn¸Ä¤Î¿ô»ú¤È¤¹¤ë¤È¡¢(n-1)¸Ä¤«¤é(k-1)¸Ä¤ò¼è¤ê½Ð¤·¤¿½çÎóp¤ÎÁ°È¾Éôʬ¤Ën¤òÁÞÆþ¤·¤Æ1¹ÔÌܤò¹½À®¤·¤Þ¤¹¡£

Ä´ºº²ó¿ô¤ò¸º¤é¤¹¤¿¤á¤Ë¡¢ÂоÎŪ¤Ê¿ôÎó¤Ï¥­¥ã¥ó¥»¥ë¤¹¤ë¤è¤¦¤Ë¤·¤Þ¤·¤¿¡£

¤¿¤È¤¨¤Ð¡¢k=5,n=15¤ÇÇÛÎóp¤¬ 7,11,6,9 ¤À¤È¤·¤Þ¤¹¡£

Ä´ºº¤¹¤ë¤Î¤Ï¡¢

  15,7,11,6,9
  7,15,11,6,9
  7,11,15,6,9

¤³¤Î3Ä̤ê¤È¤·¤Þ¤¹¡£

7,11,6,15,9 ¤È 7,11,6,9,15 ¤Ï¡¢ÇÛÎóp¤¬ 9,6,11,7 ¤Î¤È¤­¤ËÄ´ºº¤·¤Þ¤¹¡£

¤Þ¤¿¡¢¤³¤Î¤È¤­¤Ï 9,6,15,11,7 ¤ÏÄ´ºº¤·¤Þ¤»¤ó¡£


  ¹Ô¿ô     ¼Â¹Ô»þ´Ö   Ä´ºº²ó¿ô     ²ò
  k=2 --->   0.03 Éà        2 ²ó   2¸Ä
  k=3 --->   0.08 Éà       30 ²ó   4¸Ä
  k=4 --->   0.14 Éà     1008 ²ó   4¸Ä
  k=5 --->   2.05 Éà    60060 ²ó   1¸Ä
  k=6 ---> 192.16 Éà  5581440 ²ó   0¸Ä (2¿Ê¥â¡¼¥É¤Ç100.20ÉÃ)
  k=7 ---> ̤Ĵºº    745945200 ²ó   ?¸Ä (2¿Ê¥â¡¼¥É¤Ç¤â4»þ´Ö¶á¤¯¤«?)
  k=8 ---> ̤Ĵºº 135566323200 ²ó   ?¸Ä


DECLARE EXTERNAL SUB combi
PUBLIC NUMERIC k,n,h,pt,count
LET t0=TIME
LET k=5         ! ¹Ô¿ô
LET n=k*(k+1)/2 ! ºÇÂçÃÍ
LET h=INT(k/2)  ! Ⱦʬ
LET pt=MOD(k,2) ! ´ñ¶ö
DIM nn(n-1),c(k-1)
MAT nn=ZER
LET count=0
LET j=0
CALL combi(nn,1,k-1,j,c)
PRINT TIME-t0;"ÉÃ",count;"²ó"
END

EXTERNAL SUB differ(p()) !Ãí°Õ:°ìÉô²þÎɤ·¤Þ¤·¤¿
DIM a(k,k),ck(n-1)
LET a(1,1)=n
FOR j=2 TO k
   LET a(1,j)=p(j-1)
NEXT j
CALL check
FOR j=2 TO h
   SWAP a(1,j-1),a(1,j)
   CALL check
NEXT j
IF pt=1 AND p(1)<p(k-1) THEN ! n¤¬Ãæ±û¤Î¤È¤­
   SWAP a(1,h),a(1,h+1)
   CALL check
END IF
SUB check
   LET count=count+1
   MAT ck=ZER
   FOR r=1 TO k-1
      LET ck(p(r))=1
   NEXT r
   FOR ii=1 TO k-1
      FOR jj=1 TO k-ii
         LET d=ABS(a(ii,jj)-a(ii,jj+1))
         IF ck(d)=1 THEN EXIT SUB ! ¿ôÃͽÅÊ£
         LET ck(d)=1
         LET a(ii+1,jj)=d
      NEXT jj
   NEXT ii
   MAT PRINT a;  ! ²ò¤¢¤ê
END SUB
END SUB

REM ½½¿ÊBASICźÉÕ"\BASICw32\SAMPLE\COMBINAT.BAS"¤è¤ê
REM 1¡Án-1¤Î½¸¹ç¤«¤ér¸Ä¤òÁª¤ÖÁȹ礻¤òÀ¸À®¤¹¤ë¡£
EXTERNAL SUB combi(nn(),kk,r,j,c())
DECLARE EXTERNAL SUB permu
! kk°Ê¹ß¤Î¿ô¤«¤ér¸Ä¤òÁªÂò¤¹¤ë
IF r=0 THEN
   FOR i=1 TO n-1
      IF nn(i)=1 THEN
         LET j=j+1
         LET c(j)=i
      END IF
   NEXT i
   !MAT PRINT c;
   CALL permu(c,1)
   LET j=0
ELSE
   FOR i=kk TO n-r
      LET nn(i)=1
      CALL combi(nn,i+1,r-1,j,c)
      LET nn(i)=0
   NEXT i
END IF
END SUB

REM ½½¿ÊBASICźÉÕ"\BASICw32\SAMPLE\PERMUTAT.BAS"¤è¤ê
REM (k-1)¸Ä¤Î¿ôÃͤνçÎó¤ò¼­½ñ¼°½ç½ø¤ÇÀ¸À®¤¹¤ë¡£
EXTERNAL SUB permu(p(),r)
DECLARE EXTERNAL SUB differ
IF r=k-1 THEN
!MAT PRINT p;
   CALL differ(p)
ELSE
   FOR i=r TO k-1
      LET t=p(i)
      FOR j=i-1 TO r STEP -1
         LET p(j+1)=p(j)
      NEXT j
      LET p(r)=t
      CALL permu(p,r+1)
      LET t=p(r)
      FOR j=r TO i-1
         LET p(j)=p(j+1)
      NEXT j
      LET p(i)=t
   NEXT i
END IF
END SUB
 

µ¡³£¸ì¤Ç®ÅÙ¤ò¾å¤²¤¿¤¬

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ11·î18Æü(²Ð)04»þ24ʬ8ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.39[¸µµ­»ö¤Ø]

!ÃÙ¤¤Êý¤Î check1,check2,echk ¥ë¡¼¥Á¥ó ¤À¤±¡¢µ¡³£¸ì¤Ç®ÅÙ¤ò¾å¤²¤¿¤¬¡¢
!1.7GHz Pentium-4 128MB ¤Ç£¸»þ´Ö¤â¤«¤«¤ë¡££Ã¸À¸ì¤è¤ê®¤¤¤Ï¤º¤Ê¤Î¤À¤¬¡¢
!»ä¤Î½ñ¤­Êý¤¬ÉÔÌ£¤¤¤Î¤«¡©
! http://homepage2.nifty.com/neutro/asm/hojin_43.dll   ...Ʊ¤¸¥Õ¥©¥ë¥À¤ËÃÖ¤¯¡£
! http://homepage2.nifty.com/neutro/asm/hojin_43.asm   ...¥½¡¼¥¹
!----------------------------------------------------------------------------
!/* £¶¼¡¤Î¥ª¥¤¥é¡¼Êý¿Ø¤¬Â¸ºß¤·¤Ê¤¤¤³¤È¤ò³Îǧ¤¹¤ë. */

OPTION CHARACTER byte
SET TEXT BACKGROUND "opaque"
SET TEXT font"",14
OPTION BASE 0
DIM wb(8,8)
!
LET lb$=REPEAT$( CHR$(0),10000*8*8) !  N=1¡Á7: 1,1,1,4,56,9408,16942080
LET N= 6 !  2,3,4,5,6
LET cp= 1000 ! ¥«¥¦¥ó¥¿¡¼¤Îɽ¼¨´Ö³Ö(1~20000)¡¢¾®¤µ¤¤¤È®ÅÙÄã²¼¡£Â礭¤¤¤ÈÃæ»ß¤¬º¤Æñ¡£
!
CALL main

SUB makelb(x,y)
   local element
   FOR element=0 TO N-1
      FOR i=0 TO x-1
         IF element=wb(y,i) THEN EXIT FOR ! break;
      NEXT i
      IF i>x-1 THEN
         FOR i=0 TO y-1
            IF element=wb(i,x) THEN EXIT FOR ! break;
         NEXT i
         IF i>y-1 THEN
            LET wb(y,x)=element
            IF y=N-1 AND x=N-1 THEN
            !----memcpy(lb[lbs++], wb, sizeof(wb));
               LET w=1+64*lbs
               FOR i=0 TO N-1
                  FOR j=0 TO N-1
                     LET lb$(w+j:w+j)=CHR$(wb(i,j))
                  NEXT j
                  LET w=w+8
               NEXT i
               !--------¥â¥Ë¥¿¡¼
               IF MOD(lbs,1000)=0 THEN PRINT "ºîÀ®Ãæ¡£N=";N;"lbs=";lbs
               !--------
               LET lbs=lbs+1
               EXIT SUB ! return;
            END IF
            IF y=N-1 THEN CALL makelb(x+1,1) ELSE CALL makelb((x),y+1)
         END IF
      END IF
   NEXT element
END SUB

SUB main
   FOR i=0 TO N-1
      LET wb(i,0)=i ! =element
      LET wb(0,i)=i ! =element
   NEXT i
   !------
   PRINT "ɸ½à¤Î¥é¥Æ¥óÊý¿Ø¤ÎºîÀ®¡£"
   LET lbs=0
   CALL makelb(1,1)
   PRINT "ºîÀ®½ªÎ»¡£"
   PRINT
   PRINT "¼¡¿ô N=";N;"lbs=";lbs;"¸Ä"
   PRINT "ɸ½à¤Î¥é¥Æ¥óÊý¿Ø¡¡2¤Ä¤Ç¡¢"
   PRINT "¡¡¡¡¥ª¥¤¥é¡¼Êý¿Ø¤ò¹½À®²Ä¡©"
   LET w$=STR$(lbs)
   IF lbs>2 THEN LET w$=w$& "+"& STR$(lbs-1)
   IF lbs>3 THEN LET w$=w$& "+"& STR$(lbs-2)
   IF lbs>4 THEN LET w$=w$& "+..."
   IF lbs>1 THEN LET w$=w$& "+1"
   PLOT TEXT,AT 0.1,0.9 :w$& " ¤¬¸¡ºº²ó¿ô¤Ç¤¹¡£"
   PLOT TEXT,AT 0.1,0.8 :"("& STR$(lbs) &"+1)*"& STR$(lbs)& "/2= "& STR$((lbs+1)*lbs/2)& "²ó¤Þ¤Ç¡¢²¿»þ´Ö¡©"
   PRINT "µ¡³£¸ì¼Â¹ÔÃæ"
   IF check1( CallBackAdr(9), N+16*cp, lbs, lb$)=0 THEN PRINT "²ò¤Ï¡¢Í­¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£"
   PRINT "½ªÎ»¤·¤Þ¤·¤¿¡£"
END SUB

!-------------------------------------
FUNCTION check1( moni¤Î¥¢¥É¥ì¥¹, Ncp, lbs, lb$ )
   ASSIGN "hojin_43.dll","start00"
END FUNCTION

!-------------------------------------
!  hojin.dll ¤¬»ÈÍѤ¹¤ëʸ¤Ç¡¢¾õÂÖɽ¼¨ÍÑ¡£
SUB moni(message$,count), callback 9
   PRINT message$;
   PLOT TEXT,AT 0.1, 0.7 :"count= "&STR$(count)
END SUB

END

!Ãí°Õ¡§½½¿ÊBASIC¤Î Ver7.2.0 °Ê¹ß ¤Î¥Ð¡¼¥¸¥ç¥ó¤¬É¬ÍפǤ¹¡£
 

Re: ½õ¤±¤Æ²¼¤µ¤¤¡£

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î18Æü(²Ð)10»þ38ʬ17ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.91[¸µµ­»ö¤Ø]

¹ÓÅĹÀÆ󤵤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

>
>   ¹Ô¿ô     ¼Â¹Ô»þ´Ö   Ä´ºº²ó¿ô     ²ò
>   k=2 --->   0.03 Éà        2 ²ó   2¸Ä
>   k=3 --->   0.08 Éà       30 ²ó   4¸Ä
>   k=4 --->   0.14 Éà     1008 ²ó   4¸Ä
>   k=5 --->   2.05 Éà    60060 ²ó   1¸Ä
>   k=6 ---> 192.16 Éà  5581440 ²ó   0¸Ä (2¿Ê¥â¡¼¥É¤Ç100.20ÉÃ)
>   k=7 ---> ̤Ĵºº    745945200 ²ó   ?¸Ä (2¿Ê¥â¡¼¥É¤Ç¤â4»þ´Ö¶á¤¯¤«?)
>   k=8 ---> ̤Ĵºº 135566323200 ²ó   ?¸Ä

Á°²ó£ë¡á£µ¤Ç´Ý°ìÆü¤Ç¤â·×»»ÅÓÃæ¤È½ªÎ»¤»¤º¤Ë¤Ê¤Ã¤Æ¤¤¤¿¤â¤Î¤¬¡¢
º£²ó¤Î¥×¥í¥°¥é¥à¤Ç4.28Éáʤʤó¤È¤¤¤¦Ã»»þ´Ö¡Ë¤Ç·ë²Ì¤¬½Ð¤Æ¤­¤Þ¤·¤¿¡£
£¶Ëü²ó°Ê¾å¤Î¥Á¥§¥Ã¥¯¤¬¤³¤ó¤Êû»þ´Ö¤Ë¤Ê¤µ¤ì¤Æ¤¤¤ë¤Ê¤ó¤Æ¡¢¤ª¤¤¤é¤ÎƬ¤Ï¤Ê¤ó¤Ê¤ó¤À¡ª
¥×¥í¥°¥é¥à°ì¤Ä¤Ç¤³¤¦¤â°ã¤¦¤³¤È¤Ë¤Ê¤ë¤È¤Ï¡¢¥×¥í¥°¥é¥à¤ÎÀ¤³¦¤â±ü¿¼¤¤¤Ç¤¹¤Í¡£
 

Re: µ¡³£¸ì¤Ç®ÅÙ¤ò¾å¤²¤¿¤¬

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î18Æü(²Ð)10»þ44ʬ11ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.92[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

µ¡³£¸ì¡©¡©¡©
»ä¤Ë¤Ï¡¢¤³¤Î¥×¥í¥°¥é¥à¤ò¤É¤¦»È¤Ã¤¿¤é¤è¤¤¤Î¤«¸¡Æ¤¤â¤Ä¤­¤Þ¤»¤ó¡£
°ì±þ¥³¥Ô¡¼¤ò¤·¤Æ£Â£Á£Ó£É£Ã¾å¤ÇÁö¤é¤»¤Þ¤·¤¿¤¬¡¢²¿¤«¤Î¥Õ¥¡¥¤¥ë¤¬Æɤá¤Þ¤»¤ó¤ÈÊÖ»ö¤¬Ê֤äƤ­¤Þ¤·¤¿¡£
¤³¤ì¤ò»È¤¦¤Ë¤Ï¤É¤¦¤·¤¿¤é¤è¤¤¤«¶µ¤¨¤Æ²¼¤µ¤¤¡£
 

matÌ¿Îá¤ÈÊ£ÁÇ¿ôɽ¼¨

 Åê¹Æ¼Ô¡§Âç·§¡¡Àµ  Åê¹ÆÆü¡§2008ǯ11·î18Æü(²Ð)11»þ28ʬ38ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ºÇ¶á10¿ÊBASIC¤Î¥Ö¥ë¡¼¥Ð¥Ã¥¯¥¹¤ÎËܤò¹ØÆþ¡¢¤½¤Îκ¤Ë¤Ê¤Ã¤Æ¤Þ¤¹¡£
½ê¤Ç¡¢Åŵ¤´Ø·¸¤Ç¤Ï¡¢4ü»ÒÌÖ¤ò¥Þ¥È¥ê¥¯¥¹[A,B,C,D]ɽ¼¨¤·¤Þ¤¹¡£10¿ÊBASIC¤ÎMATʸ¤ËÊ£ÁÇɽ¼¨¤ÎÃͤòÆþ¤ì¤Æ·×»»¤µ¤»¤ë¤Ë¤Ï¡¢¤É¤¦¤·¤¿¤é ¤è¤¤¤Ç¤·¤ç¤¦¤«¡£A=5¡Ü3i B=4-6i C=7+2i D=2-3i¤Ê¤É¤ÈÆþ¤ì¤¿¤é[¼Â¿ô¤Ç¤Ê¤¤¤ÈÂÌÌÜ]¤ÈµñÈݤµ¤ì¤Þ¤·¤¿¡£¤Þ¤¿Ê£ÁÇ¿ôɽ¼¨¤ÎMAT¤ÎÀѤäµÕ¹ÔÎó¡¢Åù¤â¤É¤¦¤¹¤ë¤Î¤Ç¤·¤ç¤¦¤«¡£
 

Re: ½õ¤±¤Æ²¼¤µ¤¤¡£

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î18Æü(²Ð)11»þ41ʬ45ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.93[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¥×¥í¥°¥é¥à°ì¤Ä¤Ç¤³¤¦¤â°ã¤¦¤³¤È¤Ë¤Ê¤ë¤È¤Ï¡¢¥×¥í¥°¥é¥à¤ÎÀ¤³¦¤â±ü¿¼¤¤¤Ç¤¹¤Í¡£


º£²ó¾Ò²ð¤µ¤ì¤¿¥×¥í¥°¥é¥à¤Ï°Ê²¼¤Î¼êË¡¤òÍѤ¤¤Æ¤¤¤Þ¤¹¡£

¡¦¥â¥ó¥Æ¥«¥ë¥íË¡
¡¡¥é¥ó¥À¥à¤Ë¿ô»ú¤òËä¤á¤Æ¾ò·ï¤Ë¹ç¤¦¤«³Îǧ¤¹¤ë¡£
¡¡³ÎΨ¤Ç¤¹¤«¤é¡¢¡Ö¶öÁ³¤Ë¤ß¤Ä¤«¤ë¡×¤ò´üÂÔ¤¹¤ë¡£
¡¡¢ª¹ÓÅĹÀÆ󤵤ó¤Î£±²óÌÜ

¡¦¥Ð¥Ã¥¯¥È¥é¥Ã¥¯Ë¡
¡¡½çÎó¤äÁȹ礻¤Ë¤è¤ë¿ô»ú¤òȯÀ¸¤·¤Æ¡¢¾ò·ï¤Ë¹ç¤¦¤è¤¦¤Ë½ç¤Ë¿ô»ú¤òËä¤á¤Æ¤¤¤¯¡£¡Êº£²ó¤Ï²¼¤«¤é¡Ë
¡¡»Þ´¢¤ê¸ú²Ì¡ÊÌ·½âȯÀ¸°Ê¹ß¤ÏÂоݳ°¤È¤¹¤ë½èÍý¡Ë¤ò´üÂÔ¤¹¤ë¡£¡Ê¸¡¾Ú²ó¿ô¤¬¸º¤ë¡Ë
¡¡¢ª»ä¤Î£±²óÌÜ

¡¦¡Ö¾ì¹ç¤Î¿ô¡×Ë¡
¡¡ÌäÂê¤Ë±þ¤¸¤¿¡Ö¾ì¹ç¤Î¿ô¡×¤ò¡¢½çÎó¤äÁȹ礻¤ò¹Í¤¨¤ÆºÇ¾®²ó¿ô¤Î¸¡¾Ú¤ò¹Ô¤¦¡£
¡¡¢ª¹ÓÅĹÀÆ󤵤ó¤Î£²²óÌÜ
¡¡¢ª»ä¤Î£²²óÌÜ


¥×¥í¥°¥é¥ß¥ó¥°¤Ï¡¢¥³¡¼¥Ç¥£¥ó¥°¡Ê¸À¸ì¤Ë¤è¤ëɽ¸½¡Ë¤è¤ê¡¢
¥¢¥ë¥´¥ê¥º¥à¡Ê²ò¤­Êý¡Ë¤ò¸¡Æ¤¤¹¤ë¤Î¤¬¼ç¤À¤È»×¤¤¤Þ¤¹¡£
 

Re: matÌ¿Îá¤ÈÊ£ÁÇ¿ôɽ¼¨

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î18Æü(²Ð)11»þ55ʬ10ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.95[¸µµ­»ö¤Ø]

Âç·§¡¡Àµ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£


BASIC¤ÎÊÔ½¸²èÌ̤ˡÖÊ£ÁÇ¿ô¡×¥Ü¥¿¥ó¤¬¤¢¤ê¤Þ¤¹¡£¥ª¥ó¤Î¾õÂÖ¤ÇÊ£ÁÇ¿ô¤Î·×»»¤¬²Äǽ¤Ç¤¹¡£
Ä̾ï¤Ï¡¢²¼µ­¤Î¤è¤¦¤Ë¥×¥í¥°¥é¥à¤Ëµ­½Ò¤·¤Þ¤¹¡£

£²¡ß£²ÀµÊý¹ÔÎó¤Î³ÆÍ×ÁǤËÃͤòÀßÄꤹ¤ë¥×¥í¥°¥é¥à

¡üÎ㣱

OPTION ARITHMETIC COMPLEX !Ê£ÁÇ¿ô¤ò°·¤¦

LET j=SQR(-1) !µõ¿ôñ°Ì¡¡¢¨Åŵ¤·Ï¤Ï£ê¤ò»È¤¦

!M=(a b)
!  (c d)
DIM M(2,2) !£²¡ß£²¤ÎÀµÊý¹ÔÎó

LET M(1,1)=5+3*j !a
LET M(1,2)=4-6*j !b
LET M(2,1)=7+2*j !c
LET M(2,2)=2-3*j !d

MAT PRINT M;

END


¡üÎ㣲¡¡¢¨¤³¤Î¾ì¹ç¤Ï£ê¤ÏɬÍפʤ¤

OPTION ARITHMETIC COMPLEX !Ê£ÁÇ¿ô¤ò°·¤¦

!M=(a b)
!  (c d)
DIM M(2,2) !£²¡ß£²¤ÎÀµÊý¹ÔÎó

LET M(1,1)=COMPLEX(5,3) !a
LET M(1,2)=COMPLEX(4,-6) !b
LET M(2,1)=COMPLEX(7,2) !c
LET M(2,2)=COMPLEX(2,-3) !d

MAT PRINT M;

END

Ê£ÁÇ¿ô¤Ï¡¢³ç¸ÌÉÕ¤­¤Î¿ô»ú¤ÎÁȡʼÂÉô¡¢µõÉô¡Ë¤Çɽ¼¨¤µ¤ì¤Þ¤¹¡£


³Ý¤±»»¤Ï
  DIM A(2,2),B(2,2),C(2,2),T(2,2)
  MAT T=A*B !T=AB

  MAT T=A*B !T=ABC
  MAT T=T*C
¤Èµ­½Ò¤·¤Þ¤¹¡£
²Ã¸º¾è¤Ï£²¹à¤Î±é»»¤Î¤ß¤Ç¤¹¤«¤é¡¢£³¹à°Ê¾å¤Ï£²¹à¤º¤Ä¤Ëʬ²ò¤·¤¿µ­½Ò¤·¤Æ¤¯¤À¤µ¤¤¡£


Äê¿ôÇܤϡ¢MAT T=(2)*A !T=2A
µÕ¹ÔÎó¤Ï¡¢MAT T=INV(A) !T=A^-1
žÃÖ¹ÔÎó¤Ï¡¢MAT T=TRN(A) !T=tA
¹ÔÎ󼰤ϡ¢LET p=DET(A) !p=|A|
¤³¤ì¤é¤Ï£±¹à¤Î¤ß¤Ç¤¹¡£

¹ÔÎó¤Î·×»»¤Ë¤Ï¼Â¹ÔÎó¤ÈÊ£ÁǹÔÎó¤Î¶èÊ̤Ϥ¢¤ê¤Þ¤»¤ó¡£
 

Re: µ¡³£¸ì¤Ç®ÅÙ¤ò¾å¤²¤¿¤¬

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ11·î18Æü(²Ð)14»þ14ʬ21ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.94[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£
>
> µ¡³£¸ì¡©¡©¡©
> »ä¤Ë¤Ï¡¢¤³¤Î¥×¥í¥°¥é¥à¤ò¤É¤¦»È¤Ã¤¿¤é¤è¤¤¤Î¤«¸¡Æ¤¤â¤Ä¤­¤Þ¤»¤ó¡£
> °ì±þ¥³¥Ô¡¼¤ò¤·¤Æ£Â£Á£Ó£É£Ã¾å¤ÇÁö¤é¤»¤Þ¤·¤¿¤¬¡¢²¿¤«¤Î¥Õ¥¡¥¤¥ë¤¬Æɤá¤Þ¤»¤ó¤ÈÊÖ»ö¤¬Ê֤äƤ­¤Þ¤·¤¿¡£
> ¤³¤ì¤ò»È¤¦¤Ë¤Ï¤É¤¦¤·¤¿¤é¤è¤¤¤«¶µ¤¨¤Æ²¼¤µ¤¤¡£

  http://homepage2.nifty.com/neutro/asm/hojin_43.dll

¤³¤Îµ¡³£¸ì¥Õ¥¡¥¤¥ë¤ò¡¢¥À¥¦¥ó¥í¡¼¥É¤·¤Æ¡¢·Ç¼¨¤Î¥×¥í¥°¥é¥à¤ÈƱ¤¸¥Õ¥©¥ë¥À¡¼¤ËÃÖ¤¯¤È
Áö¤ê¤Þ¤¹¡£

¢¨¡Öµ¡³£¸ì¤Ï¡¢Ì¿Îá¸ì¼«ÂΤò¡¢¥×¥í¥°¥é¥à¤·¤Æ®ÅÙ¤òõ¤¹À¤³¦¤Ç¡¢
¡¡¡¡½ñ¤­Êý¡Ê¥¢¥ë¥´¥ê¥º¥à¡Ë¤Ë¤è¤Ã¤Æ¡¢£±£°Çܤâ¤Î®¤µ¤¬¡¢Æ±¤¸¥½¡¼¥¹¤Ç¡¢
¡¡¡¡Æ±¤¸¿ô³Ø¥¢¥ë¥´¥ê¥º¥à¤Ç¤â¡¢°ã¤Ã¤¿¤ê¤â¤·¤Þ¤¹¡£
 

¤µ¤¤¤³¤í¤òž¤¬¤¹

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î18Æü(²Ð)18»þ56ʬ39ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  »ä¤«¤é¤â£±¤Ä¥Ñ¥º¥ë¤ò¾Ò²ð¤·¤Þ¤¹¡£

¡üÌäÂê
£´¡ß£´¤Î³Ê»Ò¤¬¤¢¤ë¡£º¸¾å¤ò¥¹¥¿¡¼¥È¡¢±¦²¼¤ò¥´¡¼¥ë¤Î°ÌÃ֤Ȥ¹¤ë¡£
¤µ¤¤¤³¤í¤ÎÌÜ¡Ö£±¡×¤ò¾å¤Ë¤·¤Æ¥¹¥¿¡¼¥È¤ËÃÖ¤­¡¢¥´¡¼¥ë¤Ë¸þ¤±¤Æž¤¬¤¹¡£
¤³¤Î¤È¤­¡¢¥´¡¼¥ë¤Ç¤ÎÌܤοô¤¬£±¡Á£¶¤Ë¤Ê¤ëž¤¬¤·Êý¡Ê·ÐÏ©¡Ë¤òµá¤á¤ë¡£

·ÐÏ©¤Î·è¤áÊý¤Ë¡¢½ÅÊ£Ä̲ᡢ±ª²ó¡¢Ä̲áÅÀ¤Ê¤É¤ÎÀ©¸Â¤òÀߤ±¤Æ¤â¤è¤¤¡£


¥·¥ß¥å¥ì¡¼¥¿¤ò¤Ä¤¯¤Ã¤Æ³Îǧ¤·¤Æ¤ß¤Þ¤·¤¿¡£Â¾¤Ë¤â¤¢¤ë¤È»×¤¤¤Þ¤¹¡£

!¡Ö¤µ¤¤¤³¤í¤Î²óž¡×¤Î¥·¥ß¥å¥ì¡¼¥·¥ç¥ó

!ÃÖ´¹¡ÊPermutation¡Ë¤Î·×»»
SUB PermPrintOut(A()) !ɽ¼¨¤¹¤ë
   MAT PRINT USING(REPEAT$(" ##",UBOUND(A))): A;
   PRINT
END SUB
SUB PermIdentity(A()) !¹±ÅùÃÖ´¹
   FOR i=1 TO UBOUND(A)
      LET A(i)=i
   NEXT i
END SUB
SUB PermInverse(A(), iA()) !µÕÃÖ´¹¡¡¢¨iA¤ÏA°Ê³°¤ÎÇÛÎó¤ò»ØÄꤹ¤ë¤³¤È
   FOR i=1 TO UBOUND(A)
      LET iA(A(i))=i
   NEXT i
END SUB
SUB PermMultiply(A(),B(), AB()) !ÀÑAB¡¡¢¨AB¤ÏA¤«¤ÄB°Ê³°¤ÎÇÛÎó¤ò»ØÄꤹ¤ë¤³¤È
   LET ua=UBOUND(A)
   LET ub=UBOUND(B)
   IF ua=ub THEN
      FOR i=1 TO ua
         LET AB(i)=A(B(i)) !¢¨¹çÀ®¼ÌÁü(AB)(i)=A(B(i))
      NEXT i
   ELSE
      PRINT "¼¡¸µ¤¬°ã¤¤¤Þ¤¹¡£A=";ua;" B=";ub
      STOP
   END IF
END SUB
!-------------------- ¤³¤³¤Þ¤Ç¤¬¥µ¥Ö¥ë¡¼¥Á¥ó


LET N=6

!Ÿ³«¿Þ¤ÎÇÛÃÖ¤ÈÌÌÈÖ¹æ¡ÊÇÛÎó¤Îź¤¨»ú¡Ë¤È¤Î´Ø·¸
!¡¡¢¢¡¡¡¡¡¡¡¡¸å¡¡¡¡¡¡¡¡£±
!¢¢¢¢¢¢¢¢¡¡º¸¾å±¦²¼¡¡£²£³£´£µ
!¡¡¢¢¡¡¡¡¡¡¡¡Àµ¡¡¡¡¡¡¡¡£¶

!---------- ¢­¢­¢­¢­¢­ ----------
DIM A(N)
DATA 5,4,1,3,6,2 !ÌܤÎÇÛÃÖ¡¡¢¨Å¸³«¿Þ»²¾È
MAT READ A

!LET s$="DRDRDR" !¼ê½ç 1
!LET s$="RRRDDD" !¼ê½ç 2
!LET s$="RRDDDR" !¼ê½ç 3
!LET s$="RRDRDD" !¼ê½ç 4
!LET s$="RDDDRR" !¼ê½ç 5
LET s$="RDLDRRRD" !¼ê½ç 6
!---------- ¢¬¢¬¢¬¢¬¢¬ ----------


DIM U(N),D(N),L(N),R(N) !ÃÖ´¹
!    1,2,3,4,5,6
DATA 3,2,6,4,1,5 !¾å¡¡¢¨ÀµÌ̤ò¾åÌ̤ˤ¹¤ë¤Î¡Ê¿Þ¤Ç¤Î¿åÊ¿¼´¡Ë²óž
!!!DATA 5,2,1,4,6,3 !²¼
DATA 1,3,4,5,2,6 !º¸
!!!DATA 1,5,2,3,4,6 !±¦

MAT READ U
CALL PermInverse(U,D)
!!!MAT READ D
MAT READ L
CALL PermInverse(L,R)
!!!MAT READ R


SET WINDOW -1,5,5,-1 !ɽ¼¨Îΰè
DRAW grid !³Ê»Ò

DIM T(N),TT(N) !ºî¶ÈÇÛÎó
LET x=0.5 !º¸¾å
LET y=0.5

MAT T=A !½é´ü¾õÂÖ¤òɽ¼¨¤¹¤ë
CALL disp(T)

FOR k=1 TO LEN(s$) !¥¹¥¯¥ê¥×¥È¤ò¼Â¹Ô¤¹¤ë

   PLOT LINES: x,y; !·ÐÏ©¤Î·ëÀþ¡¡»ÏÅÀ

   SELECT CASE UCASE$(s$(k:k)) !³ÆÊý¸þ¤Ø
   CASE "U","N"
      CALL PermMultiply(T,U,TT)
      LET y=y-1
   CASE "D","S"
      CALL PermMultiply(T,D,TT)
      LET y=y+1
   CASE "L","W"
      CALL PermMultiply(T,L,TT)
      LET x=x-1
   CASE "R","E"
      CALL PermMultiply(T,R,TT)
      LET x=x+1
   CASE ELSE
   END SELECT
   MAT T=TT !¼¡¤Ø

   PLOT LINES: x,y; !½ªÅÀ

   CALL disp(T)

NEXT k

SUB disp(T()) !¸½ºß¤Î¾õÂÖ¤òɽ¼¨¤¹¤ë
   CALL PermPrintOut(T)

   LET nm=T(3) !¥°¥é¥Õ¥£¥Ã¥¯¥¹¤Ë¤è¤ë
   IF nm=1 THEN !Ãæ±û
      DRAW eye(4) WITH SHIFT(x,y)
   END IF
   IF nm=3 OR nm=5 THEN
      DRAW eye(1) WITH SHIFT(x,y)
   END IF
   IF nm=2 OR nm=4 OR nm=5 OR nm=6 THEN !º¸¼Ð¤á
      DRAW eye(1) WITH SHIFT(x+0.25,y+0.25)
      DRAW eye(1) WITH SHIFT(x-0.25,y-0.25)
   END IF
   IF nm=3 OR nm=4 OR nm=5 OR nm=6 THEN !±¦¼Ð¤á
      DRAW eye(1) WITH SHIFT(x+0.25,y-0.25)
      DRAW eye(1) WITH SHIFT(x-0.25,y+0.25)
   END IF
   IF nm=6 THEN !ÃæÃÊ
      DRAW eye(1) WITH SHIFT(x+0.25,y)
      DRAW eye(1) WITH SHIFT(x-0.25,y)
   END IF

   !!!SET TEXT JUSTIFY "center","half"
   !!!PLOT TEXT ,AT x,y: STR$(T(3))
END SUB

PICTURE eye(c) !ÌܤΣ±¤Ä¤òɽ¼¨¤¹¤ë
   SET AREA COLOR c
   DRAW disk WITH SCALE(0.1)
END PICTURE

END
 

> No.95[¸µµ­»ö¤Ø]

 Åê¹Æ¼Ô¡§Âç·§¡¡Àµ  Åê¹ÆÆü¡§2008ǯ11·î18Æü(²Ð)19»þ03ʬ13ÉÃ
ÊÖ¿®¡¦°úÍÑ
  Áᮤθæ²óÅúÍ­Æñ¤¦¤´¤¶¤¤¤Þ¤¹¡£
Áá®ÌÀÆü¤«¤é¡¢¿§¡¹¤ä¤Ã¤Æ¸«¤Þ¤¹¡£
¤³¤ó¤Ê¤Ë´Êñ¤ËÊ£ÁÇ¿ô¤ÎMAT¥¬¤Ç¤­¤ë¤Ê¤é¡¢¤Þ¤¹¤Þ¤¹10¿ÊBASIC¤Ë¤Ï¤Þ¤ê¤½¤¦¤Ç¤¹¡£
Ã滳ÍÍ¡¡Í­Æñ¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
 

Æ°¤­¤Þ¤·¤¿¡£

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î19Æü(¿å)06»þ55ʬ25ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.98[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¸À¤ï¤ì¤¿¤è¤¦¤Ë¡¢¥À¥¦¥ó¥í¡¼¥É¤·Æ±¤¸¥Õ¥©¥ë¥À¡¼¤ËÆþ¤ì¤¿¤éÁö¤ê¤À¤·¤Þ¤·¤¿¡£
¤À¤¤¤¿¤¤£³»þ´ÖÄøÅÙ¤ÇÁ´¥Ñ¥¿¡¼¥ó¤ÎÁȤ߹ç¤ï¤»¤ÎÄ´ºº¤òºÑ¤Þ¤»¡¢¤É¤ÎÁȤ߹ç¤ï¤»¤â
¥ª¥¤¥é¡¼Êý¿Ø¤ÎÍÑ·ï¤òËþ¤¿¤µ¤Ê¤¤Êó¹ð¤¬¤Ê¤µ¤ì¤Þ¤·¤¿¡£
Ä´ººÁí¿ô¤¬£´ÀéËü¤òĶ¤¨¤ë¤â¤Î¤¬¤¢¤ë¤Î¤ò¡¢ºÇ½é¤Ë¾ÚÌÀ¤·¤¿¿Í¤Ï¥³¥ó¥Ô¥å¡¼¥¿¡¼¤Î
Æ»¶ñ¤¬¤Ê¤¤»þÂå¤Ë¤¤¤Ã¤¿¤¤¤É¤¦¤ä¤Ã¤ÆÄ´¤Ù¤¿¤È¤¤¤¦¤Î¤Ç¤·¤ç¤¦¤«¡©
ºÇ½é¥ª¥¤¥é¡¼¤µ¤ó¤â£±ËüÄ̤ê°Ì¤ÏÄ©À路¤¿¤Ç¤·¤ç¤¦¤¬¤È¤Æ¤âÁ´¥Ñ¥¿¡¼¥ó¤Þ¤Ç¤Ï¤ä¤Ã¤Æ¤ß¤è¤¦¤È¤Ï»×¤ï¤Ê¤«¤Ã¤¿¤Ç¤·¤ç¤¦¤Í¡£
¤½¤³¤Ç¡¢°ìÈ̤ˤϣ´k¡Ü£²¡¡¡Êk=0,1,2,3,¡¦¡¦¡¦¡Ë
¤Î¾ì¹ç¤Ë¤Ï¸ºß¤·¤Ê¤¤¤À¤í¤¦¤ÈͽÁÛ¤òΩ¤Æ¤¿¤Î¤Ç¤·¤ç¤¦¡£¡Ê£±£·£¸£²Ç¯¡Ë
¤½¤ì¤«¤é¡¢Ìó£²£°£°Ç¯¥ª¥¤¥é¡¼¤µ¤ó¤Î¸ÀÍÕ¤¬¿®¤¸¤é¤ì¤Æ¤¤¤¿¡£
¤·¤«¤·¡¢£ë¡á£²¡Ê£±£°¼¡¤Î¥ª¥¤¥é¡¼Êý¿Ø¡Ë¤¬

00 47 18 76 29 93 85 34 61 52
86 11 57 28 70 39 94 45 02 63
95 80 22 67 38 71 49 56 13 04
59 96 81 33 07 48 72 60 24 15
73 69 90 82 44 17 58 01 35 26
68 74 09 91 83 55 27 12 46 30
37 08 75 19 92 84 66 23 50 41
14 25 36 40 51 62 03 77 88 99
21 32 43 54 65 06 10 89 97 78
42 53 64 05 16 20 31 98 79 87


00 17 28 39 94 85 76 61 52 43
71 22 37 48 59 96 80 13 04 65
82 73 44 57 68 09 91 35 26 10
93 84 75 66 07 18 29 50 41 32
49 95 86 70 11 27 38 02 63 54
58 69 90 81 72 33 47 24 15 06
67 08 19 92 83 74 55 46 30 21
16 31 53 05 20 42 64 77 88 99
25 40 62 14 36 51 03 89 97 78
34 56 01 23 45 60 12 98 79 87


46 57 68 70 81 02 13 24 35 99
71 94 37 65 12 40 29 06 88 53
93 26 54 01 38 19 85 77 60 42
15 43 80 27 09 74 66 58 92 31
32 78 16 89 63 55 47 91 04 20
67 05 79 52 44 36 90 83 21 18
84 69 41 33 25 98 72 10 56 07
59 30 22 14 97 61 08 45 73 86
28 11 03 96 50 87 34 62 49 75
00 82 95 48 76 23 51 39 17 64

¤Î¤è¤¦¤Ë¹½À®²Äǽ¤Ç¤¢¤ë¤³¤È¤¬¼¨¤µ¤ì¡¢¥ª¥¤¥é¡¼¤ÎͽÁÛ¤¬Ê¤¤µ¤ì¤Þ¤·¤¿¡£
¤Þ¤¿£ë¡á£´¡Ê£±£¸¼¡¤Î¥ª¥¤¥é¡¼Êý¿Ø¡Ë¤â


0X AB T9 W7 Z5 BT 8W 5C 2A Y8 X6 6Z 3Y 92 C3 11 40 74

BY 8X 56 T4 W2 Z0 6T 3W 07 A5 Y3 X1 1Z 4A 7B 99 C8 2C

9Z 6Y 3X 01 TC WA Z8 1T BW 82 50 YB X9 C5 26 44 73 A7

X4 4Z 1Y BX 89 T7 W5 Z3 9T 6W 3A 08 Y6 70 A1 CC 2B 52

Y1 XC CZ 9Y 6X 34 T2 W0 ZB 4T 1W B5 83 28 59 77 A6 0A

3B Y9 X7 7Z 4Y 1X BC TA W8 Z6 CT 9W 60 A3 04 22 51 85

18 B6 Y4 X2 2Z CY 9X 67 T5 W3 Z1 7T 4W 5B 8C AA 09 30

CW 93 61 YC XA AZ 7Y 4X 12 T0 WB Z9 2T 06 37 55 84 B8

AT 7W 4B 19 Y7 X5 5Z 2Y CX 9A T8 W6 Z4 81 B2 00 3C 63

ZC 5T 2W C6 94 Y2 X0 0Z AY 7X 45 T3 W1 39 6A 88 B7 1B

W9 Z7 0T AW 71 4C YA X8 8Z 5Y 2X C0 TB B4 15 33 62 96

T6 W4 Z2 8T 5W 29 C7 Y5 X3 3Z 0Y AX 78 6C 90 BB 1A 41

23 T1 WC ZA 3T 0W A4 72 Y0 XB BZ 8Y 5X 17 48 66 95 C9

80 38 B3 6B 16 91 49 C4 7C 27 A2 5A 05 XX YY ZZ WW TT

7A 25 A0 58 03 8B 36 B1 69 14 9C 47 C2 YT ZX WY TZ XW

57 02 8A 35 B0 68 13 9B 46 C1 79 24 AC ZW WT TX XY YZ

65 10 98 43 CB 76 21 A9 54 0C 87 32 BA WZ TW XT YX ZY

42 CA 75 20 A8 53 0B 86 31 B9 64 1C 97 TY XZ YW ZT WX

¤ÎÍͤ˽ÐÍè¤Á¤ã¤¤¤Þ¤¹¡£¡Ê¤³¤ó¤ÊÇÛÎó¤Ï¿ÀÍͤ·¤«¤Ç¤­¤Ê¤¤¡£¡Ë

¤¤¤ä¡¼¿Í´Ö¤ÎǾ¤ÎÎÏ¡Ê¿ô³Ø¤ÎÀ¨¤µ¡Ë¤ò»×¤¤ÃΤê¤Þ¤¹¡£
 

Re: Æ°¤­¤Þ¤·¤¿¡£

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ11·î19Æü(¿å)17»þ06ʬ33ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.101[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¤´Êó¹ð¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£¡É£Ã¡É¤è¤êÃÙ¤«¤Ã¤¿¤é¤É¤¦¤·¤è¤¦¤«¤È»×¤Ã¤Æ¤¤¤Þ¤·¤¿¡£
»ä¤Î¥Ñ¥½¥³¥ó¤Ç£¸»þ´Ö¤«¤«¤ê¤Þ¤¹¤Î¤Ç¡¢¤É¤¦¤Ê¤Î¤«¤¬¡¢¤ï¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£
¤â¤Ã¤È¡¢Â®¤¤Â®ÅÙ¤ò¸¦µæ¤·¤Æ¤ß¤Þ¤¹¡£

¢¨2008.11.21¡¡hojin_45.dll ¤Ë¼èÂؤ¨¤ë¤È¡¢£³»þ´Ö¢ª£²»þ´Ö£²£°Ê¬¤°¤é¤¤¤Ë¤Ê¤ê¤Þ¤¹¡£
  http://homepage2.nifty.com/neutro/asm/hojin_45.dll    ¡¦¡¦¡¦Êѹ¹¤·¤¿µ¡³£¸ì¥Õ¥¡¥¤¥ë
  http://homepage2.nifty.com/neutro/asm/hojin_45.asm    ¡¦¡¦¡¦¾å¤Î¥½¡¼¥¹Ž¥¥ê¥¹¥È
  http://homepage2.nifty.com/neutro/asm/HOJIN_45.BAS    ¡¦¡¦¡¦assign½¤Àµ¡¢½½¿ÊBASIC¥Õ¥¡¥¤¥ë
¡¡.asm ¤ä.BAS¥Õ¥¡¥¤¥ë¤Ï¡¢
¡¡¥À¥¦¥ó¡¦¥í¡¼¥ÉÁ뤬½Ð¤º¡¢²½¤±Ê¸»ú¤Ç³«¤¯¤³¤È¤¬Í­¤ê¤Þ¤¹¡£¤½¤Î¾ì¹ç¤Ï¡¢
¡¡¡Öɽ¼¨¡×¢ª¡Ö¥¨¥ó¥³¡¼¥É¡×¢ª¡ÖÆüËܸì(¥·¥Õ¥ÈJIS)¡×¤Ë¤·¤Æ¡¢
¡¡¡Ö¤¹¤Ù¤ÆÁªÂò¡×¥³¥Ô¡¼¡¦¥Ú¡¼¥¹¥È¤·¤Æ²¼¤µ¤¤¡£¡Ê¥á¥âÄ¢¤Ê¤É¤Ë¡Ë
 

£²Ã¼»ÒÂÐÄê¿ô¡Ê£´Ã¼»ÒÄê¿ô¡Ë¤Î·×»»

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î20Æü(ÌÚ)13»þ40ʬ22ÉÃ
ÊÖ¿®¡¦°úÍÑ
  Åŵ¤²óÏ©·×»»¤Î±é½¬ÌäÂê¤ò²ò¤¤¤Æ¤¤¤Þ¤¹¡£
ÅÅÂî¤Ë¤è¤ëÉ®»»¤Î¸¡»»¤È¤·¤Æ¤Î¥×¥í¥°¥é¥à¤ò¤Ä¤¯¤Ã¤Æ¤ß¤Þ¤·¤¿¡£

°ÊÁ°¶ìÏ«¤·¤¿¥é¥À¡¼²óÏ©¤Î¹çÀ®Äñ¹³Ãͤ¬¡Ö£Æ¹ÔÎó¤ÎÀѡפȡ֣ڤؤÎÊÑ´¹¡×¤Ç»»½Ð¤Ç¤­¤Þ¤¹¡£
!£²Ã¼»ÒÂвóÏ©¡Ê£´Ã¼»Ò²óÏ©¡Ë
!¡¡i1¢ª¨£¨¡¨¡¨¤i2¢ª
!¡¡a ¨¡¨©A¡¡B¨§¨¡ b
!E1¢¬¡¡¨¢¡¡¡¡¨¢¡¡¢¬E2
!¡¡a'¨¡¨©C¡¡D¨§¨¡ b'
!¡¡¡¡¡¡¨¦¨¡¨¡¨¥
!´ðËܹÔÎóF¤òÍѤ¤¤Æ
! (E1)=(A B)(E2)
! (i1) (C D)(i2)

OPTION ARITHMETIC COMPLEX !Ê£ÁÇ¿ô¤ò°·¤¦

LET j=SQR(-1) !µõ¿ôñ°Ì¡¡¢¨Åŵ¤·Ï¤Ï£ê¤ò»È¤¦

!¡ü¸òή²óÏ©

LET f=60 !¼þÇÈ¿ô[Hz]
LET w=2*PI*f !³Ñ¼þÇÈ¿ô¦Ø

DEF H2Ohm(L)=j*w*L ![H]¤ò[¦¸]¤Ø
DEF F2Ohm(C)=1/(j*w*C) ![F]¤ò[¦¸]¤Ø
DEF xL(L)=w*L !ͶƳ¥ê¥¢¥¯¥¿¥ó¥¹
DEF xC(C)=1/(w*C) !ÍÆÎ̥ꥢ¥¯¥¿¥ó¥¹

SUB DispS(z) !Ê£ÁÇ¿ô¤òSɽ¼¨¤¹¤ë¡¡¢¨¥¹¥¿¥¤¥ó¥á¥Ã¥Ä¡ÊSteinmetz¡Ë
   PRINT ABS(z);
   IF ABS(z)<>0 THEN
      IF arg(z)<>0 THEN PRINT "¢Ü";DEG(arg(z));"¡ë";
   END IF
   PRINT
END SUB

FUNCTION S2COMPLEX(l,th) !Sɽ¼¨¡Ê¶ËºÂɸ·Á¼°¡Ë¤òÊ£ÁÇ¿ô¤Ø
   LET S2COMPLEX=COMPLEX(l*COS(RAD(th)),l*SIN(RAD(th)))
END FUNCTION


!¡ü£²Ã¼»Ò¥¤¥ó¥Ô¡¼¥À¥ó¥¹²óÏ©¹ÔÎó
!¡¡¨¡Z¨¡¡¡¤Î¾ì¹ç¡¡F=(1 Z)
!¡¡¨¡-¨¡¡¡¡¡¡¡¡¡¡¡¡¡(0 1)
SUB seriesF(Z,F(,))
   LET F(1,1)=1
   LET F(1,2)=Z
   LET F(2,1)=0
   LET F(2,2)=1
END SUB
!¡¡¨¡¨¨¨¡¡¡¤Î¾ì¹ç¡¡F=(1¡¡ 0)
!¡¡¡¡Z ¡¡¡¡¡¡¡¡¡¡¡¡¡¡(1/Z 1)
!¡¡¨¡¨ª¨¡
SUB shuntF(Z,F(,))
   WHEN EXCEPTION IN
      LET F(1,1)=1
      LET F(1,2)=0
      LET F(2,1)=1/Z
      LET F(2,2)=1
   USE
      PRINT "£°¤Ç³ä¤ì¤Þ¤»¤ó¡£"
      STOP
   END WHEN
END SUB

!¡ü¥Ñ¥é¥á¡¼¥¿¤ÎÁê¸ßÊÑ´¹¡¡¢¨°ìÉô
SUB F2Z(F(,), Z(,)) !£Æ¥Ñ¥é¥á¡¼¥¿¤ò£Ú¥Ñ¥é¥á¡¼¥¿¤Ø
   LET Z(1,1)=F(1,1) !A
   LET Z(1,2)=DET(F) !AD-BC
   LET Z(2,1)=1
   LET Z(2,2)=F(2,2) !D
   WHEN EXCEPTION IN
      MAT Z=(1/F(2,1))*Z !(1/C)ÇÜ
   USE
      PRINT "£Ú¥Ñ¥é¥á¡¼¥¿¤Ï¸ºß¤·¤Þ¤»¤ó¡£"
      STOP
   END WHEN
END SUB
SUB F2Y(F(,),Y(,)) !£Æ¥Ñ¥é¥á¡¼¥¿¤ò£Ù¥Ñ¥é¥á¡¼¥¿¤Ø
   LET Y(1,1)=F(2,2) !D
   LET Y(1,2)=-DET(F) !BC-AD
   LET Y(2,1)=-1
   LET Y(2,2)=F(1,1) !A
   WHEN EXCEPTION IN
      MAT Y=(1/F(1,2))*Y !(1/B)ÇÜ
   USE
      PRINT "£Ù¥Ñ¥é¥á¡¼¥¿¤Ï¸ºß¤·¤Þ¤»¤ó¡£"
      STOP
   END WHEN
END SUB

SUB Z2Y(Z(,),Y(,)) !£Ú¥Ñ¥é¥á¡¼¥¿¤ò£Ù¥Ñ¥é¥á¡¼¥¿¤Ø
   WHEN EXCEPTION IN
      MAT Y=INV(Z) !Y=Z^-1
   USE
      PRINT "£Ù¥Ñ¥é¥á¡¼¥¿¤Ï¸ºß¤·¤Þ¤»¤ó¡£"
      STOP
   END WHEN
END SUB
!-------------------- ¤³¤³¤Þ¤Ç¤¬¥µ¥Ö¥ë¡¼¥Á¥ó


DIM mF(2,2),mZ(2,2),mY(2,2) !F,Z,Y¥Ñ¥é¥á¡¼¥¿
DIM T1(2,2),T2(2,2) !ºî¶ÈÍÑ

!¡ü¤Ï¤·¤´²óÏ©¤Î¹çÀ®Äñ¹³¡¡a-bü»Ò´Ö

!a¨¡R1¨¨R3¨¨R5¨¨ ¡Ä ¨¨Rn¨¨¨¡¨¨ ¡Ä
! ¡¡¡¡R2¡¡R4¡¡R6¡¡ Rn-1 Rn+1
!b¨¡¨¡¨ª¨¡¨ª¨¡¨ª ¡¡ ¨ª¨¡¨ª¨¡¨ª
!
LET R1=1 !1,2,1,2,¡Ä,1,2,1
LET R2=2

CALL seriesF(R1,T1) !¨¡R1¨¨
CALL shuntF(R2,T2)  !¡¡¡¡R2

MAT mF=IDN !ñ°Ì¹ÔÎó
FOR i=1 TO 5 !ÃÊ¿ô
   MAT mF=mF*T1 !¨¡R1¨¨R1¨¨ ¡Ä ¨¨R1¨¨
   MAT mF=mF*T2 !¡¡ R2¡¡R2¡¡¡¡ R2¡¡R2
NEXT i
MAT mF=mF*T1 !¨¡R1¨¤

CALL F2Z(mF,mZ) !Í×ÁÇa
MAT PRINT mZ;



!¡üT·¿LC²óÏ©
!¡¡¨¡L¨¡¨¨¨¡L¨¡
!¡¡¡¡¡¡ C
!¡¡¨¡-¨¡¨ª¨¡-¨¡
!¦Ø=1[rad/sec]¡¢L=2[H]¡¢C=1[F]
LET L=2
LET C=1
LET w=1 !ÌäÂê¤Ë¹ç¤ï¤»¤ë


!¡ü£Æ¥Ñ¥é¥á¡¼¥¿¡¢´ðËܹÔÎó
MAT mF=IDN !ñ°Ì¹ÔÎó

CALL seriesF(H2Ohm(L),T1)
MAT mF=mF*T1

CALL shuntF(F2Ohm(C),T2)
MAT mF=mF*T2

MAT mF=mF*T1

PRINT "£Æ¥Ñ¥é¥á¡¼¥¿"
MAT PRINT mF;


!¡ü£Ú¥Ñ¥é¥á¡¼¥¿¡¢¥¤¥ó¥Ô¡¼¥À¥ó¥¹¹ÔÎó V=Z*I
CALL F2Z(mF,mZ)
PRINT "£Ú¥Ñ¥é¥á¡¼¥¿"
MAT PRINT mZ;


!¡ü£Ù¥Ñ¥é¥á¡¼¥¿¡¢¥¢¥É¥ß¥¿¥ó¥¹¹ÔÎó I=Y*V
CALL F2Y(mF,mY)
PRINT "£Ù¥Ñ¥é¥á¡¼¥¿"
MAT PRINT mY;


!¡ü£Ù¥Ñ¥é¥á¡¼¥¿¡ÊÊ̲ò¡ËY=Z^-1
CALL Z2Y(mZ,mY)
PRINT "£Ù¥Ñ¥é¥á¡¼¥¿"
MAT PRINT mY;


END
 

matÌ¿Îá¤ÈÊ£ÁÇ¿ô·×»»

 Åê¹Æ¼Ô¡§Âç·§¡¡Àµ  Åê¹ÆÆü¡§2008ǯ11·î21Æü(¶â)15»þ11ʬ26ÉÃ
ÊÖ¿®¡¦°úÍÑ
  Âç·§¡¡¤Ç¤¹¡£

Á°²ó¡¡NO95 NO¤Î¸æ²óÅúÍ­Æñ¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£»³Ã椵¤ó¤òÃ滳¤µ¤ó¤È´Ö°ã¤¨¤ÆÅê¹Æ¤·¤Þ¤·¤¿¡£¼ºÎé¤ò¸æµö¤·¤¯¤À¤µ¤¤¡£
¤½¤Î¸å¤À¤¤¤Ö10¿ÊBASIC¤ò¿Ê¤á¤Æ¤Þ¤¹¤¬¡¢²¼µ­¤ÎÉÔ¶ñ¹ç¤Ç¥¹¥È¥Ã¥×¤·¤Æ¤Þ¤¹¡£
MAT T=INV(A)¡¡¤¬½ÐÍè¤Ê¤¤¤Î¤Ç¤¹¡£


OPTION ARITHMETIC COMPLEX
LET j=SQR(-1)
LET R1=5000
LET R2=5000
LET C1=0.1*10^( -6 )
LET C2=0.1*10^( -6 )
LET F=100
LET SZ=0.001
LET NP=4
LET ZC1=1/(2*PI*F*C1)
LET ZC2=1/(2*PI*F*C2)
OPTION BASE 1
PRINT "ZCI=";ZC1

DIM A(NP,NP),B(NP,NP),T(NP,NP),E1(NP)

LET A(1,2)=1/R1+SZ*j
LET A(2,3)=1/R2+SZ*j
LET A(2,4)=SZ+1/ZC1*j
LET A(3,4)=SZ+1/ZC2*j
MAT PRINT A

LET E1(1)=1
LET E1(4)=0
PRINT"²¼µ­¤Î¤´¤È¤¯MAT PRINT E1¤È¤ä¤ë¤È²£¤Ë°ìʸ»ú¤Ë¤Ê¤ë¡£"
MAT PRINT E1
PRINT"²¼µ­¤Î¤´¤È¤¯MAT PRINT USING REPEAT$RI¤Ç½Ä¤Ë°ìʸ»úʤÓÎÉ

¹¥¡£"
MAT PRINT USING REPEAT$(" #.#### ",1):E1
MAT T=INV(A)


STOP

ÁᮤǤ¹¤¬¡¢¾åµ­¤Îʸ¤òºî¤ê¡¢¥Þ¥È¥ê¥¯¥¹[A]¤òºî¤ê¼Â¹Ô¤¹¤ë¤È¡¢ºÇ¸å¤Î¡¡MAT T=INV(A)¤Ç
¡ÖEXTYPE 3009 °ú¿ô¤¬ÄêµÁ³°¤ÎÃ͡פȤʤꡢ¥¹¥È¥Ã¥×¤·¤Þ¤¹¡£
¤É¤³¤¬ÉÔÎɤθ¶°ø¤Ç¤·¤ç¤¦¤«¡£
¤Þ¤¿¡¢°ìÎó¤ÎE(5)¤Ê¤É¤òºî¤ê¡¢PRINT E ¡¡¤ò¤ä¤ë¤È¡¢²£°ìÎó¤Ëɽ¼¨¤·¤Þ¤¹¡£
»Íü»ÒÌ֤Ρ¡A*E Åù¤ÏÂç¾æÉפǤ·¤ç¤¦¤«¡£½Ä¤ËÊѹ¹¤·¤ÆT=TRAN(E) ¤½¤·¤ÆA*T ¤Ç¤·¤ç¤¦¤«¡£
 

Re: matÌ¿Îá¤ÈÊ£ÁÇ¿ô·×»»

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î21Æü(¶â)16»þ36ʬ32ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.104[¸µµ­»ö¤Ø]

Âç·§¡¡Àµ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ÁᮤǤ¹¤¬¡¢¾åµ­¤Îʸ¤òºî¤ê¡¢¥Þ¥È¥ê¥¯¥¹[A]¤òºî¤ê¼Â¹Ô¤¹¤ë¤È¡¢ºÇ¸å¤Î¡¡MAT T=INV(A)¤Ç
> ¡ÖEXTYPE 3009 °ú¿ô¤¬ÄêµÁ³°¤ÎÃ͡פȤʤꡢ¥¹¥È¥Ã¥×¤·¤Þ¤¹¡£
> ¤É¤³¤¬ÉÔÎɤθ¶°ø¤Ç¤·¤ç¤¦¤«¡£

¹ÔÎóA¤¬¡¢µÕ¹ÔÎó¤ò»ý¤¿¤Ê¤¤¹ÔÎó¤À¤«¤é¤Ç¤¹¡£
A¤ÏÉ®»»¤ÇµÕ¹ÔÎó¤Ï¸ºß¤·¤Þ¤¹¤«¡©


> ¤Þ¤¿¡¢°ìÎó¤ÎE(5)¤Ê¤É¤òºî¤ê¡¢PRINT E ¡¡¤ò¤ä¤ë¤È¡¢²£°ìÎó¤Ëɽ¼¨¤·¤Þ¤¹¡£
> »Íü»ÒÌ֤Ρ¡A*E Åù¤ÏÂç¾æÉפǤ·¤ç¤¦¤«¡£½Ä¤ËÊѹ¹¤·¤ÆT=TRAN(E) ¤½¤·¤ÆA*T ¤Ç¤·¤ç¤¦¤«¡£

DIM A(3,3)
DIM X(3),B(3)
MAT B=A*X !(3¹Ô,3Îó)(3¹Ô,1Îó)=(3¹Ô,1Îó)¤È¤·¤Æ·×»»¤µ¤ì¤ë
MAT PRINT B !²£¤Ø
MAT B=X*A !(1¹Ô,3Îó)(3¹Ô,3Îó)=(1¹Ô,3Îó)¤È¤·¤Æ·×»»¤µ¤ì¤ë
MAT PRINT B !²£¤Ø
END
¤³¤Î¾ì¹ç¡¢X,B¤Ï¥Ù¥¯¥È¥ë°·¤¤¤Ë¤Ê¤ê¤Þ¤¹¡£
X,B¤ò¹ÔÎó¤È¤·¤Æ°·¤¦¾ì¹ç¤Ï¡¢¡ÊX,B¤ËÂФ·¤ÆTRN¤òŬÍѤ¹¤ë¾ì¹ç¡Ë
¹Ô¤Þ¤¿¤ÏÎó¤Î¤ß¤Î¹ÔÎó¤Ï¡¢¤¿¤È¤¨¤Ð
¡¡£³¹Ô£±Îó¤Ê¤é DIM B(3,1)
¡¡£±¹Ô£³Îó¤Ê¤é DIM B(1,3)
¤È¤·¤Æ¤¯¤À¤µ¤¤¡£
 

Re: µì·Ç¼¨ÈĤÎÅê¹Æ¤ò¥­¥ã¥Ã¥·¥å¤«¤é¥µ¥ë¥Ù¡¼¥¸

 Åê¹Æ¼Ô¡§teriam  Åê¹ÆÆü¡§2008ǯ11·î21Æü(¶â)20»þ03ʬ4ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.34[¸µµ­»ö¤Ø]

Âç»ö¤Ê¾ðÊó¤À¤È»×¤¦¤Î¤Ç¤´ËܿͤÎλ²ò¤ÏÆÀ¤Æ¤Þ¤»¤ó¤¬ºÆ·Ç¤·¤Þ¤¹¡£

> ½½¿ÊBASIC¤Îµì·Ç¼¨ÈĤ¬10·î¾å½Ü¤«¤é±¿±Ä²ñ¼Òaround¤Î³èÆ°Ää»ß¤Ë¤è¤ê»ö¼Â¾åÊĺ¿¤µ¤ì¤Þ¤·¤¿¡£
> ¡Ö·Ç¼¨ÈIJáµî¥í¥°¡×¤ËÊݴɤµ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿101¡Á110¥Ú¡¼¥¸¤ÎÅê¹Æ¤ò¸¡º÷¥µ¥¤¥È¤Î¥­¥ã¥Ã¥·¥å¤«¤é½¦¤¤½Ð¤¹ÊýË¡¤ò¾Ò²ð¤·¤Þ¤¹¡£
> ¤¿¤À¤·¥­¥ã¥Ã¥·¥å¤Ç¤¹¤«¤é¡¢¤¹¤Ù¤Æ¤Î¥Ú¡¼¥¸¤¬Êݸ¤µ¤ì¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
> ʬ³ä¤·¤ÆÅê¹Æ¤µ¤ì¤¿¥×¥í¥°¥é¥à¤Ê¤É¤Ï¡¢ÉôʬŪ¤Ë¤·¤«½¦¤¨¤Ê¤¤¤«¤â¤·¤ì¤Þ¤»¤ó¡£
> ¤Þ¤¿¡¢¥­¥ã¥Ã¥·¥å¤ÏÆü¡¹¹¹¿·¤µ¤ì¤Þ¤¹¤Î¤Ç¤¢¤È1,2¥ö·î¤â¤·¤¿¤é¤Û¤È¤ó¤É¤Î¥Ú¡¼¥¸¤¬ºï½ü¤µ¤ì¤ë¤È»×¤¤¤Þ¤¹¡£
> ¿ôÆüÁ°¤ÈÈæ³Ó¤·¤Æ¤â¥Ò¥Ã¥È¿ô¤¬¸º¤Ã¤Æ¤¤¤Þ¤¹¡£
> ɬÍפÊÅê¹Æ¤ÏÁá¤á¤Ë¥Ñ¥½¥³¥ó¤ËÊݸ¤·¤Æ¤ª¤¯¤³¤È¤ò¤ª´«¤á¤·¤Þ¤¹¡£
>
>
> 1.¸¡º÷¥µ¥¤¥ÈGoogle¤Ç "½½¿ÊBASIC·Ç¼¨ÈÄ" ¤ò¸¡º÷¤·¤Þ¤¹¡£
>   (;·×¤Ê¾ðÊó¤òÇÓ½ü¤¹¤ë¤¿¤á¥À¥Ö¥ë¥¯¥©¥Æ¡¼¥·¥ç¥ó(")¤Ç°Ï¤ß¤Þ¤·¤ç¤¦)
>
> 2.¸¡º÷·ë²Ì¤ÎºÇ¸å¤Ë¡¢
>     ºÇ¤âŪ³Î¤Ê·ë²Ì¤òɽ¼¨¤¹¤ë¤¿¤á¤Ë¡¢¾å¤Î¡û¡û·ï¤È»÷¤¿¥Ú¡¼¥¸¤Ï½ü³°¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
>     ¸¡º÷·ë²Ì¤ò¤¹¤Ù¤Æɽ¼¨¤¹¤ë¤Ë¤Ï¡¢¤³¤³¤«¤éºÆ¸¡º÷¤·¤Æ¤¯¤À¤µ¤¤¡£

>   ¤È¤¢¤ë¤Î¤Ç¥¯¥ê¥Ã¥¯¤·¤Æ²¼¤µ¤¤¡£
>
> 3.¸¡º÷·ë²Ì¤Î¤¦¤Á¡¢URL¤¬ freebbs.around.ne.jp ¤Ç»Ï¤Þ¤ë¤â¤Î¤¬µì·Ç¼¨ÈĤÎÅê¹Æ¤Ç¤¹¡£
>   /basic/ ¤Þ¤¿¤Ï &pg= ¤Î¸å¤í¤Ë¤¢¤ë¿ô»ú¤¬µì·Ç¼¨ÈĤΥڡ¼¥¸ÈÖ¹æ¤Ç¤¹¡£
>   ¡ÊURL¤¬ www.geocities.jp ¤È¤¢¤ë¤Î¤Ï¡Ö·Ç¼¨ÈIJáµî¥í¥°¡×¤Ë¤¢¤ë¤Î¤Ç¤½¤Á¤é¤ò¤´Í÷¤¯¤À¤µ¤¤¡Ë
>
> 4.ÆâÍƤò¸«¤ë¤Ë¤Ïɬ¤º¥­¥ã¥Ã¥·¥å¤ò¥¯¥ê¥Ã¥¯¤·¤Æ²¼¤µ¤¤¡£
>   ¡Ê¸«½Ð¤·¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤ÈÀܳ¥¨¥é¡¼¤Ë¤Ê¤ê¤Þ¤¹¡Ë
>
> 5.²¼¤Î¸ì¶ç¤«¤é¤â¸¡º÷¤Ç¤­¤Þ¤¹¡£Â¾¤Î¸¡º÷¥µ¥¤¥È¤«¤é¤â¸¡º÷¤·¤Æ¤ß¤Æ²¼¤µ¤¤¡£
>     "freebbs.around.ne.jp/article/b/basic/"
>
>     "freebbs.around.ne.jp/kyview","basic"
 

Re: matÌ¿Îá¤ÈÊ£ÁÇ¿ô·×»»

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ11·î23Æü(Æü)07»þ44ʬ19ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.104[¸µµ­»ö¤Ø]

Âç·§¡¡Àµ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> MAT T=INV(A)¡¡¤¬½ÐÍè¤Ê¤¤¤Î¤Ç¤¹¡£

IF DET(A)<>0 THEN !¡¡¹ÔÎó¼°¡ÃA¡Ã¤ÎÃÍ
   MAT T=INV(A)
ELSE
   PRINT "A ¤Ï¡¢µÕ¹ÔÎó¤ò»ý¤¿¤Ê¤¤"
END IF


¢¨½½¿ÊBASIC ¤Î¡¢£±¼¡¸µÇÛÎó¡¢¹Ô¥Ù¥¯¥È¥ë¤ÈÎó¥Ù¥¯¥È¥ë

¹ÔÎó (a)
¨£              ¨¤
¨¢ 1.000   2.000¨¢
¨¢ 3.000   4.000¨¢
¨¦              ¨¥
¥Ù¥¯¥È¥ë (v1)
(  1.000   2.000 )¡¡Ž¥Ž¥Ž¥¤³¤Î¾õÂ֤ϡ¢¹Ô¤«¡¢Î󤫤¬¡¢ÉÔÄê¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£

MAT v2=a*v1¡¡Ž¥Ž¥Ž¥±¦¤Ø½ñ¤±¤Ð¡¢Îó¥Ù¥¯¥È¥ë v1 ¤È¤·¤Æ·×»»¤µ¤ì¤ë¡£
¨£              ¨¤¨£      ¨¤
¨¢ 1.000   2.000¨¢¨¢ 1.000¨¢
¨¢ 3.000   4.000¨¢¨¢ 2.000¨¢
¨¦              ¨¥¨¦      ¨¥
v2¡á(  5.000  11.000 )

MAT v2=v1*a¡¡Ž¥Ž¥Ž¥º¸¤Ø½ñ¤±¤Ð¡¢¹Ô¥Ù¥¯¥È¥ë v1 ¤È¤·¤Æ·×»»¤µ¤ì¤ë¡£
¨£              ¨¤¨£              ¨¤
¨¢ 1.000   2.000¨¢¨¢ 1.000   2.000¨¢
¨¦              ¨¥¨¢ 3.000   4.000¨¢
                  ¨¦              ¨¥
v2¡á(  7.000  10.000 )
 

Re: matÌ¿Îá¤ÈÊ£ÁÇ¿ô·×»»

 Åê¹Æ¼Ô¡§Åç¼1243  Åê¹ÆÆü¡§2008ǯ11·î23Æü(Æü)10»þ38ʬ16ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.104[¸µµ­»ö¤Ø]

Âç·§¡¡Àµ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> Âç·§¡¡¤Ç¤¹¡£
> ***Ãæά***
> ¤½¤Î¸å¤À¤¤¤Ö10¿ÊBASIC¤ò¿Ê¤á¤Æ¤Þ¤¹¤¬¡¢²¼µ­¤ÎÉÔ¶ñ¹ç¤Ç¥¹¥È¥Ã¥×¤·¤Æ¤Þ¤¹¡£
> MAT T=INV(A)¡¡¤¬½ÐÍè¤Ê¤¤¤Î¤Ç¤¹¡£
> ***Ãæά***
> LET A(1,2)=1/R1+SZ*j
> LET A(2,3)=1/R2+SZ*j
> LET A(2,4)=SZ+1/ZC1*j
> LET A(3,4)=SZ+1/ZC2*j
> MAT PRINT A
> ***Ãæά***
> ÁᮤǤ¹¤¬¡¢¾åµ­¤Îʸ¤òºî¤ê¡¢¥Þ¥È¥ê¥¯¥¹[A]¤òºî¤ê¼Â¹Ô¤¹¤ë¤È¡¢ºÇ¸å¤Î¡¡MAT T=INV(A)¤Ç
> ¡ÖEXTYPE 3009 °ú¿ô¤¬ÄêµÁ³°¤ÎÃ͡פȤʤꡢ¥¹¥È¥Ã¥×¤·¤Þ¤¹¡£
> ¤É¤³¤¬ÉÔÎɤθ¶°ø¤Ç¤·¤ç¤¦¤«¡£

¥¢¥É¥ß¥¿¥ó¥¹¹ÔÎó[A]¤ÈÀáÅÀË¡¤ò»È¤Ã¤Æ¡¢Åŵ¤²óÏ©ÌÖ¤ÎÅÅή[I]=[A][E]¡¢¥¤¥ó¥Ô¡¼¥À¥ó¥¹[Z]=INV(A)¤ò·×»»¤¹¤ë¥×¥í¥°¥é¥à¤òºîÀ®¤¹¤ë¤Ä¤â¤ê¤ÎÍͤǤ¹¤Í¡£
¥×¥í¥°¥é¥à¸¶¹Æ¤ò¸«¤ë¤È¡¢²¼µ­ÀáÅÀ´Ö¥¢¥É¥ß¥¿¥ó¥¹¤¬Ì¤ÀßÄê¤Ç¤¢¤ë¤³¤È¤¬¥¨¥é¡¼¤Î¸¶°ø¤Ç¤¹¡£

̤ÀßÄê¤ÎÀáÅÀ´Ö¥¢¥É¥ß¥¿¥ó¥¹
A(2,1)!=A(1,2)
A(3,2)!=A(2,3)
A(4,3)!=A(3,4)

¤·¤¿¤¬¤Ã¤Æ¡ÖINV(A)¡×¤è¤ê¤âÁ°¤Ë
A(2,1)=A(1,2)
A(3,2)=A(2,3)
A(4,3)=A(3,4)

¤òÄɵ­¤¹¤ì¤Ð¥¨¥é¡¼¤Ï½Ð¤Þ¤»¤ó¡£
¤Ê¤ª¡¢ËÜÍè¤ÏÂÐÃÏ´Ö¥¢¥É¥ß¥¿¥ó¥¹¡ÐA(1,1),A(2,2),A(3,3),A(4,4)¡Ñ¤ä¡¢¥¢¥É¥ß¥¿¥ó¥¹¤¬Àܳ¤µ¤ì¤Ê¤¤ÀáÅÀ´Ö¤Î¥¢¥É¥ß¥¿¥ó¥¹¤Ï£°¤È ÀßÄꤹ¤Ù¤­¤Ç¤¹¡ÊËÜ·ï¤Ç¤ÏBASIC¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬Ì¤»ØÄê¤ÎÀáÅÀ´Ö¥¢¥É¥ß¥¿¥ó¥¹¡á£°¤È¼«Æ°½é´üÃÍÀßÄê¤ò¤·¤Æ¤·¤Þ¤¦¤Î¤Ç¥È¥é¥Ö¥ë¤Ë¤Ï¤Ê¤ê¤Þ¤»¤ó¤¬Ãí°Õ¤¬ ɬÍפǤ¹¡Ë¡£
 

¤¢¤ë¥·¥ã¥Ã¥Õ¥ëÊýË¡¤Îµ¬Â§À­

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î23Æü(Æü)12»þ46ʬ19ÉÃ
ÊÖ¿®¡¦°úÍÑ
  Î㡧£±¤«¤é£±£¸¤ÎÈÖ¹æ½ç¤Ë¥«¡¼¥É¤¬Ê¤ó¤Ç¤¤¤ë¤È¤¹¤ë¡£¡Ê΢¸þ¤­¥È¥Ã¥×¤¬£±¡Ë
¤³¤Î¥«¡¼¥É·²¤ò΢¸þ¤­¤Ë»ý¤Á¡¢¾å¤«¤é1Ë示¤Ä΢¸þ¤­¤Î¤Þ¤Þ¥Æ¡¼¥Ö¥ë¤Øº¸¤«¤é±¦¤Ø£³ËçʤÙ
¤¿¤é¡¢¸µ¤ËÌá¤Ã¤Æ£²ËçÌܤò¤Þ¤¿º¸¤«¤é±¦¤Î»³¤ØÇۤ롣
¤³¤ì¤ò·«¤êÊÖ¤·¤½¤ì¤¾¤ì¤Î»³¤ÎËç¿ô¤¬£¶Ë示¤Ä¤Ë¤Ê¤ê¡¢¼ê»ý¤Á¤Î¥«¡¼¥É¤¬Ìµ¤¯¤Ê¤ë¡£
¼¡¤Ëº¸¤Î»³¤ò»ý¤Á¾å¤²¡¢Î٤λ³¤Ë½Å¤Í¡¢½Å¤Ê¤Ã¤¿»³¤ò»ý¤Á¾å¤²¡¢±¦¤Î»³¤Ø½Å¤Í°ì¤Ä¤Ë¤¹¤ë¡£
¤³¤Î¥·¥ã¥Ã¥Õ¥ë¤ò·«¤êÊÖ¤¹¤È£¹²ó·«¤êÊÖ¤·¤¿»þÅÀ¤Ç¡¢¥«¡¼¥É¤Î½çÈÖ¤¬¸µ¤ËÌá¤ë¡£
¤³¤Î¥·¥ã¥Ã¥Õ¥ë¤Îµ¬Â§¤òÄ´¤Ù¤¿¤¤¡Ê¸µ¤Î¾õÂ֤ˤɤξò·ï¤ÇÌá¤ë¤Î¤«¡Ë¤Î¤Ç¤¹¤¬¡¢
°ìÈ̤˥«¡¼¥É¤¬£îË礢¤ê
»³¤òp¸Ä¡Êp<=n¤È¤¹¤ë¡Ëºî¤Ã¤Æ¡¢¤³¤Î¥·¥ã¥Ã¥Õ¥ë¤ò¤·¤Æ¤¤¤¯¾ì¹ç¡¢²¿²ó·«¤êÊÖ¤»¤Ð¸µ¤ËÌá¤ë¤Î¤Ç¤·¤ç¤¦¤«¡©
¡Ên=7,p=3¤Ê¤é£³²ó¤Ç¸µ¤ËÌá¤ê¤Þ¤·¤¿¡£¡Ë

¤³¤ì¤òÃΤ뤿¤á¤Î¥×¥í¥°¥é¥à¤òºî¤Ã¤ÆÌ㤨¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡©
¤³¤ì¤ò»È¤Ã¤Æ¿·ºî¤Î¥«¡¼¥É¥Þ¥¸¥Ã¥¯¤òºî¤ê¤¿¤¤¤Î¤Ç¤è¤í¤·¤¯¤ª´ê¤¤¤·¤Þ¤¹¡£
¤Á¤Ê¤ß¤Ë¡¢¥È¥é¥ó¥×Á´Éô£µ£²Ëç¤Î¾ì¹ç£²»³¡¢£³»³¡¢£´»³¡¢¡¦¡¦¡¦¡¢£±£³»³
¤Ç¤ÎÉü¸µ²ó¿ô¤âÃΤꤿ¤¤¤Î¤Ç¤¹¤¬¡¦¡¦¡¦
 

!Ëü²Ú¶À

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ11·î23Æü(Æü)16»þ05ʬ47ÉÃ
ÊÖ¿®¡¦°úÍÑ
  !Ëü²Ú¶À

OPTION ARITHMETIC NATIVE
DIM px(12),py(12)

MAT READ px
DATA 0.20, 0.40, 0.60, 0.80, 0.70, 0.60, 0.50, 0.40, 0.30, 0.20, 0.40, 0.60
MAT READ py
DATA 0.11, 0.11, 0.11, 0.11, 0.29, 0.47, 0.65, 0.47, 0.29, 0.11, 0.11, 0.11

SET WINDOW -1/4,1/4, -1/4,1/4
!----------
LET N=3
DO
   LET s=MOD(s,36)+1
   LET s2=INT((s-1)/4)+1
   SET DRAW mode hidden
   CLEAR
   DRAW D4(N) WITH SHIFT(-0.5,-0.5/SQR(3))*ROTATE(PI*2/36*s+PI)
   SET DRAW mode explicit
   WAIT DELAY 0.2
LOOP

!------
PICTURE D4(k)
   IF 0< k THEN
      DRAW D4(k-1) WITH SCALE(1/2,1/2)*SHIFT(1/4,SQR(3)/4) !¡¡¾å
      DRAW D4(k-1) WITH SCALE(1/2,-1/2)*SHIFT(1/4,SQR(3)/4) !¡¡Ãæ
      DRAW D4(k-1) WITH SCALE(1/2,1/2)*ROTATE(-PI*2/3)*SHIFT(1/4,SQR(3)/4) !¡¡º¸
      DRAW D4(k-1) WITH SCALE(1/2,1/2)*ROTATE(PI*2/3)*SHIFT(1,0) !¡¡±¦
   ELSE
      DRAW Set01
   END IF
END PICTURE

!------ ¼ï¤Î»°³Ñ¿Þ
PICTURE Set01
   PLOT LINES: 0,0; 1,0 ;0.5,SQR(3)/2 ;0,0
   SET AREA COLOR 5 !2
   DRAW disk WITH SCALE(0.1)*SHIFT(px(s2),py(s2)) ! ¾þ¤ê£±
   SET AREA COLOR 6 !3
   DRAW disk WITH SCALE(0.1)*SHIFT(px(s2+1),py(s2+1)) ! ¾þ¤ê£²
   SET AREA COLOR 7 !4
   DRAW disk WITH SCALE(0.1)*SHIFT(px(s2+2),py(s2+2)) ! ¾þ¤ê£³
   SET AREA COLOR 1
   DRAW disk WITH SCALE(0.1)*SHIFT(px(s2+3),py(s2+3)) ! ¾þ¤ê£´
END PICTURE

END
 

Re: ¤¢¤ë¥·¥ã¥Ã¥Õ¥ëÊýË¡¤Îµ¬Â§À­

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î24Æü(·î)08»þ50ʬ50ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.109[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£
¼«Ê¬¤ØÊÖ»ö¤ò½Ð¤¹¤Î¤âÊѤǤ¹¤¬¡¢»ä¤Ê¤ê¤Î¥×¥í¥°¥é¥à¤òºî¤Ã¤ÆÄ´¤Ù¤Æ¤ß¤Þ¤·¤¿¡£

¡ª£´»³¤Ç¤Î¥·¥ã¥Ã¥Õ¥ëÄ´ºº
100 OPTION BASE 1
110 INPUT  PROMPT "¥«¡¼¥É¤ÎËç¿ô¤Ï¡©":n
120 INPUT  PROMPT "»³¤Î¿ô¤Ï¡©:£´¤òÆþÎϤ·¤Æ¤ª¤¤¤Æ²¼¤µ¤¤¡£":p
130 INPUT  PROMPT "¥·¥ã¥Ã¥Õ¥ë²ó¿ô¡©":t
140
150 DIM a(n)
160 DIM b(n)
170 DIM c(n)
180 DIM d(n)
190 DIM e(n)
200 DIM f(n)
210
220 FOR i=1 TO n
230    LET a(i)=i
240 NEXT i
250
260 FOR q=1 TO t
270    FOR k=1 TO INT(n/p)
280       LET b(k)=a(p*(k-1)+1)
290       LET c(k)=a(p*(k-1)+2)
300       LET d(k)=a(p*(k-1)+3)
310       LET e(k)=a(p*(k-1)+4)
320       PRINT USING "####":b(k);
330       PRINT USING "####":c(k);
340       PRINT USING "####":d(k);
350       PRINT USING "####":e(k);
360       PRINT
370    NEXT k
380
390    FOR i=1 TO n/p
400       LET f(i)=b(n/p-i+1)
410       LET f(n/p+i)=c(n/p-i+1)
420       LET f(2*n/p+i)=d(n/p-i+1)
430       LET f(3*n/p+i)=e(n/p-i+1)
440    NEXT i
450
460    FOR i=1 TO n
470       LET a(i)=f(i)
480       PRINT ;q;"²ó";
490       PRINT USING "####":a(i);
500       PRINT
510    NEXT i
520
530 NEXT q
540 END
550

¡ª£³»³¤Ç¤Î¥·¥ã¥Ã¥Õ¥ëÄ´ºº
100 OPTION BASE 1
110 INPUT  PROMPT "¥«¡¼¥É¤ÎËç¿ô¤Ï¡©":n
120 INPUT  PROMPT "»³¤Î¿ô¤Ï¡©:£³¤òÆþÎϤ·¤Æ¤ª¤¤¤Æ²¼¤µ¤¤¡£":p
130 INPUT  PROMPT "¥·¥ã¥Ã¥Õ¥ë²ó¿ô¡©":t
140
150 DIM a(n)
160 DIM b(n)
170 DIM c(n)
180 DIM d(n)
190!DIM e(n)
200 DIM f(n)
210
220 FOR i=1 TO n
230    LET a(i)=i
240 NEXT i
250
260 FOR q=1 TO t
270    FOR k=1 TO INT(n/p)
280       LET b(k)=a(p*(k-1)+1)
290       LET c(k)=a(p*(k-1)+2)
300       LET d(k)=a(p*(k-1)+3)
310       !    LET e(k)=a(p*(k-1)+4)
320       PRINT USING "####":b(k);
330       PRINT USING "####":c(k);
340       PRINT USING "####":d(k);
350       !   PRINT USING "####":e(k);
360       PRINT
370    NEXT k
380
390    FOR i=1 TO n/p
400       LET f(i)=b(n/p-i+1)
410       LET f(n/p+i)=c(n/p-i+1)
420       LET f(2*n/p+i)=d(n/p-i+1)
430       !  LET f(3*n/p+i)=e(n/p-i+1)
440    NEXT i
450
460    FOR i=1 TO n
470       LET a(i)=f(i)
480       PRINT ;q;"²ó";
490       PRINT USING "####":a(i);
500       PRINT
510    NEXT i
520
530 NEXT q
540 END
550

¥«¡¼¥É¥Þ¥¸¥Ã¥¯¤ò¤ä¤ë¾å¤Ç¤Ï¡¢¤³¤ì°Ì¤¬ÂÅÅö¤Ç¤¢¤í¤¦¡£

¤³¤¦¤ä¤Ã¤ÆÄ´¤Ù¤Þ¤·¤¿¤é¼¡¤ÎÍͤʷë²Ì¤òÆÀ¤Þ¤·¤¿¡£
             ¡ã£³»³¤Ç¤Î¥·¥ã¥Ã¥Õ¥ë¡ä
¥È¥é¥ó¥×Ëç¿ô     Àµ½çÉü¸µ²ó¿ô         µÕ½çÉü¸µ²ó¿ô
¡¡¡¡¡¡¡¡¡¡6                3
¡¡¡¡¡¡¡¡¡¡ 9                4                   2
¡¡¡¡¡¡¡¡¡¡ 12               6                   3
¡¡¡¡¡¡¡¡¡¡15               4
¡¡¡¡¡¡¡¡¡¡18               9
¡¡¡¡¡¡¡¡¡¡ 21              10                   5
¡¡¡¡¡¡¡¡¡¡ 24              20                  10
¡¡¡¡¡¡¡¡¡¡27               3
¡¡¡¡¡¡¡¡¡¡30              15
¡¡¡¡¡¡¡¡¡¡ 33              16                   8
¡¡¡¡¡¡¡¡¡¡36               9
¡¡¡¡¡¡¡¡¡¡39               4
¡¡¡¡¡¡¡¡¡¡42              21
¡¡¡¡¡¡¡¡¡¡ 45              22                  11
¡¡¡¡¡¡¡¡¡¡48              21
¡¡¡¡¡¡¡¡¡¡51               6


              ¡ã£´»³¤Ç¤Î¥·¥ã¥Ã¥Õ¥ë¡ä
¥È¥é¥ó¥×Ëç¿ô      Àµ½çÉü¸µ²ó¿ô       µÕ½çÉü¸µ²ó¿ô
¡¡¡¡¡¡¡¡¡¡ 8                6                  3
¡¡¡¡¡¡¡¡¡¡12               3
¡¡¡¡¡¡¡¡¡¡ 16               4                  2
¡¡¡¡¡¡¡¡¡¡ 20               6                  3
¡¡¡¡¡¡¡¡¡¡24               5
¡¡¡¡¡¡¡¡¡¡28               7
¡¡¡¡¡¡¡¡¡¡ 32              10                  5
¡¡¡¡¡¡¡¡¡¡36               9
¡¡¡¡¡¡¡¡¡¡40               5
¡¡¡¡¡¡¡¡¡¡44               6
¡¡¡¡¡¡¡¡¡¡48              21
¡¡¡¡¡¡¡¡¡¡52              13


¤³¤ì¤òį¤á¤ë¤È°Ê³°¤Ë¤âº®¤¼¤Æ¤¤¤ë¤è¤¦¤Ë¸«¤»¤«¤±¤Æ¡¢¸µ¤ËÌ᤹¤³¤È¤¬µ¯¤³¤ë
¸½¾Ý¤ò¤Ä¤¯¤ë¤³¤È¤¬²Äǽ¤Ç¤¢¤ë¤³¤È¤¬¤ï¤«¤ê¤Þ¤·¤¿¡£
£²£·Ëç¤Ç¤Î£³»³¤«¡¢£²£°Ëç¤Ç¤Î£´»³¤¢¤¿¤ê¤¬»È¤¨¤½¤¦¤Ç¤¹¡£
 

Re: ¤¢¤ë¥·¥ã¥Ã¥Õ¥ëÊýË¡¤Îµ¬Â§À­

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î24Æü(·î)17»þ07ʬ13ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.111[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¤³¤ì¤òį¤á¤ë¤È°Ê³°¤Ë¤âº®¤¼¤Æ¤¤¤ë¤è¤¦¤Ë¸«¤»¤«¤±¤Æ¡¢¸µ¤ËÌ᤹¤³¤È¤¬µ¯¤³¤ë
> ¸½¾Ý¤ò¤Ä¤¯¤ë¤³¤È¤¬²Äǽ¤Ç¤¢¤ë¤³¤È¤¬¤ï¤«¤ê¤Þ¤·¤¿¡£


µÕÃÖ´¹¤Ç¸µ¤ËÌ᤹¤³¤È¤ò¹Í¤¨¤ë¡£

£îËç£ð»³¤Î¤È¤­¡¢n=k*p¤Ê¤é£îËç£ë»³¤ËʬÇÛ¡¦¼ý½¸¤¬¹Í¤¨¤é¤ì¤ë¡£

¤¿¤È¤¨¤Ð
18Ëç3»³¤Î¾ì¹ç¡¢³Æ»³6Ë示¤Ä
¡¡16,13,10,7,4,1 !»³£±¡¡¢¨¾å¤«¤é½ç¤Ë
¡¡17,14,11,8,5,2 !»³£²
¡¡18,15,12,9,6,3 !»³£³
¤È¤Ê¤ëÃÖ´¹¤Ë¤Ê¤ë¡£¡Ê½ÐÂê¤Î»²¹ÍÎã¤Î¥·¥ã¥Ã¥Õ¥ë¡Ë
¤³¤ì¤ËÂФ·¤Æ¡¢18Ëç6»³¡¢³Æ»³3Ë示¤Ä
¡¡6,12,18 !»³£±
¡¡5,11,17 !»³£²
¡¡4,10,16 !»³£³
¡¡3, 9,15 !»³£´
¡¡2, 8,14 !»³£µ
¡¡1, 7,13 !»³£¶
¤È¤Ê¤ëµÕÃÖ´¹¤Ç¤¢¤ë¡£

¤³¤ÎÃÖ´¹¤Ï¡¢¾åµ­¤ÎÃÖ´¹¤Î¸å¤ËŬÍѤ¹¤ë¤È·×£²²ó¤Ç¸µ¤ËÌá¤ë¡£
¥«¡¼¥ÉÁàºî¤Ï¡¢¤Û¤ÜƱ¤¸Áàºî¤Ç¼Â¸½¤Ç¤­¤ë¡£¡Ö¥«¡¼¥É¤ò²¼¤«¤é½ç¤Ë¡×¤È¤«¡¢¡¢¡¢


¡£¡£¡£¤È¸À¤¦¶ñ¹ç¤Ë¡¢»ä¤â¾¯¤·¹Í¤¨¤Æ¤ß¤Þ¤·¤¿¡£
¤Þ¤¿¡¢µÕ½ç¤Î¤È¤­¤Ë£±²ó¤ÇµÕ½ç¤µ¤»¤ë¥·¥ã¥Ã¥Õ¥ë¤ò¹Ô¤¦¡ÊÅÓÃæ¤ÇËç¿ô¤ò¿ô¤¨¤ë¿¶¤ê¤ò¤·¤Æ¡¢£±»³¤Ë¥«¡¼¥É¤òÃÖ¤¤¤Æ¤¤¤¯¤Ê¤É¡Ë
¤Ê¤É¤ÎÁȹ礻¤Ç¡¢²ó¿ô¤È¤«¤ò¸º¤é¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¤Í¡£
 

¥·¥ã¥Ã¥Õ¥ëˡ§¹çÅÀ¡ª¡ª¡ª

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î24Æü(·î)18»þ41ʬ33ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¥ª¥Ã¡¼¡ª¡ª¡ª¡¡¥ï¥ó¥À¥Õ¥ë
£î¡ß£íËç¤Î¥«¡¼¥É¤ò¤Þ¤º£î»³¤Ëʬ¤±¤ë¥·¥ã¥Ã¥Õ¥ë¤ò¹Ô¤Ê¤Ã¤¿¸å
¼¡¤Ï£í»³¤Ç¤Î¥·¥ã¥Ã¥Õ¥ë¤ò¤·¤¿¤é¡¢ºÇ¸å¤ËËç¿ô¤ò³Îǧ¤¹¤ëÁàºî¤Ëʶ¤ì¤Æ½çÈÖ¤òµÕž¤·¤Æ¤ä¤ì¤Ð¤É¤ÎËç¿ô¤Ç¤â£³²ó¤ÎÁàºî¤Ç¥Õ¥©¡¼¥ë¥¹¥·¥ã¥Ã¥Õ¥ë¤¬²Äǽ¤È¤¤¤¦Ìõ¤Ç¤¹¤Í¡£
¤³¤ì¤Ê¤é¡¢Ëç¿ô¤Ç¤ÎÀµ½çÉü¸µ²ó¿ô¤ò¤¤¤Á¤¤¤Á³Ð¤¨¤Æ¤ª¤«¤Ê¤¯¤Æ¤âÂç¾æÉפÀ¡ª
£´¡ß£µ¡á£²£°ËçÄøÅÙ¤¬¤¤¤¤¤«¤â¡ª¡ÊǤ°Õ¤ÎËç¿ô¤Ç¤â£²¤Ä¿ô¤Î³Ý¤±»»¤µ¤¨¤ä¤ì¤ÐºÑ¤à¤ó¤À¡£¡Ë
¿ô³Ø¤¬ÆÀ°Õ¤ÊÊý¤Ï¤É¤¦¤·¤Æ¤³¤¦¤âƬ¤¬½ÀÆð¤Ê¤ó¤À¤í¤¦¡£
¼«Ê¬¤Ï¤¢¤ë»³¤À¤±¤Ë¸ÂÄꤷ¤Æ»×¹Í¤ò¤·¤Æ¤·¤Þ¤¦¡¦¡¦¡¦
¤¿¤¤¤Ø¤ó»²¹Í¤Ë¤Ê¤ë¥¢¥É¥Ð¥¤¥¹¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
 

matÌ¿Îá¤ÈÊ£ÁÇ¿ô·×»»

 Åê¹Æ¼Ô¡§Âç·§¡¡Àµ  Åê¹ÆÆü¡§2008ǯ11·î24Æü(·î)18»þ50ʬ22ÉÃ
ÊÖ¿®¡¦°úÍÑ
  Âç·§¡¡¤Ç¤¹¡£
»³ÃæÍÍ¡¢Åç¼ÍÍ¡¢¤½¤·¤ÆSECONDÍÍ
¿§¤¤¤í¤Î¸æ¶µ¼ø¡¡ËÜÅö¤ËÍ­Æñ¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£

¤½¤ÎÁí¤Æ¤¬¡¢¸½ºß¤Î»ä¤ËÍý²ò¤Ç¤­¤¿¤È¤Ï¡¢ÅþÄì»×¤Ã¤Æ¤Þ¤»¤ó¤¬¡¢
10¿ÊBASIC¤¬¹¹¤Ë¹¥¤­¤Ë¤Ê¤Ã¤¿¤³¤È¤Ï³Î¤«¤Ç¤¹¡£¡Ö»ý¤Ä¤Ù¤­¤Ï¡¢
Àèã¤Ê¤ê¡×¡¦¡¦¡¦¤È´¶¼Õ¤¤¤¿¤·¤Æ¤ª¤ê¤Þ¤¹¡£

¤½¤³¤Ç¡¢Åŵ¤²óÏ©{A}¤Ç¤Ï¡¢¥³¥ó¥Ç¥ó¥µ¡¼¤Ê¤É¤Î¥¢¥É¥ß¥Ã¥¿¥ó¥¹
¤¬¼þÇÈ¿ô¡Ê£Æ¡ËÆÃÀ­¤ò»ý¤Á¤Þ¤¹¡¢¹¹¤ËÅŸ»[B}¤âƱÍͤǤ¹¡£

¡Ê£±¡Ë¥Þ¥È¥ê¥¯¥¹[A]¤ÎÃæ¤Ë¥³¥ó¥Ç¥ó¥µ¡¼¤Ê¤É¤Î¥¢¥É¥ß¥Ã¥¿¥ó¥¹
¡¡¡¡¡¡¤ò¥¹¥Þ¡¼¥È¤ËÆþ¤ì¤ëÊýË¡¡£
¡Ê£²¡ËƱ¤¸¤¯¡¡ÅŸ»¤Î¥Þ¥È¥ê¥¯¥¹[B}¤Ë¡¢SIN¡ÊF,T)ɽ¼¨Åù¤Ç
¡¡¡¡¡¡¥¹¥Þ¡¼¥È¤ËÆþ¤ì¤ëÊýË¡¡£
¡Ê£³¡ËÅŸ»¤Î¼þÇÈ¿ô¤ÈÂ礭¤µ¡¢½ÐÎϤδط¸¡¢¾­Íè¤Î¥°¥é¥Õ²½¤Ë
¡¡¡¡¡¡È÷¤¨¡¢INV(A)*B¡¡Åù¤È¤·¤¿¾å¤Ç¹¹¤Ë¡¢Á´ÂΤò
¡¡¡¡¡¡¡¡¡¡FOR F=100 TO 10000 STEP 100¡¦¡¦¡ÖINB (A)*B¡×¡¦
¡¡¡¡¡¡¡¡¡¡¡¦¡¦¡¦NEXT F
       Åù¤È¤ä¤ë¤Î¤Ç¤·¤ç¤¦¤«¡¢Á´ÂΤÎÊýË¡¤¬»ä¤Ë¤Ï¤Þ¤À¸«¤¨
¡¡¡¡¡¡¡¡¤Æ¤Þ¤»¤ó¡£
¡Ê£´¡ËºÇ½ªÅª¤Ë¤Ï¡¢ÊÒÂпôɽ¤Î¥°¥é¥Õɽ¼¨¤ËÀ®¤ë¤Î¤Ç¤·¤ç¤¦¤¬¡¢
¡¡¡¡¡¡¤³¤ì¤ò¡¡¡¡¡¡¤ä¤Ã¤¿¡¢»²¹Í»ñÎÁ¤ä¡¢Ê¸¸¥¤Ê¤É¤¬¤¢¤ê¤Þ¤·
¡¡¡¡¡¡¤¿¤é¸æ¶µ¤¨¤¯¤À¤µ¤¤¡£
¡¡¡¡¡¡£Ã£Ò¡¡°ìÃʤβóÏ©¤Ç¤â¸½ºß¤Î»ä¤Ë¤Ï¡¢ÂçÊÑ»²¹Í¤Ë¤Ê¤ê¤Þ¤¹¡£
¡Ê£µ¡Ë¼Â¤Ï¡¢ºÇ½ªÅª¤Ë¤Ï¡ÖÍ­¸ÂÍ×ÁÇË¡¡×¤Ë¤Þ¤Ç¤¿¤É¤êÃ夭¤¿
¡¡¡¡¡¡¤¤¤Î¤Ç¤¹¤¬¡¢¡¡¡¡¡¡10¿ÊBASIC¤Ç¤³¤ì¤ò¤ä¤Ã¤¿¡¢Àèã¤Îʸ¸¥
¡¡¡¡¡¡¤Ê¤É¤¢¤ê¤Þ¤·¤¿¤é¸æ¶µ¤¨¤¯¤À¤µ¤¤¡£½¾Íè¤Î¡¡[N88 BASIC ??]
¡¡¡¡¡¡¤Ç¤ä¤Ã¤¿»²¹Í½ñ¤Ï¤¢¤ë¤Î¤Ç¤¹¤¬¡¢¿¿»÷¤·¤Æ¥×¥í¥°¥é¥à¤¹¤ë¤È
¡¡¡¡¡¡¡Öʸˡ¤ÎÁê°ã¤«¡¢¤¢¤Á¤³¤Á¤Ç¤Ä¤Ã¤«¤¨Á´¤¯Æ°¤«¤º¡×
¡¡¡¡¡¡¸½ºß¤Ï¡¢Äü¤á¤Æ¤¤¤ë¾õ¶·¤Ç¤¹¡£

¡Ö¤â¤Ã¤È¡¢¼«Ê¬¤Ç¶ìÏ«¤·¡¢¿¿ÌÌÌܤˤä¤ì¡×¤È¤Î¤ª¼¸¤ê¤Î¸ÀÍÕ¤â
¡¡¤­¤³¤¨¤Þ¤¹¤¬¡¢¤Ê¤ë¤Ù¤¯Á᤯¡Ö½éÊâ¤ÎÃʳ¬¡×¤òºÑ¤Þ¤»Àè¤Ë
¡¡¹Ô¤­¤¿¤¤¤Î¤Ç¡¡¤è¤í¤·¤¯¸æ´ê¤¤¤·¤Þ¤¹¡£

·É¶ñ
 

¸ÅÂåÀ¸Êª

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ11·î25Æü(²Ð)03»þ38ʬ43ÉÃ
ÊÖ¿®¡¦°úÍÑ
  !¸ÅÂåÀ¸Êª( ºÆÅê¹Æ¥³¥ó¥Ñ¥¯¥È)

SET TEXT FONT "£Í£Ó ÌÀÄ«",12
SET TEXT BACKGROUND "OPAQUE"
SET POINT STYLE 1
!----------------
LET t$="¥¢¥ó¥â¥Ê¥¤¥È"
LET N=101
LET xm=-0.63
LET ym=0.5
LET h=1.5
RANDOMIZE 19650218
SET WINDOW xm-h,xm+h, ym-h,ym+h
PLOT TEXT,AT xm+h*0.1,ym+h*0.85:t$& "    N="& USING$("###",N)
SET POINT COLOR 44
CALL fa(N, 0.4, 0.2)
beep
!----------------
LET t$="¥·¥À¤ÎÍÕ"
LET N=19
LET xm=0.32
LET ym=0.5
LET h=0.6
RANDOMIZE 19650218
SET WINDOW xm-h,xm+h, ym-h,ym+h
DRAW axes
PLOT TEXT,AT xm+h*0.1,ym+h*0.7:t$& "    N="& USING$("###",N)
PLOT TEXT,AT xm-h*0.75, ym+h*0.85:"¤·¤Ð¤é¤¯¸æÂÔ¤Á²¼¤µ¤¤¡£"
SET POINT COLOR 10
CALL fs(N, 0,0)
CALL fs(N, 0,0)
beep
PLOT TEXT,AT xm-h*0.75, ym+h*0.85:"¡¡ÉÁ²è¤Î½ªÎ»¡¡¡¡¡¡¡¡¡¡"

!------------------------------------------------------------
!¡¡Ê£¿ô¤Î½Ì¾®¥¢¥Õ¥¡¥¤¥óÊÑ´¹ (¥¢¥ó¥â¥Ê¥¤¥È)
DEF A1x(x,y)=-0.289993*x-0.001347*y+0.593333
DEF A1y(x,y)= 0.001986*x-0.196662*y-0.32 !¡¡p1=0.06124
DEF A2x(x,y)=-0.073058*x-0.024834*y+0.793333
DEF A2y(x,y)=-0.006353*x+0.285589*y-0.056667 !¡¡p2=0.022236
DEF A3x(x,y)= 0.939186*x-0.218787*y-0.046667
DEF A3y(x,y)= 0.214337*x+0.958685*y+0.01 !¡¡p3=0.916524
!------------------------------------------------------------
SUB fa(k, x,y)
   IF 0< k THEN
      CALL fa(k-1, A3x(x,y),A3y(x,y))
      IF RND< 0.0668176 THEN CALL fa(k-1, A1x(x,y),A1y(x,y))
      IF RND< 0.024261 THEN CALL fa(k-1, A2x(x,y),A2y(x,y))
   END IF
   PLOT POINTS: x,y
END SUB

!------------------------------------------------------------
! Ê£¿ô¤Î½Ì¾®¥¢¥Õ¥¡¥¤¥óÊÑ´¹ (¥·¥À¤ÎÍÕ)
DEF W1x(x,y)= 0.836*x+0.044*y
DEF W1y(x,y)=-0.044*x+0.836*y+0.169 ! p1=0.4
DEF W2x(x,y)=-0.141*x+0.302*y
DEF W2y(x,y)= 0.302*x+0.141*y+0.127 ! p2=0.2
DEF W3x(x,y)= 0.141*x-0.302*y
DEF W3y(x,y)= 0.302*x+0.141*y+0.169 ! p3=0.2
DEF W4x(x,y)= 0
DEF W4y(x,y)= 0.175337*y ! p4=0.2
!------------------------------------------------------------
!³ÎΨŪ¥×¥í¥Ã¥È(p1~p4)¤Ï¡¢ÊÑ·Á¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
SUB fs(k, x,y)
   IF 0< k THEN
      CALL fs(k-1, W1x(x,y),W1y(x,y))
      IF RND< 0.3 THEN CALL fs(k-1, W2x(x,y),W2y(x,y))
      IF RND< 0.3 THEN CALL fs(k-1, W3x(x,y),W3y(x,y))
      IF RND< 0.3 THEN CALL fs(k-1, W4x(x,y),W4y(x,y))
   END IF
   PLOT POINTS: x,y
END SUB

END
 

Re: matÌ¿Îá¤ÈÊ£ÁÇ¿ô·×»»

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î25Æü(²Ð)11»þ29ʬ9ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.114[¸µµ­»ö¤Ø]

Âç·§¡¡Àµ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¡Ê£±¡Ë¥Þ¥È¥ê¥¯¥¹[A]¤ÎÃæ¤Ë¥³¥ó¥Ç¥ó¥µ¡¼¤Ê¤É¤Î¥¢¥É¥ß¥Ã¥¿¥ó¥¹¤ò¥¹¥Þ¡¼¥È¤ËÆþ¤ì¤ëÊýË¡¡£
> ¡Ê£²¡ËƱ¤¸¤¯¡¡ÅŸ»¤Î¥Þ¥È¥ê¥¯¥¹[B}¤Ë¡¢SIN¡ÊF,T)ɽ¼¨Åù¤Ç¥¹¥Þ¡¼¥È¤ËÆþ¤ì¤ëÊýË¡¡£

£±Í×ÁǤº¤ÄÂåÆþʸ¤ÇÀßÄꤹ¤ë¤Î¤¬´ðËܤˤʤê¤Þ¤¹¡£
¥µ¥Ö¥ë¡¼¥Á¥ó¤ä´Ø¿ô¤ò»È¤Ã¤Æ¡¢ºÇ¾®¸Â¤ÎÍ×ÁǤò»Ø¼¨¤¹¤ë¤³¤È¤â²Äǽ¤Ç¤¹¡£¡Ê¥µ¥ó¥×¥ë»²¾È¡Ë

RC²óÏ©¡¢¤³¤ì¤Ç¤¤¤¤¤Î¤Ç¤·¤ç¤¦¤«¡©¡¡¶ñÂÎŪ¤ËÄ󼨤·¤¿Êý¤¬ÌäÂê²ò·è¤¬Áᤤ¤È»×¤¤¤Þ¤¹¡£


> ¡Ê£´¡ËºÇ½ªÅª¤Ë¤Ï¡¢ÊÒÂпôɽ¤Î¥°¥é¥Õɽ¼¨¤ËÀ®¤ë¤Î¤Ç¤·¤ç¤¦¤¬¡¢

¼þÇÈ¿ôÆÃÀ­¤Î¥°¥é¥Õ¤Ç¤¹¤«¡©


> ¡Ê£µ¡Ë¼Â¤Ï¡¢ºÇ½ªÅª¤Ë¤Ï¡ÖÍ­¸ÂÍ×ÁÇË¡¡×¤Ë¤Þ¤Ç¤¿¤É¤êÃ夭¤¿¤¤¤Î¤Ç¤¹¤¬¡¢

t¤Ë¤Ä¤¤¤Æ¤ÎÈùʬÊýÄø¼°¤ò²ò¤¯¤È¤¤¤¦¤³¤È¤Ç¤¹¤«¡©


£²Ã¼»ÒÂвóÏ©¡Ê£´Ã¼»Ò²óÏ©¡Ë¤È¤·¤Æ½èÍý¤·¤¿¥µ¥ó¥×¥ë
1000 !£²Ã¼»ÒÂвóÏ©¡Ê£´Ã¼»Ò²óÏ©¡Ë
1010 !¡¡i1¢ª¨£¨¡¨¡¨¤i2¢ª
1020 !¡¡a ¨¡¨©A¡¡B¨§¨¡ b
1030 !E1¢¬¡¡¨¢¡¡¡¡¨¢¡¡¢¬E2
1040 !¡¡a'¨¡¨©C¡¡D¨§¨¡ b'
1050 !¡¡¡¡¡¡¨¦¨¡¨¡¨¥
1060 !´ðËܹÔÎóF¤òÍѤ¤¤Æ
1070 ! (E1)=(A B)(E2)
1080 ! (i1) (C D)(i2)
1090
1100 OPTION ARITHMETIC COMPLEX !Ê£ÁÇ¿ô¤ò°·¤¦
1110
1120 LET j=SQR(-1) !µõ¿ôñ°Ì¡¡¢¨Åŵ¤·Ï¤Ï£ê¤ò»È¤¦
1130
1140 !¡ü¸òή²óÏ©
1150
1160 LET f=60 !¼þÇÈ¿ô[Hz]
1170 DEF w=2*PI*f !³Ñ¼þÇÈ¿ô¦Ø
1180 DEF w2f=w/(2*PI) !¦Ø¤«¤éf¤òµá¤á¤ë
1190
1200 DEF H2Ohm(L)=j*w*L ![H]¤ò[¦¸]¤Ø
1210 DEF F2Ohm(C)=1/(j*w*C) ![F]¤ò[¦¸]¤Ø
1220 DEF xL(L)=w*L !ͶƳ¥ê¥¢¥¯¥¿¥ó¥¹
1230 DEF xC(C)=1/(w*C) !ÍÆÎ̥ꥢ¥¯¥¿¥ó¥¹
1240
1250 SUB DispS(z) !Ê£ÁÇ¿ô¤òSɽ¼¨¤¹¤ë¡¡¢¨¥¹¥¿¥¤¥ó¥á¥Ã¥Ä¡ÊSteinmetz¡Ë
1260    PRINT ABS(z);
1270    IF ABS(z)<>0 THEN
1280       IF arg(z)<>0 THEN PRINT "¢Ü";DEG(arg(z));"¡ë";
1290    END IF
1300    PRINT
1310 END SUB
1320
1330 FUNCTION S2COMPLEX(l,th) !Sɽ¼¨¡Ê¶ËºÂɸ·Á¼°¡Ë¤òÊ£ÁÇ¿ô¤Ø
1340    LET S2COMPLEX=COMPLEX(l*COS(RAD(th)),l*SIN(RAD(th)))
1350 END FUNCTION
1360 FUNCTION i2COMPLEX(im,th) !½Ö»þÃͼ°¤òÊ£ÁÇ¿ô¤Ø¡¡¢¨ºÇÂçÃÍ¡¢½é´ü°ÌÁê
1370    LET i2COMPLEX=S2COMPLEX(im/SQR(2),th) !¼Â¸úÃÍ¡¢½é´ü°ÌÁê
1380 END FUNCTION
1390
1400
1410 !¡ü´ðËÜ£²Ã¼»ÒÂвóÏ©
1420 !¡¡¨¡Z¨¡¡¡¤Î¾ì¹ç¡¡F=(1 Z)
1430 !¡¡¨¡-¨¡¡¡¡¡¡¡¡¡¡¡¡¡(0 1)
1440 SUB seriesF(Z,F(,)) !ľÎóÁÞÆþ
1450    MAT F=IDN
1460    LET F(1,2)=Z !¥¤¥ó¥Ô¡¼¥À¥ó¥¹
1470 END SUB
1480 !¡¡¨¡¨¨¨¡¡¡¤Î¾ì¹ç¡¡F=(1¡¡ 0)
1490 !¡¡¡¡Z ¡¡¡¡¡¡¡¡¡¡¡¡¡¡(1/Z 1)
1500 !¡¡¨¡¨ª¨¡
1510 SUB shuntF(Z,F(,)) !ÊÂÎóÁÞÆþ
1520    WHEN EXCEPTION IN
1530       MAT F=IDN
1540       LET F(2,1)=1/Z !¥¢¥É¥ß¥¿¥ó¥¹
1550    USE
1560       PRINT "£°¤Ç¤Ï³ä¤ì¤Þ¤»¤ó¡£"
1570       STOP
1580    END WHEN
1590 END SUB
1600
1610 !¡ü¥Ñ¥é¥á¡¼¥¿¤ÎÁê¸ßÊÑ´¹¡¡¢¨°ìÉô
1620 SUB F2Z(F(,), Z(,)) !£Æ¥Ñ¥é¥á¡¼¥¿¤ò£Ú¥Ñ¥é¥á¡¼¥¿¤Ø
1630    LET Z(1,1)=F(1,1) !A
1640    LET Z(1,2)=DET(F) !AD-BC
1650    LET Z(2,1)=1
1660    LET Z(2,2)=F(2,2) !D
1670    WHEN EXCEPTION IN
1680       MAT Z=(1/F(2,1))*Z !(1/C)ÇÜ
1690    USE
1700       PRINT "£Ú¥Ñ¥é¥á¡¼¥¿¤Ï¸ºß¤·¤Þ¤»¤ó¡£"
1710       STOP
1720    END WHEN
1730 END SUB
1740 SUB F2Y(F(,),Y(,)) !£Æ¥Ñ¥é¥á¡¼¥¿¤ò£Ù¥Ñ¥é¥á¡¼¥¿¤Ø
1750    LET Y(1,1)=F(2,2) !D
1760    LET Y(1,2)=-DET(F) !BC-AD
1770    LET Y(2,1)=-1
1780    LET Y(2,2)=F(1,1) !A
1790    WHEN EXCEPTION IN
1800       MAT Y=(1/F(1,2))*Y !(1/B)ÇÜ
1810    USE
1820       PRINT "£Ù¥Ñ¥é¥á¡¼¥¿¤Ï¸ºß¤·¤Þ¤»¤ó¡£"
1830       STOP
1840    END WHEN
1850 END SUB
1860 !-------------------- ¤³¤³¤Þ¤Ç¤¬¥µ¥Ö¥ë¡¼¥Á¥ó
1870
1880
1890 DIM mF(2,2),mZ(2,2),mY(2,2) !F,Z,Y¥Ñ¥é¥á¡¼¥¿
1900 DIM vi(2),vo(2) !ÅÅή¤äÅÅ°µ¤Î¥Ù¥¯¥È¥ë
1910 DIM T1(2,2),T2(2,2) !ºî¶ÈÍÑ
1920
1930
1940 !¡ü£±¼¡£Ò£Ã²óÏ©¡¢Ä¾Îó£Ò£Ã²óÏ©¡¢¥í¡¼¥Ñ¥¹¥Õ¥£¥ë¥¿
1950 !i1¢ª¡¡¡¡¡¡i2¢ª
1960 !¡¡¨¡R¨¡¨¨¨¡
1970 !E1¢¬¡¡ C¡¡¢¬E2
1980 !¡¡¨¡-¨¡¨ª¨¡
1990 !i1=3*SQR(2)*SIN(377*t)[A]¡¢R=30[¦¸]¡¢C=66.3[¦ÌF]
2000
2010 LET R=30
2020 LET C=66.3e-6
2030
2040
2050 !¡ü£Æ¥Ñ¥é¥á¡¼¥¿¡¢´ðËܹÔÎó
2060 MAT mF=IDN !ñ°Ì¹ÔÎó
2070
2080 CALL seriesF(R,T1)
2090 MAT mF=mF*T1 !½Ä³Àܳ
2100
2110 CALL shuntF(F2Ohm(C),T2)
2120 MAT mF=mF*T2
2130
2140 PRINT "£Æ¥Ñ¥é¥á¡¼¥¿"
2150 MAT PRINT mF;
2160
2170
2180 !¡ü£Ú¥Ñ¥é¥á¡¼¥¿¡¢¥¤¥ó¥Ô¡¼¥À¥ó¥¹¹ÔÎó V=Z*I
2190 CALL F2Z(mF,mZ)
2200 PRINT "£Ú¥Ñ¥é¥á¡¼¥¿"
2210 MAT PRINT mZ;
2220
2230
2240 !¡ü(E1)=[F](E2)¤è¤ê
2250 !¡¡(i1)¡¡¡¡(i2)
2260 LET vi(2)=i2COMPLEX(3*SQR(2),0) !3[A}
2270 PRINT "i1=";
2280 CALL DispS(vi(2))
2290 LET vi(1)=mZ(1,1)*vi(2) !E=R*i¡¢150¢Ü-53.1¡ë[V]
2300 PRINT "E1=";
2310 CALL DispS(vi(1))
2320 PRINT
2330
2340 MAT T1=INV(mF) !½ÐÎϦ¤ò»»½Ð¤¹¤ë
2350 MAT vo=T1*vi
2360
2370 PRINT "E2=";
2380 CALL DispS(vo(1))
2390 PRINT "i2=";
2400 CALL DispS(vo(2))
2410 PRINT
2420
2430
2440 !¡ü£Ù¥Ñ¥é¥á¡¼¥¿¡¢¥¢¥É¥ß¥¿¥ó¥¹¹ÔÎó I=Y*V
2450 CALL F2Y(mF,mY)
2460 PRINT "£Ù¥Ñ¥é¥á¡¼¥¿"
2470 MAT PRINT mY;
2480
2490
2500 END
 

¥ì¥¹¡¢ÃÙ¤¯¤Ê¤ê¤Þ¤·¤¿¡£

 Åê¹Æ¼Ô¡§NINA  Åê¹ÆÆü¡§2008ǯ11·î25Æü(²Ð)23»þ07ʬ41ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¹ÓÅÄÍÍ¡¢»³ÃæÍÍ¡¢¿ÆÀڤʤ´ÀâÌÀ¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡ª¡ª

¤ªÆó¿Í¤Î¤ª¤«¤²¤Ç¡¢½½¿ÊBASIC¤Î¤¹¤´¤µ¤¬¤ï¤«¤Ã¤¿¤è¤¦¤Êµ¤¤¬¤·¤Þ¤¹¡£
¤½¤·¤Æ¡¢¼«Ê¬¤ÎÊÙ¶¯ÉÔ­¤â¡Ä¡£
¤³¤ì¤òµ¡¤Ë¡¢½½¿ÊBASIC¤ò¾¯¤·¤Ç¤â»È¤¨¤ë¤è¤¦¤ËÊÙ¶¯¤·¤¿¤¤¤È»×¤¤¤Þ¤¹¡£


ÊÖ»ö¤¬ÃÙ¤¯¤Ê¤Ã¤¿¤³¤È¡¢Ï¢Ì¾¤Ç¤Î¤ªÊÖ»öËÜÅö¤Ë¿½¤·Ìõ¤¢¤ê¤Þ¤»¤ó¡£
¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
 

Re: matÌ¿Îá¤ÈÊ£ÁÇ¿ô·×»»

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î26Æü(¿å)08»þ19ʬ38ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.114[¸µµ­»ö¤Ø]

Âç·§¡¡Àµ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£
> ¡Ê£±¡Ë¥Þ¥È¥ê¥¯¥¹[A]¤ÎÃæ¤Ë¥³¥ó¥Ç¥ó¥µ¡¼¤Ê¤É¤Î¥¢¥É¥ß¥Ã¥¿¥ó¥¹¤ò¥¹¥Þ¡¼¥È¤ËÆþ¤ì¤ëÊýË¡¡£
> ¡Ê£²¡ËƱ¤¸¤¯¡¡ÅŸ»¤Î¥Þ¥È¥ê¥¯¥¹[B}¤Ë¡¢SIN¡ÊF,T)ɽ¼¨Åù¤Ç¥¹¥Þ¡¼¥È¤ËÆþ¤ì¤ëÊýË¡¡£

ÀáÅÀÅÅ°ÌË¡¤Ë¤è¤ë¥µ¥ó¥×¥ë¤Ç¤¹¡£
°ÊÁ°Â裱·Ç¼¨ÈĤËÅê¹Æ¤·¤¿Ä¾Î®²óÏ©¤Î²þ½¤ÈǤˤʤê¤Þ¤¹¡£
1000 !Åŵ¤²óÏ©¥·¥ß¥å¥ì¡¼¥·¥ç¥ó¡ÊÀáÅÀÅÅ°ÌË¡¡Ë¡¡¸òή²óÏ©
1010
1020 !¡¦³ÆÀáÅÀ¤ÎÅṲ̋òɽ¼¨¤¹¤ë
1030 !¡¦³ÆÁǻҤؤÎÅÅή¡¢ÅṲ̋òɽ¼¨¤¹¤ë
1040
1050 OPTION ARITHMETIC COMPLEX
1060
1070 LET j=SQR(-1) !µõ¿ôñ°Ì¡¡¢¨Åŵ¤·Ï¤Ï£ê¤ò»È¤¦
1080
1090 LET f=60 !¼þÇÈ¿ô[Hz]
1100 DEF w=2*PI*f !³Ñ¼þÇÈ¿ô¦Ø
1110
1120 DEF H2Ohm(L)=j*w*L ![H]¤ò[¦¸]¤Ø
1130 DEF F2Ohm(C)=1/(j*w*C) ![F]¤ò[¦¸]¤Ø
1140 DEF xL(L)=w*L !ͶƳ¥ê¥¢¥¯¥¿¥ó¥¹
1150 DEF xC(C)=1/(w*C) !ÍÆÎ̥ꥢ¥¯¥¿¥ó¥¹
1160
1170 SUB DispS(z) !Ê£ÁÇ¿ô¤òSɽ¼¨¤¹¤ë¡¡¢¨¥¹¥¿¥¤¥ó¥á¥Ã¥Ä¡ÊSteinmetz¡Ë
1180    PRINT ABS(z);
1190    IF ABS(z)<>0 THEN
1200       IF arg(z)<>0 THEN PRINT "¢Ü";DEG(arg(z));"¡ë";
1210    END IF
1220    !PRINT
1230 END SUB
1240
1250 FUNCTION S2COMPLEX(l,th) !Sɽ¼¨¡Ê¶ËºÂɸ·Á¼°¡Ë¤òÊ£ÁÇ¿ô¤Ø
1260    LET S2COMPLEX=COMPLEX(l*COS(RAD(th)),l*SIN(RAD(th)))
1270 END FUNCTION
1280 FUNCTION i2COMPLEX(im,th) !½Ö»þÃͼ°¤òÊ£ÁÇ¿ô¤Ø¡¡¢¨ºÇÂçÃÍ¡¢½é´ü°ÌÁê
1290    LET i2COMPLEX=S2COMPLEX(im/SQR(2),th) !¼Â¸úÃÍ¡¢½é´ü°ÌÁê
1300 END FUNCTION
1310 !-------------------- ¤³¤³¤Þ¤Ç¤¬¥µ¥Ö¥ë¡¼¥Á¥ó
1320
1330 !---------- ¢­¢­¢­¢­¢­ ----------
1340 LET Ns=0 !ÅÅ°µ¸»¤Î¿ô
1350 LET Nd=3 !ÀáÅÀ¤Î¿ô
1360 !---------- ¢¬¢¬¢¬¢¬¢¬ ----------
1370
1380 LET N=Nd+Ns
1390
1400 !¡ü¥­¥ë¥Ò¥Û¥Ã¥Õ¤ÎÅÅή§¤è¤ê¡¢ÀáÅÀÊýÄø¼°¤òÁȤßΩ¤Æ¤ë
1410 DIM A(N,N),x(N),b(N) !ϢΩÊýÄø¼° Ax=b
1420 MAT A=ZER
1430 MAT b=ZER
1440
1450
1460 DIM el_tmp$(100),ev_tmp(100),nd1_tmp(100),nd2_tmp(100) !ÁǻҤΰÀ­
1470 LET K=0
1480
1490 SUB AddElements(el$,ev,nd1,nd2) !²óÏ©¤òµ­Ï¿¤¹¤ë
1500    LET K=K+1 !Ï¢È֤DzóÏ©¤òµ­Ï¿¤¹¤ë¡¡¢¨Ãí°Õ. ÊýÄø¼°¤ÎÀ®Ê¬ÈÖ¹æ¤È°ìÃפ·¤Ê¤¤
1510    LET el_tmp$(K)=el$
1520    LET ev_tmp(K)=ev
1530    LET nd1_tmp(K)=nd1
1540    LET nd2_tmp(K)=nd2
1550
1560
1570    !ϢΩÊýÄø¼°¤òÁȤßΩ¤Æ¤ë
1580    ! ¨£¡¡ ¨¢¡¡ ¨¤¨£¡¡¨¤ ¨£¡¡¨¤
1590    ! ¨¢£Ç ¨¢¡Þ1¨¢¨¢V ¨¢=¨¢I ¨¢
1600    !¨¡¨¡¨¡¨«¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡
1610    ! ¨¢¡Þ1¨¢-Zp¨¢¨¢Ip¨¢ ¨¢Ep¨¢
1620    ! ¨¦¡¡ ¨¢¡¡ ¨¥¨¦¡¡¨¥ ¨¦¡¡¨¥
1630
1640    SELECT CASE UCASE$(el$(1:1)) !ÁǻҤ˱þ¤¸¤Æ
1650    CASE "V" !ÅÅ°µ¸»¤Ê¤é
1660       LET p=VAL(el$(2:LEN(el$)))+Nd !ÈÖ¹æ¤òÆÀ¤ë
1670       LET A(nd1,p)=A(nd1,p)-1 !ÅÅήIp¤¬ÀáÅÀi¤«¤éÀáÅÀj¤Øή¤ì¤¿¤È¤·¤Æ¡¢(Vi-Vj)-Ip*Zp=Ep
1680       LET A(p,nd1)=A(p,nd1)-1
1690       LET A(nd2,p)=A(nd2,p)+1
1700       LET A(p,nd2)=A(p,nd2)+1
1710       LET A(p,p)=A(p,p)+0 !ÆâÉôÄñ¹³Zp¤Ï£°¤È¤¹¤ë
1720       LET b(p)=b(p)+ev !µ¯ÅÅÎÏ
1730
1740    CASE "I" !ÅÅή¸»¤Ê¤é
1750       LET b(nd1)=b(nd1)-ev
1760       LET b(nd2)=b(nd2)+ev
1770
1780    CASE ELSE !ÁǻҤʤé
1790       LET Gij=1/ev
1800       !ÂгÑÀ®Ê¬¡¡¢¨ÀáÅÀ¤ËÀܳ¤µ¤ì¤¿Áǻҡʥ¢¥É¥ß¥¿¥ó¥¹¡Ë¤ÎÏÂ
1810       LET A(nd1,nd1)=A(nd1,nd1)+Gij
1820       LET A(nd2,nd2)=A(nd2,nd2)+Gij
1830       !¤½¤Î¾¤ÎÀ®Ê¬¡¡¢¨ÀáÅÀ¤ËÀܳ¤µ¤ì¤¿Áǻҡʥ¢¥É¥ß¥¿¥ó¥¹¡Ë¤Ë-1¤ò¤«¤±¤¿¤â¤Î¤ÎÏÂ
1840       LET A(nd1,nd2)=A(nd1,nd2)-Gij
1850       LET A(nd2,nd1)=A(nd2,nd1)-Gij
1860
1870    END SELECT
1880 END SUB
1890 !-------------------- ¤³¤³¤Þ¤Ç¤¬¥µ¥Ö¥ë¡¼¥Á¥ó
1900
1910 !---------- ¢­¢­¢­¢­¢­ ----------
1920
1930 !¡ü²óÏ©¿Þ¡¡¢¨£±¼¡£Ò£Ã²óÏ©¡¢Ä¾Îó£Ò£Ã²óÏ©¡¢¥í¡¼¥Ñ¥¹¥Õ¥£¥ë¥¿
1940 !¡¡¨¡£²¨¡R1¨¡£³¨¡
1950 !¡¡¡¡¨¢¡¡¡¡¡¡¨¢
1960 !¡¡¡¡i3¡¡¡¡¡¡C2
1970 !¡¡¡¡¨¢¡¡¡¡¡¡¨¢
1980 !¡¡¨¡£±¨¡¨¡¨¡¨ª¨¡
1990 !¡¡¡¡¨¢
2000 !¡¡¡¡¢á¥¢¡¼¥¹
2010 !¡¡i3=3*SQR(2)*SIN(377*t)[A]¡¢R1=30[¦¸]¡¢C2=66.3[¦ÌF]
2020
2030 !ÁÇ»Ò: Rn,Vn,In¡¢n:ÈÖ¹æ¡ÊÏ¢ÈÖ¡Ë¡¡¢¨£²Ê¸»úÌܰʹߤÏÈÖ¹æ
2040 !ÃÍ:
2050 !ü»ÒÈÖ¹æ¡Êµ¯ÅÀ¡Ë: £±°Ê¾å¤ÎÃÍ¡¡¢¨ÀáÅÀ
2060 !ü»ÒÈÖ¹æ: £±°Ê¾å¤ÎÃÍ¡¡¢¨ÀáÅÀ
2070
2080 CALL AddElements("R1",30,2,3) !30[¦¸]¡¢»ÞÏ©ÅÅή¤Ï2¢ª3¤È²¾Äꤹ¤ë
2090 CALL AddElements("C2",F2Ohm(66.3e-6),3,1) !C=66.3[¦ÌF]
2100 CALL AddElements("i3",i2COMPLEX(3*SQR(2),0),1,2) !3[A]
2110
2120 !¢¨ÅÅ°µ¸»¤ÎÈÖ¹æ¤Ï£±¤«¤é¤ÎÏ¢ÈÖ¡¡Îã. CALL AddElements("V1",?,?,?) !?[V]
2130 !¤Ê¤·
2140
2150 LET GND=1 !¢¨¥¢¡¼¥¹
2160
2170 !---------- ¢¬¢¬¢¬¢¬¢¬ ----------
2180
2190
2200 FOR i=1 TO Nd !·ëÀþ¤µ¤ì¤Æ¤¤¤Ê¤¤ÀáÅÀ¡¡1*Vi=0
2210    IF A(i,i)=0 THEN LET A(i,i)=1
2220 NEXT i
2230 LET A(GND,GND)=0 !ÅṲ̋ò£°¤È¤¹¤ë
2240
2250 MAT PRINT A;
2260 MAT PRINT b;
2270
2280
2290 DIM Ai(N,N) !ϢΩÊýÄø¼°¤ò²ò¤¯
2300 MAT Ai=INV(A)
2310 MAT x=Ai*b
2320
2330
2340 FOR i=1 TO Nd !³ÆÀáÅÀ¤ÎÅÅ°Ì¡¢Î®¤ì¹þ¤àÅÅή¤òɽ¼¨¤¹¤ë
2350    PRINT "ÀáÅÀ";STR$(i);":";
2360    CALL DispS(x(i))
2370    PRINT "[V] ,";
2380    CALL DispS(b(i))
2390    PRINT "[A]"
2400 NEXT i
2410 PRINT
2420
2430 FOR i=1 TO K-Ns !³ÆÁǻҤËή¤ì¤ëÅÅή¡¢ÅṲ̋òɽ¼¨¤¹¤ë
2440    PRINT el_tmp$(i);":";
2450    LET t$=el_tmp$(i)(1:1)
2460    IF UCASE$(t$)="I" THEN !ÅÅή¸»¤Ê¤é
2470       CALL DispS(ev_tmp(i))
2480       PRINT "[A]",
2490       CALL DispS(x(nd2_tmp(i))-x(nd1_tmp(i)))
2500       PRINT "[V]"
2510    ELSE
2520       CALL DispS((x(nd1_tmp(i))-x(nd2_tmp(i)))/ev_tmp(i))
2530       PRINT "[A]",
2540       CALL DispS(x(nd1_tmp(i))-x(nd2_tmp(i)))
2550       PRINT "[V]"
2560    END IF
2570 NEXT i
2580 PRINT
2590
2600 FOR i=1 TO Ns !ÅÅ°µ¸»¤Ëή¤ì¤ëÅÅή¡¢ÅṲ̋òɽ¼¨¤¹¤ë
2610    PRINT el_tmp$(K-Ns+i);":";
2620    CALL DispS(x(Nd+i))
2630    PRINT "[A]",
2640    CALL DispS(ev_tmp(K-Ns+i))
2650    PRINT "[V]"
2660 NEXT i
2670
2680
2690 END
 

(̵Âê)

 Åê¹Æ¼Ô¡§Âç·§¡¡Àµ  Åê¹ÆÆü¡§2008ǯ11·î26Æü(¿å)12»þ16ʬ55ÉÃ
ÊÖ¿®¡¦°úÍÑ
  »³ÃæÍÍ
Âç·§¤Ç¤¹¡£Ëè²ó¡¢¸æÃúÇ«¤Ê²óÅú¤òÍ­Æñ¤¦¤´¤¶¤¤¤Þ¤¹¡£
Áí¤Æ¤ò¤Þ¤ÀÍý²ò¤Ç¤­¤Ê¤¤¤Ç¤¤¤Þ¤¹¤¬¡¢SUBÌ¿Îá¤Î¥¹¥¿¥¤¥ë¤Ê¤É¤ò
°ìÊդ˳Ф¨¤Þ¤·¤¿¡£

½ê¤Ç¡¢¸æ²óÅú¤Çµ¤¤Ë¤Ê¤ë¤³¤È¤¬¤¢¤ë¤Î¤Ç¼ÁÌ䤤¤¿¤·¤Þ¤¹¡£

¡Ê£±¡Ë¡¡ÅÅή¤Ç¤ä¤Ã¤Æ¤Þ¤¹¤¬¡¢¤½¤Î¤¿¤á¡¡E1¤Ë°ÌÁ꤬ÉÕ¤¤¤Æ¤¤¤Þ¤¹¡£
¡¡¡¡¡¡¡¡¼þÇÈ¿ôÆÃÀ­¡Ê¥Ü¡¼¥ÉÀþ¿Þ¡Ë¤Ê¤É¤Ç¤Ï¡¢
        E1 100V¤Ç°ÌÁê0ÅÙ¤ò²Ã¤¨¤ë¤È¡¡E2 I2 ¡¢¤½¤·¤ÆºÇ¸å¤ËI1
¡¡¡¡¡¡¡¡¤Ï¤É¤¦¤«¡¦¡¦¡¦¡¦¡£
¡¡¡¡¡¡¡¡¤Î¤è¤¦¤ËµÕ¤ËÀ®¤ë¤È»×¤¤¤Þ¤¹¡£ÅÅ°µ¤ÈÅÅή¤ÎÈæÎã´Ø·¸¤«¤é
¡¡¡¡¡¡¡¡E1¤Î·ë²Ì¤òñ½ã¤ËµÕ·×»»¡¢E1¤ò100V¤Ëľ¤·¡¢E1¤Î°ÌÁê¤ò
¡¡¡¡¡¡¡¡E2¤Ë²Ã¸º¤¹¤ë¤È¤¤¤¦»ö¤Ë¤Ê¤ë¤Î¤Ç¤·¤ç¤¦¤«¡£

¡Ê£²¡Ë¡¡1090 LET f=60 !¼þÇÈ¿ô
¡¡¡¡¡¡¡¡¤È¤Ê¤Ã¤Æ¤Þ¤¹¤¬¡¢¼þÇÈ¿ôÆÃÀ­¡Ê¥Ü¡¼¥ÉÀþ¿Þ¡Ë¤Ê¤É¤Ç¤Ï¡¢
¡¡¡¡¡¡¡¡¼þÇÈ¿ô¡¡£æ¡á£±£°¡¡¤«¤é¡¡£±£°£°£°£°¤Þ¤Ç
¡¡¡¡¡¡¡¡Åù¤ÈÀ®¤ê¤Þ¤¹¡£
¡¡¡¡¡¡¡¡²¼¤Ë¡¡DATA¡¡Ê¸¤òÉÕ¤±¡¢READ DATA Åù¤È¤ä¤ë¤Î¤Ç¤·¤ç¤¦¤«¡£
¡¡¡¡¡¡¡¡¼þÇÈ¿ô¤ò¡¡DIM FF(£æ¤Î»ØÄê,1)
        ½ÐÎϤ⡡¡¡DIM EE2(½ÐÎϤγÊǼ,1)
¡¡¡¡¡¡¡¡Åù¤È¤ä¤ë¤È¡¢²Äǽ¤È¤ª¤â¤¤¤Þ¤¹¤¬¡¢¤¤¤«¤¬¤Ç¤·¤ç¤¦¤«¡£


¡Ê£³¡Ë¡¡Î㤨¤Ð¡¢¤³¤Î¥í¡¼¥Ñ¥¹¥Õ¥£¥ë¥¿¡¼¤¬5ÃʤĤº¤¤¤¿¤é¡¢
¡¡¡¡¡¡¡¡£Æ¹ÔÎó¤ò5¾è¤¹¤ë¤Î¤Ç¤¹¤«¡¢
¡¡¡¡¡¡¡¡Â¶¤Î»þ¡¡(A)^5 ¤Ç¤·¤ç¤¦¤«¡£¤Þ¤¿¤Ï¡¢FOR --NEXT¤Ç¤¹¤«¡£


¡Ê£´¡Ë¡¡»ä¤Î¡ÖÍ­¸ÂÍ×ÁÇË¡¡×¤È¤Ï¡¢¡¦¡¦¡¦Ç®¤È¤«¡¢¼§µ¤¤äÅṲ̋Îɽ¼¨¤Ç
¡¡¡¡¡¡¡¡¤¿¤È¤¨¤Ð¡¢Âʱ߷Á¤ÎÈĤ¬ºß¤Ã¤¿¤È¤­¡¢¤½¤Î·Á¾õ¤ò¾®¤µ¤Ê»°³Ñ¢¦¤Ë
¡¡¡¡¡¡¡¡Ê¬³ä¤·¡¢Ï¢Î©ÊýÄø¼°¤òΩ¤Æ¤ë¡£¡¦¡¦¡¦»þ´Öt¤Ë¤â´Ø·¸¤·¤Þ¤¹¡£
¡¡¡¡¡¡¡¡ÂʱߤÎÈĤÎA(X,Y)¤Ë100ÅÙ¤ò²Ã¤¨¤ë¤È¾¤ÎÉôʬA(P,Q)¤Î²¹ÅÙ¤Ï
        ¤É¤¦¤Ê¤ë¤«,¡¦¡¦¡¦¤Þ¤¿¡¢¤½¤ì¤ò¿§¤Çɽ¼¨¤»¤è¡¦¡¦¡¦¡£
¡¡¡¡¡¡¡¡»þ´ÖŪ¤Ë¤Ï¤É¤¦¤«¡¦¡¦¡¦¡¦¤È¸À¤Ã¤¿¤è¤¦¤ÊÌäÂê¤Ç¤¹¡£
¡¡¡¡¡¡¡¡¼Â¤Ï¡¢ÌµÎÁ¤Î¥½¥Õ¥È¤¬¤¢¤ë¤è¤¦¤Ê¤Î¤Ç¤¹¤¬¡¢¡Ö¥ê¥Ê¥Ã¥¯¥¹¡×¤È¤«
¡¡¡¡¡¡¡¡¤Çºî¤é¤ì¡¢Áí¤Æ¤ÎÌäÂê¤ËÂФ·¤Þ¤Àº£¤Ï¡¢´°Á´¤Ë¤Ï´°À®½ÐÍè¤Æ¤Ê¤¤
¡¡¡¡¡¡¡¡¤Èʹ¤­¤Þ¤·¤¿¡£N88¤Ç¤Î¥½¥Õ¥È¤Ë,¶á¤¤ÌäÂê¤Î¥½¥Õ¥ÈÎ㤬¤¢¤ê
¡¡¡¡¡¡¡¡¤Þ¤¿ÀΤǤ¹¤¬¡¢ËÜ¡Ê¡ï2,300)¤â½Ð¤Æ¤¤¤Þ¤¹¡£
¡¡¡¡¡¡¡¡¡ÖBASIC¤Ë¤è¤ë¡¡Í­¸ÂÍ×ÁÇË¡¤Î´ðÁá׸ÍÀî È»¿Í¡¡¥µ¥¤¥¨¥ó¥¹¼Ò
¡¡¡¡¡¡¡¡¤³¤ì¤Ï¡¢¥Þ¥È¥ê¥¯¥¹¤Ç²ò¤¤¤Æ¤¤¤Þ¤»¤ó¡£½¾¤Ã¤Æ¥½¥Õ¥È¤Î¸«Ä̤·
¡¡¡¡¡¡¡¡¤¬°­¤¯¡¢¤³¤ÎÉôʬ¤Ï°ìÂβ¿¤ò¤·¤Æ¤ë¤Î¤«Îɤ¯Ê¬¤é¤Ê¤¤¡¦¡¦¡¦
¡¡¡¡¡¡¡¡¤È¤¤¤¦·çÅÀ¤¬¤¢¤ê¤Þ¤¹¡£¥Þ¥È¥ê¥¯¥¹¤ÈÊ£ÁÇ¿ô¤ÎξÊý¤¬¤Ç¤­¤ë
¡¡¡¡¡¡¡¡10¿ÊBASIC¤Ê¤é¡¢¤½¤ì¤¬²Äǽ¤Ç¡¢¤¢¤ë¤¤¤Ï¤â¤¦´û¤Ë½ÐÍè¤Æ¤ë
¡¡¡¡¡¡¡¡¤Î¤«¤È»×¤¤¼ÁÌ䡦Åê¹Æ¤·¤Þ¤·¤¿¡£

¡Ê£µ¡Ë¡¡Ã¦Àþ¤Ç¤¹¤¬¡¢¤³¤ÎÅê¹ÆÍó¤Ëµ¡³£¸ì¤Î¤³¤È¤¬¤¢¤ê¤Þ¤·¤¿¡£SECONDÍÍ
¡¡¡¡¡¡¡¡¤³¤Î¥½¥Õ¥È¤ÏËüǽ¤Ç¡¢¤¿¤È¤¨¤Ð¡¢º£²ó¤Î¥í¡¼¥Ñ¥¹¥Õ¥£¥ë¥¿¤Ç¤â
¡¡¡¡¡¡¡¡Â¶¤Î¥½¥Õ¥È¤Î¤¢¤ëƱ¤¸¥Û¥ë¥À¡¼¤Ë¤ª¤±¤Ð¡¢Æ°ºî²Äǽ¤Ê¤Î¤Ç¤¹¤«¡£
 

Re: (̵Âê)

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î26Æü(¿å)13»þ42ʬ16ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.119[¸µµ­»ö¤Ø]

Âç·§¡¡Àµ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£


>¡Ê£±¡Ë¡¡ÅÅή¤Ç¤ä¤Ã¤Æ¤Þ¤¹¤¬¡¢¤½¤Î¤¿¤á¡¡E1¤Ë°ÌÁ꤬ÉÕ¤¤¤Æ¤¤¤Þ¤¹¡£
>
>¡Ê£²¡Ë¡¡1090 LET f=60 !¼þÇÈ¿ô
>¡¡¡¡¡¡¡¡¤È¤Ê¤Ã¤Æ¤Þ¤¹¤¬¡¢¼þÇÈ¿ôÆÃÀ­¡Ê¥Ü¡¼¥ÉÀþ¿Þ¡Ë¤Ê¤É¤Ç¤Ï¡¢
>¡¡¡¡¡¡¡¡¼þÇÈ¿ô¡¡£æ¡á£±£°¡¡¤«¤é¡¡£±£°£°£°£°¤Þ¤Ç¡¡Åù¤ÈÀ®¤ê¤Þ¤¹¡£

f¤ÎFOR ¡ÁNEXTʸ¤ÇËè²ó·×»»¤·Ä¾¤»¤Ð¤¤¤¤¤«¤È»×¤¤¤Þ¤¹¡£
·«¤êÊÖ¤·Éôʬ¤ò¥µ¥Ö¥ë¡¼¥Á¥ó²½¤¹¤ë¤È¥×¥í¥°¥é¥à¤Î¸«Ä̤·¤¬Îɤ¯¤Ê¤ë¤È»×¤¤¤Þ¤¹¡£


Îã.

¢¨¥µ¥Ö¥ë¡¼¥Á¥óÉôʬ¤Ï¾Êά
DIM mF(2,2),mZ(2,2) !F,Z¥Ñ¥é¥á¡¼¥¿
DIM vi(2),vo(2) !ÅÅή¤äÅÅ°µ¤Î¥Ù¥¯¥È¥ë
DIM T1(2,2),T2(2,2) !ºî¶ÈÍÑ

!¡ü£±¼¡£Ò£Ã²óÏ©¡¢Ä¾Îó£Ò£Ã²óÏ©¡¢¥í¡¼¥Ñ¥¹¥Õ¥£¥ë¥¿¡¢ÀÑʬ²óÏ©
!i1¢ª¡¡¡¡¡¡i2¢ª
!¡¡¨¡R¨¡¨¨¨¡
!E1¢¬¡¡ C¡¡¢¬E2
!¡¡¨¡-¨¡¨ª¨¡
!E1=5[V]¡¢R=1k[¦¸]¡¢C=0.1[¦ÌF]

LET R=1e3
LET C=0.1e-6

SUB routine
!¢¨£Æ¥Ñ¥é¥á¡¼¥¿¡¢´ðËܹÔÎó
   MAT mF=IDN !ñ°Ì¹ÔÎó
   CALL seriesF(R,T1) !½Ä³Àܳ
   MAT mF=mF*T1
   CALL shuntF(F2Ohm(C),T2)
   MAT mF=mF*T2


   !¢¨£Ú¥Ñ¥é¥á¡¼¥¿¡¢¥¤¥ó¥Ô¡¼¥À¥ó¥¹¹ÔÎó V=Z*I
   CALL F2Z(mF,mZ)


   !¢¨(E1)=[F](E2)¤è¤ê
   !¡¡(i1)¡¡¡¡(i2)
   LET vi(1)=5 !5[V]
   LET vi(2)=vi(1)/mZ(1,1) !i=V/R¡¢?[A]

   MAT T1=INV(mF) !½ÐÎϦ¤ò»»½Ð¤¹¤ë
   MAT vo=T1*vi
END SUB


SET bitmap SIZE 800,400 !²èÌ̤ò²£Ä¹¤Ø
!¢¨£²SET bitmap SIZE 300,600 !²èÌ̤ò²£Ä¹¤Ø
SET WINDOW -1,6, -1,2 !ɽ¼¨Îΰè
!¢¨£²SET WINDOW -1,6, -91,1 !ɽ¼¨Îΰè
!¢¨£³SET WINDOW -1,6, -20,1 !ɽ¼¨Îΰè
DRAW grid !ÌÜÀ¹¤ê

FOR f=1 TO 6 !£ø¼´¤¬Âпô
   PLOT TEXT ,AT f-0.3,-0.15: mid$("10  100 1k  10k 100k1M  ",4*(f-1)+1,4)
NEXT f
FOR f=10 TO 100000 STEP 100 !¼þÇÈ¿ô[Hz]
   CALL routine

   LET vv=vo(1)/vi(1)
   PLOT LINES: LOG10(f),ABS(vv); !¿¶ÉýÆÃÀ­
   !¢¨£²PLOT LINES: LOG10(f),DEG(ATN(Im(vv)/Re(vv))); !°ÌÁê¦È
   !¢¨£³PLOT LINES: LOG10(f),20*LOG10(ABS(vv)); !ÍøÆÀ[dB]
NEXT f


END



>¡Ê£³¡Ë¡¡Î㤨¤Ð¡¢¤³¤Î¥í¡¼¥Ñ¥¹¥Õ¥£¥ë¥¿¡¼¤¬5ÃʤĤº¤¤¤¿¤é¡¢

¹ÔÎó¤Î¤Ù¤­¾è¤ÏMATʸ¤Ç¤Ïµ­½Ò¤Ç¤­¤Þ¤»¤ó¤Î¤Ç¡¢FOR¡ÁNEXTʸ¤Ç¾è»»¤ò·«¤êÊÖ¤·¤Þ¤¹¡£


Îã.
!¡ü¤Ï¤·¤´²óÏ©¤Î¹çÀ®Äñ¹³¡¡a-bü»Ò´Ö

!a¨¡R1¨¨R3¨¨R5¨¨ ¡Ä ¨¨Rn¨¨ ¡Ä
! ¡¡¡¡R2¡¡R4¡¡R6¡¡ Rn-1 Rn+1
!b¨¡¨¡¨ª¨¡¨ª¨¡¨ª ¡¡ ¨ª¨¡¨ª
!
LET R1=1 !1,2,1,2,¡Ä,1,2,1
LET R2=2

CALL seriesF(R1,T1) !¨¡R1¨¨
CALL shuntF(R2,T2)  !¡¡¡¡R2

MAT mF=IDN !ñ°Ì¹ÔÎó
FOR i=1 TO 5 !ÃÊ¿ô
   MAT mF=mF*T1 !¨¡R1¨¨R1¨¨ ¡Ä ¨¨R1¨¨
   MAT mF=mF*T2 !¡¡ R2¡¡R2¡¡¡¡ R2¡¡R2
NEXT i
MAT mF=mF*T1 !¨¡R1¨¤

PRINT "£Æ¥Ñ¥é¥á¡¼¥¿"
MAT PRINT mF;
 

Re: (̵Âê)

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ11·î26Æü(¿å)18»þ25ʬ24ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.119[¸µµ­»ö¤Ø]

Âç·§¡¡Àµ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¡Ê£µ¡Ë¡¡Ã¦Àþ¤Ç¤¹¤¬¡¢¤³¤ÎÅê¹ÆÍó¤Ëµ¡³£¸ì¤Î¤³¤È¤¬¤¢¤ê¤Þ¤·¤¿¡£SECONDÍÍ
> ¡¡¡¡¡¡¡¡¤³¤Î¥½¥Õ¥È¤ÏËüǽ¤Ç¡¢¤¿¤È¤¨¤Ð¡¢º£²ó¤Î¥í¡¼¥Ñ¥¹¥Õ¥£¥ë¥¿¤Ç¤â
> ¡¡¡¡¡¡¡¡Â¶¤Î¥½¥Õ¥È¤Î¤¢¤ëƱ¤¸¥Û¥ë¥À¡¼¤Ë¤ª¤±¤Ð¡¢Æ°ºî²Äǽ¤Ê¤Î¤Ç¤¹¤«¡£


µ¡³£¸ì¤Ë¤Ä¤¤¤Æ¡¢¤¢¤ä¤Þ¤Ã¤¿¸æÍý²ò¤¬¡¢¸«¼õ¤±¤é¤ì¤Þ¤¹¤¬¡¢»ä¤Î¥«¥ó°ã¤¤¤«¤âÃΤì¤Þ¤»¤ó¡£
¤½¤Î¾ì¹ç¤Ï¡¢°Ê²¼¡¢Ê¹¤­Î®¤·¤Æ¤¯¤À¤µ¤¤¡£

µ¡³£¸ì¤Ï¡¢¥¢¥»¥ó¥Ö¥é¡¼(Assembler) ¤È¤â¸Æ¤Ð¤ì¡¢¤½¤ÎÀΡ¢BASIC ¤â £Ã¸À¸ì¤â̵¤«¤Ã¤¿»þÂå¤Ë¡¢
ºÇ½é¤ËÍ­¤Ã¤¿¸À¸ì¡¢Â¨¤Á¡¢£Ã£Ð£Õ¡¢¥×¥í¥»¥Ã¥µ¤¬¡¢Ä¾ÀÜǧ¼±¤Ç¤­¤ë¡¢Í£°ì¤Î¸À¸ì¤Ç¤¹¡£

µ¡³£¸ì¤Ï£±£¶¿Ê¥³¡¼¥É¤½¤Î¤â¤Î¤Ç¸«¤Å¤é¤¤¡£
¤½¤³¤Ç¡¢mov ax,1234h ¤È¤«¡¢push ax ¤Ê¤É¤Î¡¢¥·¥ó¥Ü¥ë¤ò¡¢£±ÂУ±¤Çµ¡³£¸ì¤Ë¡¢Âбþ¤µ¤»¤Æ¡¢
¸«¤ä¤¹¤¯¤·¤¿¤â¤Î¤ò¡¢¥¢¥»¥ó¥Ö¥é¡¼¸À¸ì ¤È¸Æ¤ó¤Ç¤¤¤Þ¤¹¡£

½½¿Ê BASIC.EXE ËÜÂΤϡ¢¤½¤Îµ­½Ò¤ò¡¢µ¡³£¸ì¤ËËÝÌõ¤¹¤ë¤¿¤á¤Î¡Ö¥·¥¹¥Æ¥à¸À¸ì¥×¥í¥°¥é¥à¡×
¤È¤¤¤¦»ö¤Ç¤¹¡£¤½¤Î¾¤ÎÊýÌ̤θÀ¸ì¤Ê¤É¤âÁ´¤Æ¡¢Æ±ÍͤǤ¹¡£

ºÇ½ªÅª¤Ë¡¢µ¡³£¸ì¤Ë¤Ê¤é¤Ê¤¤¤È¡¢£Ã£Ð£Õ¤Ï¡¢Ç§¼±¡¢¼Â¹Ô¤Ç¤­¤Þ¤»¤ó¡£

-------------------------------------------------------------------
Åê¹Æ¤·¤¿µ¡³£¸ì¤Ï¡¢ËÜÍè¡¢BASIC.EXE ¤¬¡¢ËÝÌõ¤¹¤ëʸ¤Î°ìÉô¤ò¡¢
¼ê¤Ç¡¢Ä¾ÀܤËËÝÌõÂå¹Ô¤·¤¿¤â¤Î¤È¸À¤¨¤Þ¤¹¡£

¤Ê¤¼¡¢¤½¤ó¤Ê»ö¤ò¤·¤¿¤Î¤«¤È¡¢¤¤¤¦¤Î¤Ï¡¢
ËÝÌõ¤Î¾éĹÀ­¤ò³°¤·¤¿¤ê¡¢¹â®¤Î¤¿¤á¤Î½ñ¤­Êý¡¢Äɵá¤Ç¤·¤¿¡£
¤´¼ÁÌä¤Î·ï¤Ï¡¢¤´¿ä»¡¤µ¤ì¤ë¤È¤ª¤ê¤Ç¡¢ÀìÍѤ˽ñ¤­Ä¾¤µ¤Ê¤¤¤È¡¢»ÈÍѤǤ­¤Þ¤»¤ó¡£
 

¼þÇÈ¿ô¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§Âç·§¡¡Àµ  Åê¹ÆÆü¡§2008ǯ11·î27Æü(ÌÚ)15»þ48ʬ15ÉÃ
ÊÖ¿®¡¦°úÍÑ
  »³ÃæÍÍ¡¡¡¡¡¡Âç·§¤Ç¤¹¡£
¼þÇÈ¿ô¤Î¥×¥í¥°¥é¥à¤òÍ­Æñ¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
¥µ¥Ö¥ë¡¼¥Á¥ó¤Ë¤Ä¤Ê¤²¤¿¤éľ¤°·Ú²÷¤ËÆ°¤­¤Þ¤·¤¿¡£

¡Ê£±¡ËºÇ¸å¤Î£Ä£Âɽ¼¨¤Î¡ô£³¤È°ÌÁêɽ¼¨¤Î¡ô£²¤Î¥°¥é¥Õ
¡¡¡¡¡¡¤ò°ì½ï¤Ëɽ¼¨¤·¤¿¤¤¤Î¤Ç¤¹¤¬¡¢
¡¡¡¡¡¡º£¤Î¤Þ¤Þ¤Ç¡¢¡Ö¡ª¡×¥Þ¡¼¥¯¤ò³°¤·¡¢¤½¤Î¤Þ¤Þ
¡¡¡¡¡¡¤Ä¤Ê¤²¤Æ¤âÆ°¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£
¡¡¡¡¡¡£Ä£Â¤Î½ÄÌÜÀ¹¤ê¤Ïº¸Â¦¤Ë¡¢°ÌÁê¤Î0¡Ý90ÅÙÌÜÀ¹¤ê¤Ï
¡¡¡¡¡¡±¦Â¦¤Ë¤È¤¤¤Ã¤¿¶ñ¹ç¤Ç¤¹¡£
¡¡¡¡¡¡¤³¤¦¤¹¤ë¤È¡¢Ëܤˤ¢¤ë¡Ö¥Ü¡¼¥ÉÀþ¿Þ¡×¤º¤Ð¤ê¤Ë
¡¡¡¡¡¡¤Ê¤ê¤Þ¤¹¡£


¡Ê£²¡Ë°ÌÁêɽ¼¨¤Ï¡¢¤Ê¤Ë¤«¼þÇÈ¿ô¤Îʸ»ú¤Î¾å¤¬É½¼¨¤µ¤ì¤Æ
¡¡¡¡¡¡¤Þ¤»¤ó¡£
¡¡¡¡¡¡»ä¤Î¡¡¥Ð¡¼¥¸¥ç¥ó¤Ï¡¢VER 5.02¡¡¤Ç¤¹¤¬¡¢
¡¡¡¡¡¡ºÇ¿·¤ÏVER 7.2.8 ¤Î¤è¤¦¤Ç¤¹¡£
¡¡¡¡¡¡¤³¤ì¤¬¸¶°ø¤Ç¤·¤ç¤¦¤«¡£
¡¡¡¡¡¡»ä¤Ï¡¢¥Ï¡¼¥É¥Ç¥¹¥¯¤Î¡Ö£Ä¡×¤ËËܡ֥֥롼¥Ð¥Ã¥¯¥¹¡×
¡¡¡¡¡¡¤ËźÉդΣãġ¡ROM ¤ò»Ø¼¨¤Ë½¾¤¤Å¸³«¤·¤¿¤Î¤Ç¤¹¤¬¡¢
¡¡¡¡¡¡¥¤¥ó¥¿¡¼¥Í¥Ã¥È¾å¤Î¡Ö¡Ê²¾¾Î¡Ë10¿ÊBASIC¡×¤Ë¤¢¤ë
¡¡¡¡¡¡VER 7.2.8 ¤Î¤ò¡¢¤½¤Î¤Þ¤ÞƱ¤¸¡Ö¥Õ¥©¥ë¥À¡¼¡×¤Ë
¡¡¡¡¡¡¥³¥Ô¡¼¡ÖŸ³«¡©¡Ñ¤·¤¿¤éÂÌÌܤǤ·¤ç¤¦¤«¡£
¡¡¡¡¡¡Á°¤ÎVER 5.02 ¤Ï¡¢¤³¤ÎËܤΥµ¥ó¥×¥ë¤â°ì½ï¤Ë
¡¡¡¡¡¡Æþ¤Ã¤Æ¤ë¤Î¤Ç¤É¤³¤Þ¤Ç¤¬VER 5.02 ËÜÂΤʤΤ«
¡¡¡¡¡¡Ê¬¤é¤ºVER 5.02 ¤À¤±¾Ã¤¹¤Î¤Ïº¤Æñ¤Ê¤Î¤Ç¤¹¡£

¡¡¡¡¡¡VER 5.02¤òVER 7.2.8 ¤Ç¾å½ñ¤­¤¹¤ë¤Î¤Ï¤É¤¦
¡¡¡¡¡¡¤¹¤ë¤Î¤Ç¤¹¤«¡£

¡Ê£³¡ËÆÍÁ³¤Ç¤¹¤¬¡¢Æ±¤¸¹Ô¿ô¤ÈÎó¿ô¤ÎMAT¤Ë¤Ï¡¢
       ¸ÇÍ­ÃÍÀ®¤ë¤â¤Î¤¬¡¢¤¢¤ë¤½¤¦¤Ç¤¹¤¬¡¢
¡¡¡¡¡¡¤³¤Î
 

¼þÇÈ¿ôÆÃÀ­¡¡Â³¤­¡¡Âç·§

 Åê¹Æ¼Ô¡§Âç·§¡¡Àµ  Åê¹ÆÆü¡§2008ǯ11·î27Æü(ÌÚ)15»þ55ʬ50ÉÃ
ÊÖ¿®¡¦°úÍÑ
  »³Ãæ¡¡ÍÍ¡¡¡¡Âç·§¤Ç¤¹¡£
³Îǧ¤Î¤Ä¤â¤ê¤¬´Ö°ã¤Ã¤ÆÅê¹Æ¤ò²¡¤·¤Æ¤·¤Þ¤¤¤Þ¤·¤¿¡£



¡Ê£³¡ËÆÍÁ³¤Ç¤¹¤¬¡¢Æ±¤¸¹Ô¿ô¤ÈÎó¿ô¤ÎMAT¤Ë¤Ï¡¢
       ¸ÇÍ­Ãͤʤë¤â¤Î¤¬¡¢¤¢¤ë¤½¤¦¤Ç¤¹¤¬¡¢
¡¡¡¡¡¡ ¤³¤ÎÌ¿Îá¸ì¤ÏñÆȤǺߤë¤Î¤Ç¤·¤ç¤¦¤«¡£
¡¡¡¡¡¡¤Þ¤¿¤Ï¡¢º¡¤ì¤ò²ò¤¤¤Æɽ¼¨¤¹¤ë¥×¥í¥°¥é¥à
¡¡¡¡¡¡¤¬¤¢¤ì¤Ð¸æ¶µ¤¨¤¯¤À¤µ¤¤¡£



¡¡·É¶ñ
 

¥ê¥é¥Ã¥¯¥¹

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ11·î27Æü(ÌÚ)19»þ09ʬ8ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  !£´¤Ä¤Î¿¶¤ê»Ò¡ÊºÆÅê¹Æ ¼º¤ï¤ì¤¿¥í¥°¡Ë

!£²½Å¿¶»ÒChaos
LET g= 9.8 !m/s^2
LET m1=0.1 !kg
LET m2=0.1 !kg
LET L1= 5 !m
LET L2= 5 !m
!
LET dt=0.05 !sec. ±é»»¥Ô¥Ã¥Á¡£
!
LET ¦Ì2=m2/(m1+m2)
LET L21=L2/L1
DEF ss1(w2,¦È1,¦È2)=-g/L1*SIN(¦È1) -¦Ì2*L21*w2^2*SIN(¦È1-¦È2)
DEF ss2(w1,¦È1,¦È2)=-g/L2*SIN(¦È2) +w1^2*SIN(¦È1-¦È2)/L21
DEF D(¦È1,¦È2)=1-¦Ì2*COS(¦È1-¦È2)^2
DEF ¦Á1(w1,w2,¦È1,¦È2)=( ss1(w2,¦È1,¦È2) -L21*¦Ì2*COS(¦È1-¦È2)*ss2(w1,¦È1,¦È2) )/D(¦È1,¦È2)
DEF ¦Á2(w1,w2,¦È1,¦È2)=(-ss1(w2,¦È1,¦È2)*COS(¦È1-¦È2)/L21 +ss2(w1,¦È1,¦È2) )/D(¦È1,¦È2)

SUB RK(¦È1,¦È2,w1,w2)
   LET w11=w1
   LET w12=w2
   LET ¦Á11=¦Á1(w1,w2,¦È1,¦È2)
   LET ¦Á12=¦Á2(w1,w2,¦È1,¦È2)
   !
   LET w21=w1+¦Á11*dt/2
   LET w22=w2+¦Á12*dt/2
   LET ¦Á21=¦Á1(w21,w22,¦È1+w11*dt/2,¦È2+w12*dt/2)
   LET ¦Á22=¦Á2(w21,w22,¦È1+w11*dt/2,¦È2+w12*dt/2)
   !
   LET w31=w1+¦Á21*dt/2
   LET w32=w2+¦Á22*dt/2
   LET ¦Á31=¦Á1(w31,w32,¦È1+w21*dt/2,¦È2+w22*dt/2)
   LET ¦Á32=¦Á2(w31,w32,¦È1+w21*dt/2,¦È2+w22*dt/2)
   !
   LET w41=w1+¦Á31*dt
   LET w42=w2+¦Á32*dt
   LET ¦Á41=¦Á1(w41,w42,¦È1+w31*dt,¦È2+w32*dt)
   LET ¦Á42=¦Á2(w41,w42,¦È1+w31*dt,¦È2+w32*dt)
   !
   LET ¦È1=¦È1+(w11+2*w21+2*w31+w41)*dt/6
   LET ¦È2=¦È2+(w12+2*w22+2*w32+w42)*dt/6
   LET w1=w1+(¦Á11+2*¦Á21+2*¦Á31+¦Á41)*dt/6
   LET w2=w2+(¦Á12+2*¦Á22+2*¦Á32+¦Á42)*dt/6
END SUB

!----init.
LET a_1=PI*0.8 !½é´ü³ÑÅÙ£±
LET a_2=PI*0.9 !¡¡¡¡¡Á¡¡£²
LET a_3=0 !¡¡½é´ü³Ñ®ÅÙ£±
LET a_4=0 !¡¡¡¡¡¡¡¡¡Á¡¡£²
!
LET b_1=-a_1+0.001
LET b_2=-a_2
LET b_3=0
LET b_4=0
!
LET c_1=a_1
LET c_2=a_2+0.002
LET c_3=0
LET c_4=0
!
LET d_1=-a_1
LET d_2=-a_2+0.003
LET d_3=0
LET d_4=0
!
!----run
LET w=14
SET WINDOW -w,w,-w,w
SET LINE width 2 !4
SET LINE COLOR 2 !43
LET r1=SQR(m1)
LET r2=SQR(m2)
LET t0=TIME
DO
   LET t=TIME
   IF dt=< ABS(t-t0) THEN
      SET DRAW mode hidden
      CLEAR
      PLOT TEXT,AT 0.25*w,0.9*w:"¥Þ¥¦¥¹ ±¦¥Ü¥¿¥ó¤Ç¡¢½ªÎ»¡£"
      PLOT TEXT,AT -0.98*w,0.93*w,USING"±é»»¥Ô¥Ã¥Á=#.### ÉÃ":dt
      PLOT TEXT,AT -0.98*w,0.87*w,USING"ÉÁ²è¥Ô¥Ã¥Á=#.### ÉÃ":t-t0
      LET t0=t
      SET AREA COLOR 15
      DRAW disk WITH SCALE(3.86,4.67)
      SET AREA COLOR 1
      DRAW PDL1X2(a_1,a_2) WITH ROTATE(a_1)*SHIFT(-3,3)
      DRAW PDL1X2(b_1,b_2) WITH ROTATE(b_1)*SHIFT(3,3)
      DRAW PDL1X2(c_1,c_2) WITH ROTATE(c_1)*SHIFT(-3,-3)
      DRAW PDL1X2(d_1,d_2) WITH ROTATE(d_1)*SHIFT(3,-3)
      CALL RK(a_1,a_2,a_3,a_4)
      CALL RK(b_1,b_2,b_3,b_4)
      CALL RK(c_1,c_2,c_3,c_4)
      CALL RK(d_1,d_2,d_3,d_4)
      SET DRAW mode explicit
   END IF
   WAIT DELAY 0 !¥Î¡¼¥È¥Ñ¥½¥³¥óÅù¤Î¾ÃÈñÅÅÎϤò²¡¤¨¤ë¡£
   MOUSE POLL mx,my,mlb,mrb
LOOP UNTIL mrb=1

PICTURE PDL1X2(¦È1,¦È2)
   DRAW circle WITH SCALE(0.3)
   DRAW PDLM(L1,r1)
   DRAW PDLM(L2,r2) WITH ROTATE(¦È2-¦È1)*SHIFT(0,-L1)
END PICTURE

PICTURE PDLM(L,r)
   PLOT LINES: 0,0;0,-L
   DRAW disk WITH SCALE(r)*SHIFT(0,-L)
END PICTURE

END
 

Re: ¥ê¥é¥Ã¥¯¥¹

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î27Æü(ÌÚ)19»þ35ʬ53ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.125[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

Á°²ó¤Î¸ÅÂåÀ¸Êª¤È¤¤¤¤¡¢º£²ó¤Î¤â¤Î¤È¤¤¤¤ÂçÊÑÌÌÇò¤¯Í·¤Ó¿´ËþºÜ¤Ç¤¹¡£
SECOND¤µ¤ó¤¬ºî¤é¤ì¤¿ºîÉʤò¤É¤ó¤É¤ó¥¢¥Ã¥×¤·¤Æ¾Ò²ð¤·¤Æ¤¯¤À¤µ¤¤¡£
¤³¤ó¤Ê¤³¤È¤¬¥×¥í¥°¥é¥à¤òÁȤळ¤È¤Ç²Äǽ¤Ê¤ó¤À¤È¤¤¤Ä¤â¶Ã¤«¤µ¤ì¤Þ¤¹¡£
¤ª»Å»ö¤Ï¥×¥í¥°¥é¥Þ¡¼¤Ê¤ó¤Ç¤¹¤«¡©
 

Re: ¼þÇÈ¿ô¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î27Æü(ÌÚ)19»þ37ʬ25ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.123[¸µµ­»ö¤Ø]

Âç·§¡¡Àµ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£


> ¡Ê£±¡ËºÇ¸å¤Î£Ä£Âɽ¼¨¤Î¡ô£³¤È°ÌÁêɽ¼¨¤Î¡ô£²¤Î¥°¥é¥Õ¤ò°ì½ï¤Ëɽ¼¨¤·¤¿¤¤¤Î¤Ç¤¹¤¬¡¢


½Ä¼´¤ÎÌÜÀ¹¤ê¤¬°ã¤¦¤Î¤Ç¡¢Ä´À°¤¬É¬Íפ«¤È»×¤¤¤Þ¤¹¡£È¾¸ÇÄê¤Çɽ¼¨¤¹¤ë¤è¤¦¤Ë¤·¤Æ¤ß¤Þ¤·¤¿¡£

Îã.

¸åȾ¤Î¥°¥é¥ÕÉÁ²è¤ÎÉôʬ
!SET bitmap SIZE 600,600 !²èÌ̤òÂ礭¤¯¤¹¤ë
SET WINDOW -0.5,6.5, -50,5 !ɽ¼¨Îΰè
DRAW grid(1,5) !º¸Ã¼¤ÎÌÜÀ¹¤ê

FOR f=1 TO 6 !£ø¼´¤¬Âпô
   PLOT TEXT ,AT f-0.3,-0.15: mid$("10  100 1k  10k 100k1M  ",4*(f-1)+1,4)
NEXT f

FOR f=10 TO 100000 STEP 100 !¼þÇÈ¿ô[Hz]
   CALL routine
   LET vv=vo(1)/vi(1)
   PLOT LINES: LOG10(f),20*LOG10(ABS(vv)); !ÍøÆÀ[dB]
NEXT f
PLOT LINES


SET TEXT COLOR 2
FOR i=5 TO -45 STEP -5 !±¦Ã¼¤Î½Ä¼´ÌÜÀ¹¤ê
   PLOT TEXT ,AT 6,i: STR$(i*2)&"¡ë"
NEXT i

SET LINE COLOR 2
FOR f=10 TO 100000 STEP 100 !¼þÇÈ¿ô[Hz]
   CALL routine
   LET vv=vo(1)/vi(1)
   PLOT LINES: LOG10(f),DEG(ATN(Im(vv)/Re(vv)))/2; !°ÌÁê¦È¡¡¢¨1/2ÇÜ
NEXT f
PLOT LINES


END


> ¡Ê£²¡Ë°ÌÁêɽ¼¨¤Ï¡¢¤Ê¤Ë¤«¼þÇÈ¿ô¤Îʸ»ú¤Î¾å¤¬É½¼¨¤µ¤ì¤Æ¤Þ¤»¤ó¡£


¼þÇÈ¿ô¤Î¥°¥é¥Õ¤Ï¡¢ÌÜÀ¹¤ê¤¬£±ÅÙ¤º¤Ä¶¹¤¤¤È¤³¤í¤Ë½Å¤Í½ñ¤­¤µ¤ì¤Æ²òÆɤǤ­¤Ê¤¤¾õÂ֤ˤʤê¤Þ¤¹¡£
¤¿¤È¤¨¤Ð¡¢£³£°ÅÙ¤º¤Ä´Ö³Ö¤Î»ØÄê¤â¤Ç¤­¤Þ¤¹¤¬¡¢º£²ó¤Ï¤·¤Æ¤¤¤Þ¤»¤ó¡£¡Ê¼êÈ´¤­¤Ç¤¹¡Ë


> ¡¡¡¡¡¡VER 5.02¤òVER 7.2.8 ¤Ç¾å½ñ¤­¤¹¤ë¤Î¤Ï¤É¤¦¤¹¤ë¤Î¤Ç¤¹¤«¡£


¡¦BASICËÜÂΤΥե©¥ë¥À D:\BASIC32w Á´ÂΤǤ¹¡£¤³¤ì¤ò¥¨¥¯¥¹¥×¥í¡¼¥é¤Çºï½ü¤·¤Æ¤¯¤À¤µ¤¤¡£
¡¦¤½¤Î¸å¡¢¥À¥¦¥ó¥í¡¼¥É¤·¤¿¿·¤·¤¤BASIC¤ò¤³¤Î¥Õ¥©¥ë¥À¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤¹¡£
¡¦ËܤΥµ¥ó¥×¥ë¥×¥í¥°¥é¥à¡¢¤¿¤Ö¤óÊ̤Υե©¥ë¥À¤Ë¤Þ¤È¤á¤é¤ì¤Æ¤¤¤ë¤È»×¤¤¤Þ¤¹¤Î¤Ç¡¢
¡¡BASICËÜÂΤò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¸å¡¢¡ÊBASICËÜÂΤȤÏÊ̤Υե©¥ë¥À¤Ë¡Ë¥³¥Ô¡¼¤¹¤ì¤Ð¤¤¤¤¤È»×¤¤¤Þ¤¹¡£
¡¡¢¨BASICËÜÂΤˤ⤫¤Ê¤ê¤Î¥µ¥ó¥×¥ë¤¬ÅºÉÕ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£


> ¡Ê£³¡ËÆÍÁ³¤Ç¤¹¤¬¡¢Æ±¤¸¹Ô¿ô¤ÈÎó¿ô¤ÎMAT¤Ë¤Ï¡¢¸ÇÍ­Ãͤʤë¤â¤Î¤¬¡¢¤¢¤ë¤½¤¦¤Ç¤¹¤¬¡¢
> ¡¡¡¡¡¡¤³¤ÎÌ¿Îá¸ì¤ÏñÆȤǺߤë¤Î¤Ç¤·¤ç¤¦¤«¡£
> ¡¡¡¡¡¡¤Þ¤¿¤Ï¡¢º¡¤ì¤ò²ò¤¤¤Æɽ¼¨¤¹¤ë¥×¥í¥°¥é¥à¤¬¤¢¤ì¤Ð¸æ¶µ¤¨¤¯¤À¤µ¤¤¡£


Ì¿Îá¸ì¤Ï¤¢¤ê¤Þ¤»¤ó¡£¥×¥í¥°¥é¥à¤ò¤Ä¤¯¤Ã¤Æµá¤á¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£


BASIC VER5.02ËÜÂÎ
 

Re: ¥ê¥é¥Ã¥¯¥¹

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ11·î27Æü(ÌÚ)20»þ05ʬ43ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.126[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¤´¤á¤ó¤Ê¤µ¤¤.¤â¤¦¼ïÀÚ¤ì¤Ç¤¹¡£(^ ^; ¥×¥í¥°¥é¥Þ¡¼¤Ç¤â¤Ê¤ó¤Ç¤â¤¢¤ê¤Þ¤»¤ó¡£

¤³¤ì¤é¤Ï¡¢Á´¤Æ¡¢¿ô³Ø¤ÎÀè¿Í¤¿¤Á¤¬¡¢»Ä¤·¤Æ¤¯¤ì¤¿°ä»º¤Ç¤¹¡£
¤Í¤à¤¯¤Ê¤ë¤è¤¦¤Ê¿ôÍýŪ¤ÊÀ¤³¦¤ò¡¢³Ú¤·¤¯¤Ç¤­¤ì¤Ð¡¢¤Ê¤Ë¤è¤ê¤Ç¤¹¡£
 

º¤ÏÇ¡©

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î28Æü(¶â)10»þ18ʬ16ÉÃ
ÊÖ¿®¡¦°úÍÑ
  º£¤Þ¤Ç²¿»ö¤â¤Ê¤¯Î©¤Á¾å¤¬¤Ã¤Æ¤¤¤¿½½¿Ê£Â£Á£Ó£É£Ã¤Î²èÌ̤¬¡¢ÆÍÁ³²¼¤Î¥¿¥¹¥¯¥Ð¡¼¤Ë¤ÏÆþ¤ê¹þ¤à¤Î¤Ç¤¹¤¬¡¢¥×¥í¥°¥é¥à¤òŽ¤êÉÕ¤±¤ë²èÌ̤¬¹­¤¬¤é¤º¡Ê¥Æ¥­¥¹¥È²èÌ̤ȥ°¥é¥Õ¥£¥Ã¥¯²èÌ̤Ϲ­¤¬¤ë¡£¡Ë¥³¥Ô¡¼¤·¤¿¥×¥í¥°¥é¥à¤òÆ°¤«¤½¤¦¤È¤·¤Æ¤âÆ°¤«¤»¤Ê¤¤¾õÂ֤ˤʤäƤ·¤Þ¤¤¤Þ¤·¤¿¡£
¤É¤¦¤ä¤Ã¤Æ¸µ¤Î¾õÂ֤˽ÐÍè¤ë¤Î¤«²ò¤é¤º¤Ë¤¤¤Þ¤¹¡£
¤Á¤Ê¤ß¤Ë°ìÅÙÁ´¤Æ¤òºï½ü¤·¤Æ¡¢¤â¤¦°ìÅÙ¥¤¥ó¥¹¥È¥¥¡¼¥ë¤ò·«¤êÊÖ¤·¤Þ¤·¤¿¤¬¡¢·ë²Ì¤ÏƱ¤¸¤Ç¤·¤¿¡£
²ò·èÊýË¡¤¬¤¢¤ê¤Þ¤·¤¿¤é¤è¤í¤·¤¯¤´¶µ¼ø²¼¤µ¤¤¡£
¤Ê¤ª£ï£ó¤ÏWINDOW xp ¤Ç¤¹¡£
 

Re: º¤ÏÇ¡©

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î28Æü(¶â)10»þ56ʬ15ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.129[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

Windows Me¤Ç¤ÎÏäǤ¹¤¬¡¢
¡¦Â¾¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÈÊ»ÍÑ¡ÊƱ»þ¡¢¤½¤Î¸å¤â´Þ¤à¡Ë¤¹¤ë¤È¤³¤Î¸½¾Ý¡ÊƱ¤¸¡©¡Ë¤¬µ¯¤³¤ê¤Þ¤¹¡£
¡¡½½¿ÊBASIC¤Ç¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¤È¥ê¥½¡¼¥¹¥á¥â¥ê¡Ê¼ÂÁõ¥á¥â¥ê¤È¤Ï°ã¤¦¡Ë¤ò¾ÃÈñ¤·¤Æ¤¤¤ë¤ß¤¿¤¤¤Ç¤¹¡£
¡¡¤³¤Î¥ê¥½¡¼¥¹ÉÔ­¾õÂÖ¤ÇȯÀ¸¤·¤ä¤¹¤¤¤Ç¤¹¡£¤Þ¤¿¡¢µ¯Æ°¤â¤Ç¤­¤Ê¤¤¾ì¹ç¤¬¤¢¤ê¤Þ¤¹¡£
¡¡Îã. ¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥¨¥¯¥¹¥×¥í¡¼¥é¤ÇPDF¥Õ¥¡¥¤¥ë¤ò±ÜÍ÷¤·¤Ê¤¬¤é¡¢¥×¥í¥°¥é¥à¤¹¤ë¡£

Âнè
¡¦OS¡Ê¥Ñ¥½¥³¥ó¡Ë¤òºÆµ¯Æ°¤·¤Æ¡¢Ê»ÍѤ·¤Ê¤¤¡£
 

¼þÇÈ¿ô¥×¥í¥°¥é¥à ¤½¤Î¾

 Åê¹Æ¼Ô¡§Âç·§¡¡Àµ  Åê¹ÆÆü¡§2008ǯ11·î28Æü(¶â)13»þ40ʬ34ÉÃ
ÊÖ¿®¡¦°úÍÑ
  »³Ãæ¡¡ÍÍ¡¡¡¡¡¡Âç·§¤Ç¤¹¡£

¡Ê£±¡Ë¿¶Éý¤È°ÌÁê¤ÎƱ»þɽ¼¨¤ÎÄÉ²Ã¥×¥í¥°¥é¥à¤òÍ­Æñ¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
¡¡¡¡¡¡Ä¾¤°¼Â»Ü¤·¤¿¤é¡¢¾å¼ê¤¯Æ°¤­¤Þ¤·¤¿¡£
¡Ê£²¡Ëver ¤ÎÊѹ¹¤Î·ï¤Ç¤¹¤¬¡¢

¡¡¡¡¡¡BASIC VER5.02ËÜÂÎ
¡¡¡¡¤È¤¢¤ë35¤Î¥Õ¥¡¥¤¥ëÁí¤Æ¤ò¡¢°ì¤Ä¤Å¤Ä¾Ã¤¹¤Î¤Ç¤·¤ç¤¦¤«¡¢

¡¡¡¡¡¡¾Ã¤¹¾ì¹ç¡Ö¤´¤ßÈ¢¡×¤ÏÂÌÌܤȤ­¤¤¤Æ¤¤¤Þ¤·¤¿¤¬¡¢
¡¡¡¡¡¡¡Ö¥¨¥¯¥¹¥×¥í¡¼¥é¡¼¡×¤Ï¤É¤³¤Ë¤¢¤ë¤Î¤Ç¤·¤ç¤¦¤«¡£

¡Ê£³¡Ëver5.02¤Î¤¢¤ë¡¢¥Õ¥¡¥¤¥ë¥Û¥ë¥À¡¼¤«¤é
¡¡¡¡¡¡¡Ö¥¨¥¯¥¹¥×¥í¡¼¥é¡¼¡×¤Ç°ì¤Ä¤Å¤Ä35¸Ä¤Î¥Õ¥¡¥¤¥ë
¡¡¡¡¡¡¤ò¾Ã¤·¤Æ¡¢¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤Ë¤¢¤ë¡¡ver7.2.8¤ò
¡¡¡¡¡¡»ØÄꡢŸ³«À褬¡¢¸µ¤Îver5.02¤Î¤¢¤ë¡¢
¡¡¡¡¡¡¥Õ¥¡¥¤¥ë¥Û¥ë¥À¡¼¤ÈÍý²ò¤·¤Æµ¹¤·¤¤¤Ç¤¹¤«¡£
¡Ê£´¡Ë¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤Î¡Ö²¾¾Î10¿Êbasic]¤Ç¤Ï¡¢
¡¡¡¡¡¡£²¤Ä¤Î¥×¥í¥°¥é¥à¤¬¡Ö¡¦¡¦¡¦¤Î¾ì¹ç¤Ï¡¢¤³¤Á¤é¡¦¡¦¡×
¡¡¡¡¡¡¤È½ñ¤¤¤Æ¤¢¤ê¤Þ¤¹¤¬¡¢¥Ï¡¼¥É¥Ç¥¹¥¯¤Î¡Ö£Ä¡×¤Ç¤Ï¡¢
¡¡¡¡¡¡²¼¤ÎÆóÈÖÌܤǤ·¤ç¤¦¤«¡£

·É¶ñ¡£
 

Re: ¼þÇÈ¿ô¥×¥í¥°¥é¥à ¤½¤Î¾

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î28Æü(¶â)14»þ40ʬ32ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.131[¸µµ­»ö¤Ø]

Âç·§¡¡Àµ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¡¡¡¡¡¡BASIC VER5.02ËÜÂÎ
>  ¡¡¡¡¤È¤¢¤ë35¤Î¥Õ¥¡¥¤¥ëÁí¤Æ¤ò¡¢°ì¤Ä¤Å¤Ä¾Ã¤¹¤Î¤Ç¤·¤ç¤¦¤«¡¢
>


£±¤Ä¤º¤Äºï½ü¤·¤Æ¤¤¤¯¤Î¤¬ÌµÆñ¤Ç¤·¤ç¤¦¡£
¤Þ¤È¤á¤Æ¤Î¥Õ¥¡¥¤¥ëºï½ü¤Ï¤¤¤í¤¤¤í¤Ê¤ä¤êÊý¤¬¤¢¤ê¤Þ¤¹¡£
¤¿¤È¤¨¤Ð¡¢¥É¥é¥°¡¢Shift¤äCtrl¥­¡¼²¡¤·¤Ê¤¬¤é¤ò¥¯¥ê¥Ã¥¯¤Ç¤ÎÈÏ°Ï»ØÄê¤Ê¤É¡£

5.02¤¬Æþ¤Ã¤Æ¤¤¤ë¥Õ¥©¥ë¥À¤Ë¡¢¼«ºî¤Ê¤É¤Î¥Õ¥¡¥¤¥ë¤¬¤Ê¤±¤ì¤Ð¡¢¤½¤Î¥Õ¥©¥ë¥À¤ò¤Þ¤ë¤´¤Èºï½ü¤·¤Æ¤âÎɤ¤¤Ç¤¹¡£
¡ÊÆþ¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¥Ð¥Ã¥¯¥¢¥Ã¥×¤·¤Æ¸å¤Ç¸µ¤Ë¤â¤É¤»¤ÐÎɤ¤¤À¤±¤Ç¤¹¤¬¡¢¡¢¡¢¡Ë


> ¡¡¡¡¡¡¾Ã¤¹¾ì¹ç¡Ö¤´¤ßÈ¢¡×¤ÏÂÌÌܤȤ­¤¤¤Æ¤¤¤Þ¤·¤¿¤¬¡¢
>

ºï½ü¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ê¤É¤Ï°ìü¤´¤ßÈ¢¤ËÆþ¤ë¤È»×¤¤¤Þ¤¹¤¬¡¢¸å¤Ç¤´¤ßÈ¢¤ò¶õ¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£


> ¡¡¡¡¡¡¡Ö¥¨¥¯¥¹¥×¥í¡¼¥é¡¼¡×¤Ï¤É¤³¤Ë¤¢¤ë¤Î¤Ç¤·¤ç¤¦¤«¡£
>

¥Ç¥¹¥È¥Ã¥×¾å¤Î¡Ö¥Þ¥¤¥³¥ó¥Ô¥å¡¼¥¿¡×¡Ê¥³¥ó¥Ô¥å¡¼¥¿¤Î¥¢¥¤¥³¥ó¡Ë¤ò±¦¥¯¥ê¥Ã¥¯¤·¤Æɽ¼¨¤µ¤ì¤ë¥á¥Ë¥å¡¼¤Ë¤¢¤ê¤Þ¤¹¡£
¥¨¥¯¥¹¥×¥í¡¼¥é¤Î²èÌ̤ϡ¢¥Þ¥¤¥³¥ó¥Ô¥å¡¼¥¿¤ò¥À¥Ö¥ë¥¯¥ê¥Ã¥¯¡Ê¥·¥ó¥°¥ë¥¯¥ê¥Ã¥¯ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤â¤¢¤ë¡Ë
¤·¤Æɽ¼¨¤µ¤ì¤ë²èÌÌ¡Ê¥Õ¥¡¥¤¥ë¡¢¥Õ¥©¥ë¥À¤Ê¤É¤Î°ìÍ÷¤ò¸«¤ë²èÌ̡ˤΤ³¤È¤Ç¤¹¡£


> ¡Ê£³¡Ëver5.02¤Î¤¢¤ë¡¢¥Õ¥¡¥¤¥ë¥Û¥ë¥À¡¼¤«¤é
> ¡¡¡¡¡¡¡Ö¥¨¥¯¥¹¥×¥í¡¼¥é¡¼¡×¤Ç°ì¤Ä¤Å¤Ä35¸Ä¤Î¥Õ¥¡¥¤¥ë
> ¡¡¡¡¡¡¤ò¾Ã¤·¤Æ¡¢¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤Ë¤¢¤ë¡¡ver7.2.8¤ò
> ¡¡¡¡¡¡»ØÄꡢŸ³«À褬¡¢¸µ¤Îver5.02¤Î¤¢¤ë¡¢
> ¡¡¡¡¡¡¥Õ¥¡¥¤¥ë¥Û¥ë¥À¡¼¤ÈÍý²ò¤·¤Æµ¹¤·¤¤¤Ç¤¹¤«¡£

¤Ï¤¤¡£


> ¡Ê£´¡Ë¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤Î¡Ö²¾¾Î10¿Êbasic]¤Ç¤Ï¡¢
> ¡¡¡¡¡¡£²¤Ä¤Î¥×¥í¥°¥é¥à¤¬¡Ö¡¦¡¦¡¦¤Î¾ì¹ç¤Ï¡¢¤³¤Á¤é¡¦¡¦¡×
> ¡¡¡¡¡¡¤È½ñ¤¤¤Æ¤¢¤ê¤Þ¤¹¤¬¡¢¥Ï¡¼¥É¥Ç¥¹¥¯¤Î¡Ö£Ä¡×¤Ç¤Ï¡¢
> ¡¡¡¡¡¡²¼¤ÎÆóÈÖÌܤǤ·¤ç¤¦¤«¡£
>


¾å¤Î¡ÖWindows95/98/Me/NT4.0/2000/XP/Vista¡¡¥¤¥ó¥¹¥È¡¼¥éÈǡפÎÊý¤¬Îɤ¤¤È»×¤¤¤Þ¤¹¡£

ZIP¥Õ¥¡¥¤¥ë¤Î²òÅब²Äǽ¤Ê¤é¡¢²¼¤Î¡ÖWindows95/98/Me/NT4.0/2000/XP/Vista¡¡¥¢¡¼¥«¥¤¥ÖÈǡפǤâÂç¾æÉפǤ¹¡£
 

Re: ¼þÇÈ¿ôÆÃÀ­¡¡Â³¤­¡¡Âç·§

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î28Æü(¶â)20»þ05ʬ5ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.124[¸µµ­»ö¤Ø]

Âç·§¡¡Àµ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¡Ê£³¡ËÆÍÁ³¤Ç¤¹¤¬¡¢Æ±¤¸¹Ô¿ô¤ÈÎó¿ô¤ÎMAT¤Ë¤Ï¡¢¸ÇÍ­Ãͤʤë¤â¤Î¤¬¡¢¤¢¤ë¤½¤¦¤Ç¤¹¤¬¡¢
>¡¡¡¡¡¡¡¡Î¬
> ¡¡¡¡¡¡¤Þ¤¿¤Ï¡¢º¡¤ì¤ò²ò¤¤¤Æɽ¼¨¤¹¤ë¥×¥í¥°¥é¥à¤¬¤¢¤ì¤Ð¸æ¶µ¤¨¤¯¤À¤µ¤¤¡£

!ľÀÜË¡¤Ë¤è¤ë¹ÔÎó¤Î¸ÇÍ­Ãͤòµá¤á¤ë

OPTION ARITHMETIC COMPLEX

LET i=SQR(-1) !µõ¿ôñ°Ì

LET cEps=1e-8 !¸íº¹¡¡¢¨Ã±ÀºÅÙ


LET N=3 !N¼¡ÀµÊý¹ÔÎó

FUNCTION tr(A(,)) !¹ÔÎóA¤Î¥È¥ì¡¼¥¹
   LET t=0
   FOR j=1 TO N
      LET t=t+A(j,j)
   NEXT j
   LET tr=t
END FUNCTION


DIM c(N) !¿¹à¼° X^N+c(1)*X^(N-1)+c(2)*X^(N-2)+ ¡Ä +c(N-1)*X+c(N) ¤Î·¸¿ô
SUB DKA_00(A(),Xr()) !DKAË¡¡ÊDurand Kerner Aberth¡Ë
   LET r=1 !½é´üÃͤò²¾Äꤹ¤ë
   FOR j=2 TO N
      LET rn=ABS(A(j))^(1/j)
      if r<rn then LET r=rn
   NEXT j
   FOR j=1 TO N !Ⱦ·Âr¤Î±ß¤ËÅù´Ö³Ö¤ËÇÛÃÖ¤¹¤ë
      LET Xr(j)=-A(1)/N+r*EXP( 2*PI*i/N *(j-3/4) ) !¥¢¡¼¥Ð¥¹¤Î½é´üÃÍ
   NEXT j

   FOR m=0 TO 100 !È¿Éü¡¡¢¨Ä´À°Í×
      LET mfx=0
      LET maj=0
      FOR j=1 TO N
         LET Xk=1
         LET fx=1
         FOR w=1 TO N
            LET fx=fx*Xr(j)+A(w)
            IF w<>j THEN LET Xk=Xk*(Xr(j)-Xr(w))
         NEXT w
         LET Xr(j)=Xr(j)-fx/Xk
         IF mfx<ABS(fx) THEN LET mfx=ABS(fx)
         IF maj<ABS(fx/Xk) THEN LET maj=ABS(fx/Xk)
      NEXT j
      IF mfx<cEps AND maj<cEps THEN EXIT FOR !¼ý«¤·¤¿¤é
   NEXT m
END SUB
!-------------------- ¤³¤³¤Þ¤Ç¤¬¥µ¥Ö¥ë¡¼¥Á¥ó


DIM A(N,N) !¹ÔÎóA
!DATA 1,0,0 !¦Ë=1¡Ê£³½Åº¬¡Ë
!DATA 0,1,1
!DATA 0,0,1

!DATA 0,1,1 !¦Ë=2,-1¡Ê½Åº¬¡Ë
!DATA 1,0,1
!DATA 1,1,0

!DATA 3,0,0 !¦Ë=3,¡Þi
!DATA 0,2,-5
!DATA 0,1,-2

DATA 2,1,-1 !¦Ë=3,2,1
DATA 0,3,0
DATA 0,2,1

MAT READ A

MAT PRINT A;


!n¼¡ÀµÊý¹ÔÎóA¤Î¸Çͭ¿¹à¼° det(tE-A)=t^n+c1*t^(n-1)+ ¡Ä + cn ¤òµá¤á¤ë¡£
DIM X(N,N),cE(N,N)
MAT X=IDN !frameˡ
FOR k=1 TO N
   MAT X=A*X
   LET c(k)=-tr(X)/k
   MAT cE=(c(k))*IDN
   MAT X=X+cE
NEXT k
MAT PRINT c;

!¥Ë¥å¡¼¥È¥óË¡¤Ê¤É¤Ç²ò¤¯¡£²ò¤¬¸ÇÍ­Ãͤˤʤ롣
DIM lmd(N)
CALL DKA_00(c,lmd)

FOR k=1 TO N
   PRINT "¸ÇÍ­ÃÍ=";lmd(k)
NEXT k



!¢¨N¸Äµá¤Þ¤Ã¤¿¾ì¹ç¤Î¸¡»»
LET s=1
FOR k=1 TO N
   LET s=s*lmd(k)
NEXT k
PRINT s, DET(A) !¸ÇÍ­ÃͤÎÀÑ=¹ÔÎó¤Î¹ÔÎó¼°¡¡¦°¦Ëi=|A|

LET s=0
FOR k=1 TO N
   LET s=s+lmd(k)
NEXT k
PRINT s, tr(A) !¸ÇÍ­ÃͤÎÏÂ=¹ÔÎó¤Î¥È¥ì¡¼¥¹¡¡¦²¦Ëi=trA


END
 

¥Ð¡¼¥¸¥ç¥ó¥¢¥Ã¥×¤Î·ï

 Åê¹Æ¼Ô¡§Âç·§¡¡Àµ  Åê¹ÆÆü¡§2008ǯ11·î29Æü(ÅÚ)12»þ45ʬ44ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¡Ê£±¡Ë»³ÃæÍÍ¡¡Âç·§¤Ç¤¹¡£
¡¡¡¡¡¡¥Ð¡¼¥¸¥ç¥ó¥¢¥Ã¥×¤Ï¡¢¤ª°þÍͤǾå¼ê¤¯¹Ô¤­¤Þ¤·¤¿¡£
¡¡¡¡¡¡¸ÇÍ­Ãͤâ´Þ¤áº£¤Þ¤Ç¤Î¥½¥Õ¥È¤â½çÄ´¤ËÆ°¤­¤Þ¤·¤¿¡£
      Í­Æñ¤¦¤´¤¶¤¤¤Þ¤¹¡£

¡Ê£²¡ËSECONDÍÍ¡¡¤·¤À¤È¥¢¥ó¥â¥Ê¥¤¥È¤Î²è¤âåºÎï¤Ë½Ð¤Þ
      ¤·¤¿¡£
 

¥È¥é¥ó¥×¥Þ¥¸¥Ã¥¯¤ÎÁϺî

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î29Æü(ÅÚ)19»þ30ʬ52ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ½½¿ÊBASIC¤È¤Ï²¿¤Î´Ø·¸¤â¤¢¤ê¤Þ¤»¤ó¤¬¡¢
º£Æü°ìÆü¡¢¿ô³ØŪ¹½Â¤¤ò³è¤«¤»¤ë¥Þ¥¸¥Ã¥¯¤¬¤Ç¤­¤Ê¤¤¤«¤ÈÄ©À路¤Æ¤ß¤Æ¡¢¼¡¤Î¼ê½ç¤ò¹Í¤¨¤Þ¤·¤¿¤Î¤Ç¡¢À§Èó°ìÅ٥ȥé¥ó¥×¤ò¼ê¤Ë¤·¤Æ¤ä¤Ã¤Æ¤ß¤Æ²¼¤µ¤¤¡£

¡ö¥Ç¥Ã¥¯¤Î¥»¥Ã¥ÈÊýË¡¡Ê΢¸þ¤­¥È¥Ã¥×¤è¤ê¤Î½ç¡Ë
ÀÖ¥«¡¼¥É¡§£³¡¤£´¡¤£¸, J , K ¡Ê¥Þ¡¼¥¯¤Ï¤Ê¤ó¤Ç¤â¤è¤¤¡£¡Ë
¹õ¥«¡¼¥É¡§£²¡¤£³, £´¡¤£¶¡¤£¸, K¡ÊƱ¤¸¤¯¥Þ¡¼¥¯¤Ï¤Ê¤ó¤Ç¤â¤è¤¤¡£¡Ë
4Ëç¤ÎA¤ò¤Þ¤ºÈ´¤­½Ð¤·¤Æ¤ª¤­¡¢¥È¥Ã¥×¤«¤é¤ÎËç¿ôÌܤ˼¡¤Î¥«¡¼¥É¤òÇÛÃÖ¤·¤Æ¤¯¤À¤µ¤¤¡£

¡Ê΢¸þ¤­¥È¥Ã¥×¤«¤é¤ÎËç¿ôÌܤΥ«¡¼¥É¤ÎÇÛÃÖ¡§¡ü¥«¡¼¥É¤Ï¤Ê¤ó¤Ç¤â¤è¤¤¡£¡Ë
£±¡ü¡¡¡¡¡¡¡¡£±£±¡ü¡¡¡¡¡¡¡¡£²£±¥Ï¡¼¥ÈA¡¡¡¡£³£±¡ü¡¡¡¡¡¡¡¡ £´£±ÀÖ£´¡¡¡¡¡¡¡¡£µ£±ÀÖJ

£²¡ü¡¡¡¡¡¡¡¡£±£²¡ü¡¡¡¡¡¡¡¡£²£²¡ü¡¡¡¡ ¡¡¡¡£³£²¥¯¥é¥ÖA¡¡¡¡£´£²¡ü¡¡¡¡¡¡¡¡  £µ£²¡ü

£³¡ü¡¡¡¡¡¡¡¡£±£³¹õ£´¡¡¡¡¡¡£²£³¡ü¡¡ ¡¡¡¡¡¡£³£³¹õ£³   ¡¡¡¡£´£³¡ü

£´¡ü¡¡    ¡¡£±£´¥À¥¤¥¢A   £²£´¡ü¡¡¡¡   ¡¡£³£´¡ü¡¡   ¡¡¡¡£´£´¡ü

£µÀÖK   ¡¡¡¡£±£µ¡ü¡¡    ¡¡£²£µ¹õ£²   ¡¡¡¡£³£µ¡ü¡¡   ¡¡¡¡£´£µ¹õ£¶

£¶¡ü¡¡¡¡  ¡¡£±£¶¡ü    ¡¡¡¡£²£¶¡ü¡¡     ¡¡£³£¶¡ü¡¡   ¡¡¡¡£´£¶¡ü

£·¡ü¡¡  ¡¡¡¡£±£·¹õK   ¡¡¡¡£²£·¡ü     ¡¡¡¡£³£·¹õ£¸¡¡   ¡¡£´£·¡ü

£¸¡ü¡¡  ¡¡¡¡£±£¸¡ü    ¡¡¡¡£²£¸¡ü     ¡¡¡¡£³£¸¡ü¡¡     ¡¡£´£¸¡ü

£¹ÀÖ£¸  ¡¡¡¡£±£¹¡ü¡¡  ¡¡¡¡£²£¹ÀÖ£³ ¡¡¡¡¡¡£³£¹¡ü     ¡¡¡¡£´£¹¥¹¥Ú¡¼¥ÉA

£±£°¡ü¡¡  ¡¡£²£°¡ü    ¡¡¡¡£³£°¡ü   ¡¡¡¡¡¡£´£°¡ü     ¡¡¡¡£µ£°¡ü

¡Ê¤ä¤êÊý¡Ë
¤³¤Î¤è¤¦¤Ë¥»¥Ã¥È¤·¤¿¥Ñ¥±¥Ã¥È¤ò¤Ê¤Ë¤²¤Ë¥Æ¡¼¥Ö¥ë¤Ëɽ¸þ¤­¤Ë¥ê¥Ü¥ó¥¹¥×¥ì¥Ã¥É¤·¤Æ
ÉáÄ̤Υ«¡¼¥É¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£
½çÈÖ¤¬¶¸¤ï¤Ì¤è¤¦¤Ë½¸¤á¡¢Î¢¸þ¤­¤Ë¼ê¤Ë»ý¤Ä¡£
¤³¤³¤Ç°ìÅÙ¥Õ¥©¡¼¥ë¥¹¥«¥Ã¥È¡Ê½çÈ֤ϸµ¤Î¾õÂÖ¤ËÌá¤ë¤è¤¦¤Ë¤¹¤ë¡¢µ¶¤Î¥«¥Ã¥È¡Ë¤ò¤¹¤ë¡£
´ñ¿ôÈÖÌܤΥ«¡¼¥É¤ò¥¢¥Ã¥×¤¹¤ë¡Ê£±¡¤£³¡¤£µ¡¦¡¦¡¦ËçÌܤΥ«¡¼¥É¤ò¾å¤Ë¾¯¤·¤º¤é¤¹¡£¡Ë
¤³¤ì¤òºÇ¸å¤Þ¤Ç¥«¡¼¥É¤¬¸ß¤¤°ã¤¤¤Ë¤Ê¤ë¤Þ¤Ç·«¤êÊÖ¤·¡¢¾å¤Ë¾å¤²¤¿¥«¡¼¥É¤òÁ´¤ÆÈ´¤­½Ð¤·
¥Æ¡¼¥Ö¥ë¤Ë΢¸þ¤­¤Î¤Þ¤ÞÃÖ¤¯¡£¡Ê½çÈÖ¤¬Êø¤ì¤Ê¤¤¤è¤¦¤ËÃí°Õ¡£¡Ë¡ã¥ê¥Ð¡¼¥¹¥Õ¥§¥í¡¼¥·¥ã¥Ã¥Õ¥ë¤È¸Æ¤Ö¡£¡ä
¼ê¤Ë»Ä¤Ã¤¿¥Ñ¥±¥Ã¥È¤ÇºÆ¤ÓƱ¤¸¤è¤¦¤Ë¥ê¥Ð¡¼¥¹¥Õ¥§¥í¡¼¥·¥ã¥Ã¥Õ¥ë¤ò¤¹¤ë¡£
È´¤­½Ð¤·¤¿¥«¡¼¥É·²¤ÏÁ°¤Î¼è¤ê½Ð¤·¤Æ¥Æ¡¼¥Ö¥ë¤ËÃÖ¤¤¤Æ¤¤¤ë¾å¤Ë½Å¤Í¤Æ¤ª¤¯¡£
¤³¤ì¤ò·«¤êÊÖ¤¹¤È¼ê¸µ¤Ë¤Ï°ìËç¤Î¥«¡¼¥É¤¬»Ä¤ë¡£
¤³¤ì¤ò¥Æ¡¼¥Ö¥ë¤Ëɽ¸þ¤­¤Ë½Ð¤¹¤È¥¯¥é¥Ö¤ÎA¤¬¸½¤ì¤ë¡£
¼¡¤Ë¡¢¥Æ¡¼¥Ö¥ë¤Ë½Å¤Í¤Æ¤¤¤¿¥Ñ¥±¥Ã¥È¤òÂçÂÎȾʬ¤Ë¤Ê¤ë¤è¤¦¤ËµÒ¤Ëʬ¤±¤Æ¤â¤é¤¦¡£
¡ÊÀµ³Î¤ËȾʬ¤Ç¤Ê¤¯¤Æ¤è¤¯¡¢¾åȾʬ24Ëç¡Á27Ëç¤Þ¤Çµö¤µ¤ì¤ë¡£¡Ë
¾åȾʬ¤ò±é¼Ô¤¬¤â¤é¤¤¡¢µÒ¤Î¥Ñ¥±¥Ã¥È¤Î²¼È¾Ê¬¤ÎËç¿ô¤ò¿ô¤¨¤ë¿¶¤ê¤ò¤·¤Æ¥Ñ¥±¥Ã¥È¤Î¾å¤«¤é°ìË示¤Ä¥Æ¡¼¥Ö¥ë¤Ë¥«¥¦¥ó¥È¤·¤Ê¤¬¤é½ç½ø¤òµÕž¤µ¤»¤ë¡£
²¼È¾Ê¬¤ÎËç¿ô¤¬£²£·Ëç¡Á£²£´Ëç¤ËÆþ¤é¤Ê¤¤»þ¤Ï¡ÊËç¿ô¤¬¥ª¡¼¥Ð¡¼¤¹¤ë»þ¡Ë¡¢¥«¥¦¥ó¥È¤·½ª¤ï¤Ã¤¿µÒ¤Î¥Ñ¥±¥Ã¥È¤Î¥Ü¥È¥à¤«¤é¡¢±é¼Ô¤Î¥Ñ¥±¥Ã¥È¤Î¥Ü¥È¥à¤Ø¿ôËç¤ò²¿ µ¤¤Ë°ÜÆ°¤µ¤»¤ë¡£¤¢¤ë¤¤¤Ï¤½¤ÎµÕ¤Ë¾¯¤Ê¤¤¾ì¹ç¤Ï±é¼Ô¤Î¥Ñ¥±¥Ã¥È¤Î¥Ü¥È¥à¤«¤é¿ôËçÈ´¤­½Ð¤·¡¢¤½¤ì¤Î½ç½ø¤òµÕž¤·¤¿¿ôËç¤Î¥«¡¼¥É¤òµÒ¤Î¥Ñ¥±¥Ã¥È¤Î¥Ü¥È¥à¤ËÄɲà ¤·¤Æ¤ª¤¯¡£
¤¤¤º¤ì¤Ë¤·¤Æ¤â¡¢µÒ¤Î¥Ñ¥±¥Ã¥È¤ÎËç¿ô¤ò£²£·Ëç¡Á£²£´Ëç¤ÎÈϰϤËÄ´Àᤷ¤Æ¤ª¤¯¡£
Ä´À°¤·¤¿¥Ñ¥±¥Ã¥È¤òµÒ¤ËÅϤ¹¡£
±é¼Ô¤ÈµÒ¤Ï¤ª¸ß¤¤¤Î¥Ñ¥±¥Ã¥È¤òÁ°¤ÎÁàºî¤ÈƱÍͤ˥ê¥Ð¡¼¥¹¥Õ¥§¥í¡¼¥·¥ã¥Ã¥Õ¥ë¤ò¤·¤Æ¤¤¤¯¡£
¤½¤ì¤¾¤ì°ìË示¤Ä¤Î¥«¡¼¥É¤¬»Ä¤ë¤Î¤Ç¡¢¤½¤ì¤ò¥Æ¡¼¥Ö¥ë¤Ëɽ¸þ¤­¤Ë¤¹¤ë¡£
±é¼Ô¤Ï¥À¥¤¥¢¤ÎA¡¢µÒ¤Ï¥Ï¡¼¥È¤ÎA¤¬½Ð¸½¤¹¤ë¡£
¤³¤ì¤Ç¥Æ¡¼¥Ö¥ë¤Ë¤Ï£³Ëç¤ÎA¤¬Â·¤Ã¤¿¤Î¤Ç¡¢»Ä¤ê¤¬¥¹¥Ú¡¼¥É¤ÎA
¤³¤³¤ÇµÒ¤Ë£²¤Ä¤Î¥Ñ¥±¥Ã¥È¤Î¤¦¤Á¡¢±é¼Ô¤¬¼Î¤Æ¤Æ½Å¤Í¤Æ¤¤¤ë¥Ñ¥±¥Ã¥È¤«¡¢µÒ¤¬¼Î¤Æ¤¿Êý¤Î¥Ñ¥±¥Ã¥È¤«¤òÁªÂò¤µ¤»¤ë¡£¡Ê¤³¤³¤Ï¾¯¤·ÅÒ¤±¤Ç¤¢¤ë¤¬¡¢µÒ¤¬¼«Ê¬¤ÎÊý¤Î¥Ñ¥±¥Ã¥È¤òÁª¤Ö¤È¿´ÍýŪ¤Ë¤ß¤Æ¹½À®¤·¤Æ¤¤¤ë¡£¡Ë
¤³¤Á¤é¤Î»×ÏǤɤ¦¤ê¤ËµÒ¤¬¼«Ê¬¤Î¥Ñ¥±¥Ã¥È¤òÁª¤ó¤À¤é¡Ê¥Þ¥¸¥·¥ã¥ó¥º¥Á¥ç¥¤¥¹¤ÇµÒ¤Î¥Ñ¥±¥Ã¥È¤ÎÊý¤òÁª¤ó¤À¤è¤¦¤Ë¸«¤»¤«¤±¤ë¤È¤è¤¤¤À¤í¤¦¡£¡Ë¡¢¥Ñ¥±¥Ã¥È¤ò¼õ¤±¼è¤ê¥Æ¡¼¥Ö¥ë¤Ë
»þ·×¤Îʸ»úÈפÎÍͤˣ±¡¤£²¡¤£³¡¢¡¦¡¦¡¦£±£²»þ¤Î°ÌÃ֤˥«¡¼¥É¤ò¾å¤«¤é΢¸þ¤­¤Î¤Þ¤ÞÇÛÃÖ¤·¤Æ¤¤¤¯¡£
»Ä¤Ã¤¿¥«¡¼¥É¤ÏÃæ±û¤Î¿Ë¤Î°ÌÃÖ¤Ëɽ¸þ¤­¤Ë¤·¤ÆÃÖ¤¯¡£±é¼Ô¤ÎÊý¤Î¥Ñ¥±¥Ã¥È¤âɽ¸þ¤­¤Ç½Å¤Í¤Æ¤ª¤¯¡£
¤³¤³¤ÇµÒ¤Ë£±£²»þ¤Î°ÌÃÖ¤ËÃÖ¤¤¤¿¥«¡¼¥É°Ê³°¤¬Áª¤Ð¤ì¤ë¤è¤¦¤ËͶƳ¤·¤Ê¤¬¤é¡¢Ê¸»úÈפΰÌÃ֤ˤ¢¤ë¥«¡¼¥É¤ò°ì¤Ä¤òÁª¤Ð¤»¤ë¡£¡Ê£±£²»þ¤òÁª¤Ð¤»¤Æ¤¤¤¤»þ¤Ï¡¢µÒ¤Î¥Ñ¥±¥Ã¥ÈËç¿ô¤¬£²£´Ëç¤Þ¤¿¤Ï£²£µËç¤Î»þ¤Ë¸Â¤ë¡£¡Ë
¡Ê¤â¤·¡¢µÒ¤¬£¶»þ¤Î°ÌÃÖ¤òÁª¤ó¤À¤éµ®Êý¤Î´ª¤Ï¤¹¤Ð¤é¤·¤¤¤ÈË«¤á¤Æ¤½¤Î¥«¡¼¥É¤ò¤á¤¯¤Ã¤Æ¡¢ºÇ¸å¤Î¥¹¥Ú¡¼¥É¤ÎA¤ò½Ð¤·¤Æ½ªÎ»¤¹¤ë¡£¡Ë
µÒ¤¬Áª¤ó¤À¥«¡¼¥É¤òɽ¸þ¤­¤Ë¤·¤Æ¡¢¤½¤Î¥«¡¼¥É¤Î¿ô»ú¤¬
¹õ¤Ê¤é¤½¤Î¥«¡¼¥É¤Î¼¡¤«¤é¿ô¤¨¤Æ»þ·×²ó¤ê¤Î¸þ¤­¤Ë¤½¤Î¿ô¤À¤±¿Ê¤ß¡¢¤½¤³¤Î¥«¡¼¥É¤ò¤á¤¯¤Ã¤Æ¼è¤ê½ü¤¤¤Æ¤¤¤¯¡£¡Ê¤á¤¯¤Ã¤¿¥«¡¼¥É¤ÏÃæ±û¤Ëɽ¸þ¤­¤Ç½Å¤Í¤Æ¤¤¤¯¡£¡Ë
¤Þ¤¿µÒ¤¬»ØÄꤷ¤¿¥«¡¼¥É¤¬À֤Υ«¡¼¥É¤Ê¤éÈ¿»þ·×²ó¤ê¤Ë¿Ê¤ó¤Ç¤á¤¯¤ê¡¢¼è¤ê½ü¤¤¤Æ¤¤¤¯¡£
¤³¤ì¤ò·«¤êÊÖ¤·¤Æ¤¤¤¯¡Ê¼è¤ê½ü¤¤¤¿¥«¡¼¥É¤Î¼¡¤«¤é¤Þ¤¿¿Ê¤ó¤Ç¡ãºÇ½é¤ÎµÒ¤¬Áª¤ó¤À¥«¡¼¥É¤Î¿ô¤Ö¤ó¡ä¼¡¤Î¥«¡¼¥É¤ò¤á¤¯¤ë¡£¡Ë¤ÈºÇ¸å¤Ë£¶»þ¤Î°ÌÃ֤ˤ¢¤Ã¤¿¥«¡¼¥É¤¬°ìËç¤À¤±»Ä¤ë¡£
¤³¤Î¥«¡¼¥É¤ò»×¤ï¤»¤Ö¤ê¤Ë¾Ç¤é¤»¤Æɽ¤Ë¤¹¤ë¤È¡¢¤Þ¤µ¤ËºÇ¸å¤Î¥¹¥Ú¡¼¥É¤ÎA¤¬½Ð¸½¤¹¤ë¡£
¾¤Î¥«¡¼¥É¤Ë£²Ëç¤È¤·¤ÆƱ¤¸¥«¡¼¥É¤¬´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ò¡¢Ãæ±û¤Ë¤¢¤ëɽ¸þ¤­¤Ë½Å¤Ê¤Ã¤Æ¤¤¤ë¥Ñ¥±¥Ã¥È¤ò¥Æ¡¼¥Ö¥ë¤Ë¥ê¥Ü¥ó¥¹¥×¥ì¥Ã¥É¤·¤Æ±éµ»¤ò½ª¤ï¤ë¡£

¸¶ÍýŪ¤Ë¤ÏÆó¿ÊË¡¤ÎÍøÍѤȡ¢·Ñ»ÒΩ¤Æ¤ÎÍ·¤Ó¤òÁȤ߹ç¤ï¤»¤¿Íͤʼê½ç¤Ë¤Ê¤ê¤Þ¤¹¡£
Ä«¤«¤é¼è¤êÁȤߡ¢º£¤è¤¦¤ä¤¯¤É¤¦¤Ë¤«¤Þ¤È¤á¤Þ¤·¤¿¡£
²¿¤«¼ê°ã¤¤¤¬À¸¤¸¤¿¤é¡¢¤ª¶µ¤¨¤¯¤À¤µ¤¤¡£
¹¹¤Ë²þÎÉÉôʬ¤¬¤¢¤ê¤Þ¤·¤¿¤é¥Ò¥ó¥È¤ò¤ª´ê¤¤¤·¤Þ¤¹¡£
 

¡Ö¸ÅÂåÀ¸Êª¡×¤Ë¤Ä¤¤¤Æ¡£

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ11·î29Æü(ÅÚ)20»þ07ʬ15ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  £Ö7.2.1 ¤Þ¤Ç¤Ï¡¢Íð¿ô¤¬°Û¤Ê¤ê¡¢Æ°ºî¤Ç¤­¤Þ¤»¤ó¡¢°Ê¹ß¤Î¥Ð¡¼¥¸¥ç¥ó¤¬É¬ÍפǤ¹¡£

¢¨¤¢¤ä¤Þ¤Ã¤Æ¡¢cookie ¤ò¡¢¾Ã¤·¤Æ¤·¤Þ¤¤¡¢½¤Àµ¤Ç¤­¤Ê¤¯¤Ê¤ê¤Þ¤·¤¿¡¢¤¹¤ß¤Þ¤»¤ó¡£
¡¡ÌµÍý¤ËÆ°¤«¤¹¤È¡¢¿Þ¤¬±ø¤¯¤Ê¤ë¤È»×¤¤¤Þ¤¹¡£
 

Re: ¥È¥é¥ó¥×¥Þ¥¸¥Ã¥¯¤ÎÁϺî

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ11·î30Æü(Æü)17»þ53ʬ57ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.135[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¤³¤³¤ÇµÒ¤Ë£±£²»þ¤Î°ÌÃÖ¤ËÃÖ¤¤¤¿¥«¡¼¥É°Ê³°¤¬Áª¤Ð¤ì¤ë¤è¤¦¤ËͶƳ¤·¤Ê¤¬¤é¡¢Ê¸»úÈפΰÌÃ֤ˤ¢¤ë¥«¡¼¥É¤ò°ì¤Ä¤òÁª¤Ð¤»¤ë¡£¡Ê£±£²»þ¤òÁª¤Ð¤»¤Æ¤¤¤¤»þ¤Ï¡¢µÒ¤Î¥Ñ¥±¥Ã¥ÈËç¿ô¤¬£²£´Ëç¤Þ¤¿¤Ï£²£µËç¤Î»þ¤Ë¸Â¤ë¡£¡Ë


»þ·×¾õ¤ËÇÛÃÖ¤¹¤ë¤È¤­¤Î¥Ñ¥±¥Ã¥È¤ÎÆâÍÆ
¸µ¤Î¥«¡¼¥É¤ÎÇÛÃÖ°ÌÃ֤ʤé
£²£¶¤Î¾ì¹ç
  37  5  45  29  13  49  41  33  25  17  9  1  51  47  43  39  35  31  27  23  19  15  11  7  3
£²£·¤Î¾ì¹ç
  37  5  45  29  13  49  41  33  25  17  9  1  51  47  43  39  35  31  27  23  19  15  11  7  3  50

¼ÂºÝ¤Î¥«¡¼¥É¤Ç¤Ï¡¢¹õ¤ÏÀµ¡¢ÀÖ¤ÏÉé¤È¤¹¤ë¤È
  8 -13  6 -3  4 sA -4  3  2  13 -8  ? -11  ?  ? ¡Ä
¤È¤Ê¤ë¡£

£±ÈÖÌܤΥ«¡¼¥É¤¬¤³¤Î°ÌÃ֤ˤ¯¤ë¤Î¤Ç¡¢¤â¤¦£±¤Ä¤Î¡ÖÀ֣ʡפˤ¹¤ì¤Ð¤è¤¤¤È»×¤¤¤Þ¤¹¡£



> ¸¶ÍýŪ¤Ë¤ÏÆó¿ÊË¡¤ÎÍøÍѤȡ¢·Ñ»ÒΩ¤Æ¤ÎÍ·¤Ó¤òÁȤ߹ç¤ï¤»¤¿Íͤʼê½ç¤Ë¤Ê¤ê¤Þ¤¹¡£


²ò¤ê¤Å¤é¤«¤Ã¤¿¤Î¤Ç¡¢¥·¥ß¥å¥ì¡¼¥¿¤ò¤Ä¤¯¤Ã¤Æ¤ß¤Þ¤·¤¿¡£
·Ñ»ÒΩ¤Æ¤Ë¤Ï¤¤¤í¤¤¤í¤Ê¼êË¡¤¬¤¢¤ë¤Î¤Ç¡¢¾¯¤·¥×¥í¥°¥é¥à¤ò½¤Àµ¤¹¤ë¤ÈÂбþ¤Ç¤­¤ë¤È»×¤¤¤Þ¤¹¡£
!·Ñ»ÒΩ¤Æ¡Ê¥è¥»¥Õ¥¹¤ÎÌäÂê¡Ë¤ò¥·¥ß¥å¥ì¡¼¥È¤¹¤ë

LET N=12 !ÀФοô¡¡¢¨
LET P=-3 !½ü¤¤¤Æ¤¤¤¯°ÌÃÖ¡¡¢¨<----------
LET a=4 !³«»Ï°ÌÃÖ¡¡¢¨<----------


!¡ü¿ôÍýŪ

IF P>0 THEN !»þ·×¤Þ¤ï¤ê¤Ê¤é
   PRINT MOD(a-1+f(N,P),N)+1
ELSE !È¿»þ·×¤Þ¤ï¤ê¤Ê¤é
   PRINT MOD((N-a)-1+f(N,ABS(P)),N)+1 !º¸±¦È¿Å¾¤·¤Æ»þ·×¤Þ¤ï¤ê¤Ë¤¹¤ë
END IF
PRINT
FUNCTION f(n,p) !£±ÈÖ¤«¤é»þ·×¤Þ¤ï¤ê¤ËpÈÖÌܤò¼è¤ê½ü¤¯
   IF n=1 THEN LET f=1 ELSE LET f=MOD(p-1+f(n-1,p),n)+1
END FUNCTION



!¡ü¥·¥ß¥å¥ì¡¼¥¿

DIM s(N) !ÀФξõÂÖ
FOR i=1 TO N !Ï¢ÈÖ¤ò¤Ä¤±¤ë
   LET s(i)=i
NEXT i

SET WINDOW -2,2,-2,2 !ɽ¼¨²èÌÌ
LET r=1.5 !ÀФΰÌÃÖ
SET TEXT JUSTIFY "center","half" !ʸ»ú¤Î°ÌÃÖ
LET r2=1.8

CALL disp_stone !½é´ü¾õÂÖ

PRINT "³«»Ï°ÌÃÖ=";a
PRINT "½ü¤¤¤Æ¤¤¤¯°ÌÃÖ=";P

!LET s(a)=0
!CALL disp_stone
LET k=N !»Ä¤ê¤Î¸Ä¿ô

DO UNTIL k=1 !»Ä¤ê¤ÎÀФ¬£±¤Ä¤Ë¤Ê¤ë¤Þ¤Ç
   LET c=0 !¥«¥¦¥ó¥¿
   DO UNTIL c=ABS(P) !³ºÅö°ÌÃÖ¤ò¸«¤Ä¤±¤ë
      LET a=a+SGN(P) !¡Þ£±¡¡¢¨Àµ¤Î¾ì¹ç¡¢»þ·×¤Þ¤ï¤ê
      LET b=MOD(a-1,N)+1 !ÇÛÃÖ°ÌÃÖ¤ò´¹»»¤¹¤ë
      IF s(b)>0 THEN LET c=c+1 !ÀФ¬¤¢¤ë¾ì¹ç¤Î¤ß¥«¥¦¥ó¥È¤¹¤ë
   LOOP
   PRINT b !¼è¤ê½ü¤¯
   LET s(b)=-1
   LET k=k-1

   CALL disp_stone !¸½ºß¤Î¾õÂÖ
LOOP


SUB disp_stone !´Ä¾õ¤Ëʤ٤ë
   SET DRAW mode hidden !¤Á¤é¤Ä¤­¤òÍÞ¤¨¤ë¡Ê³«»Ï¡Ë
   CLEAR
   FOR i=1 TO N
      LET th=RAD(90-i/N*360) !£Ù¼´¤«¤é»þ·×¤Þ¤ï¤ê
      LET x=COS(th) !°ÌÃÖ
      LET y=SIN(th)
      PLOT TEXT ,AT r2*x,r2*y: STR$(i) !ÈÖ¹æ
      IF s(i)>=0 THEN DRAW disk WITH SCALE(0.1)*SHIFT(r*x,r*y) !ÀÐ
   NEXT i
   SET DRAW mode explicit !¤Á¤é¤Ä¤­¤òÍÞ¤¨¤ë¡Ê½ªÎ»¡Ë
   WAIT DELAY 0.5
END SUB

END
 

¤½¤¦¤À¡ª

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ11·î30Æü(Æü)22»þ29ʬ22ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¤½¤¦¤À¡ª¡ª¡ª
1ËçÌܤȣµ£±ËçÌܤò¶¦¤ËÀÖ¤ÎJ¤Ç¤¢¤ì¤Ð£²£´¡Á£²£·Ëç¤Î¤¤¤º¤ì¤Ç¤âÂбþ¤Ç¤­¤ë¤ó¤Ç¤¹¤Í¡£
¡Ê£±ËçÌܤˤϵ¤ÉÕ¤¤¤Æ¤Ï¤¤¤ë¤Î¤À¤¬¡¢¤É¤¦¤·¤Æ¶¦¤Ë¥»¥Ã¥È¤·¤Æ¤ª¤±¤Ð¤¤¤¤¤È»×¤¤¤Ä¤«¤Ê¤¤¤ó¤À¤í¤¦¡¢¾ð¤±¤Ê¤¤¡£¡Ë
¤¤¤Ä¤âµÞ½ê¤ò²¡¤µ¤¨¤ë¥Ò¥ó¥È¤òÍ¿¤¨¤Æ¤â¤é¤¤¡¢¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
¤Û¤ó¤È¤Ë½õ¤«¤ê¤Þ¤¹¡£
 

ºÆÅ٥ȥé¥ó¥×¤Ç

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ12·î 1Æü(·î)22»þ44ʬ34ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¥È¥é¥ó¥×¤¬Â³¤¤¤Æ¤¹¤ß¤Þ¤»¤ó¤¬¡¢¼¡¤Î¼ê½ç¤òºÆ¸½¤Ç¤­¤ë¥×¥í¥°¥é¥à¤¬¤Ç¤­¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡©
£±¡¥°ìÁȤΥ«¡¼¥É¡Ê£µ£²Ëç¡Ë¤ò¤Þ¤º¤è¤¯¥·¥ã¥Ã¥Õ¥ë¤¹¤ë¡£
£²¡¥¥Ç¥Ã¥¯¤òɽ¸þ¤­¤Ë»ý¤Á¡¢´ñ¿ô¤Î¥«¡¼¥É¤ò¥¢¥Ã¥×¥¸¥ç¥°¡Ê¾å¤Ë¤¹¤³¤·¤º¤é¤¹¡Ë¤·¤Æ¤¤¤­
¡¡¡¡¤³¤ì¤é¤Î¥«¡¼¥ÉÁ´¤Æ¤òÈ´¤­¼è¤ê¡Ê½çÈÖ¤òÊѤ¨¤Ê¤¤¤Ç¡Ë¡¢¥Ü¥È¥à¦¤Ø²ó¤¹¡£
£³¡¥¾åȾʬ¡Ê¶ö¿ô·²¡Ë¤«¤é£´¡¤£¸¡¤Q¡¡¤Î¥«¡¼¥É¤ò¡¢
¡¡¡¡²¼È¾Ê¬¡Ê´ñ¿ô·²¡Ë¤«¤é£³¡¤£·¡¤J¡¡¤Î¥«¡¼¥É¤ò¥¢¥Ã¥×¥¸¥ç¥°¤·¤Æ¤¤¤­¡¢¤³¤ì¤é¤òÈ´¤­¼è¤ê¡¢¥Ü¥È¥à¤Ø
£´¡¥¾å»°Ê¬¤Î°ì°Ì¤«¤é£²¡¤£±£°¤Î¥«¡¼¥É
¡¡¡¡Ã滰ʬ¤Î°ì°Ì¤«¤éA¡¤£¹¤Î¥«¡¼¥É
¡¡¡¡²¼»°Ê¬¤Î°ì°Ì¤«¤é£·¡¤£¸¤Î¥«¡¼¥É¤ò¥¢¥Ã¥×¥¸¥ç¥°¤·¤Æ¡¢¤³¤ì¤òÈ´¤­¼è¤ê¥Ü¥È¥à¤Ø
£µ¡¥¾å¤«¤é½ç¤Ë¡¢£¶¡¤£µ¡¤£´¡¤£³¡¤£²¡¤A¤Î¥«¡¼¥É¤ò¥¢¥Ã¥×¥¸¥ç¥°¤·¤ÆÈ´¤­¼è¤ê¥Ü¥È¥à¤Ø
£¶¡¥ÀÖ¥«¡¼¥É¤ò¥¢¥Ã¥×¥¸¥ç¥°¤·¤Æ¥Ü¥È¥à¤Ø
£·¡¥¾åȾʬ¡Ê¹õ¥«¡¼¥É·²¡Ë¤«¤é¥¯¥é¥Ö¡¢²¼È¾Ê¬¡ÊÀÖ¥«¡¼¥É·²¡Ë¤«¤é¥À¥¤¥¢¥«¡¼¥É¤ò¥¢¥Ã¥×¥¸¥ç¥°¤·¤Æ¥Ü¥È¥à¤Ø
°Ê¾å¤Î¼ê½ç¤ò¹Ô¤Ê¤¦¤È¡¢¥Ç¥Ã¥¯¤Ï΢¸þ¤­¥È¥Ã¥×¤«¤é
¥À¥¤¥¢¡¢¥¯¥é¥Ö¡¢¥Ï¡¼¥È¡¢¥¹¥Ú¡¼¥É¤Î½ç¤Ë
A,2,3,¡¦¡¦¡¦J,Q,k¡¡¤È·¤¦¡£¡Ê¸¶Íý¤Ï£²¿ÊË¡¤Î±þÍÑ¡Ë
¤³¤ì¤ò¤É¤Î¥«¡¼¥É¤òÁª¤Ó¤Þ¤¹¤«¡©
¤Î¼ÁÌä¤ò¼õ¤±¤Ê¤¬¤éÆþÎÏÂÔ¤Á¤È¤·¤Æ¡Ê2È֤Ǥϴñ¿ô¡¢£¶È֤ǤÏÀÖ¡¢7È֤Ǥϥޡ¼¥¯¡¢Â¾¤Ï¿ô»ú¡Ë¿Ê¹Ô¤·¤Æ¤¤¤±¤ë¤è¤¦¤Ë¤·¤¿¤¤¡£
¾¤ÎǤ°Õ¤Î¥«¡¼¥É¤ÎÇÛÎó¤â¤³¤ÎÊýË¡¤ò»È¤Ã¤ÆÄ´¤Ù¤¿¤¤¤Î¤Ç¡¢¿ô»ú¤È¿§¤È¥Þ¡¼¥¯¤¬ÆÈΩ¤ËÁªÂò¤Ç¤­¤Æ¤¤¤±¤ë¤è¤Ç¤¢¤ì¤Ð¤¦¤ì¤·¤¤¤Î¤Ç¤¹¤¬...
 

Re: ºÆÅ٥ȥé¥ó¥×¤Ç

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ12·î 3Æü(¿å)11»þ06ʬ36ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.139[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¥È¥é¥ó¥×¤¬Â³¤¤¤Æ¤¹¤ß¤Þ¤»¤ó¤¬¡¢¼¡¤Î¼ê½ç¤òºÆ¸½¤Ç¤­¤ë¥×¥í¥°¥é¥à¤¬¤Ç¤­¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡©

> ¤³¤ì¤ò¤É¤Î¥«¡¼¥É¤òÁª¤Ó¤Þ¤¹¤«¡©
> ¤Î¼ÁÌä¤ò¼õ¤±¤Ê¤¬¤éÆþÎÏÂÔ¤Á¤È¤·¤Æ¡Ê2È֤Ǥϴñ¿ô¡¢£¶È֤ǤÏÀÖ¡¢7È֤Ǥϥޡ¼¥¯¡¢Â¾¤Ï¿ô»ú¡Ë¿Ê¹Ô¤·¤Æ¤¤¤±¤ë¤è¤¦¤Ë¤·¤¿¤¤¡£


¥á¥Ë¥å¡¼·Á¼°¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¤¬¡¢ºÆ¸½¤¹¤ë¥×¥í¥°¥é¥à¤ò»îºî¤·¤Æ¤ß¤Þ¤·¤¿¡£
¥³¡¼¥Ç¥£¥ó¥°·Á¼°¤¬¥Þ¥ó¥Í¥ê¤Ê¤Î¤Ç¡¢º£²ó¤Ï¡Öʸ»úÎóÁàºî¡×¤Ç¥«¡¼¥É¤ÎÆ°¤­¤ò¼Â¸½¤·¤Æ¤¤¤Þ¤¹¡£
¤Þ¤¿¡¢¥Ó¥¸¥å¥¢¥ëɽ¼¨¤âÄɲ䷤Ƥ¤¤Þ¤¹¤¬¡¢É¬Íפ˱þ¤¸¤Æ¤½¤ÎÉôʬ¤òºï½ü¤·¤Æ¤¯¤À¤µ¤¤¡£
½½¿ÊBASIC¤Ï¡¢¥Ó¥Ã¥È¥Þ¥Ã¥×²èÁü¤Î½èÍý¤¬¶ì¼ê¤Ç¤¹¤«¤é½èÍý®Å٤ϴüÂԤǤ­¤Þ¤»¤ó¡£

¤³¤³¤«¤é¥À¥¦¥ó¥í¡¼¥É

¡Ê¼Â¹Ô²èÌÌ¡Ë
 

¥«¡¼¥É¤¬Ê¤ó¤Ç¤¤¤Þ¤¹

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ12·î 3Æü(¿å)19»þ28ʬ13ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¤ª¤ª¤ª¤ª¡¼¥ï¥ó¥À¥Õ¥ë¡£
¥È¥é¥ó¥×¤¬¼ÂºÝ¤Ëʤó¤Ç¤¤¤Þ¤¹¡£¡Ê¤É¤³¤«¤é¸½¤ì¤¿¤Î¤«¡©¡Ë
¤¤¤Á¤¤¤Á¼êºî¶È¤Ç¤ä¤Ã¤Æ¤¤¤¿Áàºî¤¬°ì½Ö¤Ç½ªÎ»¤·¤Þ¤¹¡£
¤·¤«¤âËè²ó¥«¡¼¥É¤Ï¸«»ö¤Ë¤Ð¤é¤Ð¤é¤Ç¥¹¥¿¡¼¥È¤Ç¤­¤Þ¤¹¡£
Ãæ¤Î¹½Â¤¤Ï¤ª¤Ü¤í¤²¤Ê¤¬¤éÆɤ߲ò¤±¤Þ¤¹¤¬¡¢ºÙÉô¤Ï¤Þ¤À²òÆɤ¹¤ëÎϤ¬»ä¤Ë¤Ï¤¢¤ê¤Þ¤»¤ó¡£
¤³¤ó¤ÊŤ¤²áÄø¤Î¥×¥í¥°¥é¥à¤¬¤è¤¯¤³¤ó¤Êû»þ´Ö¤Ë¤Ç¤­¤Þ¤¹¤Í¡£
ÌäÂê¤ò¸«¤¿½Ö´Ö¡¢¤À¤¤¤¿¤¤¤³¤¦¥×¥í¥°¥é¥à¤òÁȤá¤Ð¤¤¤¤¤ó¤À¤È¤ï¤«¤ë¤â¤ó¤Ê¤ó¤Ç¤¹¤«¡©
¥×¥í¥°¥é¥à¤ò¶²¤ë¶²¤ë°ìÉô¼êľ¤·¤ò¤·¤Æ¡¢Î㤨¤Ð¥À¥¤¥¢¤Î£²¡¤£´¡¤£µ¤Î¥«¡¼¥É¤À¤±¤ò¥¢¥¦¥È¥¸¥ç¥°¤·¤Æ¥Ü¥È¥à¤Ø²ó¤½¤¦¤È¤¢¤ì¤³¤ìÄ©À路¤¿¤Î¤Ç¤¹¤¬¡¢¤¤¤º¤ì¤âµ¡³£¤¬¤¤¤¦¤³¤È¤òʹ¤¤¤Æ¤¯¤ì¤Þ¤»¤ó¡£
¥À¥¤¥¢¤È¾¤Î¥Þ¡¼¥¯¤ò´Þ¤á¤¿£²¡¤£´¡¤£µ¤Î¥«¡¼¥É¤¬¥¢¥¦¥È¥¸¥ç¥°¤µ¤ì¤¿¤ê¤·¤Þ¤¹¡£
AND ¤Ç·Ò¤´¤¦¤È»î¤ß¤Æ¤â¡¢¡É¤³¤³¤Ë¤ÏAND¤ÏÆþ¤ì¤é¤ì¤Þ¤»¤ó¡É¤Ê¤É¤Î¥³¥á¥ó¥È¤ò¼õ¤±¤Þ¤¹¡£
¥×¥í¥°¥é¥à¤ÇÆÃÄê¤Î¥«¡¼¥É¡Ê¥Þ¡¼¥¯¤È¿ô»ú¤Î»ØÄê¡Ë¤ò¡¢¥¢¥¦¥È¥¸¥ç¥°¤¹¤ë¤Ë¤Ï¤É¤Î¤è¤¦¤Ë
µ­½Ò¤·¤¿¤é¤è¤¤¤«¶µ¤¨¤Æ¤¯¤À¤µ¤¤¡£
 

Re: ¥«¡¼¥É¤¬Ê¤ó¤Ç¤¤¤Þ¤¹

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ12·î 3Æü(¿å)20»þ09ʬ59ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.141[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> Î㤨¤Ð¥À¥¤¥¢¤Î£²¡¤£´¡¤£µ¤Î¥«¡¼¥É¤À¤±¤ò¥¢¥¦¥È¥¸¥ç¥°¤·¤Æ¥Ü¥È¥à¤Ø²ó¤½¤¦

> ¥×¥í¥°¥é¥à¤ÇÆÃÄê¤Î¥«¡¼¥É¡Ê¥Þ¡¼¥¯¤È¿ô»ú¤Î»ØÄê¡Ë¤ò¡¢¥¢¥¦¥È¥¸¥ç¥°¤¹¤ë¤Ë¤Ï¤É¤Î¤è¤¦¤Ëµ­½Ò¤·¤¿¤é¤è¤¤¤«¶µ¤¨¤Æ¤¯¤À¤µ¤¤¡£


FOR i=1 TO N !³ºÅö¤¹¤ë¥«¡¼¥É¡¡¢¨¥Þ¡¼¥¯¤È¿ô»ú
   k=CNum(c$,i)
   IF CMark$(c$,i)="D" AND ( k=2 OR k=4 OR k=5 ) THEN LET flg(i)=1
NEXT i
CALL shuffle(c$,flg)


¤Þ¤¿¤Ï

FOR i=1 TO N !³ºÅö¤¹¤ë¥«¡¼¥É¡¡¢¨¥«¡¼¥É
   SELECT CASE CGet$(c$,i)
   CASE "D2","D4","D5"
      LET flg(i)=1
   CASE ELSE
   END SELECT
NEXT i
CALL shuffle(c$,flg)
 

µì·Ç¼¨ÈÄ

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2008ǯ12·î 4Æü(ÌÚ)20»þ48ʬ13ÉÃ
ÊÖ¿®¡¦°úÍÑ
  µì·Ç¼¨ÈĤ¬Éü³è¤·¤Æ¤¤¤Þ¤¹¡£
¥Õ¥ê¡¼¥½¥Õ¥ÈWeBox¤òÍøÍѤ·¤ÆWebÁ´ÂΤò¼è¤ê¹þ¤ó¤Ç²áµî¥í¥°¤Î¥Ú¡¼¥¸¤Ë¥¢¥Ã¥×¤·¤Þ¤·¤¿¡£

http://www.geocities.jp/thinking_math_education/log/logs.html

 

¥°¥é¥Õ¥£¥Ã¥¯¤Ç¤ª´ê¤¤¤·¤Þ¤¹¡£

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ12·î 5Æü(¶â)07»þ34ʬ7ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¥«¡¼¥É¤Ç¤Î¥°¥é¥Õ¥£¥Ã¥¯¤¬²Äǽ¤Ê¤³¤È¤òÍøÍѤ·¤Æ¡¢¼¡¤Î¸½¾Ý¤òºÆ¸½¤·¤¿¤¤¤Î¤Ç¤¹¤¬
³¨»¥¡ÊJ,Q,K)¤ÈA¤Î£±£¶Ëç¤ò»È¤¦¡£
¤³¤Î¥«¡¼¥É¤ò΢¸þ¤­¤Ë£´¡ß£´¤Î¹ÔÎó·Á¼°¤ËʤÙ(²¼¤ÎÈÖ¹æ½ç¤Ëʤ٤ë¡Ë
¥«¡¼¥É¤Î°ÌÃÖ¤ò¡Ê±é¼Ô¦¤«¤é¸«¤¿ÈÖ¹æ¡Ë
1  2  3  4
5  6  7  8
9  10 11 12
13 14 15 16
¤È¤¹¤ë¡£
¤³¤ìÁ´ÂΤò°ìËç¤Î»æ¤È¸«Î©¤Æ¤Æ°ìËç¤Î¥«¡¼¥É¤ÎÂ礭¤µ¤ËÀÞ¤ëÁàºî¤ò¹Ô¤Ê¤¦¡£
¡ãÀÞ¤êÊý¤ÎÊýË¡¡ä
²¿½è¤Î°ÌÃÖ¡Ê¥«¡¼¥É¤È¥«¡¼¥É¤Î´Ö¤Î½Ä¤Þ¤¿¤Ï²£Àþ¡Ë
¤Ç¤â¤«¤Þ¤ï¤Ê¤¤Éôʬ¤ò»ØÄꤷ¤Æ¤â¤é¤¤
Î㤨¤Ð 1  2  3  4
     --------------
¡¡¡¡¡¡ 5  6  7  8
¤Î´Ö¤ÎÀþ¤Ê¤é¤Ð¡¢1  2  3  4
¤Î¥«¡¼¥É¤ò¤Ò¤Ã¤¯¤êÊÖ¤·¤Æ
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡5  6  7  8
¤Î¥«¡¼¥É¤Î¾å¤Ë½Å¤Í¤ë¡£
¤Þ¤¿¡¡2 |  3
      6 |  7
     10 | 11
     14 | 15
¤ÎÀþ¤Ê¤é±¦È¾Ê¬¡Ê¤Þ¤¿¤Ïº¸È¾Ê¬¤Ç¤â¤è¤¤¡£¡Ë
¤òÁ´¤ÆÀÞ¤êÊÖ¤·¤Æ(¥«¡¼¥É¤Ï¤Ò¤Ã¤¯¤êÊ֤뤳¤È¤Ë¤Ê¤ë¡£¡Ë

3 ¢ª  2
4 ¢ª  1
7 ¢ª  6
8 ¢ª  5
11 ¢ª 10
12 ¢ª  9
15 ¢ª 14
16 ¢ª 13
¤È½Å¤Í¤ë¤³¤È¤È¤¹¤ë¡£

¤³¤ì¤òµÒ¤Ë¤½¤ÎÅÔÅÙÀþ¤ò»ØÄꤵ¤»¡¢£±£¶Ëç¤Î¥«¡¼¥É¤¬°ì¤Ä¤Ë½Å¤Ê¤ë¤Þ¤Ç³¤±¤ë¡£
¡Ê¥Ñ¥±¥Ã¥È¤Ïɽ¸þ¤­¡¢Î¢¸þ¤­¤¬º®¤¶¤Ã¤¿¾õÂ֤ˤ¢¤ë¡£¡Ë
¤³¤Î¥Ñ¥±¥Ã¥È¤Ë¤ª¤Þ¤¸¤Ê¤¤¤ò¤«¤±¡¢¥Æ¡¼¥Ö¥ë¤Ë¥ê¥Ü¥ó¥¹¥×¥ì¥Ã¥É¤·¤Æ¤ß¤ë¡£
¡Ê¤³¤Î¤È¤­¡¢¥Ñ¥±¥Ã¥ÈÁ´ÂΤò¤Ò¤Ã¤¯¤êÊÖ¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ë»þ¤¬µ¯¤­¤ë¤³¤È¤â¤¢¤ë¡£¡Ë

¡Ê¥Ñ¥¿¡¼¥óK¡Ë
»Å¹þ¤ß¡§£±£¶Ëç¤Î¥Ñ¥±¥Ã¥È¤Î¾å¤«¤é3,4,9,12ËçÌܤËK¤òÇÛÃÖ¤·¤Æ¤ª¤¯¡£
¥¹¥¿¡¼¥È¡§£´¡ß£´¤Ëʤ٤¿¥«¡¼¥É¤Î
¡¡¡¡¡¡¡¡¡¡1,4,6,8,11,12,14,16ÈÖ¤òɽ¸þ¤­¤Ë¤¹¤ë¡£¡Ê¤³¤ì¤ÏµÒ¤«¤é¸«¤ÆK¤Ë¸«¤¨¤ë¡£¡Ë

¡Ê¥Ñ¥¿¡¼¥óA¡Ë
»Å¹þ¤ß¡§£±£¶Ëç¤Î¥Ñ¥±¥Ã¥È¤Î¾å¤«¤é5,7,8,16ËçÌܤËA¤òÇÛÃÖ¤·¤Æ¤ª¤¯¡£
¥¹¥¿¡¼¥È¡§£´¡ß£´¤Ëʤ٤¿¥«¡¼¥É¤Î
¡¡¡¡¡¡¡¡¡¡1,3,5,6,7,9,11,14ÈÖ¤òɽ¸þ¤­¤Ë¤¹¤ë¡£¡Ê¤³¤ì¤ÏµÒ¤«¤é¸«¤ÆA¤Ë¸«¤¨¤ë¡£¡Ë

¡Ê¥Ñ¥¿¡¼¥óJ¡Ë
»Å¹þ¤ß¡§£±£¶Ëç¤Î¥Ñ¥±¥Ã¥È¤Î¾å¤«¤é4,9,10,15ËçÌܤËJ¤òÇÛÃÖ¤·¤Æ¤ª¤¯¡£
¥¹¥¿¡¼¥È¡§£´¡ß£´¤Ëʤ٤¿¥«¡¼¥É¤Î
¡¡¡¡¡¡¡¡¡¡2,5,7,9,12,13ÈÖ¤òɽ¸þ¤­¤Ë¤¹¤ë¡£¡Ê¤³¤ì¤ÏµÒ¤«¤é¸«¤ÆJ¤Ë¸«¤¨¤ë¡£¡Ë

¡Ê¥Ñ¥¿¡¼¥óQ¡Ë
»Å¹þ¤ß¡§£±£¶Ëç¤Î¥Ñ¥±¥Ã¥È¤Î¾å¤«¤é1,4,14,16ËçÌܤËQ¤òÇÛÃÖ¤·¤Æ¤ª¤¯¡£
¥¹¥¿¡¼¥È¡§£´¡ß£´¤Ëʤ٤¿¥«¡¼¥É¤Î
¡¡¡¡¡¡¡¡¡¡3,4,6,8,9,11ÈÖ¤òɽ¸þ¤­¤Ë¤¹¤ë¡£¡Ê¤³¤ì¤ÏµÒ¤«¤é¸«¤ÆQ¤Ë¸«¤¨¤ë¡£¤³¤ì¤Ï¾¯¤·¶ì¤·¤¤¡Ë

¤³¤ì¤é¤Î»Å¹þ¤ß¤ÈºÇ½é¤Î½é´üÀßÄ꤫¤é¤ÎÀÞ¤êÊÖ¤·¤ò·«¤êÊÖ¤·¤Æ¡¢ºÇ¸å¤Î¥Ñ¥±¥Ã¥È¤Ç¤Î
¥¹¥×¥ì¥Ã¥É¤ò¤¹¤ë¤È¤½¤ì¤¾¤ì¤Î¥Ñ¥¿¡¼¥ó¤Ç¤Î£´Ëç¤À¤±¤Î¥«¡¼¥É¤¬ ɽ¸þ¤­¤Ç½Ð¸½¤·¡¢
¾¤Î¥«¡¼¥É¤Ï΢¸þ¤­¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£

¤È¤¤¤¦¤â¤Î¤Ç¤¹¡£¡Ê¤¹¤ß¤Þ¤»¤ó¡¢ÀâÌÀ¤¬Ä¹¤¹¤®¤Æ¡¦¡¦¡¦¡Ë
 

Re: ¥°¥é¥Õ¥£¥Ã¥¯¤Ç¤ª´ê¤¤¤·¤Þ¤¹¡£

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ12·î 5Æü(¶â)19»þ39ʬ34ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.144[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¡Ê¥Ñ¥¿¡¼¥óK¡Ë
> »Å¹þ¤ß¡§£±£¶Ëç¤Î¥Ñ¥±¥Ã¥È¤Î¾å¤«¤é3,4,9,12ËçÌܤËK¤òÇÛÃÖ¤·¤Æ¤ª¤¯¡£
> ¥¹¥¿¡¼¥È¡§£´¡ß£´¤Ëʤ٤¿¥«¡¼¥É¤Î
> ¡¡¡¡¡¡¡¡¡¡1,4,6,8,11,12,14,16ÈÖ¤òɽ¸þ¤­¤Ë¤¹¤ë¡£¡Ê¤³¤ì¤ÏµÒ¤«¤é¸«¤ÆK¤Ë¸«¤¨¤ë¡£¡Ë


ÀÞ¤ê»æ¤Î¿ôÍý¤Ç¤¹¤Í¡£

¡ü²òÀÏ·ë²Ì
¸þ¤­¤¬ÉÔÆ°¤Ê²Õ½ê¤Ï¡¢1,3,6,8,9,11,14,16¤Ç¤¢¤ë¡£¡¡2,4,5,7,10,12,13,15¤Ï¡¢È¿Å¾¤¹¤ë¡£
£´¡ß£´ÇÛÃ֤ʤé
1  *  3  *
*  6  *  8
9  * 11  *
* 14  * 16
¤È¤Ê¤ë¡£

¤È¤³¤í¤Ç¡¢³Æ¥«¡¼¥É¤ÎÇÛÃÖ¾ì½ê¤Ï¡¢

  1  *  *  4  *  6  *  8  *  * 11 12  * 14  * 16 <-- £Ë¤Î¥Ñ¥¿¡¼¥ó
¡¡ ¢­ ¡¡ ¢­ ¢­ ¡¡ ¢­ ¡¡ ¡¡ ¢­ ¡¡ ¢­ ¢­ ¡¡ ¢­
  1  2  *  *  5  6  7  8  * 10 11  * 13 14 15 16 <-- ¥·¥ã¥Ã¥Õ¥ë¸å
¤·¤¿¤¬¤Ã¤Æ¡¢3,4,9,12¤Ë£Ë¤òÇÛÃÖ¤·¤Æ¤ª¤±¤Ð¤è¤¤¡£

  1  *  3  *  5  6  7  *  9  * 11  *  * 14  *  * <-- £Á¤Î¥Ñ¥¿¡¼¥ó
¡¡ ¢­ ¡¡ ¢­ ¢­ ¡¡ ¢­ ¡¡ ¡¡ ¢­ ¡¡ ¢­ ¢­ ¡¡ ¢­
  1  2  3  4  *  6  *  *  9 10 11 12 13 14 15  * <-- ¥·¥ã¥Ã¥Õ¥ë¸å
¤·¤¿¤¬¤Ã¤Æ¡¢5,7,8,16¤Ë£Á¤òÇÛÃÖ¤·¤Æ¤ª¤±¤Ð¤è¤¤¡£

  *  2  *  *  5  *  7  *  9  *  * 12 13  *  *  * <-- £Ê¤Î¥Ñ¥¿¡¼¥ó
¡¡ ¢­ ¡¡ ¢­ ¢­ ¡¡ ¢­ ¡¡ ¡¡ ¢­ ¡¡ ¢­ ¢­ ¡¡ ¢­
  *  *  *  4  *  *  *  *  9 10  *  *  *  * 15  * <-- ¥·¥ã¥Ã¥Õ¥ë¸å
¤·¤¿¤¬¤Ã¤Æ¡¢4,9,10,15¤Ë£Ê¤òÇÛÃÖ¤·¤Æ¤ª¤±¤Ð¤è¤¤¡£

  *  2  3  *  *  6  *  8  9  * 11  * 13 14  *  * <-- £Ñ¤Î¥Ñ¥¿¡¼¥ó
¡¡ ¢­ ¡¡ ¢­ ¢­ ¡¡ ¢­ ¡¡ ¡¡ ¢­ ¡¡ ¢­ ¢­ ¡¡ ¢­
  *  *  3  4  5  6  7  8  9 10 11 12  * 14 15  * <-- ¥·¥ã¥Ã¥Õ¥ë¸å
¤·¤¿¤¬¤Ã¤Æ¡¢1,2,13,16¤Ë£Ñ¤òÇÛÃÖ¤·¤Æ¤ª¤±¤Ð¤è¤¤¡£¡ÊÄûÀµ¤òÈ¿±Ç¡Ë


¼¡¤Î¥×¥í¥°¥é¥à¤Ç³Îǧ¤Ç¤­¤Þ¤¹¡£¤É¤Á¤é¤òÀޤꤿ¤¿¤à¤«¤Ç°ÌÃÖ(a,b)¤ÏÊѤï¤ê¤Þ¤¹¡£
LET N=4 !N¹ÔNÎó
LET a=-2 !Àޤꤿ¤¿¤à°ÌÃÖ(a,b)
LET b=2
DATA 0,1,1,0 !£Ñ¥Ñ¥¿¡¼¥ó¡¡¢¨1:ɽ¡¢0:΢
DATA 0,1,0,1
DATA 1,0,1,0
DATA 1,1,0,0
DIM M(N,N)
MAT READ M
FOR y=1 TO N !¹Ô
   FOR x=1 TO N !Îó
      IF MOD(ABS(x-a)+ABS(y-b),2)=1 THEN !³Ê»Ò¾å¤Ç¤Îµ÷Î¥¡¡¢¨1:ȿž¡¢0:¤½¤Î¤Þ¤Þ
         LET M(y,x)=1-M(y,x) !ÏÀÍýÈÝÄê
      END IF
      PRINT M(y,x); !¡Ö£°¤¬£´¤Ä¡×¤Þ¤¿¤Ï¡Ö£±¤¬£´¤Ä¡×¤Î°ÌÃÖ
   NEXT x
   PRINT
NEXT y
END


¥·¥ß¥å¥ì¡¼¥¿¤Ë¤è¤ë¥×¥í¥°¥é¥à¤Ï¤³¤Á¤é¤«¤é¥À¥¦¥ó¥í¡¼¥É¡ÊÁ°²ó¤ÈƱ¤¸¡¢Á°²óʬ¤âƱº­¡Ë
 

¸æÎé

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ12·î 5Æü(¶â)20»þ33ʬ6ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¤µ¤Ã¤½¤¯À½ºî¤·¤Æ夤¤ÆÌã¤Ã¤Æ¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
³Ú¤·¤¯»È¤ï¤»¤Æ¤¤¤¿¤À¤¤¤Æ¤ª¤ê¤Þ¤¹¡£
Æüº¢¥«¡¼¥É¤Ç¤ä¤Ã¤Æ¤¤¤ë¥Þ¥¸¥Ã¥¯¤ò¥×¥í¥°¥é¥à¤Ë¤¹¤ë¤È¡¢¤³¤ó¤ÊÉ÷¤Ë¹½À®¤·¤Æ¤¤¤¯¤Î¤«¤È
BASIC¤òÊÙ¶¯¤¹¤ë¤Î¤Ë¤È¤Ã¤Æ¤âÌò¤ËΩ¤Á¤Þ¤¹¤·¡¢¤½¤Î°ÕÌ£¤òÄϤà¤Î¤Ë¹¥ÅÔ¹ç¤Ç¤¹¡£
¼«Ê¬¤Ï¤¿¤«¤¬¥È¥é¥ó¥×¤Ç¤¹¤¬¡¢¤½¤³¤Ë¤¤¤í¤¤¤í¤Ê¿ôÍý¤äˡ§¡¢ÁȤ߹ç¤ï¤»¤Î̯¤Ê¤É¤Îµ»¹ª¤¬¹½À®¤·¤Æ¤¤¤±¤ëÅÀ¤Ë¶½Ì£¤¬¤¢¤ê¡¢¿·¤·¤¤ºîÉʤòÁϤ¤·¤Æ¤¤¤¯¤³¤È¤¬³Ú¤·¤ß¤Ç¤¹¡£
¤³¤ì¤ò¥³¥ó¥Ô¥å¡¼¥¿¤Ç¥·¥å¥ß¥ì¡¼¥È¤Ç¤­¤ì¤Ð»î¹Ôºø¸í¤ò±Þ¤ï¤Ê¤¤¶¯¤ß¤¬¼ê¤ËÆþ¤ê¤Þ¤¹¡£
ÉôʬŪ¤Ë½ñ¤­´¹¤¨¤Æ¸½¾Ý¤¬¤É¤¦ÊѲ½¤·¤Æ¤¤¤¯¤Î¤«¤òÃΤ뤳¤È¤¬¤Ç¤­¡¢²þÎɤä²þÁ±ÅÀ¤Îȯ¸«¤ËÂ礤¤ËÌòΩ¤Á¤Þ¤¹¡£
¤³¤ì¤«¤é¤â²¿¤«¤È¤ª´ê¤¤¤¹¤ë¤«¤È»×¤¤¤Þ¤¹¤Î¤Ç¤ª½õ¤±²¼¤µ¤¤¡£
¼¡¤«¤é¼¡¤Ø¤ÎÀ½ºî°ÍÍê¤Ë±þ¤¸¤Æ²¼¤µ¤¤¤Þ¤·¤Æ¡¢½Å¤Í½Å¤Í¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
 

ÄûÀµ

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ12·î 5Æü(¶â)22»þ58ʬ14ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¥¢¥Ã¥×¤·¤¿¸å¡¢¿ôÃͤδְ㤤¤Ëµ¤ÉÕ¤­ÄûÀµ¤ò¤·¤Æ¤ª¤¤¤Æ²¼¤µ¤¤¡£
¡Ê¥Ñ¥¿¡¼¥óQ¡Ë¤Ç
»Å¹þ¤ß¡§£±¡¤£²¡¤£±£³¡¤£±£¶ËçÌܤȤ·
¥¹¥¿¡¼¥È¡§£²¡¤£³¡¤£¶¡¤£¸¡¤£¹¡¤£±£±¡¤£±£³¡¤£±£´ÈÖ
¤Ø¤ÎÊѹ¹¤ò¤ª´ê¤¤¤·¤Þ¤¹¡£
 

¤µ¤¤¤³¤íÅÒÇî

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ12·î 7Æü(Æü)20»þ46ʬ54ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¡ã¥Ñ¥¿¡¼¥ó­µ¡ä
£´¤Ä¤Î¤µ¤¤¤³¤í¤¬¤¢¤ê
A={2,3,3,9,10,11}¡¢B={0,1,7,8,8,8}¡¢C={5,5,6,6,6,6}¡¢D={4,4,4,4,12,12}
¤ÎÌܤ¬³ÆÌ̤˰õ»ú¤µ¤ì¤Æ¤¤¤ë¤È¤·¤Þ¤¹¡£
¤¢¤Ê¤¿¤È»ä¤Ï¤³¤ÎÃ椫¤é¤½¤ì¤¾¤ì°ì¤Ä¤Î¤µ¤¤¤³¤í¤òÁª¤ó¤Ç¤µ¤¤¤³¤í¤ò¿¶¤ê¤Þ¤¹¡£
½Ð¤¿Ìܤ¬Â礭¤¤¤Û¤¦¤¬Áê¼ê¤«¤éÀé±ß¤ò¼õ¤±¼è¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
¤Ç¤â¾¯¤Ê¤¯¤È¤â£±£°£°²ó¤Ï¾¡É餹¤ë¤³¤È¤Ë¤·¤Þ¤¹¡£¡ÊÁª¤ó¤À¤µ¤¤¤³¤í¤ÏÊѤ¨¤Ê¤¤¡£¡Ë
¤µ¤Æµ®Êý¤Ï¤É¤Î¤µ¤¤¤³¤í¤òÁª¤Ó¤Þ¤¹¤«¡©


¡ã¥Ñ¥¿¡¼¥ó­¶¡ä
Ʊ¤¸¤¯£´¤Ä¤Î¤µ¤¤¤³¤í¤¬
X={5,5,6,6,7,7}¡¢Y={1,2,3,9,10,11}¡¢Z={0,1,7,8,8,9}¡¢W={3,4,4,5,11,12}
¤ÎÌܤǤǤ­¤Æ¤¤¤Þ¤¹¡£
Ʊ¤¸¤¯¾¡É餷¤Þ¤¹¤¬¡Ê¤³¤ì¤â£±£°£°²ó¤ÏÀ臘¾ò·ï¤Ä¤­¡ËƱ¤¸Ìܤ¬½Ð¤ì¤Ð¥¢¥¤¥³¤Ç¤ä¤êľ¤·¤ò¤·¤Þ¤¹¡£
¤µ¤Æ¤¢¤Ê¤¿¤¬Áª¤Ö¤µ¤¤¤³¤í¤Ï¤É¤ì¡©
 

Re: ¤µ¤¤¤³¤íÅÒÇî

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2008ǯ12·î 8Æü(·î)09»þ22ʬ26ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.148[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

10Ëü²ó¤Î¼Â¸³¤Ç¤Ï£Ä¤È£×¤¬¤ï¤º¤«¤ËÍ­Íø¤È¤Ç¤Þ¤·¤¿¡£
´üÂÔÃͤÎ1.324¤È¤Ï¡¢1²ó¤Ë1000±ß¤«¤±¤ë¤ÈÊ¿¶Ñ1324±ßÌá¤Ã¤Æ¤¯¤ë¤È¤¤¤¦°ÕÌ£¤Ç¤¹¡£
²¼¤Î¥×¥í¥°¥é¥à¤Ç¤ÏÂÐÀï¿Í¿ô¤ò2¡Á4¿Í¤Ë»ØÄê¤Ç¤­¤Þ¤¹¡£
¤¿¤À¤·Á´°÷°ã¤¦¥µ¥¤¥³¥í¤òÁªÂò¤¹¤ë¤È¤·¤Þ¤¹¡£
3¿Í¡¢4¿Í¤Ç¤Ï£Á¤È£Ù¤¬Í­Íø¤È¤Ç¤Þ¤·¤¿¡£
ÍýÏÀÃͤòµá¤á¤ë¤Î¤â¤½¤ì¤Û¤ÉÆñ¤·¤¯¤Ï¤Ê¤¤¤È»×¤¤¤Þ¤¹¤¬¡¢¤É¤¦¤Ç¤·¤ç¤¦¡©


DECLARE EXTERNAL SUB combination
LET k=100000 ! ÂÐÀï²ó¿ô
LET p=2 ! ¥Ñ¥¿¡¼¥ó
LET n=4 ! ¥µ¥¤¥³¥í¤Î¼ïÎà
LET f=6 ! ¥µ¥¤¥³¥í¤ÎÌÌ¿ô
INPUT PROMPT "ÂÐÀï¿Í¿ô¤Ï¡© " : r
IF r<2 OR r>n THEN STOP
DIM code$(p,n),dice(p,n,f),d(r),win(r),sumwin(p,n),a(n),com(COMB(n,r),r)
MAT READ code$,dice
MAT a=ZER(n)
MAT sumwin=ZER
LET total=(COMB(n,r)-COMB(n-1,r))*k
LET count=0 ! COMB(n,r)
CALL combination(a,n,1,r,com,count)
FOR pp=1 TO p
   FOR i=1 TO count
      MAT win=ZER
      FOR j=1 TO k
         LET maxd=-1
         FOR ri=1 TO r
            LET d(ri)=dice(pp,com(i,ri),INT(f*RND)+1)
            IF d(ri)>maxd THEN
               LET maxd=d(ri)
               LET w=ri
            ELSEIF d(ri)=maxd THEN ! °ú¤­Ê¬¤±
               LET w=0
            END IF
         NEXT ri
         IF w=0 THEN LET j=j-1 ELSE LET win(w)=win(w)+1
      NEXT j
      LET maxw=0
      FOR ri=1 TO r
         LET sumwin(pp,com(i,ri))=sumwin(pp,com(i,ri))+win(ri)
         PRINT code$(pp,com(i,ri));win(ri);"  ";
         IF win(ri)>maxw THEN
            LET w=ri
            LET maxw=win(ri)
         END IF
      NEXT ri
      PRINT "¾¡¼Ô ";code$(pp,com(i,w));win(w);"¾¡";k-win(w);"ÇÔ";
      PRINT USING " ´üÂÔÃÍ #.####":r*win(w)/k
   NEXT i
   PRINT "Áí¹ç¾¡ÇÔ"
   FOR ni=1 TO n
      PRINT code$(pp,ni);sumwin(pp,ni);"¾¡";total-sumwin(pp,ni);"ÇÔ";
      PRINT USING " ´üÂÔÃÍ #.####":r*sumwin(pp,ni)/total
   NEXT ni
   PRINT
NEXT pp
DATA A,B,C,D,X,Y,Z,W
DATA 2,3,3,9,10,11  ! A
DATA 0,1,7,8,8,8    ! B
DATA 5,5,6,6,6,6    ! C
DATA 4,4,4,4,12,12  ! D
DATA 5,5,6,6,7,7    ! X
DATA 1,2,3,9,10,11  ! Y
DATA 0,1,7,8,8,9    ! Z
DATA 3,4,4,5,11,12  ! W
END

REM ½½¿ÊBASICźÉÕ"\BASICw32\SAMPLE\COMBINAT.BAS"¤è¤ê
REM 1¡Án¤Î½¸¹ç¤«¤ér¸Ä¤òÁª¤ÖÁȹ礻¤òÀ¸À®¤¹¤ë¡£ÇÛÎócom(,)
EXTERNAL SUB combination(a(),n,k,r,com(,),count)
! k°Ê¹ß¤Î¿ô¤«¤ér¸Ä¤òÁªÂò¤¹¤ë
IF r=0 THEN
   LET count=count+1
   LET ri=1
   FOR i=1 TO n
      IF a(i)=1 THEN
         LET com(count,ri)=i
         LET ri=ri+1
      END IF
   NEXT i
ELSE
   FOR i=k TO n-r+1
      LET a(i)=1
      CALL combination(a,n,i+1,r-1,com,count)
      LET a(i)=0
   NEXT i
END IF
END SUB
 

Re: ¤µ¤¤¤³¤íÅÒÇî

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ12·î 8Æü(·î)11»þ26ʬ21ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.149[¸µµ­»ö¤Ø]

¹ÓÅĹÀÆ󤵤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

£±£°Ëü²ó¤Î¾¡Éé¤È¤Ï¤¹¤´¤¤¡£
£²¿Í¤Ç¤ä¤ë¾ì¹ç¤·¤«¹Íθ¤·¤Æ¤¤¤Ê¤«¤Ã¤¿¤Î¤Ç¡¢£³¡¤£´¿Í¤Ç¤Î¥×¥í¥°¥é¥à¤Þ¤Ç¹½À®¤µ¤ì¤Æ¤¤¤ë¤Î¤Ë¶Ã¤­¤Þ¤·¤¿¡£
¼«Ê¬¤ÇÁȤó¤À¥×¥í¥°¥é¥à¤Ë³Ó¤Ù¡¢¤Ê¤ó¤È¸úΨ¤è¤¯ÁȤޤì¤Æ¤¤¤ë¤«¤È´¶¿´¤¤¤¿¤·¤Þ¤·¤¿¡£
¤µ¤Æ¤³¤³¤ÏÅÒÇî¤Ç¤¹¡£
ÅöÁ³Æ¹¸µ¤¬Í­Íø¤Ë¤Ê¤ë¤è¤¦¤ÊÀïά¤òΩ¤Æ¤Æ²¼¤µ¤¤¡£
Îã¤Î·×»»·ë²Ì¤òį¤á¡¢´üÂÔÃͤ¬¹â¤¯¤Ê¤ëÁȤ߹ç¤ï¤»¤ÇºîÀï¤òÎý¤ê¤Þ¤¹¡£
¡ã¥Ò¥ó¥È¡ä¡§Æó¿Í¤ÇƱ»þ¤ËÁª¤Ö¤è¤¦¤Ë¸«¤»¤«¤±¡¢µÒ¤¬Àè¤Ë¤µ¤¤¤³¤í¤òÁª¤Ð¤»¤Þ¤¹¡£
 

¥Õ¥¡¥¤¥ë¤Î³«¤­Êý

 Åê¹Æ¼Ô¡§½é¿´¼ÔA  Åê¹ÆÆü¡§2008ǯ12·î 8Æü(·î)12»þ05ʬ31ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ½½¿ÊBasic¤ÇÊݸ¤·¤¿¥Õ¥¡¥¤¥ë¤ò¥À¥Ö¥ë¥¯¥ê¥Ã¥¯¤·¤Æ¤â³«¤­¤Þ¤»¤ó¡£
¤É¤¦¤·¤¿¤é¥À¥Ö¥ë¥¯¥ê¥Ã¥¯¤Ç³«¤±¤ë¤Î¤Ç¤¹¤«¡©
¥×¥í¥°¥é¥à¤òµ¯Æ°¤·¤Æ¤«¤é¡¢¥Õ¥¡¥¤¥ë¤ò³«¤¯¤Î¤Ï¼Â»Ü¤Ç¤­¤Þ¤¹¡£
½é¿´¼Ô¤Ê¤Î¤Ç¤è¤í¤·¤¯¤ª´ê¤¤¤·¤Þ¤¹¡£
 

Re: ¥Õ¥¡¥¤¥ë¤Î³«¤­Êý

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2008ǯ12·î 8Æü(·î)14»þ37ʬ17ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.151[¸µµ­»ö¤Ø]

¤¤¤¯¤Ä¤«ÊýË¡¤¬¤¢¤ê¤Þ¤¹¡£
£±¤Ä¤á¤Ï¡¤¥¤¥ó¥¹¥È¡¼¥éÈÇ¥À¥¦¥ó¥í¡¼¥É¤Î¥Ú¡¼¥¸¤«¤éBASIC728setup.exe¤ò¥À¥¦¥ó¥í¡¼¥É¤·¤Æ¼Â¹Ô¤¹¤ë¤³¤È¤Ç¤¹¡£¤³¤ì¤¬°ìÈÖ´Êñ¤Ç¤¹¡£
£²¤Ä¤á2¤Ï¡¤BASIC¤Î¥Õ¥©¥ë¥À¤Ë¤¢¤ë,SETUP.BAT¤ò¼Â¹Ô¤¹¤ë¤³¤È¤Ç¤¹¡£¤Ê¤ª¡¤¥¨¥¯¥¹¥×¥í¡¼¥é¤Ç³ÈÄ¥»Ò¤òɽ¼¨¤¹¤ëÀßÄê¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¤È¡È.BAT¡É¤ÎÉôʬ¤Ïɽ¼¨¤µ¤ì¤Þ¤»¤ó¡£
£³¤Ä¤á¤Ï¡¤FAQ¤Î¥Ú¡¼¥¸¤ÎBAS¥Õ¥¡¥¤¥ë¤Î´ØÏ¢ÉÕ¤±¤Î½¤Àµ¤Ë¤¢¤ê¤Þ¤¹¡£
 

Re: ¥Õ¥¡¥¤¥ë¤Î³«¤­Êý

 Åê¹Æ¼Ô¡§½é¿´¼ÔA  Åê¹ÆÆü¡§2008ǯ12·î 8Æü(·î)15»þ38ʬ6ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.152[¸µµ­»ö¤Ø]

ÇòÀС¡ÏÂÉ×ÀèÀ¸¤Ø

½½¿ÊBASIC¤Î³«È¯¼Ô¤Ç¤¢¤ëÇòÀÐÏÂÉ×ÀèÀ¸¤«¤é¡¢Á᮲óÅú¤ò¤¤¤¿¤À¤­¡¢¶²½Ì¤·¤Æ¤ª¤ê¤Þ¤¹¡£
¹â¹»¶µ»Õ¤ò¤·¤Æ¤¤¤ë¤Î¤Ç¡¢Æü¾ï¤Î¼ø¶È¶µºà¤È¤·¤Æ³èÍѤµ¤»¤Æ¤¤¤¿¤À¤­¤¿¤¤¤È»×¤¤¤Þ¤¹¡£

»Ø¼¨¤µ¤ì¤¿£²¤Ä¤á¤ÎÊýË¡¤Ç¡¢¾å¼ê¤¯¼Â¹Ô¤Ç¤­¤Þ¤·¤¿¡£
ËÜÅö¤Ë¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
º£¸å¤È¤â¤è¤í¤·¤¯¤´»ØƳ²¼¤µ¤¤¡£


> ¤¤¤¯¤Ä¤«ÊýË¡¤¬¤¢¤ê¤Þ¤¹¡£
> £±¤Ä¤á¤Ï¡¤¥¤¥ó¥¹¥È¡¼¥éÈÇ¥À¥¦¥ó¥í¡¼¥É¤Î¥Ú¡¼¥¸¤«¤éBASIC728setup.exe¤ò¥À¥¦¥ó¥í¡¼¥É¤·¤Æ¼Â¹Ô¤¹¤ë¤³¤È¤Ç¤¹¡£¤³¤ì¤¬°ìÈÖ´Êñ¤Ç¤¹¡£
> £²¤Ä¤á2¤Ï¡¤BASIC¤Î¥Õ¥©¥ë¥À¤Ë¤¢¤ë,SETUP.BAT¤ò¼Â¹Ô¤¹¤ë¤³¤È¤Ç¤¹¡£¤Ê¤ª¡¤¥¨¥¯¥¹¥×¥í¡¼¥é¤Ç³ÈÄ¥»Ò¤òɽ¼¨¤¹¤ëÀßÄê¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¤È¡È.BAT¡É¤ÎÉôʬ¤Ïɽ¼¨¤µ¤ì¤Þ¤»¤ó¡£
> £³¤Ä¤á¤Ï¡¤FAQ¤Î¥Ú¡¼¥¸¤ÎBAS¥Õ¥¡¥¤¥ë¤Î´ØÏ¢ÉÕ¤±¤Î½¤Àµ¤Ë¤¢¤ê¤Þ¤¹¡£
 

½½¿ÊBASIC¤Î¥×¥í¥°¥é¥à¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§¥ÉÁÇ¿Í  Åê¹ÆÆü¡§2008ǯ12·î11Æü(ÌÚ)11»þ59ʬ5ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ½½¿ÊBASIC¤Çµ¼»÷Íð¿ô¤ò»È¤Ã¤¿¥×¥í¥°¥é¥à¤òºîÀ®¤·¤¿¤¤¤È»×¤Ã¤Æ¤¤¤Þ¤¹¡£ÂÇΨ¤Î¥Ç¡¼¥¿¤ò´ð¤Ë¡¢¤É¤¦¤¤¤¦Âǽç¤òÁȤá¤Ð¸úΨ¤è¤¯ÅÀ¤¬¼è¤ì¤ë¤Î¤«¤ò¡¢Íð¿ô¤òȯÀ¸¤µ¤»¤Æºî¤ê¤¿¤¤¤Î¤Ç¤¹¤¬¡¢¤É¤¦¤·¤¿¤é¤¤¤¤¤Ç¤·¤ç¤¦¤«¡©  

Re: ½½¿ÊBASIC¤Î¥×¥í¥°¥é¥à¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ12·î11Æü(ÌÚ)19»þ54ʬ8ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.154[¸µµ­»ö¤Ø]

¥ÉÁǿͤµ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

ÂǤä¿¡¢Á÷¤Ã¤¿¤Îñ½ã¤Ç¡¢5000»î¹ç¤ÎÊ¿¶Ñ¤òɽ¼¨¤·¤Þ¤¹¡£
£±»î¹ç¤´¤È¤ÎÆâÌõ¤Ï¡¢PRINTʸ¤ÎÃí¼á¤òºï½ü¤¹¤ì¤Ðɽ¼¨¤µ¤ì¤Þ¤¹¡£
¤¿¤À¤·¡¢5000²ó»î¹ç¤Îɽ¼¨¤Ë¤Ï»þ´Ö¤¬¤«¤«¤ê¤Þ¤¹¡£¡Ê¼ÂÍÑŪ¤Ç¤Ê¤¤¡Ë
!Âǽç¹Í»¡¤Î¤¿¤á¤Î¥·¥ß¥å¥ì¡¼¥·¥ç¥ó

DATA 0.2, 0.2, 0.3, 0.3, 0.3, 0.2, 0.2, 0.1, 0.1
!DATA 0.1, 0.2, 0.2, 0.3, 0.2, 0.1, 0.3, 0.2, 0.3
!DATA 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2
DIM D(9) !£¹¿Íʬ¤ÎÂÇΨ
MAT READ D

RANDOMIZE

LET N=5000 !»î¹ç¿ô
FOR x=1 TO N

   DIM SM(N) !Áí¹çÆÀÅÀ
   LET P=1 !Âǽç

   FOR w=1 TO 9 !£¹²ó¤Þ¤Ç

      LET B=0 !ÎݤξõÂÖ
      LET S1=0 !ÆÀÅÀ
      LET O=0
      DO UNTIL O=3 !£³¥¢¥¦¥È¤Þ¤Ç
      !PRINT P;"ÈÖÂǼԡ§";
         IF RND<D(P) THEN !¥Ò¥Ã¥È¤Ê¤é
            LET t=INT(RND*10)+1 !ĹÂÇΨ¤Ê¤É¡¡¢¨£±¡Á10
            SELECT CASE t
            CASE 1,2,3,4
               LET v=1
            CASE 5,6,7
               LET v=2
            CASE 8,9
               LET v=3
            CASE ELSE
               LET v=4
            END SELECT
            !PRINT v;"ÎÝÂÇ", !£±¡Á£´

            LET B=B*10+1 !vÎÝÂǤÇÁö¼Ô¤òÁ÷¤ë
            LET S1=S1+INT(B/10^3)
            LET B=MOD(B,10^3)
            FOR i=0 TO v-2
               LET B=B*10
               LET S1=S1+INT(B/10^3)
               LET B=MOD(B,10^3)
            NEXT i
         ELSE
            LET O=O+1
            !PRINT "¥¢¥¦¥È",
         END IF
         !PRINT USING "# %%%": S1,B !ÎݤξõÂÖ

         LET P=P+1 !¼¡¤Ø
         IF P>9 THEN LET P=1
      LOOP

      !PRINT w;"²ó";S1;"ÅÀ"
      !PRINT
      LET SM(w)=SM(w)+S1
   NEXT w

NEXT x


LET S=0 !ÆÀÅÀ¤ÎʬÉÛ
FOR w=1 TO 9
   PRINT w;"²ó";SM(w)/N;"ÅÀ"
   LET S=S+SM(w)
NEXT w
PRINT "Áí¹çÆÀÅÀ=";S/N


END
 

Re: ½½¿ÊBASIC¤Î¥×¥í¥°¥é¥à¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§¥ÉÁÇ¿Í  Åê¹ÆÆü¡§2008ǯ12·î15Æü(·î)16»þ11ʬ49ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.155[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

ÁÇÁᤤ¤ªÊÖ»ö¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£¤È¤Æ¤â½õ¤«¤ê¤Þ¤·¤¿¡£¤Þ¤¿¤ï¤«¤é¤Ê¤¤¤³¤È¤¬¤¢¤Ã¤¿¤éÅê¹Æ¤µ¤»¤Æ¤¤¤¿¤À¤­¤Þ¤¹¡£
 

Re: ½½¿ÊBASIC¤Î¥×¥í¥°¥é¥à¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2008ǯ12·î16Æü(²Ð)12»þ15ʬ34ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.154[¸µµ­»ö¤Ø]

¥ÉÁǿͤµ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

9¿Í¤Ç¤ÎÂǽç¤Ï 9!=362880Ä̤ꤢ¤ê¤Þ¤¹¤¬¡¢³ÆÂǽ礴¤È¤Ë1000»î¹ç¤ò¥·¥ß¥å¥ì¡¼¥È¤·¤Þ¤·¤¿¡£
»î¹ç¤Î¥·¥ß¥å¥ì¡¼¥·¥ç¥ó¤Ïñ½ã¤Ë¥Ò¥Ã¥È3ËܤÇ1ÅÀ¡¢°Ê²¼¥Ò¥Ã¥È1Ëܤ´¤È¤Ë1ÅÀÄɲá£
¼Â¹Ô¤Ë¤Ï2¿Ê¥â¡¼¥É¤ÇÌó2»þ´Ö20ʬ¤«¤«¤ê¤Þ¤·¤¿¡£
¤¿¤À¤·1000»î¹ç¤Ç¤Ï»î¹Ô²ó¿ô¤¬¾¯¤Ê¤¯¡¢¤È¤¯¤Ë³ÆÂǼԤÎÂÇΨ¤Î¥Ð¥é¤Ä¤­¤¬¾®¤µ¤¤¤È¤­¤Ï·ë²Ì¤Î¿®ÍêÀ­¤ÏÄ㤤¤È»×¤¤¤Þ¤¹¡£
¾å°Ì100°Ì¤ò½ÐÎϤ·¤Þ¤·¤¿¤¬¡¢¤¢¤¯¤Þ¤Ç¤â·¹¸þ¤òÃΤë¤Æ¤¤¤É¤À¤È¾µÃΤ·¤Æ²¼¤µ¤¤¡£

DECLARE EXTERNAL SUB perm
PUBLIC NUMERIC player,games,rank,total_point,worst_point
PUBLIC NUMERIC ave(9),best_order(100,9),best_point(100)
PRINT TIME$
LET t=TIME
LET player=9   ! 9!=362880Ä̤ê
LET games=1000 ! »î¹ç¿ô
LET rank=100   ! ¥é¥ó¥¯
MAT READ ave
DATA .460,.420,.380,.340,.300,.260,.220,.180,.140
!DATA .380,.360,.340,.320,.300,.280,.260,.240,.220
DIM a(player)
FOR i=1 TO player
   LET a(i)=i
NEXT i
MAT best_order=ZER
MAT best_point=ZER
LET total_point=0
LET worst_point=10*games
CALL perm(a,1)
FOR i=1 TO rank
   PRINT USING "No##  Âǽç" : i;
   FOR j=1 TO player
      PRINT best_order(i,j);
   NEXT j
   PRINT USING "  ´üÂÔÃÍ-%.### ÅÀ":best_point(i)/games
NEXT i
PRINT "ºÇÄã´üÂÔÃÍ =";worst_point/games;"ÅÀ"
PRINT "Ê¿¶Ñ =";total_point/(games*FACT(player));"ÅÀ"
PRINT TIME-t;"sec"
END

EXTERNAL SUB simulation(order())
LET sum_point=0
FOR i=1 TO games
   LET at_bat=0
   FOR inning=1 TO 9 ! 9²ó
      LET out_count=0
      LET hit=0
      DO
         IF ave(order(MOD(at_bat,player)+1))>RND THEN
            LET hit=hit+1
            IF hit>=3 THEN LET sum_point=sum_point+1
         ELSE
            LET out_count=out_count+1
         END IF
         LET at_bat=at_bat+1
      LOOP UNTIL out_count=3
   NEXT inning
NEXT i
LET total_point=total_point+sum_point
IF sum_point>best_point(rank) THEN ! ¥é¥ó¥¯ÉÕ¤±
   LET best_point(rank)=sum_point
   FOR j=1 TO player
      LET best_order(rank,j)=order(j)
   NEXT j
   FOR i=rank TO 2 STEP -1
      IF best_point(i)>best_point(i-1) THEN
         SWAP best_point(i),best_point(i-1)
         FOR j=1 TO player
            SWAP best_order(i,j),best_order(i-1,j)
         NEXT j
      ELSE
         EXIT SUB
      END IF
   NEXT i
ELSEIF sum_point<worst_point THEN
   LET worst_point=sum_point
END IF
END SUB

REM ½½¿ÊBASICźÉÕ"\BASICw32\SAMPLE\PERMUTAT.BAS"¤è¤ê
REM 1¡Án¤Î½çÎó¤ò¼­½ñ¼°½ç½ø¤ÇÀ¸À®¤¹¤ë¡£
EXTERNAL SUB perm(a(),n)
DECLARE EXTERNAL SUB simulation
IF n=player THEN
   CALL simulation(a)
ELSE
   FOR i=n TO player
      LET t=a(i)
      FOR j=i-1 TO n STEP -1
         LET a(j+1)=a(j)
      NEXT j
      LET a(n)=t
      CALL perm(a,n+1)
      LET t=a(n)
      FOR j=n TO i-1
         LET a(j)=a(j+1)
      NEXT j
      LET a(i)=t
   NEXT i
END IF
END SUB

No 1  Âǽç 2  1  3  4  6  5  7  9  8   ´üÂÔÃÍ 2.952 ÅÀ
No 2  Âǽç 3  4  1  2  5  6  9  8  7   ´üÂÔÃÍ 2.914 ÅÀ
No 3  Âǽç 4  3  5  1  2  6  8  7  9   ´üÂÔÃÍ 2.905 ÅÀ
No 4  Âǽç 6  3  4  1  2  5  9  8  7   ´üÂÔÃÍ 2.902 ÅÀ
No 5  Âǽç 7  6  3  2  1  5  4  8  9   ´üÂÔÃÍ 2.895 ÅÀ
No 6  Âǽç 3  1  2  4  5  6  7  9  8   ´üÂÔÃÍ 2.889 ÅÀ
No 7  Âǽç 1  5  4  3  2  6  9  8  7   ´üÂÔÃÍ 2.880 ÅÀ
No 8  Âǽç 4  1  3  2  5  6  8  9  7   ´üÂÔÃÍ 2.879 ÅÀ
No 9  Âǽç 4  2  3  1  5  6  8  9  7   ´üÂÔÃÍ 2.879 ÅÀ
No10  Âǽç 6  5  3  1  2  4  7  8  9   ´üÂÔÃÍ 2.879 ÅÀ
No11  Âǽç 2  5  4  1  3  6  7  9  8   ´üÂÔÃÍ 2.878 ÅÀ
No12  Âǽç 4  2  5  1  3  6  9  8  7   ´üÂÔÃÍ 2.875 ÅÀ
No13  Âǽç 1  2  5  4  3  7  6  9  8   ´üÂÔÃÍ 2.871 ÅÀ
No14  Âǽç 5  3  4  2  1  6  7  9  8   ´üÂÔÃÍ 2.870 ÅÀ
No15  Âǽç 5  4  2  1  3  9  7  8  6   ´üÂÔÃÍ 2.869 ÅÀ
No16  Âǽç 2  1  3  4  5  6  7  9  8   ´üÂÔÃÍ 2.867 ÅÀ
No17  Âǽç 4  2  3  1  5  6  9  8  7   ´üÂÔÃÍ 2.865 ÅÀ
No18  Âǽç 5  1  3  4  2  6  7  8  9   ´üÂÔÃÍ 2.865 ÅÀ
No19  Âǽç 2  3  4  5  1  7  6  8  9   ´üÂÔÃÍ 2.864 ÅÀ
No20  Âǽç 6  2  4  3  1  5  9  8  7   ´üÂÔÃÍ 2.864 ÅÀ
No21  Âǽç 3  6  4  1  2  8  9  5  7   ´üÂÔÃÍ 2.863 ÅÀ
No22  Âǽç 5  4  2  1  3  6  7  9  8   ´üÂÔÃÍ 2.862 ÅÀ
No23  Âǽç 6  2  1  4  3  7  9  5  8   ´üÂÔÃÍ 2.861 ÅÀ
No24  Âǽç 7  5  3  1  2  4  6  8  9   ´üÂÔÃÍ 2.861 ÅÀ
No25  Âǽç 3  1  2  5  4  6  7  9  8   ´üÂÔÃÍ 2.860 ÅÀ
No26  Âǽç 2  1  5  4  9  8  7  6  3   ´üÂÔÃÍ 2.859 ÅÀ
No27  Âǽç 2  3  1  4  5  6  8  9  7   ´üÂÔÃÍ 2.858 ÅÀ
No28  Âǽç 7  3  4  1  2  9  8  5  6   ´üÂÔÃÍ 2.857 ÅÀ
No29  Âǽç 2  4  1  3  5  7  6  8  9   ´üÂÔÃÍ 2.856 ÅÀ
No30  Âǽç 9  5  4  1  3  2  6  7  8   ´üÂÔÃÍ 2.856 ÅÀ
No31  Âǽç 2  1  5  3  4  7  6  9  8   ´üÂÔÃÍ 2.853 ÅÀ
No32  Âǽç 4  1  3  5  2  6  7  9  8   ´üÂÔÃÍ 2.852 ÅÀ
No33  Âǽç 4  1  5  3  2  9  7  8  6   ´üÂÔÃÍ 2.852 ÅÀ
No34  Âǽç 4  5  3  2  1  6  9  8  7   ´üÂÔÃÍ 2.852 ÅÀ
No35  Âǽç 2  5  1  4  3  6  9  7  8   ´üÂÔÃÍ 2.851 ÅÀ
No36  Âǽç 3  4  2  1  7  6  9  5  8   ´üÂÔÃÍ 2.850 ÅÀ
No37  Âǽç 5  3  4  2  1  6  9  8  7   ´üÂÔÃÍ 2.850 ÅÀ
No38  Âǽç 2  3  1  4  5  6  9  8  7   ´üÂÔÃÍ 2.849 ÅÀ
No39  Âǽç 4  2  3  5  1  6  7  9  8   ´üÂÔÃÍ 2.849 ÅÀ
No40  Âǽç 2  4  1  5  3  7  9  8  6   ´üÂÔÃÍ 2.848 ÅÀ
No41  Âǽç 5  7  4  1  3  2  8  9  6   ´üÂÔÃÍ 2.847 ÅÀ
No42  Âǽç 2  4  1  5  3  7  8  9  6   ´üÂÔÃÍ 2.846 ÅÀ
No43  Âǽç 4  3  2  1  5  7  8  9  6   ´üÂÔÃÍ 2.845 ÅÀ
No44  Âǽç 1  4  2  3  8  7  9  5  6   ´üÂÔÃÍ 2.844 ÅÀ
No45  Âǽç 4  3  1  2  5  6  9  7  8   ´üÂÔÃÍ 2.844 ÅÀ
No46  Âǽç 7  3  2  1  4  5  6  9  8   ´üÂÔÃÍ 2.844 ÅÀ
No47  Âǽç 4  2  3  1  5  9  7  8  6   ´üÂÔÃÍ 2.843 ÅÀ
No48  Âǽç 5  2  3  1  4  6  8  7  9   ´üÂÔÃÍ 2.843 ÅÀ
No49  Âǽç 5  3  2  4  1  7  6  8  9   ´üÂÔÃÍ 2.842 ÅÀ
No50  Âǽç 2  1  4  3  5  8  6  7  9   ´üÂÔÃÍ 2.841 ÅÀ
No51  Âǽç 4  6  3  1  2  8  5  9  7   ´üÂÔÃÍ 2.841 ÅÀ
No52  Âǽç 5  4  1  2  3  9  8  7  6   ´üÂÔÃÍ 2.841 ÅÀ
No53  Âǽç 2  4  3  1  5  8  9  6  7   ´üÂÔÃÍ 2.840 ÅÀ
No54  Âǽç 3  2  1  4  5  8  9  7  6   ´üÂÔÃÍ 2.840 ÅÀ
No55  Âǽç 9  2  3  4  1  5  6  7  8   ´üÂÔÃÍ 2.839 ÅÀ
No56  Âǽç 6  5  2  1  4  3  8  9  7   ´üÂÔÃÍ 2.838 ÅÀ
No57  Âǽç 7  3  6  1  2  4  5  8  9   ´üÂÔÃÍ 2.838 ÅÀ
No58  Âǽç 3  5  7  2  1  4  6  8  9   ´üÂÔÃÍ 2.837 ÅÀ
No59  Âǽç 4  3  1  2  7  5  8  9  6   ´üÂÔÃÍ 2.837 ÅÀ
No60  Âǽç 4  6  2  3  1  5  7  8  9   ´üÂÔÃÍ 2.837 ÅÀ
No61  Âǽç 4  6  3  2  1  5  8  9  7   ´üÂÔÃÍ 2.837 ÅÀ
No62  Âǽç 6  1  2  4  3  8  5  9  7   ´üÂÔÃÍ 2.837 ÅÀ
No63  Âǽç 2  4  3  1  5  8  6  9  7   ´üÂÔÃÍ 2.836 ÅÀ
No64  Âǽç 4  3  5  2  1  6  9  8  7   ´üÂÔÃÍ 2.836 ÅÀ
No65  Âǽç 4  5  1  2  3  6  7  9  8   ´üÂÔÃÍ 2.836 ÅÀ
No66  Âǽç 1  4  3  5  6  8  9  7  2   ´üÂÔÃÍ 2.835 ÅÀ
No67  Âǽç 4  3  1  2  5  6  9  8  7   ´üÂÔÃÍ 2.835 ÅÀ
No68  Âǽç 4  6  1  2  3  5  8  9  7   ´üÂÔÃÍ 2.835 ÅÀ
No69  Âǽç 5  4  1  3  6  9  8  7  2   ´üÂÔÃÍ 2.835 ÅÀ
No70  Âǽç 6  3  4  1  2  7  5  8  9   ´üÂÔÃÍ 2.835 ÅÀ
No71  Âǽç 1  3  2  4  6  9  8  5  7   ´üÂÔÃÍ 2.834 ÅÀ
No72  Âǽç 3  2  1  4  6  7  5  8  9   ´üÂÔÃÍ 2.834 ÅÀ
No73  Âǽç 4  1  3  2  5  6  7  8  9   ´üÂÔÃÍ 2.834 ÅÀ
No74  Âǽç 6  5  3  4  1  2  7  8  9   ´üÂÔÃÍ 2.834 ÅÀ
No75  Âǽç 7  4  5  1  2  3  6  9  8   ´üÂÔÃÍ 2.834 ÅÀ
No76  Âǽç 3  1  2  6  5  4  7  8  9   ´üÂÔÃÍ 2.833 ÅÀ
No77  Âǽç 6  1  2  3  4  5  8  9  7   ´üÂÔÃÍ 2.833 ÅÀ
No78  Âǽç 6  3  1  2  5  4  9  7  8   ´üÂÔÃÍ 2.833 ÅÀ
No79  Âǽç 7  3  6  1  2  5  4  8  9   ´üÂÔÃÍ 2.833 ÅÀ
No80  Âǽç 5  2  3  1  4  7  8  9  6   ´üÂÔÃÍ 2.832 ÅÀ
No81  Âǽç 7  4  5  3  1  2  6  8  9   ´üÂÔÃÍ 2.832 ÅÀ
No82  Âǽç 3  1  2  7  4  6  9  8  5   ´üÂÔÃÍ 2.831 ÅÀ
No83  Âǽç 3  1  4  2  7  8  9  6  5   ´üÂÔÃÍ 2.831 ÅÀ
No84  Âǽç 3  2  1  4  5  7  9  8  6   ´üÂÔÃÍ 2.831 ÅÀ
No85  Âǽç 5  3  1  2  4  6  9  7  8   ´üÂÔÃÍ 2.831 ÅÀ
No86  Âǽç 5  6  1  2  4  3  7  8  9   ´üÂÔÃÍ 2.831 ÅÀ
No87  Âǽç 6  3  4  1  2  7  5  9  8   ´üÂÔÃÍ 2.831 ÅÀ
No88  Âǽç 1  2  3  5  4  9  7  8  6   ´üÂÔÃÍ 2.830 ÅÀ
No89  Âǽç 2  5  1  3  4  7  9  8  6   ´üÂÔÃÍ 2.830 ÅÀ
No90  Âǽç 6  5  3  1  4  2  7  9  8   ´üÂÔÃÍ 2.830 ÅÀ
No91  Âǽç 6  9  3  4  2  1  5  7  8   ´üÂÔÃÍ 2.830 ÅÀ
No92  Âǽç 2  1  4  5  7  9  8  6  3   ´üÂÔÃÍ 2.829 ÅÀ
No93  Âǽç 5  1  4  3  2  7  9  8  6   ´üÂÔÃÍ 2.829 ÅÀ
No94  Âǽç 8  5  1  4  2  3  6  9  7   ´üÂÔÃÍ 2.829 ÅÀ
No95  Âǽç 1  2  3  4  6  9  8  7  5   ´üÂÔÃÍ 2.828 ÅÀ
No96  Âǽç 3  4  1  2  6  7  9  5  8   ´üÂÔÃÍ 2.828 ÅÀ
No97  Âǽç 1  3  5  2  4  6  7  8  9   ´üÂÔÃÍ 2.827 ÅÀ
No98  Âǽç 2  1  3  5  4  7  9  8  6   ´üÂÔÃÍ 2.827 ÅÀ
No99  Âǽç 3  4  1  2  5  6  7  9  8   ´üÂÔÃÍ 2.826 ÅÀ
No100 Âǽç 4  2  1  3  5  8  9  7  6   ´üÂÔÃÍ 2.826 ÅÀ

ºÇÄã´üÂÔÃÍ = 2.073 ÅÀ
Ê¿¶Ñ = 2.44374 ÅÀ
 

¥×¥í¥°¥é¥à¤Î½ñ¤­Ä¾¤·

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ12·î16Æü(²Ð)22»þ55ʬ17ÉÃ
ÊÖ¿®¡¦°úÍÑ
  UBASIC¤Ë¤è¤ë¼¡¤Î¥×¥í¥°¥é¥à¤ò½½¿ÊBASIC¤Ë½ñ¤­Ä¾¤·¤Æ¤â¤é¤¤¤¿¤¤¤Î¤Ç¤¹¤¬¡¢¤É¤Ê¤¿¤«¤è¤í¤·¤¯¤ª´ê¤¤¤¤¤¿¤·¤Þ¤¹¡£

10 !euler function
20 input "n=";M
30 Mw=M:Phi=1
40 repeat
50   P=prmdiv(Mw)
60   Phi*=P-1:Mw\=P
70   while Mw@P=0:Phi*=P:Mw\=P:wend
80 until Mw=1
90 print Phi
100 end


¥ª¥¤¥é¡¼´Ø¿ô¡Ê1 ¤«¤é n ¤Þ¤Ç¤Î¼«Á³¿ô¤Î¤¦¤Á n ¤È¸ß¤¤¤ËÁǤʤâ¤Î¤Î¸Ä¿ô¡Ë
¤òµá¤á¤ëÌÜŪ¤Ç¤¹¡£
 

Re: ¥×¥í¥°¥é¥à¤Î½ñ¤­Ä¾¤·

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ12·î17Æü(¿å)05»þ50ʬ56ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.158[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

!¡¡´Ø¿ô prmdiv() ¤ÎËÜÍè¤Ï¡¢ÁÇ¿ô¤Ç³ä¤Ã¤Æ¤¤¤¯¤è¤¦¤Ç¤¹¡£

! euler function
!------------------
INPUT PROMPT "n=":M
LET Mw=M
LET Phi=1
DO
   LET P=prmdiv(Mw)
   LET Phi=Phi*(P-1)
   LET Mw=INT(Mw/P)
   DO WHILE MOD(Mw,P)=0
      LET Phi=Phi*P
      LET Mw=INT(Mw/P)
   LOOP
LOOP UNTIL Mw=1
PRINT Phi

FUNCTION prmdiv(Mw) !£±¡ã¤ÎºÇ¾®¤ÎÌó¿ô
   FOR i=2 TO Mw
      IF MOD(Mw,i)=0 THEN EXIT FOR
   NEXT i
   LET prmdiv=i
END FUNCTION

END

¡ã¥×¥í¥°¥é¥à¤Î¾È¹çÍÑ¤Ë¡ä ¸¶Ê¸¤ò uBASIC ¤Ç¡¢¼Â¹Ô¤·¤¿·ë²Ì¡£
run
n=2~400
   1   2   2   4   2   6   4   6   4  10   4  12   6   8   8  16   6  18   8  12
  10  22   8  20  12  18  12  28   8  30  16  20  16  24  12  36  18  24  16  40
  12  42  20  24  22  46  16  42  20  32  24  52  18  40  24  36  28  58  16  60
  30  36  32  48  20  66  32  44  24  70  24  72  36  40  36  60  24  78  32  54
  40  82  24  64  42  56  40  88  24  72  44  60  46  72  32  96  42  60  40 100
  32 102  48  48  52 106  36 108  40  72  48 112  36  88  56  72  58  96  32 110
  60  80  60 100  36 126  64  84  48 130  40 108  66  72  64 136  44 138  48  92
  70 120  48 112  72  84  72 148  40 150  72  96  60 120  48 156  78 104  64 132
  54 162  80  80  82 166  48 156  64 108  84 172  56 120  80 116  88 178  48 180
  72 120  88 144  60 160  92 108  72 190  64 192  96  96  84 196  60 198  80 132
100 168  64 160 102 132  96 180  48 210 104 140 106 168  72 180 108 144  80 192
  72 222  96 120 112 226  72 228  88 120 112 232  72 184 116 156  96 238  64 240
110 162 120 168  80 216 120 164 100 250  72 220 126 128 128 256  84 216  96 168
130 262  80 208 108 176 132 268  72 270 128 144 136 200  88 276 138 180  96 280
  92 282 140 144 120 240  96 272 112 192 144 292  84 232 144 180 148 264  80 252
150 200 144 240  96 306 120 204 120 310  96 312 156 144 156 316 104 280 128 212
132 288 108 240 162 216 160 276  80 330 164 216 166 264  96 336 156 224 128 300
108 294 168 176 172 346 112 348 120 216 160 352 116 280 176 192 178 358  96 342
180 220 144 288 120 366 176 240 144 312 120 372 160 200 184 336 108 378 144 252
190 382 128 240 192 252 192 388  96 352 168 260 196 312 120 396 198 216 160
OK
 

Re: ¥×¥í¥°¥é¥à¤Î½ñ¤­Ä¾¤·

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2008ǯ12·î17Æü(¿å)10»þ56ʬ47ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.159[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£


> FUNCTION prmdiv(Mw) !£±¡ã¤ÎºÇ¾®¤ÎÌó¿ô
>    FOR i=2 TO Mw
>       IF MOD(Mw,i)=0 THEN EXIT FOR
>    NEXT i
>    LET prmdiv=i
> END FUNCTION



´Ø¿ôÄêµÁ¤ò²þÎɤ·¤Þ¤·¤¿¡£
°ú¿ô¤¬Â礭¤¯¡¢ºÇ¾®¤ÎÌó¿ô¤âÂ礭¤¤¤È¤­¸ú²Ì¤¬¤¢¤ê¤Þ¤¹¡£

FUNCTION prmdiv(Mw) !£±¡ã¤ÎºÇ¾®¤ÎÌó¿ô
   IF MOD(Mw,2)=0 THEN
      LET prmdiv=2
      EXIT FUNCTION
   ELSEIF MOD(Mw,3)=0 THEN
      LET prmdiv=3
      EXIT FUNCTION
   END IF
   FOR i=5 TO SQR(Mw) STEP 6
      IF MOD(Mw,i)=0 THEN
         LET prmdiv=i
         EXIT FUNCTION
      ELSEIF MOD(Mw,i+2)=0 THEN
         LET prmdiv=i+2
         EXIT FUNCTION
      END IF
   NEXT i
   LET prmdiv=Mw
END FUNCTION
 

¸ÇÍ­¥Ù¥¯¥È¥ë¤Î»»Ë¡

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ12·î17Æü(¿å)12»þ42ʬ29ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ¸ÇÍ­¥Ù¥¯¥È¥ë¤ò¹â®¤Ë»»½Ð¤¹¤ëÊýË¡¤ò¡¢¤´»ØƳ¤¯¤À¤µ¤¤¡£
¢¨¶á»÷ÃͤǤâ¤è¤¤¤Ç¤¹¡££Ã£Á£Ä¤Ê¤É¡¢¤«¤Ê¤ê®¤¤¤Ç¤¹¤¬¡¢
¡¡¤É¤ó¤Ê¥¢¥ë¥´¥ê¥º¥à¤¬¡¢»È¤ï¤ì¤Æ¤¤¤ë¤Î¤Ç¤·¤ç¤¦¤«¡£
 

Re: ¸ÇÍ­¥Ù¥¯¥È¥ë¤Î»»Ë¡

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ12·î17Æü(¿å)13»þ23ʬ36ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.161[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¤É¤Ê¤¿¤«¡¢¸ÇÍ­¥Ù¥¯¥È¥ë¤ò¹â®¤Ë»»½Ð¤¹¤ëÊýË¡¤ò¡¢¤´»ØƳ¤¯¤À¤µ¤¤¡£
> £Ã£Á£Ä¤Ê¤É¤Ï¡¢Â®¤¤¤Ç¤¹¤¬¡¢¤É¤ó¤Ê¥¢¥ë¥´¥ê¥º¥à¤¬¡¢»È¤ï¤ì¤Æ¤¤¤ë¤Î¤Ç¤·¤ç¤¦¤«¡£


¡¦ÂоιÔÎó
¡¡¥ä¥³¥ÓË¡

¥¢¥ë¥´¥ê¥º¥à¤ÎËܤ˷Ǻܤµ¤ì¤Æ¤¤¤ë¡£¼ê¸µ¤Ë¥³¡¼¥É¤Ê¤·¡£


¡¦ºÇÂç¤Î¸ÇÍ­ÃÍ¡¦¸ÇÍ­¥Ù¥¯¥È¥ë¤Î»»½Ð
¡¡¤Ù¤­¾èË¡¡Ê¥Ñ¥ï¡¼Ë¡¡Ë

¥¢¥ë¥´¥ê¥º¥à¤ÎËܤ˷Ǻܤµ¤ì¤Æ¤¤¤ë¡£
¿ôÃÍ·×»»¤ÎÀìÌç½ñ¤Ë¤Ï¡¢Ê£ÁÇ¿ô¤Ø¤Î³ÈÄ¥¤¬¤µ¤ì¤Æ¤¤¤ë¡£

!¤Ù¤­¾èË¡¤Ë¤è¤ë¹ÔÎó¤Î¸ÇÍ­ÃͤȸÇÍ­¥Ù¥¯¥È¥ë¤òµá¤á¤ë
!¢¨¸ÇÍ­Ãͤ¬£°¡¢½ÅÊ£¤¹¤ë¾ì¹ç¤ÏŬÍѤǤ­¤Ê¤¤¡£
!¢¨¼Â¿ô¤Î¸ÇÍ­ÃͤΤߡ£µõ¿ô¤ò´Þ¤à²ò¤ÏÆÀ¤é¤ì¤Ê¤¤¡£

!Ax=¦ËIx¡¢¦Ë:¸ÇÍ­ÃÍ¡¢x:¸ÇÍ­¥Ù¥¯¥È¥ë

LET N=3 !N¼¡ÀµÊý¹ÔÎó


DATA 2,1,-1 !¦Ë=3,2,1
DATA 0,3,0
DATA 0,2,1

!DATA 0,1,1 !¦Ë=2,1,0
!DATA -4,4,2
!DATA 4,-3,-1

!DATA 1,0,0 !¦Ë=1¡Ê£³½Åº¬¡Ë
!DATA 0,1,1
!DATA 0,0,1

DIM A(N,N) !¹ÔÎóA
MAT READ A
MAT PRINT A;


LET cEps=1e-6 !¸íº¹¡¡¢¨Ä´À°Íס¢Ã±ÀºÅÙ

DIM u(N) !¸ÇÍ­¥Ù¥¯¥È¥ë

DIM AA(N,N) !ºî¶ÈÍÑ
MAT AA=A
FOR s=1 TO N !sÈÖÌÜ
   CALL EigenPower(N,AA, lambda,u)
   PRINT "¸ÇÍ­ÃÍ=";lambda
   PRINT "¸ÇÍ­¥Ù¥¯¥È¥ë"
   MAT PRINT u;

   FOR i=1 TO N !»Äº¹¹ÔÎó¤òµá¤á¤Æ¡¢¼¡¤Ø
      FOR j=1 TO N
         LET AA(i,j)=AA(i,j)-lambda*u(i)*u(j)
      NEXT j
   NEXT i
NEXT s




DEF norm(v())=SQR(DOT(v,v)) !¥Î¥ë¥à

SUB EigenPower(N,A(,), lambda,u()) !¸ÇÍ­ÃÍ¡ÊÀäÂÐÃͺÇÂç¡Ë¡¢¸ÇÍ­¥Ù¥¯¥È¥ë¤òµá¤á¤ë
   DIM u0(100),u2(100) !¢¨ºÇÂç100¼¡

   MAT u=CON !½é´üÃÍ¡¡¢¨¥Î¥ë¥à¤¬£±
   MAT u=(1/norm(u))*u

   LET cMax=100
   FOR i=1 TO cMax !ºÇÂç²ó¿ô¤Þ¤Ç·«¤êÊÖ¤¹
      MAT u0=u !ľÁ°¤Îu

      MAT u=A*u0
      WHEN EXCEPTION IN
         MAT u=(1/norm(u))*u !Àµµ¬²½¤¹¤ë
      USE
         PRINT "£°¥Ù¥¯¥È¥ë¤Ë¤Ê¤ê¤Þ¤·¤¿¡£"
         STOP
      END WHEN

      MAT u2=u-u0 !¼ý«¤·¤¿¤«³Îǧ¤¹¤ë
      IF norm(u2)<cEps THEN EXIT FOR
      MAT u2=u+u0
      IF norm(u2)<cEps THEN EXIT FOR
   NEXT i
   IF i>cMax THEN
      PRINT "¼ý«¤·¤Þ¤»¤ó¡£"
      STOP
   END IF

   MAT u2=A*u
   LET lambda=DOT(u2,u)/DOT(u,u) !¸ÇÍ­ÃÍ
END SUB


END
 

Re: ¸ÇÍ­¥Ù¥¯¥È¥ë¤Î»»Ë¡

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ12·î17Æü(¿å)14»þ10ʬ15ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.162[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£

¤Ê¤¼¤³¤ó¤Ê¤â¤Î¤ò¡¢¤È¤¤¤¦¤Î¤Ï¡¢
¿®¹æ¥Ù¥¯¥È¥ë¤Î¼«¸ÊÁê´Ø¥Þ¥È¥ê¥¯¥¹¤Î¸ÇÍ­¥Ù¥¯¥È¥ë¤ò´ðÄì¤È¤·¤Æ¡¢¼ÌÁü¤·¤¿¿®¹æ¥Ù¥¯¥È¥ë¤¬¡¢
¿®¹æ¥Ù¥¯¥È¥ë¤Î°µ½Ì¤Î¸Â³¦¡Ê£Ë£Ì£ÔÊÑ´¹¡Ë¤Ë¤Ê¤ë¤Î¤ò¼Â¸³¤·¤è¤¦¤È¤¤¤¦¤â¤Î¤Ç¤¹¡£
¤Ç¤â¡¢¥ê¥¢¥ë¥¿¥¤¥à¤Ë¡¢£±£°£ø£±£°¤¯¤é¤¤¤Î¹ÔÎ󡡤Ȥ¤¤¦¤Î¤Ï¡¢¤­¤Ä¤¤¤Ç¤¹¡£
 

Re: ½½¿ÊBASIC¤Î¥×¥í¥°¥é¥à¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§¥ÉÁÇ¿Í  Åê¹ÆÆü¡§2008ǯ12·î17Æü(¿å)15»þ02ʬ48ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.155[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

ÃúÇ«¤Ë¥×¥í¥°¥é¥à¤ò·ÇºÜ¤·¤Æ¤¤¤¿¤À¤­¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
¤Ò¤È¤Ä¼ÁÌ䤬¤¢¤ë¤Î¤Ç¤¹¤¬¡¢¡Ö£±»î¹ç¤´¤È¤ÎÆâÌõ¤Ï¡¢PRINTʸ¤ÎÃí¼á¤òºï½ü¤¹¤ì¤Ðɽ¼¨¤µ¤ì¤Þ¤¹¡£¡×¤È½ñ¤¤¤Æ¤¢¤ëÉôʬ¤Ï¡¢¶ñÂÎŪ¤Ë¤Ï¤É¤ÎÉôʬ¤Î¤³¤È¤ò¤µ¤·¤Æ¤¤¤ë¤Î¤Ç¤·¤ç¤¦¤«¡©£±»î¹ç¤´¤È¤ÎÆâÌõ¤òÃΤꤿ¤¤¤Î¤Ç¤¼¤Ò¶µ¤¨¤Æ¤¤¤¿¤À¤±¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡©¤è¤í¤·¤¯¤ª´ê¤¤¤·¤Þ¤¹¡£
 

Re: ½½¿ÊBASIC¤Î¥×¥í¥°¥é¥à¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ12·î17Æü(¿å)15»þ42ʬ26ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.164[¸µµ­»ö¤Ø]

¥ÉÁǿͤµ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¤Ò¤È¤Ä¼ÁÌ䤬¤¢¤ë¤Î¤Ç¤¹¤¬¡¢¡Ö£±»î¹ç¤´¤È¤ÎÆâÌõ¤Ï¡¢PRINTʸ¤ÎÃí¼á¤òºï½ü¤¹¤ì¤Ðɽ¼¨¤µ¤ì¤Þ¤¹¡£¡×¤È½ñ¤¤¤Æ¤¢¤ëÉôʬ¤Ï¡¢¶ñÂÎŪ¤Ë¤Ï¤É¤ÎÉôʬ¤Î¤³¤È¤ò¤µ¤·¤Æ¤¤¤ë¤Î¤Ç¤·¤ç¤¦¤«¡©


!PRINT ¡Á¡¡¤Î·Á¤ÎÉôʬ¤Ç¤¹¡£½½¿ÊBASIC¤ÎÃí¼á¡Ê¥³¥á¥ó¥È¡Ë¤Ï´¶Ã²Éä¡Ê!¥Þ¡¼¥¯¡Ë¤Ç¤¹¡£

²¼µ­¤Ëºï½ü¤·¤¿¥×¥í¥°¥é¥à¤ò·ÇºÜ¤·¤Æ¤ª¤­¤Þ¤¹¡£

!Âǽç¹Í»¡¤Î¤¿¤á¤Î¥·¥ß¥å¥ì¡¼¥·¥ç¥ó

DATA 0.2, 0.2, 0.3, 0.3, 0.3, 0.2, 0.2, 0.1, 0.1
!DATA 0.1, 0.2, 0.2, 0.3, 0.2, 0.1, 0.3, 0.2, 0.3
!DATA 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2
DIM D(9) !£¹¿Íʬ¤ÎÂÇΨ
MAT READ D

RANDOMIZE

LET N=10 !»î¹ç¿ô¡¡¢¨Ä´À°Í×
FOR x=1 TO N
   PRINT !<----- ¤³¤³
   PRINT "***";x;"»î¹çÌÜ ***" !<----- ¤³¤³

   DIM SM(N) !Áí¹çÆÀÅÀ
   LET P=1 !Âǽç

   FOR w=1 TO 9 !£¹²ó¤Þ¤Ç

      LET B=0 !ÎݤξõÂÖ
      LET S1=0 !ÆÀÅÀ
      LET O=0
      DO UNTIL O=3 !£³¥¢¥¦¥È¤Þ¤Ç
         PRINT P;"ÈÖÂǼԡ§"; !<----- ¤³¤³
         IF RND<D(P) THEN !¥Ò¥Ã¥È¤Ê¤é
            LET t=INT(RND*10)+1 !ĹÂÇΨ¤Ê¤É¡¡¢¨£±¡Á10
            SELECT CASE t
            CASE 1,2,3,4
               LET v=1
            CASE 5,6,7
               LET v=2
            CASE 8,9
               LET v=3
            CASE ELSE
               LET v=4
            END SELECT
            PRINT v;"ÎÝÂÇ", !£±¡Á£´ <----- ¤³¤³

            LET B=B*10+1 !vÎÝÂǤÇÁö¼Ô¤òÁ÷¤ë
            LET S1=S1+INT(B/10^3)
            LET B=MOD(B,10^3)
            FOR i=0 TO v-2
               LET B=B*10
               LET S1=S1+INT(B/10^3)
               LET B=MOD(B,10^3)
            NEXT i
         ELSE
            LET O=O+1
            PRINT "¥¢¥¦¥È", !<----- ¤³¤³
         END IF
         PRINT USING "# %%%": S1,B !ÎݤξõÂÖ <----- ¤³¤³

         LET P=P+1 !¼¡¤Ø
         IF P>9 THEN LET P=1
      LOOP

      PRINT w;"²ó";S1;"ÅÀ" !<----- ¤³¤³
      PRINT !<----- ¤³¤³
      LET SM(w)=SM(w)+S1
   NEXT w

NEXT x


PRINT
LET S=0 !ÆÀÅÀ¤ÎʬÉÛ
FOR w=1 TO 9
   PRINT w;"²ó";SM(w)/N;"ÅÀ"
   LET S=S+SM(w)
NEXT w
PRINT "Áí¹çÆÀÅÀ=";S/N


END
 

Re: ½½¿ÊBASIC¤Î¥×¥í¥°¥é¥à¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§¥ÉÁÇ¿Í  Åê¹ÆÆü¡§2008ǯ12·î17Æü(¿å)15»þ52ʬ47ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.155[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¤¿¤Ó¤¿¤Ó¤¹¤ß¤Þ¤»¤ó¡£DATA¤Î¼¡¤Î¹Ô¤Ë½ñ¤¤¤Æ¤¢¤ë¡ªDATA¤Ï¤É¤Î¤è¤¦¤Ê°ÕÌ£¤¬¤¢¤ë¤Î¤Ç¤·¤ç¤¦¤«¡©¤³¤³¤Ë¤Ï¤É¤Î¤è¤¦¤Ê¥Ç¡¼¥¿¤ò½ñ¤­¹þ¤á¤Ð¤¤¤¤¤Î¤Ç¤·¤ç¤¦¤«¡©Ìµ¤¯¤Æ¤âÌäÂê¤Ï¤Ê¤¤¤Î¤Ç¤·¤ç¤¦¤«¡©
 

Re: ½½¿ÊBASIC¤Î¥×¥í¥°¥é¥à¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ12·î17Æü(¿å)16»þ23ʬ21ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.166[¸µµ­»ö¤Ø]

¥ÉÁǿͤµ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> DATA¤Î¼¡¤Î¹Ô¤Ë½ñ¤¤¤Æ¤¢¤ë¡ªDATA¤Ï¤É¤Î¤è¤¦¤Ê°ÕÌ£¤¬¤¢¤ë¤Î¤Ç¤·¤ç¤¦¤«¡©¤³¤³¤Ë¤Ï¤É¤Î¤è¤¦¤Ê¥Ç¡¼¥¿¤ò½ñ¤­¹þ¤á¤Ð¤¤¤¤¤Î¤Ç¤·¤ç¤¦¤«¡©Ìµ¤¯¤Æ¤âÌäÂê¤Ï¤Ê¤¤¤Î¤Ç¤·¤ç¤¦¤«¡©


´¶Ã²É䤫¤é»Ï¤Þ¤ë¹Ô¤Ç¤¹¤«¤é¡¢¤³¤Î¹ÔÁ´ÂΤÏÃí¼á¤¹¤Ê¤ï¤Á¡Ö¼Â¹Ô¤µ¤ì¤Ê¤¤Ê¸¡×¤È¤Ê¤ê¤Þ¤¹¡£
¤·¤¿¤¬¤Ã¤Æ¡¢¤¢¤Ã¤Æ¤â̵¤¯¤Æ¤âÌäÂê¤Ë¤Ê¤ê¤Þ¤»¤ó¡£


¤³¤ÎÃí¼á¹Ô¤òÊѹ¹¤¹¤ë¤³¤È¤Ç¡¢Ê̤Υѥ¿¡¼¥ó¤¬¤¹¤Ð¤ä¤¯³Îǧ¤Ç¤­¤Þ¤¹¡£¡Ê¥á¥â¤â·ó¤Í¤ë¡Ë

Îã

DATA ¥Ñ¥¿¡¼¥ó£± <---- ¤³¤³¤¬¼Â¹Ô¤µ¤ì¤ë
!DATA ¥Ñ¥¿¡¼¥ó£²
!DATA ¥Ñ¥¿¡¼¥ó£³

¤ò

!DATA ¥Ñ¥¿¡¼¥ó£±
DATA ¥Ñ¥¿¡¼¥ó£²  <---- ¤³¤³¤¬¼Â¹Ô¤µ¤ì¤ë
!DATA ¥Ñ¥¿¡¼¥ó£³

¤ÈÊѹ¹¤·¤Æ¡¢¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¡£
 

ÊüʪÀþ£Ù¡á£Ø¡°£²¤ÎÍøÍÑ

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ12·î17Æü(¿å)17»þ46ʬ1ÉÃ
ÊÖ¿®¡¦°úÍÑ
  Y=X^2 ¤ÎÊüʪÀþ¤Î»×¤ï¤ÌÍøÍѤǡ¢£²¤Ä¤Î¿ô¤Î¤«¤±»»¤Î·ë²Ì¤ò¼¡¤Îºî¿Þ¤Çµá¤á¤ë¤³¤È¤ò¤ä¤ì¤ë¤³¤È¤òÃΤê¤Þ¤·¤¿¡£
Î㡧£³¡ß£µ¡á£±£µ
¤Ç¤¢¤ë·×»»¤¬
ÊüʪÀþ¾å¤Ë£²ÅÀ£Á(-3,9)¤È£Â(5,25)¤ò¼è¤ê¡¢£Á¡¤£Â¤Î£²ÅÀ¤ò·ë¤ÖľÀþ¤¬£Ù¼´¤È¸ò¤ï¤ëÅÀ£Ð
¤òºî¿Þ¤Çµá¤á¤ë¡£
¤³¤Î£ÐÅÀ¤Î£ÙºÂɸ¤¬µá¤á¤ëÀѤÎÃͤòÃΤ餻¤ë¡£
°ìÈ̤ˣÁ(-a,(-a)^2),£Â(b,b^2)¤ò·ë¤ÖľÀþ¤¬£Ù¼´¤È¸ò¤ï¤ëÅÀ¤¬ÀÑa¡ßb¤ÎÃͤò¼¨¤¹¡£

¤³¤Î¸½¾Ý¤ò¥×¥í¥°¥é¥à¤Ë¤·¤Æ¡¢³ØÀ¸¤Ë²ò¤é¤»¤Æ³Îǧ¤·¤Æ¸«¤»¤ë¤â¤Î¤òºî¤Ã¤Æ夭¤¿¤¯Â¸¤¸¤Þ¤¹¡£
 

Re: ÊüʪÀþ£Ù¡á£Ø¡°£²¤ÎÍøÍÑ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ12·î17Æü(¿å)20»þ25ʬ11ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.168[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¤³¤Î¸½¾Ý¤ò¥×¥í¥°¥é¥à¤Ë¤·¤Æ¡¢³ØÀ¸¤Ë²ò¤é¤»¤Æ³Îǧ¤·¤Æ¸«¤»¤ë¤â¤Î¤òºî¤Ã¤Æ夭¤¿¤¯Â¸¤¸¤Þ¤¹¡£

ÊüʪÀþ¤òÉÁ²è¤Ç¤­¤ëÈϰϤ¬¸¶ÅÀ¶á˵¤Ë¸Â¤é¤ì¤Þ¤¹¤¬¡¢¡¢¡¢


ÊüʪÀþy=x^2¤ÈľÀþy=m*x+n¤Î£²¤Ä¤Î¸òÅÀA(a,?)¤ÈB(b,?)¤Ï¡¢£²¼¡ÊýÄø¼°x^2-m*x-n=0¤ò²ò¤±¤Ð¤è¤¤¡£
²ò¤È·¸¿ô¤È¤Î´Ø·¸¤«¤é¡¢a*b=-n¡¢a+b=m¡£

a+b¤â·×»»¤Ç¤­¤ë!?¡¡·¹¤­!?

DEF f(x)=x^2 !´Ø¿ôy=x^2
DEF g(x,a,b)=(f(b)-f(a))/(b-a)*(x-a)+f(a) !ÅÀA¤ÈÅÀB¤òÄ̤ëľÀþ

LET a=-2
LET b=4

SET bitmap SIZE 300,600
SET WINDOW -10,10,-20,20 !ɽ¼¨Îΰè
DRAW grid !ºÂɸ

FOR x=-10 TO 10 STEP 0.2 !ÊüʪÀþy=x^2¤òÉÁ¤¯
   PLOT LINES: x,f(x);
NEXT x
PLOT LINES

SUB ten(x,y,s$)
   PLOT TEXT ,AT x+0.4,y: s$
   DRAW disk WITH SCALE(0.2)*SHIFT(x,y)
END SUB
CALL ten(-a,f(-a),"A")
CALL ten(b,f(b),"B")

FOR x=-10 TO 10 STEP 0.2 !ľÀþ¤òÉÁ¤¯
   PLOT LINES: x,g(x,-a,b);
NEXT x
PLOT LINES

CALL ten(0,g(0,-a,b),"P") !yÀÚÊÒ


PRINT g(0,-a,b), a*b !¸¡»»



DEF h(a,b)=(f(b)-f(a))/(b-a) !·¹¤­
PRINT h(a,b), a+b


END
 

ÊüʪÀþ¤ÇÍ·¤Ö

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ12·î18Æü(ÌÚ)07»þ21ʬ0ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ·ÇºÜ¤·¤Æ¤â¤é¤Ã¤¿¥×¥í¥°¥é¥à¤ò»²¹Í¤Ë¤µ¤»¤Æ夤¤Æ¡¢»ä¤Ê¤ê¤Ë¤ä¤Ã¤Æ¸«¤¿¤«¤Ã¤¿¸½¾Ý¤òºî¤Ã¤Æ¤ß¤Þ¤·¤¿¡£
´¶³Ð¤È¤·¤Æ¡¢·×»»¼Ü¤Ç·×»»¤·¤Æ¤¤¤ë¤è¤¦¤ÊÊ·°Ïµ¤¤¬½Ð¤Þ¤¹¡£
£±£²£³£´£µ£¶£·£¹¡ß£¶£³
¤Ê¤É¤Î·×»»¤ò¤ª³Ú¤·¤ß¤¯¤À¤µ¤¤¡£



10 DEF f(x)=x^2 !´Ø¿ôy=x^2
20 DEF g(x,a,b)=(f(b)-f(a))/(b-a)*(x-a)+f(a) !ÅÀA¤ÈÅÀB¤òÄ̤ëľÀþ
30 INPUT PROMPT "2¿ô¤òÁª¤Ö":x,y
40 LET x1=INT(LOG10(x))
50 LET y1=INT(LOG10(y))
60 LET x=x/10^x1
70 LET y=y/10^y1
80 LET a=x
90 LET b=y
100 IF a>b THEN LET t=a ELSE LET t=b
110 SET bitmap SIZE 300,600
120 SET WINDOW -(t+1),t+1,-2,(t+1)^2+5 !ɽ¼¨Îΰè
130 DRAW grid !ºÂɸ
140 FOR x=-10 TO 10 STEP 0.2 !ÊüʪÀþy=x^2¤òÉÁ¤¯
150    PLOT LINES: x,f(x);
160 NEXT x
170 PLOT LINES
180 SUB ten(x,y,s$)
190    PLOT TEXT ,AT x+0.4,y: s$
200    DRAW disk WITH SCALE(0.2)*SHIFT(x,y)
210 END SUB
220 CALL ten(-a,f(-a),"A")
230 CALL ten(b,f(b),"B")
240 FOR x=-10 TO 10 STEP 0.2 !ľÀþ¤òÉÁ¤¯
250    PLOT LINES: x,g(x,-a,b);
260 NEXT x
270 PLOT LINES
280 CALL ten(0,g(0,-a,b),"P") !yÀÚÊÒ
290 PRINT "YÀÚÊÒ¤ÎÃÍ";g(0,-a,b);
300 PRINT "·×»»·ë²Ì"; a*b*10^(x1+y1) !¸¡»»
310 DEF h(a,b)=(f(b)-f(a))/(b-a) !·¹¤­
320 !PRINT h(a,b), a+b
330 END
 

Re: ¥×¥í¥°¥é¥à¤Î½ñ¤­Ä¾¤·

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ12·î18Æü(ÌÚ)15»þ43ʬ28ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.158[¸µµ­»ö¤Ø]

UBASIC¤ÎÀ°¿ôÏÀ´ØÏ¢¤ÎÁȹþ¤ß´Ø¿ô¤ò°Ü¿¢¤·¤Þ¤·¤¿¡£

!RSA¸ø³«¸°°Å¹æ¤Î·×»»

PRINT modpow(1371,1241,2279) !1371¤ò°Å¹æ²½¤¹¤ë¡£¸ø³«¸°43*53=2279¤È1241

PRINT eul(2279) !=2184¡¢43¤È53¤È2184¤ÏÈëÌ©
PRINT gcd(43,53) !¸ß¤¤¤ËÁÇ
PRINT gcd(2184,1241) !¸ß¤¤¤ËÁÇ

PRINT modinv(1241,2184) !ÈëÌ©¸°1649

PRINT modpow(2003,1649,2279) !2003¤òÊ£¹ç²½¤¹¤ë


!£î¤Î£±¤è¤êÂ礭¤ÊºÇ¾®¤ÎÌó¿ô
PRINT prmdiv(1234567) !127
PRINT prmdiv(23456789) !23456789
!PRINT prmdiv(11111111111111111) !2071723


!ÁÇ¿ô¤ÎÀ¸À®
PRINT prm(100) !541
PRINT nxtprm(999) !prm(1000)=7919
!PRINT nxtprm(9999) !prm(10000)=104729


!¥ª¥¤¥é¡¼´Ø¿ô¡Ê£±¤«¤é£î¤Þ¤Ç¤Î¼«Á³¿ô¤Î¤¦¤Á£î¤È¸ß¤¤¤ËÁǤʤâ¤Î¤Î¸Ä¿ô¡Ë
FOR N=2 TO 100
   LET S=0
   FOR i=1 TO N-1
      IF GCD(N,i)=1 THEN LET S=S+1
   NEXT i
   PRINT N;S, eul(N)
NEXT N


FOR i=2 TO 100
   PRINT USING "#### #### #### ####": i,fnSigma(i),eul(i),moeb(i)
NEXT i


END



!À°¿ôÏÀ´ØÏ¢¡¡¢¨ubasic¤è¤ê

EXTERNAL FUNCTION prmdiv(n) !£±¤è¤êÂ礭¤ÊºÇ¾®¤ÎÌó¿ô
IF MOD(n,2)=0 THEN !£²¤ÎÇÜ¿ô
   LET prmdiv=2
ELSEIF MOD(n,3)=0 THEN !£³¤ÎÇÜ¿ô
   LET prmdiv=3
ELSE
   FOR i=5 TO SQR(n) STEP 6
   !!!FOR i=5 TO INTSQR(n) STEP 6 !<----- ¢¨Í­Íý¿ô¥â¡¼¥É
      IF MOD(n,i)=0 THEN !5,11,17,23,29,¡Ä
         LET prmdiv=i
         EXIT FUNCTION
      ELSEIF MOD(n,i+2)=0 THEN !7,13,19,25,31,¡Ä
         LET prmdiv=i+2
         EXIT FUNCTION
      END IF
   NEXT i
   LET prmdiv=n !¤½¤Î¿ô¼«¿È
END IF
END FUNCTION

EXTERNAL FUNCTION eul(n) !¥ª¥¤¥é¡¼´Ø¿ô ¦Õ(n)¡Ê£±¤«¤é£î¤Þ¤Ç¤Î¼«Á³¿ô¤Î¤¦¤Á£î¤È¸ß¤¤¤ËÁǤʤâ¤Î¤Î¸Ä¿ô¡Ë
LET t=n
IF MOD(n,2)=0 THEN
   LET t=t/2
   DO
      LET n=n/2
   LOOP WHILE MOD(n,2)=0
END IF
LET d=3
DO WHILE n/d>=d
   IF MOD(n,d)=0 THEN
      LET t=t/d*(d-1)
      DO
         LET n=n/d
      LOOP WHILE MOD(n,d)=0
   END IF
   LET d=d+2
LOOP
IF n>1 THEN LET t=t/n*(n-1)
LET eul=t
END FUNCTION

EXTERNAL FUNCTION moeb(n) !¥á¥Ó¥¦¥¹´Ø¿ô ¦Ì(n)
LET W=1
DO WHILE n>1
   LET P=prmdiv(n)
   IF MOD(n,P^2)=0 THEN
      LET W=0
      EXIT DO
   END IF
   LET W=-W
   LET n=INT(n/P)
LOOP
LET moeb=W
END FUNCTION

EXTERNAL FUNCTION modpow(a,b,n) !a^b¢áx mod n ¤Îx¤òÊÖ¤¹
IF b=0 THEN
   LET modpow=1
ELSE
   LET S=1
   DO WHILE b>0
      IF MOD(b,2)=1 THEN LET S=MOD(S*a,n) !¥Ó¥Ã¥È¤¬£±¤Ê¤é·×»»¤¹¤ë
      LET b=INT(b/2) !¤Ù¤­¾èb¤ò£²¿ÊŸ³«¤¹¤ë
      LET a=MOD(a*a,n)
   LOOP
END IF
LET modpow=S
END FUNCTION

EXTERNAL FUNCTION modinv(a,n) !n¤òË¡¤È¤·¤¿a¤ÎµÕ¸µ¡¡a*x (mod n)=1
LET M=n
LET Sa=1
LET Ta=0
DO WHILE M<>0
   LET Q=INT(a/M)
   LET U=a-Q*M
   LET Ua=Sa-Q*Ta
   LET a=M
   LET Sa=Ta
   LET M=U
   LET Ta=Ua
LOOP
IF a<>1 THEN
   LET modinv=0
ELSE
   IF Sa<0 THEN LET Sa=Sa+n
   LET modinv=Sa
END IF
END FUNCTION

EXTERNAL FUNCTION prm(n) !nÈÖÌܤÎÁÇ¿ô¡¡¢¨n¤Ï£±°Ê¾å
DIM prime(n) !ÁÇ¿ôÎó
LET prime(1)=2 !£±ÈÖÌܤϣ²
LET k=2 !kÈÖÌÜ
LET x=1 !¸¡¾Ú¤¹¤ë¼«Á³¿ô
DO WHILE k<=n !NÈÖÌܤޤÇ
   LET x=x+2 !´ñ¿ô¤¬ÂоÝ
   LET j=1 !¸«¤Ä¤«¤Ã¤¿ÁÇ¿ô¤ÎÇÜ¿ô¤«¤É¤¦¤«³Îǧ¤¹¤ë
   DO WHILE j<k AND MOD(x,prime(j))<>0 !ÇÜ¿ô¤Ê¤éÅÓÃæ¤Ç½ªÎ»
      LET j=j+1
   LOOP
   IF j=k THEN !¿·¤·¤¯¸«¤Ä¤«¤Ã¤¿ÁÇ¿ô¤òµ­Ï¿¤¹¤ë
      LET prime(k)=x
      LET k=k+1
   END IF
LOOP
LET prm=prime(n)
END FUNCTION

EXTERNAL FUNCTION nxtprm(n) !n+1ÈÖÌܤÎÁÇ¿ô
LET nxtprm=prm(n+1)
END FUNCTION

EXTERNAL FUNCTION gcd(a,b) !ºÇÂç¸øÌó¿ô
DO UNTIL b=0
   LET t=b
   LET b=MOD(a,b)
   LET a=t
LOOP
LET gcd=a
END FUNCTION

EXTERNAL FUNCTION lcm(a,b) !ºÇ¾®¸øÇÜ¿ô
LET lcm=a*b/gcd(a,b)
END FUNCTION


!¥æ¡¼¥¶¡¼ÄêµÁ

EXTERNAL FUNCTION fnSigma(n) !Ìó¿ô¤ÎÏ ¦Ò(n)
LET S=1
DO WHILE n>1
   LET W=1
   LET P=prmdiv(n)
   DO
      LET W=W*P+1
      LET n=INT(n/P)
   LOOP WHILE MOD(n,P)=0
   LET S=S*W
LOOP
LET fnSigma=S
END FUNCTION
 

Re: ¥×¥í¥°¥é¥à¤Î½ñ¤­Ä¾¤·

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ12·î18Æü(ÌÚ)19»þ29ʬ52ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.171[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> UBASIC¤ÎÀ°¿ôÏÀ´ØÏ¢¤ÎÁȹþ¤ß´Ø¿ô¤ò°Ü¿¢¤·¤Þ¤·¤¿¡£

ËÜ¡ÊUBASIC¤Ë¤è¤ë¥³¥ó¥Ô¥å¡¼¥¿À°¿ôÏÀ¡§ÌÚÅÄÍ´»Ê¡¦ËÒÌî·éÉ×Ãø¡ãÆüËÜɾÏÀ¼Ò¡ä¡Ë
¤ÇÊÙ¶¯¤·¤Æ¤¤¤Æ¤ëºÇÃæ¤Ë¡¢¤³¤ÎÃæ¤Ç»È¤ï¤ì¤Æ¤¤¤ë´Ø¿ô¤¬½½¿Êbasic¤Ç¤â»È¤¨¤¿¤é¤Ê¤È»×¤Ã¤Æ¤¤¤ë½ê¤Ë¡¢»³Ã椵¤ó¤«¤é´ê¤Ã¤Æ¤â¤Ê¤¤°Ü¿¢¤Î¥×¥í¥°¥é¥à¤òÄ󶡤·¤Æ夤¤¿¤È¤³¤í¤Ç¤·¤¿¡£

À°¿ôÏÀ¤Ï¤ä¤ì¤Ð¤ä¤ë¤À¤±±ü¿¼¤µ¤¬´¶¤¸¤é¤ì¡¢¥¬¥¦¥¹¤ä¥ª¥¤¥é¡¼¤Ê¤É̾¤À¤¿¤ëÅ·ºÍ¤¬ºÇ¤â¼æ¤­¤Ä¤±¤é¤ì¤¿Ì¥ÎϤ¬Àø¤ó¤Ç¤¤¤ë¤³¤È¤¬¤ª¤Ü¤í¤²¤Ê¤¬¤é±®¤¤ÃΤì¤Þ¤¹¡£
Åö»þ¡¢¥³¥ó¥Ô¥å¡¼¥¿¤È¤¤¤¦Æ»¶ñ̵¤·¤Ëľ´¶¡ÊÎî´¶¡©¡Ë¤òƯ¤«¤»¤ÆÇظå¤ËÀø¤à¿ÀÈ뤵¤Ë¿´¤òÃ¥¤ï¤ì¤Æ¤¤¤Ã¤¿Àè¿Í¤¿¤Á¤Î´¶Æ°¤ò¸½Âå¤ÎËâË¡¤Î¥Þ¥·¡¼¥ó¤òÍøÍѤ·¤ÆË޿ͤǤâºÆ·Ð¸³¤·¤Æ¹Ô¤­¤¿¤¤¤È»×¤Ã¤Æ¤¤¤Þ¤¹¡£
¤Ê¤Ë¤»ÆȳؤǤä¤Ã¤Æ¤¤¤Þ¤¹¤Î¤Ç¸í²ò¤ä²ó¤êÆ»¤ò¤·¤Æ¤¤¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£

À°¿ôÏÀ¤òï¤Ë¤Ç¤âÍý²ò¤·¤Æ¤¤¤±¤ë¤è¤¦¤Ë¥³¥ó¥Ô¥å¡¼¥¿¥×¥í¥°¥é¥à¤òÁȤó¤Ç¤¤¤¯»ö¤Ï¤È¤Æ¤âÂçÀÚ¤ÊʬÌî¤Ç¤Ï¤Ê¤¤¤«¤È»×¤¦¼¡Âè¤Ç¤¹¡£
¤³¤ÎʬÌî¤Î½ñÀÒ¤¬¤¢¤Þ¤ê̵¤¤¤è¤¦¤Ë´¶¤¸¤Þ¤¹¡£¡Ê»ä¤ÎÉÔÊÙ¶¯¤«¤â¤·¤ì¤Þ¤»¤ó¤¬¡¦¡¦¡¦¡Ë
À°¿ôÏÀ¤Ç»È¤ï¤ì¤ë¤¤¤í¤¤¤í¤Ê´Ø¿ô¤òEXTERNAL FUNCTION ¤È¤·¤ÆÆ»¶ñÈ¢¤Ë¤¤¤ì¤Æ¤ª¤±¤Ð¡¢¤¤¤í¤¤¤í¤Ê¸½¾Ý¤òºÆ¸½¤Ç¤­¤ë²ÄǽÀ­¤¬½Ð¤Æ¤­¤Þ¤¹¡£
¤³¤ó¤ÊÆ»¶ñ¤¬¤¢¤Ã¤¿¤éÊØÍø¤À¤í¤¦¤Ê¤È´¶¤¸¤Þ¤·¤¿¤é¤ªÍê¤ß¤·¤Þ¤¹¤Î¤Ç¤è¤í¤·¤¯¤ª´ê¤¤¤·¤Þ¤¹¡£
¤Þ¤¿¡¢¤³¤ÎʬÌî¤Ç¶Ã¤¯¤Ù¤­¼°¤ä·ëÏÀ¤ò¤´Â¸ÃΤǤ·¤¿¤é¤¼¤Ò¤È¤â¤ª¶µ¤¨¤¯¤À¤µ¤¤¡£
 

Re: ¥×¥í¥°¥é¥à¤Î½ñ¤­Ä¾¤·

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2008ǯ12·î19Æü(¶â)12»þ24ʬ41ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.171[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£


> !ÁÇ¿ô¤ÎÀ¸À®
> PRINT prm(100) !541
> PRINT nxtprm(999) !prm(1000)=7919
> !PRINT nxtprm(9999) !prm(10000)=104729
>
> EXTERNAL FUNCTION prm(n) !nÈÖÌܤÎÁÇ¿ô¡¡¢¨n¤Ï£±°Ê¾å
> DIM prime(n) !ÁÇ¿ôÎó
> LET prime(1)=2 !£±ÈÖÌܤϣ²
> LET k=2 !kÈÖÌÜ
> LET x=1 !¸¡¾Ú¤¹¤ë¼«Á³¿ô
> DO WHILE k<=n !NÈÖÌܤޤÇ
>    LET x=x+2 !´ñ¿ô¤¬ÂоÝ
>    LET j=1 !¸«¤Ä¤«¤Ã¤¿ÁÇ¿ô¤ÎÇÜ¿ô¤«¤É¤¦¤«³Îǧ¤¹¤ë
>    DO WHILE j<k AND MOD(x,prime(j))<>0 !ÇÜ¿ô¤Ê¤éÅÓÃæ¤Ç½ªÎ»
>       LET j=j+1
>    LOOP
>    IF j=k THEN !¿·¤·¤¯¸«¤Ä¤«¤Ã¤¿ÁÇ¿ô¤òµ­Ï¿¤¹¤ë
>       LET prime(k)=x
>       LET k=k+1
>    END IF
> LOOP
> LET prm=prime(n)
> END FUNCTION
>
> EXTERNAL FUNCTION nxtprm(n) !n+1ÈÖÌܤÎÁÇ¿ô
> LET nxtprm=prm(n+1)
> END FUNCTION


nÈÖÌܤÎÁÇ¿ô¤òÊÖ¤¹´Ø¿ô¤ò²þÎɤ·¤Þ¤·¤¿¡£
prm(10000)¤Ê¤é¤Ð5Éá¢prm(100000)¤Ê¤é¤Ð35Éäۤɤǵá¤Þ¤ê¤Þ¤¹¡£
prm(5761455)=99999989(10^8°Ê²¼ºÇÂçÁÇ¿ô) ¤òµá¤á¤ë¤Ë¤Ï2¿Ê¥â¡¼¥É¤ÇÌó37ʬ¤Ç¤¹¡£

EXTERNAL FUNCTION prm(n) ! nÈÖÌܤÎÁÇ¿ô
DIM prime(n)
FOR i=1 TO MIN(n,10)
   READ prime(i)
NEXT i
DATA 2,3,5,7,11,13,17,19,23,29
FOR i=11 TO n
   LET m30=MOD(prime(i-1),30)
   IF m30=1 OR m30=23 THEN LET a=prime(i-1)+6 ELSE LET a=prime(i-1)-2*MOD(m30,3)+6
   DO
      LET sqra=SQR(a)
      FOR j=4 TO i-1
         IF MOD(a,prime(j))=0 THEN EXIT FOR
         IF prime(j)>=sqra THEN
            LET prime(i)=a
            EXIT DO
         END IF
      NEXT j
      LET m30=MOD(a,30)
      IF m30=1 OR m30=23 THEN LET a=a+6 ELSE LET a=a-2*MOD(m30,3)+6
   LOOP
NEXT i
LET prm=prime(n)
END FUNCTION
 

Re: ¥×¥í¥°¥é¥à¤Î½ñ¤­Ä¾¤·

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ12·î19Æü(¶â)16»þ34ʬ17ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.173[¸µµ­»ö¤Ø]

¹ÓÅĹÀÆ󤵤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

>  nÈÖÌܤÎÁÇ¿ô¤òÊÖ¤¹´Ø¿ô¤ò²þÎɤ·¤Þ¤·¤¿¡£

½õ¤«¤ê¤Þ¤¹¡£ÁÇ¿ô¤òÁÇÁ᤯°·¤¦¤«¤¬¤³¤Î¼ê¤Î¥×¥í¥°¥é¥à¤Ë¤ÏɬÍפǤ¹¤Í¡£

nxtprm(x)´Ø¿ô¤Ï¡¢´Ö°ã¤Ã¤Æ¤¤¤Þ¤·¤¿¤Î¤Çº¹¤·Âؤ¨¤Æ¤ª¤­¤Þ¤¹¡£
EXTERNAL FUNCTION nxtprm(x) !x¤è¤êÂ礭¤¤ÁÇ¿ô¤ÎºÇ¾®¤Î¤â¤Î
   DIM prime(x)

   FOR i=1 TO 10 !ºÇ½é¤Î10¸Ä
      READ prime(i)
      IF x<prime(i) THEN
         LET nxtprm=prime(i)
         EXIT FUNCTION
      END IF
   NEXT i
   DATA 2,3,5,7,11,13,17,19,23,29

   FOR i=11 TO INT(x) !11¸ÄÌܰʹß
      LET m30=MOD(prime(i-1),30)
      IF m30=1 OR m30=23 THEN LET a=prime(i-1)+6 ELSE LET a=prime(i-1)-2*MOD(m30,3)+6
      DO
         LET sqra=SQR(a)
         !!!LET sqra=INTSQR(a) !<----- ¢¨Í­Íý¿ô¥â¡¼¥É
         FOR j=4 TO i-1
            IF MOD(a,prime(j))=0 THEN EXIT FOR
            IF prime(j)>=sqra THEN
               LET prime(i)=a
               EXIT DO
            END IF
         NEXT j
         LET m30=MOD(a,30)
         IF m30=1 OR m30=23 THEN LET a=a+6 ELSE LET a=a-2*MOD(m30,3)+6
      LOOP

      IF x<prime(i) THEN
         LET nxtprm=prime(i)
         EXIT FUNCTION
      END IF
   NEXT i

   PRINT "¸«¤Ä¤«¤ê¤Þ¤»¤ó¡£"
   STOP
END FUNCTION



¡üprm(n)´Ø¿ô¤ò»È¤Ã¤¿¤â¤Î¤òÄɲ䷤Ƥª¤­¤Þ¤¹¡£¡ÊÄêµÁºÑ¤ß¤Î¥µ¥Ö¥ë¡¼¥Á¥ó¤Ï¾Êά¡Ë
!ÁÇ¿ô¤Î¸Ä¿ô
!PRINT fnPrimePi(77777)


!¸¶»Ïº¬ genshi3
FOR LP=1 TO 100
   LET P=prm(LP) !ºÇ½é¤Î100¸Ä¤ÎÁÇ¿ô¤ËÂФ·¤Æ

   PRINT USING "##### ### |": P,fnGenshi(P);
   IF MOD(LP,5)=0 THEN PRINT
NEXT LP
PRINT


!¸¶»Ïº¬ genshi2
FOR LP=1 TO 100
   LET P=prm(LP) !ºÇ½é¤Î100¸Ä¤ÎÁÇ¿ô¤ËÂФ·¤Æ

   LET G=1
   IF P<>2 THEN
50       LET G=G+1
         LET W=1
         FOR i=1 TO P-2
            LET W=MOD(W*G,P)
            IF W=1 THEN GOTO 50
         NEXT i
      END IF

      PRINT USING "##### ### |": P,G;
      IF MOD(LP,5)=0 THEN PRINT
   NEXT LP
   PRINT


END


EXTERNAL FUNCTION fnPrimePi(X) !¼Â¿ôx¤ËÂФ·x°Ê²¼¤ÎÁÇ¿ô¤Î¸Ä¿ô
   LET S=1
   LET E=10000 !100,000°Ê²¼¤ÎÁÇ¿ô¤Ï10,000¸Ä̤Ëþ¤À¤«¤é¡¡¢¨
   DO WHILE E>S+1
      LET K=INT((S+E)/2) !£²Ê¬Ãµº÷
      IF prm(K)<=X THEN LET S=K ELSE LET E=K
   LOOP
   LET fnPrimePi=S
END FUNCTION

EXTERNAL FUNCTION fnGenshi(P) !¸¶»Ïº¬
   LET G=1
   LET N=P-1
   IF P<>2 THEN
180    LET G=G+1
       LET Nw=N
       DO
          LET Div=prmdiv(Nw)
          DO WHILE MOD(Nw,Div)=0
             LET Nw=INT(Nw/Div)
          LOOP
          IF modpow(G,INT(N/Div),P)=1 THEN GOTO 180
       LOOP UNTIL Nw=1
    END IF
    LET fnGenshi=G
 END FUNCTION
 

uBASIC ¤«¤é¤Î¡¢°Ü¿¢

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ12·î19Æü(¶â)17»þ30ʬ43ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  !
! uBASIC ¤«¤é¤Î¡¢°Ü¿¢¡£¢¨¸¶Ëܤϡ¢¥³¥³¤Ë¤¢¤ê¤Þ¤¹¡£(¤½¤Î¾¡¢Â¿¿ôƱº­)
!  http://www.rkmath.rikkyo.ac.jp/~kida/ubgraph.lzh

!  ¥¢¥¹¥­¡¼¡¦¥»¡¼¥Ö ¤·¤Ê¤ª¤·¤¿¤â¤Î¡£
!  http://homepage2.nifty.com/neutro/asm/ubgraph(ASC).lzh

! MAZE.UB
!---------------------------------
!¡¡ÌÂÏ©¤òºî¤ë
!¡¡Pascal version from
!¡¡±ü¼À²É§¡¡¥³¥ó¥Ô¥å¡¼¥¿¥¢¥ë¥´¥ê¥º¥à»öŵ¡Êµ»½ÑɾÏÀ¼Ò¡Ë 349-350
!¡¡¡ÌÉÕ¡ÍÌÂÏ©¤ò²ò¤¯  by ´äÀ¥½ç°ì

OPTION BASE 0
SET WINDOW 0,500, 500,0
!
LET Xmax=90
LET Ymax=90
LET MaxCan=INT(Xmax*Ymax/4) !¡¡must Ymax<=Xmax
LET Bsize=4
LET Xoff=INT((500-Xmax*Bsize)/2)
LET Yoff=INT((500-Ymax*Bsize)/3) ! 20
DIM Map_(Xmax,Ymax)
DIM CanX_(MaxCan),CanY_(MaxCan),DirX_(MaxCan),DirY_(MaxCan)
RANDOMIZE
!
FOR I=0 TO 1
   FOR J=0 TO Ymax
      LET Map_(I,J)=1
      LET Map_(Xmax-I,J)=1
   NEXT J
NEXT I
FOR J=0 TO 1
   FOR I=0 TO Xmax
      LET Map_(I,J)=1
      LET Map_(I,Ymax-J)=1
   NEXT I
NEXT J
LET X=2
FOR Y=4 TO Ymax-2
   CALL DOT_(X,Y)
NEXT Y
LET X=Xmax-2
FOR Y=2 TO Ymax-4
   CALL DOT_(X,Y)
NEXT Y
LET Y=2
FOR X=2 TO Xmax-2
   CALL DOT_(X,Y)
NEXT X
LET Y=Ymax-2
FOR X=2 TO Xmax-2
   CALL DOT_(X,Y)
NEXT X
LET Ncan=0
FOR I=2 TO INT(Xmax/(2)) -2
   CALL InsCan_(I*2,2)
   CALL InsCan_(I*2,Ymax-2)
NEXT I
FOR J=2 TO INT(Ymax/(2)) -2
   CALL InsCan_(2,J*2)
   CALL InsCan_(Xmax-2,J*2)
NEXT J
LET Ndir=4
LET DirX_(1)=2
LET DirY_(1)=0
LET DirX_(2)=0
LET DirY_(2)=2
LET DirX_(3)=-2
LET DirY_(3)=0
LET DirX_(4)=0
LET DirY_(4)=-2
DO WHILE Ncan>0
   CALL Selcan_(I,J)
   DO
      LET Ndir=4
      DO
         CALL SelDir_(DI,DJ)
         LET Ok=1-Map_(I+DI,J+DJ)
      LOOP UNTIL Ok<>0 OR Ndir=0
      IF Ok<>0 THEN
         CALL DOT_(I+INT(DI/(2)),J+INT(DJ/(2)) )
         LET I=I+DI
         LET J=J+DJ
         CALL DOT_(I,J)
         CALL InsCan_(I,J)
      END IF
   LOOP UNTIL NOT Ok<>0
LOOP

SUB DOT_(X,Y)
   LET Map_(X,Y)=1
   ! SET AREA COLOR 5
   PLOT AREA: Bsize*X+Xoff,Bsize*Y+Yoff;Bsize*X+Xoff+Bsize-1,Bsize*Y+Yoff;Bsize*X+Xoff+Bsize-1,Bsize*Y+Yoff+Bsize-1;Bsize*X+Xoff,Bsize*Y+Yoff+Bsize-1
END SUB

SUB InsCan_(I,J)
   LET Ncan=Ncan+1
   LET CanX_(Ncan)=I
   LET CanY_(Ncan)=J
END SUB

SUB Selcan_(I,J)
   local R
   LET R=int(Ncan*rnd)+1
   LET I=CanX_(R)
   LET J=CanY_(R)
   LET CanX_(R)=CanX_(Ncan)
   LET CanY_(R)=CanY_(Ncan)
   LET Ncan=Ncan-1
END SUB

SUB SelDir_(I,J)
   local R
   LET R=int(Ndir*rnd)+1
   LET I=DirX_(R)
   LET J=DirY_(R)
   LET DirX_(R)=DirX_(Ndir)
   LET DirY_(R)=DirY_(Ndir)
   LET DirX_(Ndir)=I
   LET DirY_(Ndir)=J
   LET Ndir=Ndir-1
END SUB

!--------------------------------------------------
!¡¡¡¡¡¡¡¡¡¡¡¡¤³¤ÎÀè¤Ï¡¢´äÀ¥¤¬½ñ¤¤¤¿¡£
!¡¡¡¡¡¡¡¡¡¡¡¡Êý¿Ë¡§ÂÞ¾®Ï©¤¬¤¢¤Ã¤¿¤é¡¢¤Ì¤ê¤Ä¤Ö¤¹
!
PLOT TEXT,AT Xoff*1.2,20 :"²¿¤«¥­¡¼¤ò²¡¤·¤Æ¤¯¤À¤µ¤¤¡£ÌÂÏ©¤ò²ò¤­¤Þ¤¹¡£"
PLOT TEXT,AT Xoff*1.2,40 :"Push any key to solve the maze."
CHARACTER INPUT s$
SET AREA COLOR 0
PLOT AREA :Xoff,0; 500,0; 500,40; Xoff,40
!
LET Map_(2,3)=0
LET Map_(Xmax-2,Ymax-3)=0 !¡¡½Ð¸ý¡¢Æþ¸ý¤Ï£°¤Ë¤¹¤ë
FOR I=0 TO Xmax !¡¡¡¡¡¡¡¡¡¡¡¡ÌÂÏ©¤Î³°¤Ï£±¤Ë¤¹¤ë
   FOR J=0 TO 1
      LET Map_(I,J)=0
   NEXT J
   FOR J=Ymax-1 TO Ymax
      LET Map_(I,J)=0
   NEXT J
NEXT I
FOR J=0 TO Ymax
   FOR I=0 TO 1
      LET Map_(I,J)=0
   NEXT I
   FOR I=Xmax-1 TO Xmax
      LET Map_(I,J)=0
   NEXT I
NEXT J
!
!
!$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
!$$$$$$$$$ MAIN ROUTINE TO SOLVE THE MAZE $$$$$$$$$$$$$$$$$$$$$$$$$$$
!$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
!
FOR K=6 TO Ymax
   FOR J=3 TO K-3
      CALL Routine_
   NEXT J
NEXT K
FOR K=Ymax+1 TO Xmax
   FOR J=3 TO Ymax-3
      CALL Routine_
   NEXT J
NEXT K
FOR K=Xmax+1 TO Xmax+Ymax-6
   FOR J=K-Xmax+3 TO Ymax-3
      CALL Routine_
   NEXT J
NEXT K

SUB Routine_
   LET I=K-J
   IF fnCheck(I,J)< 3 THEN EXIT SUB
   LET Ii=I
   LET Jj=J
   DO
      CALL Fil_(Ii,Jj)
      IF Map_(Ii-1,Jj)=0 THEN
         LET Ii=Ii-1
      ELSEIF Map_(Ii,Jj+1)=0 THEN
         LET Jj=Jj+1
      ELSEIF Map_(Ii+1,Jj)=0 THEN
         LET Ii=Ii+1
      ELSEIF Map_(Ii,Jj-1)=0 THEN
         LET Jj=Jj-1
      END IF
   LOOP UNTIL fnCheck(Ii,Jj)<>3
END SUB

SUB Fil_(X,Y)
   LET Map_(X,Y)=1
   SET AREA COLOR 4 !3
   PLOT AREA: Bsize*X+Xoff,Bsize*Y+Yoff;Bsize*X+Xoff+Bsize-1,Bsize*Y+Yoff;Bsize*X+Xoff+Bsize-1,Bsize*Y+Yoff+Bsize-1;Bsize*X+Xoff,Bsize*Y+Yoff+Bsize-1
END SUB

FUNCTION fnCheck(I,J) !¡¡ÂÞ¾®Ï©¤Î»þ£³¤ò¤«¤¨¤¹
   LET fnCheck=0
   IF Map_(I,J)=1 THEN EXIT FUNCTION
   LET fnCheck=Map_(I-1,J)+Map_(I,J+1)+Map_(I+1,J)+Map_(I,J-1)
END FUNCTION

END
 

¥È¥é¥ó¥×Àꤤ¤Ç¤Î³ÎΨ

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ12·î20Æü(ÅÚ)08»þ05ʬ32ÉÃ
ÊÖ¿®¡¦°úÍÑ
  £±¡¥¥È¥é¥ó¥×¡Ê£µ£²Ëç¡Ë¤ò¤è¤¯Àڤäơ¢»þ·×²ó¤ê¤Ë£±»þ¤Î°ÌÃÖ¤«¤éʸ»úÈפΤ褦¤Ë¥«¡¼¥É¤ò΢¤Ë¤·¤Æ£±£²Ëçʤ١¢Ãæ¿´¤Ë£±£³ËçÌܤΥ«¡¼¥É¤òÃÖ¤¯¡£¤³¤ì¤ò·«¤êÊÖ¤·Á´¤Æ¤Î¥«¡¼¥É¤òÇۤ롣

£²¡¥£±£³ËçÌܤΰìÈÖ²¼¤Î¥«¡¼¥É¤ò°ú¤¯¡£
¤½¤Î¥«¡¼¥É¤¬£µ¤Î»þ¤Ï£µ»þ¤Î°ÌÃ֤ΰìÈÖ¾å¤Ëɽ¸þ¤­¤Ë¤·¤ÆÃÖ¤­¡¢£µ»þ¤Î°ÌÃ֤ΰìÈÖ²¼¤Î¥«¡¼¥É¤ò°ú¤¯¡£
¤³¤Î¥«¡¼¥É¤Î¿ô»ú¤Î¼¨¤¹°ÌÃÖ¤Ëɽ¸þ¤­¤ËÃÖ¤­¡¢¤½¤Î°ÌÃ֤ΰìÈÖ²¼¤Î¥«¡¼¥É¤ò°ú¤¯¡£

£³¡¥£±£³ËçÌܤΰÌÃ֤Σˤ¬£´Ëç¤Ç¤ë¤Þ¤Ç£²¡¥¤ò·«¤êÊÖ¤¹¡£


¤³¤Î¥ë¡¼¥ë¤Ç£±£²ÁÈ¡Ê1»þ¤«¤é£±£²»þ¤ÎÁȡˤ¬Á´¤Æɽ¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤¦³ÎΨ¤ò¤ß¤Æ¤ß¤¿¤¤¤Î¤Ç¤¹¤¬¡¢¡Ê¤Ç¤­¤¿¤é£°ÁÈ¡Á£±£²ÁȤǤγÎΨʬÉÛ¤âÃΤꤿ¤¤¡£¡Ë
¤³¤ÎÀꤤ¤ò¥³¥ó¥Ô¥å¡¼¥¿¤Ë¤µ¤»¤Æ失¤Þ¤»¤ó¤«¡©
 

Re: ¥È¥é¥ó¥×Àꤤ¤Ç¤Î³ÎΨ

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ12·î20Æü(ÅÚ)13»þ12ʬ19ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.176[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

ºò¶á¤Î£Ô£Ö¤Ç¸«¤é¤ì¤ë¡¢¥«¡¼¥É¡¦¥Þ¥¸¥Ã¥¯¤ÎÃæ¤Ë¡¢ÊªÍýŪ¤Ë¤Ï¡¢Í­¤êÆÀ¤Ê¤¤¤â¤Î¤¬¡¢
¿¡¹¸«¤é¤ì¤Þ¤¹¡¢Ä»È©Î©¤Æ¤Æ¸«¤Æ¤¤¤ë¤è¤ê¤Ï¡¢Ã٤줿Ƭ¤ò¤«¤«¤¨¤ë¾ì¹ç¡¢¤Ê¤Î¤«¡©¡©

Ϫ¹ü¤ËÉԻ׵Ĥʥޥ¸¥Ã¥¯¡¢Ä¶¾ï¸½¾Ý¤Ê¤É¤â¡¢Âå¿ô³Ø¾å¤Îµ­½Ò¡¢°Û¼¡¸µ´Ö¤Î¼ÌÁü¡¢
¨¤Á¡¢¹ÔÎ󡢥ޥȥꥯ¥¹¤Ç¡¢²ò¤­ÌÀ¤«¤µ¤ì¤ëÆü¤¬¡¢¾­ÍèÍè¤ë¤è¤¦¤Ë¤â¡¢»×¤¤¤Þ¤¹¡£
À¤³¦¤â¡¢»ä¤¿¤Á¼«¿È¤â¡¢¤Ò¤ç¤Ã¤È¤·¤Æ¡¢µðÂç¤Ê¤À¤±¤Î¿ô³Ø¥â¥Ç¥ë¤«¤â¡¦¡¦¡ª¡©
»ä¤Ï¡¢Æ¬°­¤¯¤ÆÂå¿ô³Ø¤ò¡¢Ëؤó¤ÉÍý²ò¤Ç¤­¤Þ¤»¤ó¤¬¡¢¤½¤Î̤Íè¤ËÌ¥¤»¤é¤ì¤Æ¤¤¤Þ¤¹¡£
 

Re: ¥È¥é¥ó¥×Àꤤ¤Ç¤Î³ÎΨ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ12·î20Æü(ÅÚ)14»þ56ʬ45ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.176[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¤³¤Î¥ë¡¼¥ë¤Ç£±£²ÁÈ¡Ê1»þ¤«¤é£±£²»þ¤ÎÁȡˤ¬Á´¤Æɽ¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤¦³ÎΨ¤ò¤ß¤Æ¤ß¤¿¤¤¤Î¤Ç¤¹¤¬¡¢¡Ê¤Ç¤­¤¿¤é£°ÁÈ¡Á£±£²ÁȤǤγÎΨʬÉÛ¤âÃΤꤿ¤¤¡£¡Ë


¥Ñ¡¼¥Õ¥§¥¯¥È¡Ê¤¹¤Ù¤Æ¤Î¥«¡¼¥É¤¬¤á¤¯¤é¤ì¤¿¾õÂ֡ˤˤʤë¤Ë¤Ï¡¢
¥«¡¼¥É¤ò¤á¤¯¤Ã¤Æ¤¤¤Ã¤¿½ç¤ò¹Í¤¨¤ë¤È¡¢ºÇ¸å¤Î52ËçÌܤˣˤΥ«¡¼¥É¤¬¤¢¤ì¤Ð¤è¤¤¡£
¤³¤ì¤¬4Ä̤ê¤Ç¡¢»Ä¤ê51Ëç¤Îʤӽç¡Ê¤á¤¯¤Ã¤¿½ç¡Ë¤Ï51!Ä̤ê¤À¤«¤é¡¢4*51!Ä̤ê¤È¤Ê¤ë¡£

¤Þ¤¿¡¢52Ëç¤Î¥«¡¼¥É¤òʤ٤ë½ç¤Ï¡¢52!Ä̤ꡣ

¤·¤¿¤¬¤Ã¤Æ¡¢¥Ñ¡¼¥Õ¥§¥¯¥È¤Ï¡¢4*51!/52!=4/52=1/13¤È¤Ê¤ë¤È»×¤¤¤Þ¤¹¡£



¤á¤¯¤Ã¤¿²ó¿ô¤Î´üÂÔÃͤϡ¢42²ó¡£Ê¬Éۤϡ¢£±»þ¤«¤é£±£²»þ¤Ï¡¢3.2Ëç¡££±£³»þ¤Ï4Ëç¡£
 

Re: ¥È¥é¥ó¥×Àꤤ¤Ç¤Î³ÎΨ

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2008ǯ12·î20Æü(ÅÚ)20»þ21ʬ44ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.176[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

10Ëü²ó¤Î»î¹Ô¤Ç¡¢4Ëç¤È¤âɽ¤Ë¤Ê¤ëÁÈ¿ô¤Ï¤¹¤Ù¤ÆƱ¤¸³ÎΨ¤Ç½Ð¸½¤¹¤ë¤È½Ð¤Þ¤·¤¿¡£


  ÁÈ   ³ÎΨ  Ê¿¶ÑËç¿ô
   0  .07669  25.06Ëç
   1  .07519  31.20Ëç
   2  .07792  35.14Ëç
   3  .07686  38.10Ëç
   4  .07674  40.48Ëç
   5  .07722  42.48Ëç
   6  .07848  44.25Ëç
   7  .07573  45.84Ëç
   8  .07778  47.28Ëç
   9  .07741  48.59Ëç
  10  .07723  49.81Ëç
  11  .07564  50.94Ëç
  12  .07711  52.00Ëç
              42.41Ëç


DECLARE EXTERNAL SUB sort
PUBLIC NUMERIC c
LET tt=TIME
LET s=4
LET n=13
LET c=s*n
DIM check(c),card(c),position(n,s),face(n),total(0 TO n-1),count(0 TO n-1)
LET test=100000 ! 100000¤Ç125ÉÃ
FOR t=1 TO test
   CALL prep
   CALL play
NEXT t
LET cc=0
PRINT " ÁÈ   ³ÎΨ  Ê¿¶ÑËç¿ô"
FOR i=0 TO n-1
   PRINT USING " ##  .#####  ##.##Ëç" : i,total(i)/test,count(i)/total(i)
   LET cc=cc+count(i)
NEXT i
PRINT USING "             ##.##Ëç" : cc/test
PRINT INT(TIME-tt);"sec"

SUB prep
   FOR i=1 TO c
      LET check(i)=RND
   NEXT i
   CALL sort(check,card)
   !MAT PRINT card;
   FOR j=1 TO s
      FOR i=1 TO n
         LET position(i,j)=card((j-1)*n+i)
      NEXT i
   NEXT j
   !MAT PRINT position;
END SUB
SUB play
   MAT face=ZER
   LET cc=0
   CALL open_card(n)
   !MAT PRINT face;
   LET f=0
   FOR i=1 TO n-1
      IF face(i)=s THEN LET f=f+1
   NEXT i
   LET total(f)=total(f)+1
   LET count(f)=count(f)+cc
END SUB
SUB open_card(nn)
   LET cc=cc+1
   LET look=position(nn,1)
   FOR j=1 TO s-1
      LET position(nn,j)=position(nn,j+1)
   NEXT j
   LET p=MOD(look,n)+1
   !PRINT p;
   LET face(p)=face(p)+1
   IF face(n)=s THEN EXIT SUB
   CALL open_card(p)
END SUB
END

REM ½½¿ÊBASICźÉÕ"\BASICw32\Library\SORT2.LIB"¤è¤ê
! ix¤Ë¤Ïm¤È²¼¸Â¡¤¾å¸Â¤ò°ìÃפµ¤»¤¿¶õ¤ÎÇÛÎó¤ò»ØÄꤹ¤ë¡£
! m¤Ï»²¾È¤µ¤ì¤ë¤Î¤ß¡£
! ix¤Ëm¤Îź»ú¤òÂ礭¤µ¤Î½ç¤Ëʤ٤ÆÊÖ¤¹¡£
! ¤Ä¤Þ¤ê¡¤m(ix(1))¡åm(ix(2))¡åm(ix(3))¡åŽ¥Ž¥Ž¥¤È¤Ê¤ë¡£
EXTERNAL SUB sort(m(),ix())
FOR i=1 TO c
   LET ix(i)=i
NEXT i
CALL q_sort(m,ix,1,c)
END SUB
EXTERNAL SUB q_sort(m(),a(),l,r)
IF r<=l THEN
   EXIT SUB
ELSE
   LET i=l-1
   LET j=r
   LET pv=m(a(r))
   DO
      DO
         LET i=i+1
      LOOP UNTIL pv<=m(a(i))
      DO
         LET j=j-1
      LOOP UNTIL j<=i OR m(a(j))<=pv
      IF j<=i THEN EXIT DO
      LET t=a(i)
      LET a(i)=a(j)
      LET a(j)=t
   LOOP
   LET t=a(i)
   LET a(i)=a(r)
   LET a(r)=t
   CALL q_sort(m,a,l,i-1)
   CALL q_sort(m,a,i+1,r)
END IF
END SUB
 

Re: ¥È¥é¥ó¥×Àꤤ¤Ç¤Î³ÎΨ

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ12·î21Æü(Æü)07»þ58ʬ9ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.178[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

ÌäÂ꤬¡¢¤è¤¯¤ï¤«¤é¤Ê¤¤¤Î¤Ç¡¢¤«¤ó°ã¤¤¤«¤â¤·¤ì¤Þ¤»¤ó¤¬¡¢
¥Ñ¡¼¥Õ¥§¥¯¥È¤Î¡¢4*51! Ä̤ê¤ÎÃæ¤Ç¡¢
£±£³»þ¤Î°ÌÃ֤ˡ¢£´Ëç¤Î£Ë¤¬Á´¤Æ½¸¤Þ¤ëÇÛÃ֤Ρ¢4!*48! Ä̤ê¤Ï¡¢
¥¹¥¿¡¼¥È»þÅÀ¤Ç¡¢Ìµ¸Â¥ë¡¼¥×¤ËÍî¤Á¤ë¤¿¤á¡¢½ü¤«¤Ê¤¯¤Æ¤è¤í¤·¤¤¤Ç¤¹¤«¡£

¤¹¤ß¤Þ¤»¤ó¡¢¥«¥ó°ã¤¤¤Ç¤·¤¿¡£
 

¥ë¡¼¥ë¤Î¾ÜºÙ

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ12·î21Æü(Æü)08»þ24ʬ49ÉÃ
ÊÖ¿®¡¦°úÍÑ
  £±¡¥¥È¥é¥ó¥×¡Ê£µ£²Ëç¡Ë¤ò¤è¤¯Àڤäơ¢»þ·×²ó¤ê¤Ë£±»þ¤Î°ÌÃÖ¤«¤éʸ»úÈפΤ褦¤Ë¥«¡¼¥É¤ò΢¤Ë¤·¤Æ£±£²Ëçʤ١¢Ãæ¿´¤Ë£±£³ËçÌܤΥ«¡¼¥É¤òÃÖ¤¯¡£¤³¤ì¤ò·«¤êÊÖ¤·Á´¤Æ¤Î¥«¡¼¥É¤òÇۤ롣
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ö
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ö¡¡¡ö
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ö¡¡¡¡¡¡¡ö
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ö¡¡¡¡¡ö¡¡¡¡¡ö
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ö¡¡¡¡¡¡¡ö
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ö¡¡¡ö
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ö


£²¡¥£±£³ËçÌÜ¡Ê¿¿¤óÃæ¤Î¥Ñ¥±¥Ã¥È¡Ë¤Î°ìÈÖ²¼¤Î¥«¡¼¥É¤ò°ú¤¯¡£
¤½¤Î¥«¡¼¥É¤¬£µ¤Î»þ¤Ï£µ»þ¤Î°ÌÃ֤ΰìÈÖ¾å¤Ëɽ¸þ¤­¤Ë¤·¤ÆÃÖ¤­¡¢£µ»þ¤Î°ÌÃ֤ΰìÈÖ²¼¤Î¥«¡¼¥É¤ò°ú¤¯¡£
¤³¤Î¥«¡¼¥É¤Î¿ô»ú¤¬Q¤Ê¤é£±£²»þ¤Î¼¨¤¹°ÌÃÖ¤Ëɽ¸þ¤­¤ËÃÖ¤­¡¢£±£²»þ¤Î°ÌÃ֤ΰìÈÖ²¼¤Î¥«¡¼¥É¤ò°ú¤¯¡£
¤³¤ì¤¬K¤Ê¤é¿¿¤óÃæ¤Î»³¡Ê»þ·×¤Î¿Ë¤ÎÃæ¿´¡Ë¤Î°ìÈÖ¾å¤Ëɽ¸þ¤­¤ÇÃÖ¤¯¡£
¼¡¤Ë¡¢¤³¤Î»³¡ÊÃæ¿´Éôʬ¤Î¥Ñ¥±¥Ã¥È¡Ë¤Î°ìÈÖ²¼¤Î¥«¡¼¥É¤ò°ú¤­½Ð¤·¤½¤Î¥«¡¼¥É¤Î¿ô»ú¤Ë½¾¤¤¼¡¤Îºî¶È¤ò¤·¤Æ¤¤¤¯¡£
¡ã¤³¤ì¤ò³¤±¤Æ¤¤¤¯¤È¡¢³Æ»þ¹ï¤Îʸ»úÈ׿ô¤ËÂбþ¤¹¤ëɽ¸þ¤­¤Î¥«¡¼¥É¤¬½¸¤Þ¤Ã¤Æ¤¤¤¯¡£¡ä

£³¡¥£±£³ËçÌܤΰÌÃÖ¡ÊÃæ¿´¤ËÃÖ¤«¤ì¤¿¥Ñ¥±¥Ã¥È¡Ë¤Ë4Ëç¤Î£Ë¤¬É½¸þ¤­¤ËÃÖ¤«¤ì¤ë¤Þ¤Ç£²¡¥¤ò·«¤êÊÖ¤¹¡£


°ìÈÖ²¼¤ËK¤ò»Å¹þ¤ó¤Ç¤ä¤Ã¤Æ¤ß¤Þ¤·¤¿¤¬¡¢ºÇ¸å¤Þ¤Ç¹Ô¤«¤ºÅÓÃæ¤Ç½ª¤ï¤Ã¤Æ¤·¤Þ¤¤¤Þ¤·¤¿¡£
 

Re: ¥ë¡¼¥ë¤Î¾ÜºÙ

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2008ǯ12·î21Æü(Æü)09»þ32ʬ27ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.181[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¼¡¤Î¤è¤¦¤Ë²¼¤«¤é¥«¡¼¥É¤òÇÛÃÖ¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£¥Ñ¡¼¥Õ¥§¥¯¥È¤Ë¤Ê¤ë¤Ï¤º¤Ç¤¹¡£
»ä¤Î¤¢¤²¤¿¥×¥í¥°¥é¥à¤Ç3²óÌÜ¡¢18²óÌÜ¡¢20²óÌܤÎÎã¤Ç¤¹¡£
¥Ñ¡¼¥Õ¥§¥¯¥È¤ÏºÇ¸å¤Ë£Ë¤ò°ú¤¯¤ï¤±¤Ç¤¹¤«¤é¡¢£Ë¤ò°ìÈÖ¾å¤Ë»Å¹þ¤á¤ÐãÀ®¤¹¤ë³ÎΨ¤¬¾å¤¬¤ê¤Þ¤¹¡£
  
   1»þ   12 11  6 12
   2»þ    2  2  8  6
   3»þ    4  9  1  2
   4»þ    1  1  9 13
   5»þ   12 10 11  2
   6»þ    9  5 10  7
   7»þ    4 10  3  4
   8»þ   12  7 11 11
   9»þ    6  7  3  8
  10»þ    7  8  9  3
  11»þ    8 10  1  6
  12»þ    5 13 13 13
  13»þ    5  4  3  5

   1»þ    7  4  1  9
   2»þ    7  9  1  6
   3»þ    1  5  3  9
   4»þ    5 11  4  6
   5»þ   13  2  2  3
   6»þ    4  8 10 13
   7»þ   11  3 12 11
   8»þ   10  8  6  2
   9»þ    5  9  7  4
  10»þ    6 11  5  7
  11»þ    8  8 13 13
  12»þ    3 12 10  2
  13»þ    1 12 12 10

   1»þ   10  3  9  3
   2»þ    2  8  8 12
   3»þ    4  1  2 10
   4»þ    4  6  1 12
   5»þ   13 11  6  7
   6»þ   11  1  1 12
   7»þ    4  5  2 13
   8»þ    8  6  8  2
   9»þ   12  9  6  5
  10»þ    7  3 11 13
  11»þ   11 10  4  3
  12»þ    7 10  7  5
  13»þ   13  9  9  5
 

º£Æü¤Î±¿Àª¤òºÇ¹â¤Ë

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ12·î21Æü(Æü)12»þ16ʬ46ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.182[¸µµ­»ö¤Ø]

¹ÓÅĹÀÆ󤵤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£


¼ÂºÝ¤Ë¥È¥é¥ó¥×¤Ç¤ä¤é¤Ê¤¤¤Ç¤âÀꤨ¤Á¤ã¤¦¤È¤Ï¤¢¤ê¤¬¤¿¤¤¤Ç¤¹¡£
³ÎΨ¤¬Åùʬ¤Ç¤¢¤ë¤È¤Ï»×¤Ã¤Æ¤â¤¤¤Þ¤»¤ó¤Ç¤·¤¿¡£
¥Ñ¡¼¥Õ¥§¥¯¥È¤¬Ã£À®¤¹¤ë¤¿¤á¤Ë¤Ï£±£³²ó¤ò¤á¤É¤Ë¤ä¤ì¤Ð¤¤¤¤¤Î¤«¡ª
¹ÓÅĤµ¤ó¤Î¥×¥í¥°¥é¥à¤Çtest=1¤È¤ª¤¤¤Æ¥Ñ¡¼¥Õ¥§¥¯¥È¤Ë¤Ê¤ë¤Þ¤Ç¤ä¤Ã¤Æº£Æü¤Î±¿Àª¤òËèÆü
ºÇ¹â¤Ë¤·¤è¤¦¤Ã¤È¡ª¡ª

¤È¤³¤í¤Ç
¥Ñ¡¼¥Õ¥§¥¯¥ÈãÀ®¤Î¤¿¤á¤Î¥Ñ¥¿¡¼¥ó¤ò²Äǽ¤Ê¤À¤±½¸¤á¤¿¤¤¤Î¤Ç¤¹¤¬¤É¤Î¤è¤¦¤Ë¤¹¤ì¤Ð¤è¤í¤·¤¤¤Î¤Ç¤·¤ç¤¦¤«¡©
¤½¤³¤«¤é¤É¤ó¤Ê¾ò·ï¤¬É¬ÍפʤΤ«ÃΤꤿ¤¤¤Ç¤¹¤¬¡£
 

»þ·×¤Î¥×¥í¥°¥é¥ß¥ó¥°

 Åê¹Æ¼Ô¡§Åļ¹¬½õ  Åê¹ÆÆü¡§2008ǯ12·î22Æü(·î)11»þ09ʬ20ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ½½¿ÊBASIC¤Ç»þ·×¤òºî¤ê¤¿¤¤¤Î¤Ç¤¹¤¬¡¢
¥×¥í¥°¥é¥à¤ò¶µ¤¨¤Æ¤¤¤¿¤À¤±¤Þ¤»¤ó¤«¡©
»þ·×¤Ï¥¢¥Ê¥í¥°»þ·×¤Ç¤¹¡£
 

Re: »þ·×¤Î¥×¥í¥°¥é¥ß¥ó¥°

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ12·î22Æü(·î)11»þ45ʬ27ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.184[¸µµ­»ö¤Ø]

Åļ¹¬½õ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> »þ·×¤Ï¥¢¥Ê¥í¥°»þ·×¤Ç¤¹¡£

¥·¥ó¥×¥ë¤Ç¤¹¡£Ã±°Ì±ß¾å¤Ëʸ»úÈפòÉÁ¤¤¤Æ¤¤¤Þ¤¹¡£¤¤¤í¤¤¤í²þÎɤ·¤Æ¤¯¤À¤µ¤¤¡£

ÉäˤĤ¤¤Æ
¾¤Î¼êË¡¡Ê¤¿¤È¤¨¤Ð¡¢TIME´Ø¿ô¡Ë¤Ç¾®¿ôÅÀ°Ê²¼¡Ê¥ß¥êÉáˤò¼èÆÀ¤Ç¤­¤Þ¤¹¤¬¡¢
Àµ³Î¤ÊÃͤϴüÂԤǤ­¤Þ¤»¤ó¤Î¤Ç¡¢Éÿˤò¤Ê¤á¤é¤«¤ËÆ°¤«¤¹¤³¤È¤ÏÆñ¤·¤¤¤«¤È»×¤¤¤Þ¤¹¡£

!¥¢¥Ê¥í¥°»þ·×

SET WINDOW -1.2,1.2,-1.2,1.2 !ɽ¼¨Îΰè
SET TEXT JUSTIFY "center","half" !ʸ»úɽ¼¨¤Î½ñ¼°

DO
   LET t$=TIME$ !»þ¹ï¤òhh:mm:ss·Á¼°¤ÇÆÀ¤ë
   LET h=VAL(t$(1:2)) !¿ôÃͤØ
   LET m=VAL(t$(4:5))
   LET s=VAL(t$(7:8))

   SET DRAW mode hidden !¤Á¤é¤Ä¤ßËɻߡʳ«»Ï¡Ë
   CLEAR

   FOR i=1 TO 12 !ʸ»úÈ×
      LET th=PI/2-2*PI*i/12 !£Ù¼´¤«¤é»þ·×¤Þ¤ï¤ê
      PLOT TEXT ,AT COS(th),SIN(th): STR$(i) !±ß¼þ¾å
   NEXT i

   LET th=PI/2-2*PI*(h + m/60)/12 !»þ¿Ë
   PLOT LINES: 0,0; 0.6*COS(th),0.6*SIN(th)

   LET th=PI/2-2*PI*m/60 !ʬ¿Ë
   PLOT LINES: 0,0; 0.9*COS(th),0.9*SIN(th)

   LET th=PI/2-2*PI*s/60 !ÉÿË
   PLOT LINES: 0,0; 0.8*COS(th),0.8*SIN(th)

   SET DRAW mode explicit !¤Á¤é¤Ä¤­ËɻߡʽªÎ»¡Ë
LOOP

END
 

Re: »þ·×¤Î¥×¥í¥°¥é¥ß¥ó¥°

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2008ǯ12·î22Æü(·î)18»þ34ʬ45ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.185[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£


¾å½ñ¤­¤»¤Æ¤¤¤¿¤À¤­¤Þ¤·¤¿¡£
Ä´¤Ù¤¿¤é1ʬ´Ö¤ËÌó8200²ó¤ÎÉÁ²è¤ò¤·¤Æ¤¤¤¿¤Î¤Ç¡¢Éäι¹¿·¤¬¤¢¤Ã¤¿¤È¤­¤ËÉÁ²è¤¹¤ë¤è¤¦¤Ë¤·¤Þ¤·¤¿¡£
ʸ»úÈ×Éôʬ¤âLOOP¤«¤é½Ð¤·¤ÆÉÁ²è»þ´Ö¤òÀáÌó¡£
Ĺ¿Ë¡¦Ã»¿Ë¤ò³¨ÄêµÁ¤Ë¤·¡¢PICTURE hand ¤ò½ñ¤­´¹¤¨¤ë¤³¤È¤Ë¤è¤ê¿Ë¤Î¥Ç¥¶¥¤¥óÊѹ¹¤òÍưפˤǤ­¤ë¤è¤¦¤Ë¤·¤Þ¤·¤¿¡£


!¥¢¥Ê¥í¥°»þ·×(²þ)

SET WINDOW -1.2,1.2,-1.2,1.2 !ɽ¼¨Îΰè
SET TEXT JUSTIFY "center","half" !ʸ»úɽ¼¨¤Î½ñ¼°
SET TEXT HEIGHT 1.2/10
SET AREA COLOR 5 ! ¿å¿§
SET POINT STYLE 4 ! ¡£
DRAW disk WITH SCALE(1.1)
FOR i=1 TO 12 !ʸ»úÈ×
   LET th=PI/2-2*PI*i/12 !£Ù¼´¤«¤é»þ·×¤Þ¤ï¤ê
   PLOT TEXT ,AT COS(th),SIN(th): STR$(i) !±ß¼þ¾å
   FOR j=1 TO 4
      LET th=PI/2-2*PI*(5*i+j)/60
      PLOT POINTS : 0.94*COS(th),0.94*SIN(th)
   NEXT j
NEXT i

SET LINE COLOR "RED"
LET t0=INT(TIME)
DRAW clock(t0)

DO
   IF TIME-t0>=1 THEN ! Éäι¹¿·¤ÇÉÁ²è
      LET t0=INT(TIME)
      DRAW clock(t0)
   END IF
LOOP

PICTURE clock(t0)
   LET h=INT(t0/3600) !¿ôÃͤØ
   LET m=INT((t0-3600*h)/60)
   LET s=MOD(t0,60)

   SET DRAW mode hidden !¤Á¤é¤Ä¤­Ëɻߡʳ«»Ï¡Ë
   SET AREA COLOR 0 ! Çò
   DRAW disk WITH SCALE(0.9) !¿ËÉÁ²èÉôʬ¤Î¤ß¥¯¥ê¥¢

   LET th=PI/2-2*PI*(h + m/60)/12 !»þ¿Ë
   DRAW hand(3) WITH SCALE(0.6,1)*ROTATE(th)

   LET th=PI/2-2*PI*m/60 !ʬ¿Ë
   DRAW hand(2) WITH SCALE(0.86,1)*ROTATE(th)

   LET th=PI/2-2*PI*s/60 !ÉÿË
   PLOT LINES: 0,0; 0.8*COS(th),0.8*SIN(th)

   SET DRAW mode explicit !¤Á¤é¤Ä¤­ËɻߡʽªÎ»¡Ë
END PICTURE

PICTURE hand(col) !¿ËÉÁ²è
   SET AREA COLOR col
   PLOT AREA : -0.05,-0.03;1,-0.03;1,0.03;-0.05,0.03
END PICTURE

END
 

±ÕÂÎËü²Ú¶À

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ12·î23Æü(²Ð)01»þ01ʬ5ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  !
!¡¡±ÕÂÎËü²Ú¶À
!
!¡¡ºø»ë¤¬¡¢À¸¤¸Æñ¤¤¤è¤¦£±²óžËè¤Ë¡¢µÕ²óž¤µ¤»¤ë¤è¤¦¤Ë¤·¤¿¡£
!¡¡±ÕÌ̤ÎÊѲ½¤Ëȼ¤¦ÍÆÀÑÊÑÆ°¤ò¡¢¡Þ3.85% °Ê²¼¤Þ¤Ç²¡¤¨¤¿¡£

!-----------------
!¢¨Àµ³Î¤Ê±ÕÌ̤ˤϡ¢¤Ê¤Ã¤Æ¤¤¤Þ¤»¤ó¡£²þ¤´¿·Þ¡£

SET TEXT BACKGROUND "OPAQUE"
SET WINDOW -1/4,1/4, -1/4,1/4
DIM x(2),y(2)

!Ãæ¿´(1/2,1/sqr(3)/2)¡¢È¾·Â r ¤Î±ß¼þ¾å¤ÎÅÀ(x0(¦È),y0(¦È))
DEF x0(¦È)=r*COS(¦È)+1/2
DEF y0(¦È)=r*SIN(¦È)+1/SQR(3)/2

!Ãæ¿´(1/2,1/sqr(3)/2)¡¢È¾·Â r ¤Î±ß¼þ¾å¤ÎÅÀ(x0(¦È),y0(¦È))¡¢¤ËÀܤ¹¤ëľÀþ
DEF f(x)=TAN(¦È+PI/2)*(x-x0(¦È))+y0(¦È)

!¡²Ä¾Àþ£±¤Èf(x)¤È¤Î¸òÅÀ(x1,y1)
!y=0 =TAN(¦È+PI/2)*(x-x0(¦È))+y0(¦È)
DEF x1(¦È)= -y0(¦È)/TAN(¦È+PI/2)+x0(¦È)
LET y1=0

!¡¿Ä¾Àþ£²¤Èf(x)¤È¤Î¸òÅÀ(x2,y2)
!y=SQR(3)*x =TAN(¦È+PI/2)*(x-x0(¦È))+y0(¦È)
DEF x2(¦È)=(-y0(¦È)+TAN(¦È+PI/2)*x0(¦È))/(TAN(¦È+PI/2)-SQR(3))
DEF y2(¦È)=SQR(3)*x2(¦È)

!¡ÀľÀþ£³¤Èf(x)¤È¤Î¸òÅÀ(x3,y3)
!y=-SQR(3)*(x-1) =TAN(¦È+PI/2)*(x-x0(¦È))+y0(¦È)
DEF x3(¦È)=(SQR(3)-y0(¦È)+TAN(¦È+PI/2)*x0(¦È))/(TAN(¦È+PI/2)+SQR(3))
DEF y3(¦È)=-SQR(3)*(x3(¦È)-1)

SET AREA COLOR 5
LET s00=SQR(3)/4
LET ¦Õ=0.001
LET stp=PI/180
DO
   IF 2*PI<=ABS(¦Õ) THEN LET stp=-stp !¡¡(¡Ü)º¸²óž (¡Ý)±¦²óž
   LET ¦Õ=REMAINDER(¦Õ, 2*PI) +stp
   !-----
   LET ¦È=¦Õ+SIN(¦Õ*51)*0.1+SIN(¦Õ*49)*0.05 !¡¡¿åÌÌÍɤì..Í­¤ê
   !LET ¦È=¦Õ !¡¡¿åÌÌÍɤì..̵¤·
   !-----
   LET r=0.19985-0.00355*COS(¦È*6) !¡¡±ÕÌÌÊäÀµ¡¢»Ä¸íº¹¡Þ3.85%
   LET x00=0
   LET y00=0
   LET i=1
   LET x(i)=x1(¦È)
   LET y(i)=y1
   IF 0<=x(i) AND x(i)<=1 AND 0<=y(i) AND y(i)<=SQR(3)/2 THEN LET i=i+1
   LET x(i)=x2(¦È)
   LET y(i)=y2(¦È)
   IF 0<=x(i) AND x(i)<=1 AND 0<=y(i) AND y(i)<=SQR(3)/2 THEN LET i=i+1.01
   IF i< 3 THEN
      LET x(i)=x3(¦È)
      LET y(i)=y3(¦È)
      IF 2< i THEN
         LET x00=1/2
         LET y00=SQR(3)/2
      ELSE
         LET x00=1
         LET y00=0
      END IF
   END IF
   LET ss2=ABS((x(1)-x00)*(y(2)-y00)-(y(1)-y00)*(x(2)-x00))
   SET DRAW mode hidden
   CLEAR
   DRAW D4(3) WITH SHIFT(-1/2,-1/SQR(3)/2)*ROTATE(¦Õ-PI/2)
   DRAW center WITH SHIFT(-1/2,-1/SQR(3)/2)*ROTATE(-¦Õ-PI/2)*SCALE(-1/8,1/8)
   PLOT TEXT,AT 0.13,0.23:"±¦¥¯¥ê¥Ã¥¯¤Ç½ªÎ»"
   SET DRAW mode explicit
   WAIT DELAY 0.05
   MOUSE POLL mx,my,mlb,mrb
LOOP UNTIL mrb>=1

PICTURE center
   SET LINE COLOR 2
   SET LINE width 2
   PLOT LINES:0,0;1,0;1/2,SQR(3)/2;0,0
   SET LINE width 1
   SET LINE COLOR 1
END PICTURE

!------
PICTURE D4(k)
   IF 0< k THEN
      DRAW D4(k-1) WITH SCALE(1/2,1/2)*SHIFT(1/4,SQR(3)/4) !¡¡¾å
      DRAW D4(k-1) WITH SCALE(1/2,-1/2)*SHIFT(1/4,SQR(3)/4) !¡¡Ãæ
      DRAW D4(k-1) WITH SCALE(1/2,1/2)*ROTATE(-PI*2/3)*SHIFT(1/4,SQR(3)/4) !º¸
      DRAW D4(k-1) WITH SCALE(1/2,1/2)*ROTATE(PI*2/3)*SHIFT(1,0) !¡¡±¦
   ELSE
      DRAW Set01
   END IF
END PICTURE

!------ ¼ï¤Î»°³Ñ¿Þ
PICTURE Set01
   IF s00< ss2 THEN
      IF x00=0 THEN PLOT AREA:x(1),y(1);x(2),y(2);1/2,SQR(3)/2;1,0
      IF x00=1 THEN PLOT AREA:x(1),y(1);x(2),y(2);1/2,SQR(3)/2;0,0
      IF x00=1/2 THEN PLOT AREA:x(1),y(1);x(2),y(2);1,0;0,0
   ELSE
      PLOT AREA:x(1),y(1);x(2),y(2);x00,y00
   END IF
   PLOT LINES:x(1),y(1);x(2),y(2)
   PLOT LINES:0,0;1,0;1/2,SQR(3)/2;0,0
END PICTURE

END
 

Re: º£Æü¤Î±¿Àª¤òºÇ¹â¤Ë

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ12·î23Æü(²Ð)10»þ35ʬ56ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.183[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¥Ñ¡¼¥Õ¥§¥¯¥ÈãÀ®¤Î¤¿¤á¤Î¥Ñ¥¿¡¼¥ó¤ò²Äǽ¤Ê¤À¤±½¸¤á¤¿¤¤¤Î¤Ç¤¹¤¬¤É¤Î¤è¤¦¤Ë¤¹¤ì¤Ð¤è¤í¤·¤¤¤Î¤Ç¤·¤ç¤¦¤«¡©
> ¤½¤³¤«¤é¤É¤ó¤Ê¾ò·ï¤¬É¬ÍפʤΤ«ÃΤꤿ¤¤¤Ç¤¹¤¬¡£


¤á¤¯¤é¤ì¤ë¥«¡¼¥É¤Ë¤Ï¡¢¼¡¤Î¤è¤¦¤ÊñÊý¸þ¥ê¥¹¥È¡Ê¥ê¥ó¥¯¡Ë¤¬¹½À®¤µ¤ì¤Æ¤¤¤ì¤Ð¤è¤¤¤È»×¤¤¤Þ¤¹¡£

¡ü¡Ö£îËç¤ò¤á¤¯¤ë¡×¥«¡¼¥É«¤Î¤Ä¤¯¤êÊý
£´Ëç¤Î£Ë¤ò´Þ¤à£îËç¡Ên=4¡Á52¡Ë¤Î¥«¡¼¥É¤òÍÑ°Õ¤¹¤ë¡£¡Ê£µ£²¡Ý£îËç¤Ï½ü¤¤¤Æ¤ª¤¯¡Ë
¥Ñ¡¼¥Õ¥§¥¯¥È¤Ê¤é£µ£²Ëç¤È¤Ê¤ë¡£

¡Êstep.1¡Ëɽ¸þ¤­¤Ë¡¢¾å¤«¤é£Ë¢¢¢£¡þ¡¦¡¦¡¦¡û¢¡¤Î½ç¤Î«¤È¤¹¤ë¡£¢¢¤Ê¤É¤ÎÉôʬ¤Ï²¿¤Ç¤â¤è¤¤¡£
¡¡¡¡¡¡¡¡ºÇ½é¤Î£Ë¤Ï£´Ë礫¤é£±¤Ä¤òÁª¤Ö¡£¢¢¢£¡þ¡¦¡¦¡¦¡û¢¡¤Ë¤Ï»Ä¤ê£³Ëç¤Î£Ë¤¬´Þ¤Þ¤ì¤ë¡£

¡Êstep.2¡Ë¼¡¤Î¼ê½ç¤Ç¡¢µÕÇÛÃ֤λþ·×¤Î¤è¤¦¤Ë¥«¡¼¥É¤òÃÖ¤¯¡£
¡¡¡¡¡¡¡¡¡¡¡¡¡¡12
¡¡¡¡¡¡¡¡¡¡¡¡£±¡¡11
¡¡¡¡¡¡¡¡¡¡£²¡¡¡¡¡¡10
¡¡¡¡¡¡¡¡£³¡¡¡¡13¡¡¡¡£¹
¡¡¡¡¡¡¡¡¡¡£´¡¡¡¡¡¡£¸
¡¡¡¡¡¡¡¡¡¡¡¡£µ¡¡£·
¡¡¡¡¡¡¡¡¡¡¡¡¡¡£¶

¡¡¡¡¡¡¡¡¾å¤«¤é£±ÈÖÌܤΥ«¡¼¥É¡Ê£Ë¡Ë¤ò¡¢£²ÈÖÌܤΥ«¡¼¥É¡Ê¢¢¡Ë¤Î»Ø¤¹°ÌÃÖ¤ËÃÖ¤¯¡£
¡¡¡¡¡¡¡¡¾å¤«¤é£²ÈÖÌܤΥ«¡¼¥É¡Ê¢¢¡Ë¤ò¡¢£³ÈÖÌܤΥ«¡¼¥É¡Ê¢£¡Ë¤Î»Ø¤¹°ÌÃÖ¤ËÃÖ¤¯¡£
¡¡¡¡¡¡¡¡¾å¤«¤é£³ÈÖÌܤΥ«¡¼¥É¡Ê¢£¡Ë¤ò¡¢£´ÈÖÌܤΥ«¡¼¥É¡Ê¡þ¡Ë¤Î»Ø¤¹°ÌÃÖ¤ËÃÖ¤¯¡£

¡¡¡¡¡¡¡¡¡¡¡§
¡¡¡¡¡¡¡¡¡¡¡§
¡¡¡¡¡¡¡¡¡¡¡§

¡¡¡¡¡¡¡¡¾å¤«¤é£î¡Ý£±ÈÖÌܤΥ«¡¼¥É¡Ê¡û¡Ë¤ò¡¢£îÈÖÌܤΥ«¡¼¥É¡Ê¢¡¡Ë¤Î»Ø¤¹°ÌÃÖ¤ËÃÖ¤¯¡£
¡¡¡¡¡¡¡¡¾å¤«¤é£îÈÖÌܤΥ«¡¼¥É¡Ê¢¡¡Ë¤ò¡¢£±£³ÈÖÌܤΰÌÃÖ¤ËÃÖ¤¯¡£

¡¡¡¡¡¡¡¡¥Æ¡¼¥Ö¥ë¤Î΢¦¤«¤é¸«¤¿ÇÛÃ֤ˤʤäƤ¤¤ë¡£


¡Êstep.3¡Ë¥Æ¡¼¥Ö¥ë¤Îɽ¤«¤é¸«¤¿ÇÛÃ֤ˤ¹¤ë¤¿¤á¡¢¥«¡¼¥É¤ò«¤´¤È΢ÊÖ¤·¤Ê¤¬¤éº¸±¦¤Î°ÌÃÖ¤òÆþ¤ìÂؤ¨¤ë¡£
¡¡¡¡¡¡¡¡£±£²¡¢£±£³¡¤£¶»þ¤Î°ÌÃÖ¤Ï΢ÊÖ¤¹¤Î¤ß¤È¤Ê¤ë¡£

¡Êstep.4¡ËÁȤ¬£´Ë示¤Ä¤Ë¤Ê¤ë¤è¤¦¤Ë¡¢½ü¤¤¤Æ¤ª¤¤¤¿£µ£²¡Ý£îËç¤Î¥«¡¼¥É¤ò¡¢¡Ê̵ºî°Ù¤Ë¡Ë΢¸þ¤­¤Ç¾å¤Ë½Å¤Í¤Æ¤¤¤¯¡£
¡¡¡¡¡¡¡¡¥Ñ¡¼¥Õ¥§¥¯¥È¤Î¾ì¹ç¤Ï¤³¤ÎÁàºî¤Ï¤Ê¤¤¡£

¡¡¡¡¡¡¡¡¤á¤¯¤ëÁ°¤Î¾õÂ֤ˤʤ롣

¡Êstep.5¡Ë£±£³»þ°ÌÃÖ¤«¤é£±£²»þ¡¢£±£±»þ¡¢¡¦¡¦¡¦¤Î¤è¤¦¤Ë¡ÊÄ̾ï¤Î¡ËÈ¿»þ·×¤Þ¤ï¤ê¤Ë£±Ë示¤Ä¤½¤Î¤Þ¤Þ¤Î¾õÂ֤Ǿå¤Ë½Å¤Í¤Ê¤¬¤é²ó¼ý¤¹¤ë¡£



¡ü¤á¤¯¤é¤ì¤ëËç¿ô¤´¤È¤Î³ÎΨ
¡Ö»Ä¤ë¥«¡¼¥É¡¢£Ë¡¢¤á¤¯¤é¤ì¤Æ¤¤¤¯¥«¡¼¥É¡Ê£³Ëç¤Î£Ë¤ò´Þ¤à¡Ë¡×¤Îʤӽç¤È¤·¤Æ¹Í¤¨¤ë¡£
±¦Ã¼¤¬ºÇ½é¤Ë¤á¤¯¤é¤ì¤ë¥«¡¼¥É¡Ê£±£³»þ¤Î°ÌÃÖ¤ÎÄì¤Î¥«¡¼¥É¡Ë¤Ë¤Ê¤ë¡£
OPTION ARITHMETIC RATIONAL

LET t=fact(52)


LET s=0
FOR i=4 TO 52
   LET b=perm(48,52-i) * 4 * fact(i-1) !»Ä¤ë¥«¡¼¥É¡¢£Ë¡¢¤á¤¯¤é¤ì¤Æ¤¤¤¯¥«¡¼¥É¡Ê£³Ëç¤Î£Ë¤ò´Þ¤à¡Ë
   PRINT i;"Ëç¡¡³ÎΨ=";b/t
   LET s=s+b/t
NEXT i


PRINT "³ÎΨ=";s !¸¡»»

END


ºî°Ù¤Î¡Ö¼ï¡×¤ò¼¬¤¯¤³¤È¤Ç¡¢²Ö¤òËþ³«¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¡Êºé¤­Êý¤âƱÍÍ¡Ë
 

Re: »þ·×¤Î¥×¥í¥°¥é¥ß¥ó¥°

 Åê¹Æ¼Ô¡§Åļ¹¬½õ  Åê¹ÆÆü¡§2008ǯ12·î23Æü(²Ð)19»þ50ʬ37ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.186[¸µµ­»ö¤Ø]

»³Ã椵¤ó¹ÓÅĤµ¤ó
¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
 

¾ê;¤Î·×»»

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ12·î24Æü(¿å)12»þ02ʬ1ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¤É¤ó¤ÊÂ礭¤Ê¡Ê£±£°·å¤Û¤É¤ÏÍߤ·¤¤¡Ëx,n,a¤ËÂФ·¤Æ¤â¡¢¼¡¤Î¾ê;¤¬µá¤Þ¤ë¥×¥í¥°¥é¥à
¤òºî¤Ã¤Æ夭¤¿¤¤¤Ç¤¹¡£
x^n mod a
 

Re: ¾ê;¤Î·×»»

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ12·î24Æü(¿å)12»þ52ʬ41ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.190[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¤É¤ó¤ÊÂ礭¤Ê¡Ê£±£°·å¤Û¤É¤ÏÍߤ·¤¤¡Ëx,n,a¤ËÂФ·¤Æ¤â¡¢¼¡¤Î¾ê;¤¬µá¤Þ¤ë¥×¥í¥°¥é¥à
> ¤òºî¤Ã¤Æ夭¤¿¤¤¤Ç¤¹¡£
> x^n mod a


¡¦Ä󶡺ѤßUBASIC´Ø¿ô¤Îmodpow(1234,56,789)


¡¦PRINT MOD(1234^56,789) !1234^56 mod 789
¡¡Â¿·å¤ÎÀ°¿ô¤Ê¤éÍ­Íý¿ô¥â¡¼¥É¤Ç¼Â¹Ô¤·¤Þ¤¹¡£
¡¡x^n¤¬Â礭¤¤¤È»þ´Ö¤¬¤«¤«¤ê¤Þ¤¹¡£


n¤¬Éé¤ä¼Â¿ô¤Ê¤é¸¡Æ¤¤·¤Ê¤¤¤È¤¤¤±¤Þ¤»¤ó¡£
 

Re: ¾ê;¤Î·×»»

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2008ǯ12·î25Æü(ÌÚ)00»þ05ʬ19ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.190[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¤É¤ó¤ÊÂ礭¤Ê¡Ê£±£°·å¤Û¤É¤ÏÍߤ·¤¤¡Ëx,n,a¤ËÂФ·¤Æ¤â¡¢¼¡¤Î¾ê;¤¬µá¤Þ¤ë¥×¥í¥°¥é¥à
> ¤òºî¤Ã¤Æ夭¤¿¤¤¤Ç¤¹¡£
> x^n mod a

  (x mod a) = r ¤È¤¹¤ì¤Ð¡¢
  (x^n mod a) = (r^n mod a) ¤È¤¤¤¨¤ë¤Î¤Ç¡¢
   x>a ¤Î¤È¤­¤Ï¿ôÃͤ¬Â礭¤¯¤Ê¤ê¤¹¤®¤º¸ú²Ì¤¬¤¢¤ê¤Þ¤¹¡£

  [Ãí°Õ] ½½¿ÊBASIC¤Î¥Ø¥ë¥×¤Ë¤è¤ë¤È¡¢Í­Íý¿ô¥â¡¼¥É¤Ç¤Ï
  ¡Ö¤Ù¤­»Ø¿ô¤Ï-2147483647¡Á2147483647¤ÎÈϰϤÎÀ°¿ô¤Ë¸ÂÄê¡×
  ¤µ¤ì¤ë¤½¤¦¤Ç¤¹¡£

! mod(x^n,a) Í­Íø¿ô¥â¡¼¥É¤Ç¼Â¹Ô
LET x=1234
LET n=56
LET a=789
PRINT "x=";x
PRINT "n=";n
PRINT "a=";a
PRINT
PRINT "x^n=";x^n
PRINT "mod(x^n,a)=";MOD(x^n,a)
PRINT
LET r=MOD(x,a)
PRINT "r=mod(x,a)=";MOD(x,a)
PRINT "r^n=";r^n
PRINT "mod(r^n,a)=";MOD(r^n,a)
END
 

±ÕÂÎËü²Ú¶À¤Î¥³¥Þ¡¼¥·¥ã¥ë

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ12·î25Æü(ÌÚ)01»þ57ʬ10ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.187[¸µµ­»ö¤Ø]

¡¡ºø»ë¤¬¡¢À¸¤¸Æñ¤¤¤è¤¦£±²óžËè¤Ë¡¢µÕ²óž¤µ¤»¤ë¤è¤¦¤Ë¤·¤¿¡£
¡¡±ÕÌ̤ÎÊѲ½¤Ëȼ¤¦ÍÆÀÑÊÑÆ°¤ò¡¢¡Þ3.85% °Ê²¼¤Þ¤Ç²¡¤¨¤¿¡£
¡¡±ÕÂΤÎÆþ¤Ã¤Æ¤¤¤ë¿¿Ãæ¤Î»°³Ñ¤Ë¥³¥ó¥È¥é¥¹¥È¤òÉÕ¤±¤¿¡£¢¨²þ¤´¿·Þ
 

Re: ¾ê;¤Î·×»»

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2008ǯ12·î25Æü(ÌÚ)02»þ09ʬ38ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.190[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¤É¤ó¤ÊÂ礭¤Ê¡Ê£±£°·å¤Û¤É¤ÏÍߤ·¤¤¡Ëx,n,a¤ËÂФ·¤Æ¤â¡¢¼¡¤Î¾ê;¤¬µá¤Þ¤ë¥×¥í¥°¥é¥à
> ¤òºî¤Ã¤Æ夭¤¿¤¤¤Ç¤¹¡£
> x^n mod a

  ²¼¤Î¥×¥í¥°¥é¥à¤Ê¤é¡¢·×»»Ãæ¤ÎºÇÂçÃͤÏr^2¤Ë¤Ê¤ê¤Þ¤¹¡£
  r¤¬8·å°Ê²¼¤Ê¤é10¿Ê¥â¡¼¥É¤ä2¿Ê¥â¡¼¥É¤Ç¼Â¹Ô¤Ç¤­¤Þ¤¹¡£
  r¤¬8·å¤òĶ¤¨¤ë¾ì¹ç¤Ï1000·å¥â¡¼¥É¤Ë¤Ê¤ê¤Þ¤¹¡£

  x,n,a¤¬¤È¤â¤Ë10·å¤Î²¼¤ÎÎã¤Ç¤Ï¡¢1000·å¥â¡¼¥É¤ÇÌó40ʬ¤«¤«¤ê¤Þ¤·¤¿¡£

! mod(x^n,a)
LET x=9876543201
LET n=1234567890
LET a=6789012345

LET r=MOD(x,a)
LET k=r
FOR i=2 TO n
   LET k=MOD(k*r,a)
NEXT i
PRINT k
END
 

Re: ¾ê;¤Î·×»»

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ12·î25Æü(ÌÚ)04»þ29ʬ36ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.190[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

»³Ãæ»á¤Î¡¢EXTERNAL FUNCTION modpow(a,b,n) !a^b mod n ¤Ç¤¹¤¬¡¢
£±£³·å¤Þ¤Ç¡¢UBASIC ¤Î¼Â¹Ô·ë²Ì¤È°ìÃפ·¤Þ¤¹¡£¡Ê½½¿Ê15·ådefault¤Î¤Þ¤Þ¡Ë
£±£´·å¤Ï¡¢°ìÃפ·¤Ê¤¤¡£
   10   print modpow(9999999999990,9999999999991,9999999999992)
   20   print modpow(9999999999991,9999999999992,9999999999993)
   30   print modpow(9999999999992,9999999999993,9999999999994)
   40   print modpow(9999999999993,9999999999994,9999999999995)
   50   print modpow(1999999999999,2999999999999,3999999999999)
   60   print modpow(2999999999999,3999999999999,4999999999999)
   70   print modpow(3999999999999,4999999999999,5999999999999)
   80   print modpow(4999999999999,5999999999999,6999999999999)
run
4328812006896
6296396057422
709006245058
6925339067979
2162020581010
1769850372477
5139725946770
6768106064755
OK
 

Re: ¾ê;¤Î·×»»

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2008ǯ12·î25Æü(ÌÚ)09»þ11ʬ50ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.190[¸µµ­»ö¤Ø]

¡Ö´ðËܤΥ¢¥ë¥´¥ê¥º¥à¡×¤Î¥Ú¡¼¥¸¤ò¸«¤Æ¤¯¤À¤µ¤¤¡£
http://hp.vector.co.jp/authors/VA008683/F_Algor.htm

¤³¤Î¥×¥í¥°¥é¥à¤Ï¡¤a^n mod k ¤ò·×»»¤·¤Þ¤¹¡£
k¤ÎÃͤ¬8·å¤òĶ¤¨¤ë¤È¤­¤ÏÍ­Íý¿ô¥â¡¼¥É¤Ç¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£

100 INPUT k
110 INPUT a,n
120 LET p=1
130 LET b=MOD(a,k)
140 DO UNTIL n=0
150    IF MOD(n,2)=1 THEN LET p=MOD(p*b,k)
160    LET b=MOD(b*b,k)
170    LET n=INT(n/2)
180 LOOP
190 PRINT p
200 END
 

Re: ¾ê;¤Î·×»»

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2008ǯ12·î25Æü(ÌÚ)11»þ23ʬ39ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.190[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

  x^n¤Ç¤Ù¤­»Ø¿ô¤òn=s*t*u¤Èʬ²ò¤¹¤ì¤Ð¡¢¾ê;·×»»¤Î²ó¿ô¤¬s+t+u¤Ë¸º¤é¤»¤ë¤Î¤Çn¤òÁÇ°ø¿ôʬ²ò¤·¤Þ¤·¤¿¡£
n¤¬ÁÇ¿ô¤Ç¤Ê¤±¤ì¤Ð¹â®¤Ç¤¹¡£1000·å¥â¡¼¥É¤Ç¤â¿ôÉäǤ¹¡£

[Åê¹Æ¤·¤è¤¦¤È·Ç¼¨ÈĤò³«¤¤¤¿¤éÇòÀÐÀèÀ¸¤ÎÅê¹Æ¤¬¤¢¤ê¤Þ¤·¤¿¡£ÇòÀÐÀèÀ¸¤Î¥×¥í¥°¥é¥à¤Ç¤Ïn¤¬ÁÇ¿ô¤Ç¤¢¤ë¤«¤Ë̵´Ø·¸¤Ç¹â®¤Ç¤¹¡£¤Þ¤¢¡¢¤»¤Ã¤«¤¯ºî¤Ã¤¿¤Î¤ÇÅê¹Æ¤·¤Þ¤¹¡£]

ÄɲÃÊÔ½¸[SECOND¤µ¤ó¤ÎÅê¹Æ¤Ç¤µ¤«¤Î¤Ü¤Ã¤Æ³Îǧ¤·¤Þ¤·¤¿¤¬¡¢»³ÃæϵÁ¤µ¤ó¤¬¤¹¤Ç¤ËÇòÀÐÀèÀ¸¤ÈƱÍͤÎÅê¹Æ¤ò¤µ¤ì¤Æ¤¤¤Þ¤·¤¿¡£]

DECLARE EXTERNAL SUB prime_factor
PUBLIC NUMERIC prn(2000000),pf(100),f
DECLARE FUNCTION modn
LET x=9876543201
LET n=1234567890
LET a=6789012345
LET r=MOD(x,a)
CALL prime_factor(n) ! ÁÇ°ø¿ôʬ²ò
LET k=r
FOR i=1 TO f
   LET k=modn(k,pf(i),a)
NEXT i
PRINT k
!
FUNCTION modn(r,n,a) ! mod(r^n,a)
   LET kk=r
   FOR ii=2 TO n
      LET kk=MOD(kk*r,a)
   NEXT ii
   LET modn=kk
END FUNCTION
END

REM ** ÁÇ°ø¿ôʬ²ò **
EXTERNAL SUB prime_factor(n)
DECLARE EXTERNAL SUB prime
LET f=0 ! ÁÇ°ø¿ô¤Î¸Ä¿ô
LET q=n ! q¤Ï¡¢¾¦
LET m=1 ! ¸¡¾ÚÍÑÊÑ¿ô
FOR i=1 TO 10
   READ prn(i)
NEXT i
DATA 2,3,5,7,11,13,17,19,23,29
LET i=1
DO WHILE MOD(q,prn(i))=0 ! °ø¿ôȽÄê¥ë¡¼¥Á¥ó
   LET f=f+1
   LET pf(f)=prn(i) ! pf(f)¤Ïn¤ÎfÈÖÌܤÎÁÇ°ø¿ô
   LET q=q/prn(i)
   LET m=m*prn(i)
LOOP
LET i=2
DO WHILE prn(i)<=SQR(q)
   DO WHILE MOD(q,prn(i))=0 ! °ø¿ôȽÄê¥ë¡¼¥Á¥ó
      LET f=f+1
      LET pf(f)=prn(i) ! pf(f)¤Ïn¤ÎfÈÖÌܤÎÁÇ°ø¿ô
      LET q=q/prn(i)
      LET m=m*prn(i)
   LOOP
   IF q=1 THEN EXIT DO
   LET i=i+1
   IF i>10 THEN CALL prime(i) ! iÈÖÌܤÎÁÇ¿ô
LOOP
IF q<>1 THEN
   LET f=f+1
   LET pf(f)=q
   LET m=m*q
END IF
IF m<>n THEN PRINT "error !!"
END SUB
!
REM ** ÁÇ¿ôÎóÀ¸À®(kÈÖÌܤÎÁÇ¿ô) **
EXTERNAL SUB prime(k)
LET m30=MOD(prn(k-1),30)
IF m30=1 OR m30=23 THEN LET a=prn(k-1)+6 ELSE LET a=prn(k-1)-2*MOD(m30,3)+6
DO
   LET sqra=SQR(a)
   FOR j=4 TO k-1
      IF MOD(a,prn(j))=0 THEN EXIT FOR
      IF prn(j)>=sqra THEN
         LET  prn(k)=a
         EXIT SUB
      END IF
   NEXT j
   LET m30=MOD(a,30)
   IF m30=1 OR m30=23 THEN LET a=a+6 ELSE LET a=a-2*MOD(m30,3)+6
LOOP
END SUB
 

¾ê;·×»»¤ÎÄ´ºº¤è¤ê

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ12·î25Æü(ÌÚ)15»þ23ʬ30ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¿ô³Ø¤Ë¾Ü¤·¤¤Êý¤Ï°Ê²¼¤Î¤³¤È¤ÏÌÀÇò¤Ê¤³¤È¤Ç¤¢¤ë¤Ç¤·¤ç¤¦¤¬¡¢»ä¤Ë¤È¤Ã¤Æ¤ÏÂçȯ¸«¤Ç¤·¤¿¡£
°ÊÁ°
¥È¥é¥ó¥×¤Î¥·¥ã¥Ã¥Õ¥ë¤Ë¶½Ì£¤¬¤¢¤Ã¤¿¤È¤­¡¢¼¡¤Î¤³¤È¤òÄ´¤Ù¤Æ¤¤¤Þ¤·¤¿¡£
¥«¡¼¥É¡Ê2nËç¡Ë¤Ç¥¤¥ó¤Î¥ê¥Õ¥ë¥·¥ã¥Ã¥Õ¥ë¤ò¤·¤¿¤È¤­¡¢
¡ã¤¤¤Þ¡¢¥«¡¼¥É¤¬ £²£îËç
£á1¡¢£á2¡¢¡¦¡¦¡¦¡¢£á£î¡¢£â1¡¢£â2¡¢¡¦¡¦¡¦¡¢£â£î
¤¢¤ë¤È¤­¡¢¤½¤Î½ç½ø¤òʤÙÂؤ¨¤Æ¡¢
£â1¡¢£á1¡¢£â2¡¢£á2¡¢¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¢£â£î¡¢£á£î
¤È¤Ê¤ë¤È¤­¡¢
£²£î Ëç¤Î¥«¡¼¥É¤¬¡Ö¥¤¥ó¤Ç¥ê¥Õ¥ë¥·¥ã¥Ã¥Õ¥ë¡×¤µ¤ì¤¿¤È¤¤¤¦¤³¤È¤Ë¤¹¤ë¡£¡ä

¤³¤ì¤Ë¤Ä¤¤¤ÆÄ´¤Ù¤Æ¤¤¤¯¤È¡Ê£²¡Á£±£°£°Ëç¤ÇÄ´ºº¡Ë

Ëç¿ô Ʊ½çÉü¸µ²ó¿ô µÕ½çÉü¸µ²ó¿ô ¡¡ ¡¡Ëç¿ô Ʊ½çÉü¸µ²ó¿ô µÕ½çÉü¸µ²ó¿ô
£²   £²           £±           ¡¡ ¡¡£µ£² £µ£²         £²£¶
£´   £´           £²           ¡¡ ¡¡£µ£´ £²£°
£¶   £³     ¡¡ ¡¡                  ¡¡£µ£¶ £±£¸           £¹
£¸   £¶           £³           ¡¡ ¡¡£µ£¸ £µ£¸         £²£¹
£±£° £±£°         £µ           ¡¡ ¡¡£¶£° £¶£°         £³£°
£±£² £±£²         £¶           ¡¡ ¡¡£¶£²   £¶
£±£´   £´ ¡¡                    ¡¡ ¡¡£¶£´ £±£²           £¶
£±£¶   £¸         £´           ¡¡ ¡¡£¶£¶ £¶£¶         £³£³
£±£¸ £±£¸         £¹           ¡¡ ¡¡£¶£¸ £²£²
£²£°   £¶ ¡¡                    ¡¡ ¡¡£·£° £³£µ
£²£² £±£±                   ¡¡ ¡¡ ¡¡£·£²   £¹
£²£´ £²£°       £±£°           ¡¡ ¡¡£·£´ £²£°
£²£¶ £±£¸         £¹           ¡¡ ¡¡£·£¶ £³£°
£²£¸ £²£¸       £±£´           ¡¡ ¡¡£·£¸ £³£¹
£³£°   £µ ¡¡                    ¡¡ ¡¡£¸£° £µ£´         £²£·
£³£² £±£°         £µ           ¡¡¡¡ £¸£² £¸£²         £´£±
£³£´ £±£² ¡¡                    ¡¡ ¡¡£¸£´   £¸
£³£¶ £³£¶       £±£¸           ¡¡ ¡¡£¸£¶ £²£¸
£³£¸ £±£² ¡¡                   ¡¡ ¡¡£¸£¸ £±£±
£´£° £²£°       £±£°           ¡¡ ¡¡£¹£° £±£²
£´£² £±£´         £·           ¡¡ ¡¡£¹£² £±£°
£´£´ £±£² ¡¡ ¡¡                   ¡¡£¹£´ £³£¶
£´£¶ £²£³ ¡¡ ¡¡                    ¡¡£¹£¶ £´£¸         £²£´
£´£¸ £²£± ¡¡ ¡¡                    ¡¡£¹£¸ £³£°         £±£µ
£µ£° ¡¡£¸ ¡¡ ¡¡                  ¡¡£±£°£°1£°£°  ¡¡     £µ£°

¤Ê¤ëÄ´ºº·ë²Ì¤òÆÀ¤Æ¤¤¤Þ¤·¤¿¡£

¤³¤Î¤³¤È¤«¤é¡¢¥È¥é¥ó¥×¡Ê£µ£²Ëç¡Ë¤Ç
¥¢¥¦¥È¤Î¥ê¥Õ¥ë¥·¥ã¥Ã¥Õ¥ë¡Ê¸µ¤Î¥È¥Ã¥×¤È¥Ü¥È¥à¤ò¾ï¤ËºÆ¤Ó¥ê¥Õ¥ë¸å¤Î¥È¥Ã¥×¤È¥Ü¥È¥à¤Ë¤¹¤ë¡£¡Ë¤ò¤¹¤ì¤Ð¡¢£µ£²Ëç¤Î¥¢¥¦¥È¥·¥ã¥Ã¥Õ¥ë¡á£µ£°Ëç¤Î¥¤¥ó¥·¥ã¥Ã¥Õ¥ë¤ËƱ¤¸¤Ê¤Î¤Ç¡¢£¸²ó
¤Ç¸µ¤ËÌá¤ë¤³¤È¤¬µ¯¤­¤ë¤³¤È¤Ë¤Ê¤ë¡£

¤È¤³¤í¤Ç¤³¤³¤Ë½Ð¤Æ¤¯¤ë¿ô»ú¤¬¥é¥ó¥À¥à¤Ëʤó¤Ç¤¤¤¯¤³¤È¤ËÉԻ׵Ĥµ¤ò´¶¤¸¤Æ¤¤¤Þ¤·¤¿¡£
º£ÅÙ¡¢ºîÀ®¤·¤Æ夤¤¿a^n(mod k)¤ò·×»»¤·¤Æɽ¤òºîÀ®¤·¤Æ¡¢Ä¯¤á¤Æ¤¤¤Æ¤¢¤ë´Ø·¸¤¬¤¢¤ë¤³¤È¤Ëµ¤¤Å¤­¤Þ¤·¤¿¡£

¤³¤ÎƱ½çÉü¸µ²ó¿ô¤¬
a=2,k=¥«¡¼¥É¤ÎËç¿ô¡Ü£±¤Ç·×»»¤µ¤»¤¿¤È¤­¡¢Í¾¤ê¤ÎÃͤ¬£±¤òºÇ½é¤Ë¤È¤ë»þ¤Î£î¤ËÂбþ¤·¤¿¡£
¡ãÎã¡ä
¥«¡¼¥É£µ£²Ëç¤Ê¤é
¡¡£²¡°£î¢á£±¡ÊMOD53)
¤Ê¤ëºÇ¾®¤Î£î¤¬Æ±½çÉü¸µ²ó¿ô¤Ë¤Ê¤Ã¤Æ¤¤¤¿¡£
¤Þ¤¿
¡¡£²¡°£î¢á£µ£²¡¡¡ÊMOD53)
¤Ê¤ëºÇ¾®£î¤¬µÕ½çÉü¸µ²ó¿ô¤òÃΤ餻¤ë¡£

¥È¥é¥ó¥×¥·¥ã¥Ã¥Õ¥ë¤È¾ê;¤¬»×¤ï¤Ì¤È¤³¤í¤Ç·Ò¤¬¤Ã¤¿¤³¤È¤Ë¤µ¤é¤ËÉԻ׵Ĥµ¤¬¿¼¤Þ¤ê¤Þ¤·¤¿
 

Re: ¾ê;·×»»¤ÎÄ´ºº¤è¤ê

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ12·î25Æü(ÌÚ)16»þ50ʬ57ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.198[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¥«¡¼¥É£µ£²Ëç¤Ê¤é
> ¡¡£²¡°£î¢á£±¡ÊMOD53)
> ¤Ê¤ëºÇ¾®¤Î£î¤¬Æ±½çÉü¸µ²ó¿ô¤Ë¤Ê¤Ã¤Æ¤¤¤¿¡£
> ¤Þ¤¿
> ¡¡£²¡°£î¢á£µ£²¡¡¡ÊMOD53)
> ¤Ê¤ëºÇ¾®£î¤¬µÕ½çÉü¸µ²ó¿ô¤òÃΤ餻¤ë¡£



£±²ó¤Î¥·¥ã¥Ã¥Õ¥ë¤Ç¥«¡¼¥Ék¤¬¸½¤ì¤ë°ÌÃÖ¤òf(k)¤Ï¡Ê¥«¡¼¥Ék¤Ïf(k)ÈÖÌܤˤ¢¤ë¡Ë
¡¡f(k)=MOD(2*k,n+1)
¤Èɽ¤»¤ë¡£

m²ó¥·¥ã¥Ã¥Õ¥ë¤ò·«¤êÊÖ¤¹¤È
f(f(f(¡Ä(f(k)))))=2*(2*(2*¡Ä(2*k mod n+1) mod n+1) mod n+1) mod n+1=2^m*k mod n+1


°ìÍ÷ɽ¤ò¤Ä¤¯¤ë¥×¥í¥°¥é¥à
!¥ê¥Õ¥ë¥·¥ã¥Ã¥Õ¥ë

!nËç¤Î¥«¡¼¥É¤ò1,2,3,¡Ä,n-1,n¤Ëʤ٤롣
!£±²ó¤Î¥·¥ã¥Ã¥Õ¥ë¤Ç¥«¡¼¥Ék¤¬¸½¤ì¤ë°ÌÃÖ¤òf(k)¤Èɽ¤¹¡£¡Ê¥«¡¼¥Ék¤Ïf(k)ÈÖÌܤˤ¢¤ë¡Ë
DEF f(k)=MOD(2*k,n+1)

FOR n=2 TO 100 STEP 2 !¶ö¿ô
   PRINT USING "### Ë硧":n;

   LET x=1 !¥«¡¼¥Éx¤ËÃåÌÜ
   LET iter=1000
   FOR m=1 TO iter !m²ó¤Î¥·¥ã¥Ã¥Õ¥ë¡¡¢¨
      LET x=f(x) !2^m*k (mod n+1)
      !!!PRINT m;x
      IF x=n THEN PRINT USING "### ²óÌܤǵս硢":m; !µÕ½ç
      IF x=1 THEN EXIT FOR !¤â¤È¤ËÌá¤ë
   NEXT m
   IF m>iter THEN
      PRINT USING "### ²ó¤Ç¤Ï¸µ¤ËÌá¤ê¤Þ¤»¤ó¡£":m
   ELSE
      PRINT USING "### ²óÌܤ˸µ¤ËÌá¤ë":m
   END IF

NEXT n

END


UBASIC¤Îmodinv´Ø¿ô¤ò»È¤Ã¤¿¾ì¹ç¡Ê¥µ¥Ö¥ë¡¼¥Á¥ó¤Ï¾Êά¡Ë
FOR n=2 TO 100 STEP 2 !¶ö¿ô
   PRINT USING "### Ë硧":n;

   LET iter=1000
   FOR m=1 TO iter
      LET x=modinv(2^m,n+1) !£±ËçÌܤΥ«¡¼¥É¤Î¸µ¤Î°ÌÃÖ¤òÆÀ¤ë
      IF x=n THEN PRINT USING "### ²óÌܤǵս硢":m; !µÕ½ç
      IF x=1 THEN EXIT FOR !¤â¤È¤ËÌá¤ë
   NEXT m
   IF m>iter THEN
      PRINT USING "### ²ó¤Ç¤Ï¸µ¤ËÌá¤ê¤Þ¤»¤ó¡£":m
   ELSE
      PRINT USING "### ²óÌܤ˸µ¤ËÌá¤ë":m
   END IF

NEXT n
END
 

Re: ¥×¥í¥°¥é¥à¤Î½ñ¤­Ä¾¤·

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ12·î25Æü(ÌÚ)20»þ28ʬ59ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.171[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

b=0 ¤Î¤È¤­¤ÎÃͤ¬ÊѤǤ¹¡£EXTERNAL FUNCTION modpow(a,b,n) !a^b¢áx mod n ¤Îx¤òÊÖ¤¹
 

Re: ¥×¥í¥°¥é¥à¤Î½ñ¤­Ä¾¤·

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ12·î25Æü(ÌÚ)21»þ19ʬ17ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.200[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> b=0 ¤Î¤È¤­¤ÎÃͤ¬ÊѤǤ¹¡£EXTERNAL FUNCTION modpow(a,b,n) !a^b¢áx mod n ¤Îx¤òÊÖ¤¹

b=0¤Ç¤Î¾ì¹çʬ¤±¤ÏɬÍפʤ·¤Ç¤¹¤Í¡£¡Ê¸¶·Á¤Ç¤Ïmodpow=1¤Ç¤Ï¤Ê¤¯¤Æ¡¢S=1¤Ç¤·¤¿¡£¡Ë


EXTERNAL FUNCTION modpow(a,b,n) !a^b¢áx mod n ¤Îx¤òÊÖ¤¹
   LET S=1
   DO WHILE b>0
      IF MOD(b,2)=1 THEN LET S=MOD(S*a,n) !¥Ó¥Ã¥È¤¬£±¤Ê¤é·×»»¤¹¤ë
      LET b=INT(b/2) !¤Ù¤­¾èb¤ò£²¿ÊŸ³«¤¹¤ë
      LET a=MOD(a*a,n)
   LOOP
   LET modpow=S
END FUNCTION
 

Re: ¾ê;·×»»¤ÎÄ´ºº¤è¤ê

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ12·î26Æü(¶â)15»þ25ʬ9ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.198[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£


°ÊÁ°¡¢»³¤ò»È¤Ã¤¿¥·¥ã¥Ã¥Õ¥ë¤¬¤¢¤Ã¤¿¤È»×¤¤¤Þ¤¹¡£

¡Ö¤¢¤ë¥·¥ã¥Ã¥Õ¥ëÊýË¡¤Îµ¬Â§À­¡× > No.109 [¸µµ­»ö¤Ø]


¤³¤Î¾ì¹ç¤Ï¡¢

¡¡LET p=3 !»³¤Î¿ô
¡¡DEF f(k)=MOD(p*(n-k+1),n+1)

¡¡¤¿¤À¤·¡¢n=m*p¡Ên¤Ïp¤ÎÇÜ¿ô¡Ë¡£

¤È¤Ê¤ë¤Î¤Ç¡¢modpow´Ø¿ô¤Þ¤¿¤Ïmodinv´Ø¿ô¤ò»È¤¦¤Ê¤é¡Ê¥µ¥Ö¥ë¡¼¥Á¥ó¤Ï¾Êά¡Ë
!»³¤ò»È¤Ã¤¿¥·¥ã¥Ã¥Õ¥ë
LET p=3 !»³¤Î¿ô

FOR n=p TO 100 STEP p !p¤ÎÇÜ¿ô
   PRINT USING "### Ë硧":n;

   LET iter=1000
   FOR m=1 TO iter
   !!!LET x=modinv((n*p)^m,n+1) !£±ËçÌܤΥ«¡¼¥É¤Î¸µ¤Î°ÌÃÖ¡Ê¥«¡¼¥ÉÈÖ¹æ¡Ë¤òÆÀ¤ë
      LET x=modpow(n*p,m,n+1) !£±È֤Υ«¡¼¥É¤Î°ÌÃÖ¤òÆÀ¤ë
      IF x=n THEN PRINT USING "### ²óÌܤǵս硢":m; !µÕ½ç
      IF x=1 THEN EXIT FOR !¤â¤È¤ËÌá¤ë
   NEXT m
   IF m>iter THEN
      PRINT USING "##### ²ó¤Ç¤Ï¸µ¤ËÌá¤ê¤Þ¤»¤ó¡£":m
   ELSE
      PRINT USING "### ²óÌܤ˸µ¤ËÌá¤ë":m
   END IF

NEXT n

END

¤Ç²ó¿ô¤¬µá¤Þ¤ë¤È»×¤¤¤Þ¤¹¡£
 

¤ª¡¼¡¼¡¼¡¼¡¼

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ12·î26Æü(¶â)18»þ30ʬ43ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.202[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¥Û¥ó¥È¤À¡ª¡ª¡ª
°ÊÁ°¤Î»³Ê¬¤±¥·¥ã¥Ã¥Õ¥ë¤âmodinv¤ämodpow´Ø¿ô¤ò»È¤¦¤³¤È¤Ç²òÌÀ¤Ç¤­¤ë¤ó¤Ç¤¹¤Í¡£
¿ô¼°¤À¤±¤À¤È¶á´ó¤êÆñ¤¤°õ¾Ý¤¬¤¢¤ê¤Þ¤¹¤¬¡¢¤³¤ó¤Ê¤Ë¤âÌòΩ¤Äµ¡Ç½¤òÍ­¤·¤Æ¤¤¤ë¤Ê¤ó¤Æ¤¹¤Ð¤é¤·¤¤¡£
À°¿ôÏÀ¤ÎËܤò¤¢¤é¤¿¤á¤ÆÆɤߤ¿¤¯¤Ê¤ê¤Þ¤·¤¿¡£
¿ô»ú¤È¤Ï¤Þ¤Ã¤¿¤¯ÉԻ׵Ĥʿ¶¤ëÉñ¤¤¤ò¤¹¤ë¤â¤ó¤À¡£¡Ê¿ô»ú¤Ë¤·¤Æ¤ß¤ì¤Ð¡¢ÅöÁ³¤Î¹ÔÆ°¤Ê¤ó¤Ç¤·¤ç¤¦¤¬¡¦¡¦¡¦¡Ë
¤³¤ì¤Ï¿Í´ÖÂÐ¥³¥ó¥Ô¥å¡¼¥¿¤Î´Ø·¸¤Ë»÷¤Æ¤¤¤ë¤Î¤«¤â¤·¤ì¤Ê¤¤¡£
¥³¥ó¥Ô¥å¡¼¥¿¤Ï»Ø¼¨¤µ¤ì¤¿Ä̤ê¤Î¹ÔÆ°¤ò¤·¤Æ¤¤¤ë¤Î¤Ë¡¢»×¤¦¤è¤¦¤ËÆ°¤«¤Ê¤»¤Ê¤¤¤³¤Î¤â¤É¤«¤·¤µ¤Ë»÷¤Æ¤¤¤Þ¤¹¡£
 

»ÅÍͤǤ·¤ç¤¦¤«¡£

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ12·î27Æü(ÅÚ)00»þ15ʬ51ÉÃ
ÊÖ¿®¡¦°úÍÑ
  !
!ʸ»ú¤¬¡¢¶ÀÁü¤Ë¤Ê¤ê¤Þ¤»¤ó¡¢»ÅÍͤǤ·¤ç¤¦¤«¡£
!
SET TEXT JUSTIFY "center","half"
SET WINDOW -2, 2, -2, 2
SET COLOR MIX(15) 0.5,0.5,0.5
DRAW grid

DRAW test WITH SCALE( 1, 1)
DRAW test WITH SCALE(-1, 1)
DRAW test WITH SCALE( 1,-1)

PICTURE test
   PLOT LINES: 0,0; 1,0; 0.7,0.8; 0,0
   PLOT POINTS: 0.2,0.1
   PLOT TEXT,AT 0.6,0.4 :"1234"
END PICTURE

END
 

»þ·×¡¢»þ·×¡¢»þ·×

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ12·î27Æü(ÅÚ)01»þ50ʬ5ÉÃ
ÊÖ¿®¡¦°úÍÑ
  !£±¤Ä³Ð¤¨¤Ë²á¤®¤ë¤«¡©¼è¤ê¤¢¤¨¤º¥ß¥é¡¼¤ÎÃæ¤ËÆþ¤ì¤Æ¤ß¤¿¡£plot text ¤òÈò¤±¤Æ¡¢
!plot label ¤ò»ÈÍѤ·¤¿¤Î¤Ç¡¢Ê¸»ú¤Ø¤Î¸ú²Ì¤Ï¡¢¤¢¤ê¤Þ¤»¤ó¡£

!¡¡»þ·×¡¢»þ·×¡¢»þ·×
!-------------------
LET N=2
LET NN=2^N
SET TEXT font "Century",11
SET TEXT JUSTIFY "center","half"
SET TEXT BACKGROUND "OPAQUE"
SET WINDOW -250/NN,250/NN,250/NN,-250/NN

LET ¦Õ=0
LET stp=-PI/180*6
DO
   LET t=INT(TIME)
   IF t0<>t THEN
      LET t0=t
      IF 2*PI<=ABS(¦Õ) THEN LET stp=-stp
      LET ¦Õ=REMAINDER(¦Õ, 2*PI) +stp
      !-----
      SET DRAW mode hidden
      CLEAR
      DRAW D4(N) WITH SHIFT(-300/2,-300/2/SQR(3))*ROTATE(¦Õ*(-1)^N)*SCALE(1,(-1)^N)
      DRAW center WITH SHIFT(-300/2/NN,-300/2/NN/SQR(3))*ROTATE(¦Õ)
      PLOT TEXT,AT 180/NN,-240/NN:"Right Click to Stop"
      SET DRAW mode explicit
   ELSE
      WAIT DELAY 0.05 !¡¡¾ÊÅÅÎϸú²Ì
   END IF
   MOUSE POLL mx,my,mlb,mrb
LOOP UNTIL mrb>=1 !¡¡±¦¥¯¥ê¥Ã¥¯¤ÇÄä»ß

PICTURE center
   SET LINE COLOR 2
   SET LINE width 2
   PLOT LINES:0,0;300/NN,0;300/2/NN,300/2/NN*SQR(3);0,0
   SET LINE width 1
   SET LINE COLOR 1
END PICTURE

!------
PICTURE D4(k)
   IF 0< k THEN
      DRAW D4(k-1) WITH SCALE(1/2,1/2)*SHIFT(300/4,SQR(3)*300/4) !¡¡Æ⦤ξå
      DRAW D4(k-1) WITH SCALE(1/2,-1/2)*SHIFT(300/4,SQR(3)*300/4) !¡¡Æ⦤ÎÃæ
      DRAW D4(k-1) WITH SCALE(1/2,1/2)*ROTATE(-PI*2/3)*SHIFT(300/4,SQR(3)*300/4) !Æ⦤κ¸
      DRAW D4(k-1) WITH SCALE(1/2,1/2)*ROTATE(PI*2/3)*SHIFT(300,0) !¡¡Æ⦤α¦
   ELSE
      DRAW »þ·×¿Þ WITH ROTATE(-¦Õ)*SHIFT(300/2,300/2/SQR(3))
      PLOT LINES:0,0;300,0;300/2,SQR(3)*300/2;0,0 !¡¡³°Â¦¤Î´ð½à»°³Ñ·Á¡ÊľÀܤÎÉÁ²è¤Ï̵¤·¡£)
   END IF
END PICTURE

!------
PICTURE »þ·×¿Þ
   SET AREA COLOR 1
   FOR i=1 TO 60
      LET a=PI/30*(i-15)
      IF MOD(i,5)=0 THEN
         PLOT label,AT 60*COS(a)+1, 60*SIN(a) :STR$(i/5) !¿ô»ú
         DRAW disk WITH SCALE(1)*SHIFT(72*COS(a),72*SIN(a)) !£µÊ¬ÌÜÀ¹¤ê
      ELSE
         DRAW disk WITH SCALE(.5)*SHIFT(72*COS(a),72*SIN(a)) !£±Ê¬ÌÜÀ¹¤ê
      END IF
   NEXT i
   !---¡¡00:00 ¤«¤é£ôÉà ¤Î¿Ë²óž Gear
   DRAW hand(1) WITH SCALE(2.5, 0.75)*ROTATE(t*PI/21600) !¡¡»þ¿Ë
   DRAW hand(1) WITH ROTATE(t*PI/1800) !¡¡Ê¬¿Ë
   DRAW hand(1) WITH SCALE(0, 1.1)*ROTATE(t*PI/30) !¡¡ÉÿË
   !---¡¡Ãæ¿´¤Î¾þ¤ê
   DRAW disk WITH SHIFT(0,0)*SCALE(4)
END PICTURE

PICTURE hand(c) !¡¡£³¿Ë¶¦ÍÑ
   SET AREA COLOR c
   PLOT AREA: -1,15; 1,15; 1,-60; -1,-60
END PICTURE

END
 

µ¿Ìä

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ12·î27Æü(ÅÚ)13»þ38ʬ59ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.205[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

Ëü²Ú¶À¤ËËü²Ú¶À¤òÆþ¤ì¹þ¤à¤³¤È¤Ï¤Ç¤­¤ë¤Î¤Ç¤·¤ç¤¦¤«¡©
Ãæ¤Ë¿å¤ä»þ·×¤¬Æþ¤ì¤é¤ì¤ë¤Ê¤é¡¢Ãæ¤Ë¸«¤Æ¤¤¤ëËü²Ú¶À¤Î±ÇÁü¤òÆþ¤ì¤Æ¤ß¤Æ¸«¤¿¤¤¡£
 

Re: µ¿Ìä

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ12·î27Æü(ÅÚ)14»þ18ʬ26ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.206[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> Ëü²Ú¶À¤ËËü²Ú¶À¤òÆþ¤ì¹þ¤à¤³¤È¤Ï¤Ç¤­¤ë¤Î¤Ç¤·¤ç¤¦¤«¡©
> Ãæ¤Ë¿å¤ä»þ·×¤¬Æþ¤ì¤é¤ì¤ë¤Ê¤é¡¢Ãæ¤Ë¸«¤Æ¤¤¤ëËü²Ú¶À¤Î±ÇÁü¤òÆþ¤ì¤Æ¤ß¤Æ¸«¤¿¤¤¡£

¼Â¤Ï¡¢¤½¤Î¤´ÊÖ»ö¤ò¤¹¤ëÁ°¤Ë¡¢
°ÊÁ°¤Ë¡¢Åê¹Æ¤·¤¿¤â¤Î¤Ç¤¹¤¬¡¢²¼¤Î¥×¥í¥°¥é¥à¤òÁö¤é¤»¤Æ¸«¤Æ²¼¤µ¤¤¡£

!-----------------------------------------------------
!¥·¥ë¥Ô¥ó¥¹¥­¡¼¤Î¥¬¥¹¥±¥Ã¥È¤Èʤ٤ÆÆ°¤«¤·¤Æ¤ß¤ë¡£

OPTION ARITHMETIC NATIVE
DIM px(11),py(11)

MAT READ px
DATA 0.20, 0.40, 0.60, 0.80, 0.70, 0.60, 0.50, 0.40, 0.30, 0.20, 0.40
MAT READ py
DATA 0.11, 0.11, 0.11, 0.11, 0.29, 0.47, 0.65, 0.47, 0.29, 0.11, 0.11

!----------
FOR N=0 TO 4
   FOR s=9 TO 1 STEP -1
      SET DRAW mode hidden
      CLEAR
      SET WINDOW -0.4,1.6, -1.1,0.9
      PLOT TEXT,AT 0.6,0.8:"¥ß¥é¡¼½Ì¾®£´Ê¬´ô"
      PLOT TEXT,AT 0.8,0.7, USING "N= %%":N
      DRAW D4(N)
      SET WINDOW -1.0,1.0, -0.05,1.95
      PLOT TEXT,AT 0.6,0.8:"Ãæ¤òÈ´¤¤¤¿¤â¤Î"
      PLOT TEXT,AT 0.8,0.7, USING "N= %%":N
      DRAW D42(N)
      SET WINDOW 0.0,4.0, -0.1,3.9
      PLOT TEXT,AT 0.1,1.8:"¥·¥ë¥Ô¥ó¥¹¥­¡¼¤Î¥¬¥¹¥±¥Ã¥È"
      PLOT TEXT,AT 1.2,1.6, USING "N= %%":N
      DRAW D3(N)
      SET DRAW mode explicit
      WAIT DELAY 0.2
   NEXT s
NEXT N

!------ ¥ß¥é¡¼½Ì¾®£´Ê¬´ô
PICTURE D4(k)
   IF 0<k THEN
      DRAW D4(k-1) WITH SCALE(1/2,1/2)*SHIFT(1/4,SQR(3)/4) !¡¡¾å
      DRAW D4(k-1) WITH SCALE(1/2,-1/2)*SHIFT(1/4,SQR(3)/4) !¡¡Ãæ
      DRAW D4(k-1) WITH SCALE(1/2,1/2)*ROTATE(-PI*2/3)*SHIFT(1/4,SQR(3)/4) !¡¡º¸
      DRAW D4(k-1) WITH SCALE(1/2,1/2)*ROTATE(PI*2/3)*SHIFT(1,0) !¡¡±¦
   ELSE
      DRAW Set01
   END IF
END PICTURE

!------ ¥ß¥é¡¼½Ì¾®£´Ê¬´ô¡ÊÃæ¡Ë¤ò³°¤¹¤È¡¢¥·¥ë¥Ô¥ó¥¹¥­¡¼¤Î¥¬¥¹¥±¥Ã¥È¤â¤É¤­¤Ë¤Ê¤ë¡£
PICTURE D42(k)
   IF 0<k THEN
      DRAW D42(k-1) WITH SCALE(1/2,1/2)*SHIFT(1/4,SQR(3)/4) !¡¡¾å
      ! ¤³¤ì¤ò³°¤¹¡¡DRAW D42(k-1) WITH SCALE(1/2,-1/2)*SHIFT(1/4,SQR(3)/4) !¡¡Ãæ
      DRAW D42(k-1) WITH SCALE(1/2,1/2)*ROTATE(-PI*2/3)*SHIFT(1/4,SQR(3)/4) !¡¡º¸
      DRAW D42(k-1) WITH SCALE(1/2,1/2)*ROTATE(PI*2/3)*SHIFT(1,0) !¡¡±¦
   ELSE
      DRAW Set01
   END IF
END PICTURE

!------ ¥·¥ë¥Ô¥ó¥¹¥­¡¼¤Î¥¬¥¹¥±¥Ã¥È
PICTURE D3(k)
   IF 0<k THEN
   !---¥ê¥ó¥¯¡¦BASIC¤ÇÉÁ¤¯¼«¸ÊÁê»÷¿Þ·Á¤«¤éÇÒ¼Ú
      DRAW D3(k-1) WITH SCALE(1/2)
      DRAW D3(k-1) WITH SHIFT(-2,0)*SCALE(1/2)*SHIFT(2,0)
      DRAW D3(k-1) WITH SHIFT(-1,-SQR(3))*SCALE(1/2)*SHIFT(1,SQR(3))
   ELSE
      DRAW Set01
   END IF
END PICTURE

!------ ¿Æ½¸¹ç¤Î»°³Ñ¿Þ£±Ëç
PICTURE Set01
   PLOT LINES: 0,0; 1,0 ;0.5,SQR(3)/2 ;0,0
   SET AREA COLOR 2
   DRAW disk WITH SCALE(0.1)*SHIFT(px(s),py(s)) ! ¾þ¤ê£±
   SET AREA COLOR 3
   DRAW disk WITH SCALE(0.1)*SHIFT(px(s+1),py(s+1)) ! ¾þ¤ê£²
   SET AREA COLOR 4
   DRAW disk WITH SCALE(0.1)*SHIFT(px(s+2),py(s+2)) ! ¾þ¤ê£³
END PICTURE

END
 

¥·¥ã¥Ã¥Õ¥ë¤Ë¤Ä¤¤¤ÆÄ´¤Ù¤Æ¤¤¤¿¤é

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ12·î29Æü(·î)07»þ01ʬ26ÉÃ
ÊÖ¿®¡¦°úÍÑ
  !¥·¥ã¥Ã¥Õ¥ë¤Ë¤Ä¤¤¤ÆÄ´¤Ù¤Æ¤¤¤¿¤é¡¢¤³¤Î¥Ú¡¼¥¸¤Ë
!http://www004.upp.so-net.ne.jp/s_honma/number/shuffle.htm#ÊÌɽ
!£Ç£Á£É ¤µ¤ó¤ÎÄ´ºº¤µ¤ì¤¿É½¤È¡¢¤½¤Î²¼¤ÎÊý¤Ë¡¢£Ã¸À¸ì¤Î¸¡¾Ú¥×¥í¥°¥é¥à¤¬
!¤¢¤ê¤Þ¤·¤¿¤Î¤Ç¡¢½½¿ÊBASIC ¤Ç¤âÆ°¤¯¤è¤¦¤Ë½ñ¤­Ä¾¤·¤Æ¤ß¤Þ¤·¤¿¡£
!¾¡¼ê¤Ë²ÃÉ®¤·¤Æ¡¢·ë²Ì¤Ë¡¢¤ª¤«¤·¤Ê¿ô»ú¤¬¡¢½Ð¤¿¤ê¤·¤Æ¤¤¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£

!#include <stdio.h>
!#include <string.h>
!int buf[1000], bufw[1000];
!int n;

!void shuffle(void)
!{
!¡¡int i;
!¡¡memcpy(bufw, buf, sizeof(buf[0]) * n);
!¡¡for(i = 0; i < n; ++i)
!¡¡¡¡buf[i] = bufw[i / 2 + (i + 1) % 2 * n / 2];
!}

!int main(void)
!{
!¡¡int i, c, cc;
!¡¡for(n = 2; n <= 1000; n += 2){
!¡¡¡¡for(i = 0; i < n; ++i)
!¡¡¡¡¡¡buf[i] = i;
!¡¡¡¡cc = c = 0;
!¡¡¡¡do{
!¡¡¡¡¡¡++c;
!¡¡¡¡¡¡shuffle();
!¡¡¡¡¡¡for(i = 0; i < n; ++i)
!¡¡¡¡¡¡¡¡if(buf[i] != n - 1 - i)
!¡¡¡¡¡¡¡¡¡¡break;
!¡¡¡¡¡¡if(i >= n && cc == 0)
!¡¡¡¡¡¡¡¡cc = c;
!¡¡¡¡¡¡for(i = 0; i < n; ++i)
!¡¡¡¡¡¡¡¡if(buf[i] != i)
!¡¡¡¡¡¡¡¡¡¡break;
!¡¡¡¡}while(i < n);
!¡¡¡¡printf("%3d %3d %3d\n", n, c, cc);
!¡¡}
!¡¡return 0;
!}

!----------------------------
!½½¿ÊBASIC ¤Ë°Ü¿¢¡£
! i=0~n-1 ¤Ï¡¢¸«¤Å¤é¤¤¤Î¤Ç i=1~n¡¡¤½¤Î¾ ̵ÃDzÃÉ®¡¢¤´ÍÆ¼Ï ¡Ë

LET maxim=13 !¡¡ºÇÂçËç¿ô 2~1000
DIM buf(1000), bufw(1000)

SUB in_riffle_shuffle !¥¤¥ó¤Î¥ê¥Õ¥ë¡£´ñ¿ôËç¤Ï¡¢¸åȾ¤ò£±Ë翤á
   MAT bufw=buf
   FOR i=1 TO n
      LET buf(i)= bufw(CEIL(i/2)+MOD(i,2)*INT(n/2)) !1234¢ª3142, 12345¢ª31425
   NEXT i
END SUB

SUB out_riffle_shuffle !¥¢¥¦¥È¤Î¥ê¥Õ¥ë¡£´ñ¿ôËç¤Ï¡¢Á°È¾¤ò£±Ë翤á
   MAT bufw=buf
   FOR i=1 TO n
      LET buf(i)= bufw(CEIL(i/2)+MOD(i+1,2)*CEIL(n/2)) !1234¢ª1324, 12345¢ª13243
   NEXT i
END SUB

FOR n=2 TO maxim !STEP 2 !¡¡Step ¤ò³°¤»¤Ð´ñ¿ô¤â·×»»¡£
!-----
   MAT buf=ZER(n) !¡¡ÇÛÎó¥µ¥¤¥ºÄ´À°¡¢ÄɲÃ
   !-----
   FOR i=1 TO n
      LET buf(i)= i
   NEXT i
   LET cc=0
   LET c=0
   !-----
   IF maxim<15 THEN MAT PRINT USING REPEAT$(" ###",n) :buf !¡¡É½¼¨¡¢ÄɲÃ
   !-----
   DO
      LET c=c+1
      CALL in_riffle_shuffle ! 1234¢ª3142, 12345¢ª31425
      !CALL out_riffle_shuffle ! 1234¢ª1324, 12345¢ª13243
      !-----
      IF maxim<15 THEN MAT PRINT USING REPEAT$(" ###",n) :buf !¡¡É½¼¨¡¢ÄɲÃ
      !-----
      FOR i=1 TO n
         IF buf(i)<> n+1-i THEN EXIT FOR
      NEXT i
      IF i>n AND cc=0 THEN LET cc=c
      FOR i=1 TO n
         IF buf(i)<>i THEN EXIT FOR
      NEXT i
   LOOP UNTIL i>n
   PRINT USING "Ëç¿ô=###¡¡Æ±½ç=###¡¡µÕ½ç=###¡ÊÉü¸µ²ó¿ô¡Ë": n, c, cc
   IF maxim<15 THEN PRINT !¡¡É½¼¨¡¢ÄɲÃ
NEXT n

END
 

¤ªÀµ·î¥Þ¥¸¥Ã¥¯

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2008ǯ12·î29Æü(·î)12»þ31ʬ20ÉÃ
ÊÖ¿®¡¦°úÍÑ
  Àµ·î¤Ï°ì²ÈÃÄݳ¡¢¿ÆÀ̤ʤɤ⽸¤Þ¤ê»Ò¶¡¤¿¤Á¤â´ó¤Ã¤ÆÍè¤Þ¤¹¡£
¤½¤³¤Ç¥È¥é¥ó¥×¥Þ¥¸¥Ã¥¯¤ò¤Ò¤È¤Ä¾Ò²ð¡£
狼¤Ë£µ£²Ëç¤ÎÃ椫¤é¾¡¼ê¤Ë£µËç¤Î¥«¡¼¥É¤ò°ú¤«¤»¤ë¡£
¤³¤ì¤ò¥¢¥·¥¹¥¿¥ó¥È¤ËÅϤ·¤Æ¤â¤é¤¦¡£¡Ê¥¢¥·¥¹¥¿¥ó¥È¤ÎÌòÌܤϤ¢¤È¤ÇÀâÌÀ¡Ë
¥¢¥·¥¹¥¿¥ó¥È¤Ï¥«¡¼¥É¤ò°ìË示¤Äɽ¸þ¤­¤Ë¥Æ¡¼¥Ö¥ë¤Ø½Ð¤·¤Æʤ٤Ƥ¤¤¯¡£
£´Ëçʤó¤À¤È¤³¤í¤Ç¡¢ÂԤ俤ò¤«¤±¤ë¡£
¤³¤³¤Ç¤¢¤Ê¤¿¡Ê¥Þ¥¸¥·¥ã¥ó¡Ë¤Ï½½Ê¬¤Ê±éµ»¤ò¹Ô¤Ê¤¦¡£
¥Þ¥¸¥·¥ã¥ó¤Ï»Ä¤Ã¤¿°ìËç¤Î¥«¡¼¥É¤Î¥Þ¡¼¥¯¤È¿ô»ú¤òͽ¸À¤¹¤ë¡£
ºÇ¸å¤Î°ìËç¤òɽ¸þ¤­¤Ëʤ٤Ƥâ¤é¤¦¡£¡Êͽ¸À¤¬ÅªÃ椹¤ë¡£¡Ë

¡ã¥¢¥·¥¹¥¿¥ó¥È¤ÎÌòÌÜ¡ä
£µËç¤Î¥«¡¼¥É¤ÎÃæ¤Ë¤Ïɬ¤ºÆ±¤¸¥Þ¡¼¥¯¤¬Â¸ºß¤¹¤ë¡£
ºÇ½é¤Ëɽ¤Ë¤·¤Æʤ٤륫¡¼¥É¤Ï¤³¤Î¥Þ¡¼¥¯¤Î¥«¡¼¥É¤Î°ì¤Ä¤Ë¤¹¤ë¡£¡Ê¤³¤ì¤ÇºÇ¸å¤Ë»Ä¤ë¥«¡¼¥É¤Î¥Þ¡¼¥¯¤¬È½ÌÀ¤¹¤ë¡£¡Ë
¼¡¤Ë£³¤Ä¤Î¥«¡¼¥É¤òʤ٤뤬¡¢Ê¤٤ë½çÈÖ¤ò¿ô»ú¤Ç
A>K>Q>J>10>9>8>7>6>5>4>3>2
¤Î½ç½ø¡Ê¥Ý¡¼¥«¡¼¤Ç¤Î¶¯¼å¤ËƱ¤¸¤Ë¤¹¤ë¡£¡Ë¤È·è¤á¤Æ¤ª¤­¡¢ºÇ½é¤ËÃÖ¤¤¤¿¥«¡¼¥É¤Î¿ô»ú¤ÈºÇ¸å¤Þ¤Ç¼ê¸µ¤Ë»Ä¤¹¥«¡¼¥É¡ÊƱ¤¸¥Þ¡¼¥¯¡Ë¤Î¿ô»ú¤Îº¹¡Ê¥­¡¼¥Ê¥ó¥Ð¡¼¡Ë¤Ë½¾¤Ã¤ÆʤÙÊý¤ò¹©Éפ·¤Æ¤ä¤ë¡£
¤³¤³¤ÇºÇ½é¤Î¥«¡¼¥É¤ÈºÇ¸å¤Î¥«¡¼¥É¤Î¿ô»ú¤ÎÇÛÎ󺹤Ïɬ¤º£¶°ÊÆâ¤ËǼ¤Þ¤ë¡£
¤³¤ì¤Ï¿ô»ú¤ò±ß¼þ¾å¤ÎÇÛÎó¤È¤·¤Æ¹Í¤¨¤Æ¤ª¤¯¤È¤¹¤ë¡£(»þ·×²ó¤ê¤Ë¥«¥¦¥ó¥È¤¹¤ë¡£¡Ë
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡K
¡¡¡¡¡¡¡¡¡¡¡¡¡¡Q¡¡A
¡¡¡¡¡¡¡¡     J    2
           10      3
            9     4
             8   5
              7 6

<ºÇ½é¤Ë½Ð¤¹¥«¡¼¥É¤Î¿ô¡ä¡¡¡¡¡¡¡ãºÇ¸å¤Þ¤Ç»Ä¤¹¥«¡¼¥É¤Î¿ô¡ä¡¡¡¡¡ã¥­¡¼¥Ê¥ó¥Ð¡¼¡ä
¡¡¡¡¡¡¡¡¡¡A¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡  2¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ 1
          2                              4                       2
          3                              6                       3
          4                              8                       4
          5                             10                       5
          6                              Q                       6
          7                              K                       6
¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦
¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦
¡¡¡¡¡¡¡¡¡¡ K                              A                       1

¡ã¥­¡¼¥Ê¥ó¥Ð¡¼¤ËÂФ¹¤ë£³Ëç¤Î¥«¡¼¥É¤ÎÇÛÎóˡ§¡ä
£³Ëç¤Î¥«¡¼¥É¤Î¿ô»ú¤ò¸«Èæ¤Ù¤Æ¡¢3¤Ä¤Ç¤Î¶¯¡¢Ãæ¡¢¼å¤ò¸«¤ë¡£
¡Ê¤â¤·Æ±¿ô¤Ç¤¢¤ì¤Ð¥Þ¡¼¥¯¤Ç♠¡ä♡¡ä♢¡ä♣¡¡¤Î½ç¤Ç¶¯¡¢¼å¤ò·è¤á¤ë¡£¡Ë
¡Ê¥­¡¼¥Ê¥ó¥Ð¡¼¡Ë¡¡¡¡¡¡¡Ê£³Ëç¤ÎÇÛÎó½ç½ø¡Ë
¡¡¡¡¡¡1¡§¡¡¡¡¡¡¡¡¡¡¡¡¡¡¼å¡¡¡¦¡¡Ãæ¡¡¡¦¡¡¶¯
¡¡¡¡ £²¡§¡¡¡¡¡¡¡¡¡¡¡¡¡¡¼å¡¡¡¦¡¡¶¯¡¡¡¦¡¡Ãæ
¡¡¡¡ £³¡§¡¡¡¡¡¡¡¡¡¡¡¡¡¡Ãæ¡¡¡¦¡¡¼å¡¡¡¦¡¡¶¯
¡¡¡¡ £´¡§¡¡¡¡¡¡¡¡¡¡¡¡¡¡Ãæ¡¡¡¦¡¡¶¯¡¡¡¦¡¡¼å
¡¡ ¡¡£µ¡§¡¡¡¡¡¡¡¡¡¡¡¡¡¡¶¯¡¡¡¦¡¡¼å¡¡¡¦¡¡Ãæ
¡¡¡¡ £¶¡§¡¡¡¡¡¡¡¡¡¡¡¡¡¡¶¯¡¡¡¦¡¡Ãæ¡¡¡¦¡¡¼å

¡ãÎ㣱¡ä
¡ÊµÒ¤¬°ú¤¤¤¿£µËç¤Î¥«¡¼¥É¡Ë¡§♠J,♠2,♢5,♣J,♣2

(¥¢¥·¥¹¥¿¥ó¥È¤¬Ê¤٤륫¡¼¥É½ç¡Ë¡§♣J,♢5,♠J,♠2
                                *♣2 ¤òºÇ½é¤Ëʤ٤ë¤ÈJ¤Þ¤Ç¤Ï¡Ü£¹¤È¤Ê¤ë¤Î¤Ç£Ê¤È¤¹¤ë¡£

¡Ê¥Þ¥¸¥·¥ã¥ó¤ÎȽÃÇ¡Ë¡§1ÈÖÌܤΥ«¡¼¥É¥Þ¡¼¥¯¤è¤ê¡¡¥¯¥é¥Ö¤Î
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Ã桦¶¯¡¦¼å¡¡¤Çʤó¤Ç¤¤¤ë¤«¤é¡¡£Ê¡Ü£´¤è¤ê¡¡¿ô»ú¤Ï¡¡£²

¡ãÎ㣲¡ä
¡ÊµÒ¤¬°ú¤¤¤¿£µËç¤Î¥«¡¼¥É¡Ë¡§♠J,♠4,♢2,♣J,♣2

(¥¢¥·¥¹¥¿¥ó¥È¤¬Ê¤٤륫¡¼¥É½ç¡Ë¡§♠J,♣J,♢2,♣2

¡Ê¥Þ¥¸¥·¥ã¥ó¤ÎȽÃÇ¡Ë¡§1ÈÖÌܤΥ«¡¼¥É¥Þ¡¼¥¯¤è¤ê¡¡¥¹¥Ú¡¼¥É¤Î
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¶¯¡¦Ã桦¼å¡¡¤Çʤó¤Ç¤¤¤ë¤Î¤Ç¡¡£Ê¡Ü£¶¡¡¤è¤ê¿ô»ú¤Ï¡¡£´

¤³¤ì¤Ç¤¢¤Ê¤¿¤ÏĶǽÎϼÔ
 

UBASIC¤Î¥Ó¥Ã¥È±é»»´Ø¿ô¤Î¼ÂÁõ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ12·î29Æü(·î)19»þ42ʬ22ÉÃ
ÊÖ¿®¡¦°úÍÑ
 
!¿¿ÍýÃÍɽ
LET a=3 !0011¤Î¥Ñ¥¿¡¼¥ó
LET b=5 !0101¤Î¥Ñ¥¿¡¼¥ó

PRINT " b NOT" !ÈÝÄê
FOR i=0 TO 1
   PRINT bit(i,b); 1-bit(i,b) !b'=1-b
NEXT i
PRINT " a  b IMP" !ÏÀÍýÊñ´Þ
FOR i=0 TO 3
   PRINT bit(i,a); bit(i,b); bit(i,bitor(bitreverse(i,a),b)) !a' or b
NEXT i
PRINT " a  b EQV" !ƱÃÍ
FOR i=0 TO 3
   PRINT bit(i,a); bit(i,b); 1-bit(i,bitxor(a,b)) !(a xor b)'
NEXT i



!£²¤ÎÊä¿ô¡§ÄêµÁ¤è¤ê
LET n=16 !£î¥Ó¥Ã¥ÈÉä¹æÉÕÀ°¿ô -2^(n-1)¡Á2^(n-1)-1
LET m=2^n

LET a=3
LET aa=m-a !a+a'=m
FOR i=N-1 TO 0 STEP -1 !¾å¤Î°Ì¤«¤é
   PRINT bit(i,aa);
NEXT i
PRINT


!£²¤ÎÊä¿ô¡§È¿Å¾¤·¤Æ£±¤ò¤¿¤¹
LET a=3
FOR i=N-1 TO 0 STEP -1 !¾å¤Î°Ì¤«¤é
   LET a=bitreverse(i,a)
NEXT i
LET a=a+1
PRINT a !£î¥Ó¥Ã¥ÈÉä¹æ¤Ê¤·À°¿ô 0¡Á2^n-1

!£²¤ÎÊä¿ô¡§È¿Å¾¤·¤Æ£±¤ò¤¿¤¹¡¡¢¨Ê̲ò
LET a=3
FOR i=0 TO N-1 !²¼¤Î°Ì¤«¤é
   IF bit(i,a)=1 THEN EXIT FOR !£±¤¬¸«¤Ä¤«¤ë¤Þ¤Ç
   LET a=bitreset(i,a) !£°¤Ë¤¹¤ë
NEXT i
FOR k=i+1 TO N-1 !³¤­
   LET a=bitreverse(k,a) !£°¤ò£±¤Ë¤¹¤ë
NEXT k
PRINT a



!²Ã»» a+b
LET a=123
LET b=45
DO WHILE bitand(a,b)>0
   LET t=bitxor(a,b)
   LET b=sft(bitand(a,b),1)
   LET a=t
LOOP
PRINT bitxor(a,b)


END


!¥Ó¥Ã¥È±é»»´ØÏ¢¡¡¢¨UBASIC¤è¤ê

EXTERNAL FUNCTION bit(n,x) !nÈÖÌܤΥӥåÈÃÍ¡¡¢¨n,x¤ÏÀ°¿ô
IF n<>INT(n) OR x<>INT(x) THEN !À°¿ô°Ê³°¤Ê¤é
   PRINT "¥Ñ¥é¥á¡¼¥¿¤¬ÉÔŬÅö¤Ç¤¹¡£"
   STOP
ELSE
   LET bit=MOD(INT(x/2^n),2)
END IF
END FUNCTION

EXTERNAL FUNCTION bitset(n,x) !nÈÖÌܤΥӥåȤò£±¤Ë¤¹¤ë¡¡¢¨n,x¤ÏÈóÉéÀ°¿ô
IF n<0 OR n<>INT(n) OR x<0 OR x<>INT(x) THEN !ÈóÉéÀ°¿ô°Ê³°¤Ê¤é
   PRINT "¥Ñ¥é¥á¡¼¥¿¤¬ÉÔŬÅö¤Ç¤¹¡£"
   STOP
ELSE
   LET d=2^n !n·å
   LET bitset=(INT(x/d/2)*2+1)*d+MOD(x,d) !Â礭¤¤·å¡Ü£±¡Ü¾®¤µ¤¤·å
END IF
END FUNCTION

EXTERNAL FUNCTION bitreset(n,x) !nÈÖÌܤΥӥåȤò£°¤Ë¤¹¤ë¡¡¢¨n,x¤ÏÈóÉéÀ°¿ô
IF n<0 OR n<>INT(n) OR x<0 OR x<>INT(x) THEN !ÈóÉéÀ°¿ô°Ê³°¤Ê¤é
   PRINT "¥Ñ¥é¥á¡¼¥¿¤¬ÉÔŬÅö¤Ç¤¹¡£"
   STOP
ELSE
   LET d=2^n !n·å
   LET bitreset=INT(x/d/2)*2*d+MOD(x,d) !Â礭¤¤·å¡Ü£±¡Ü¾®¤µ¤¤·å
END IF
END FUNCTION

EXTERNAL FUNCTION bitreverse(n,x) !nÈÖÌܤΥӥåȤòȿž¤¹¤ë¡¡¢¨n,x¤ÏÈóÉéÀ°¿ô
IF n<0 OR n<>INT(n) OR x<0 OR x<>INT(x) THEN !ÈóÉéÀ°¿ô°Ê³°¤Ê¤é
   PRINT "¥Ñ¥é¥á¡¼¥¿¤¬ÉÔŬÅö¤Ç¤¹¡£"
   STOP
ELSE
   LET d=2^n !n·å
   LET a=INT(x/d)
   LET bitreverse=(INT(a/2)*4-a+1)*d+MOD(x,d) !Â礭¤¤·å¡ÜNOT¡Ü¾®¤µ¤¤·å
END IF
END FUNCTION

EXTERNAL FUNCTION bitand(a,b) !¥Ó¥Ã¥È¤´¤È¤ÎÏÀÍýÀÑ¡¡¢¨a,b¤ÏÈóÉéÀ°¿ô
IF a<0 OR a<>INT(a) OR b<0 OR b<>INT(b) THEN !ÈóÉéÀ°¿ô°Ê³°¤Ê¤é
   PRINT "¥Ñ¥é¥á¡¼¥¿¤¬ÉÔŬÅö¤Ç¤¹¡£"
   STOP
ELSE
   LET c=0 !ÃÍ
   LET d=1
   DO UNTIL a=0 OR b=0 !ºÇ²¼°Ì¤Î·å¤«¤é¡¢·å¿ô¤¬¾®¤µ¤¤Êý¤Þ¤Ç
      LET aa=INT(a/2)
      LET bb=INT(b/2)
      LET c=c + MIN((a-aa*2),(b-bb*2)) * d !and(x,y)=MIN(x,y)

      LET a=aa !¼¡¤Ø
      LET b=bb
      LET d=d*2
   LOOP
   LET bitand=c
END IF
END FUNCTION

EXTERNAL FUNCTION bitor(a,b) !¥Ó¥Ã¥È¤´¤È¤ÎÏÀÍýÏ¡¡¢¨a,b¤ÏÈóÉéÀ°¿ô
IF a<0 OR a<>INT(a) OR b<0 OR b<>INT(b) THEN !ÈóÉéÀ°¿ô°Ê³°¤Ê¤é
   PRINT "¥Ñ¥é¥á¡¼¥¿¤¬ÉÔŬÅö¤Ç¤¹¡£"
   STOP
ELSE
   LET c=0
   LET d=1
   DO UNTIL a=0 AND b=0 !·å¿ô¤¬Â礭¤¤Êý
      LET aa=INT(a/2)
      LET bb=INT(b/2)
      LET c=c+MAX((a-aa*2),(b-bb*2)) * d !or(x,y)=MAX(x,y)
      LET a=aa !¼¡¤Ø
      LET b=bb
      LET d=d*2
   LOOP
   LET bitor=c
END IF
END FUNCTION

EXTERNAL FUNCTION bitxor(a,b) !¥Ó¥Ã¥È¤´¤È¤ÎÇÓ¾ŪÏÀÍýÏ¡¡¢¨a,b¤ÏÈóÉéÀ°¿ô
IF a<0 OR a<>INT(a) OR b<0 OR b<>INT(b) THEN !ÈóÉéÀ°¿ô°Ê³°¤Ê¤é
   PRINT "¥Ñ¥é¥á¡¼¥¿¤¬ÉÔŬÅö¤Ç¤¹¡£"
   STOP
ELSE
   LET c=0
   LET d=1
   DO UNTIL a=0 AND b=0 !·å¿ô¤¬Â礭¤¤Êý
      LET aa=INT(a/2)
      LET bb=INT(b/2)
      LET c=c + MOD((a-aa*2)+(b-bb*2),2) * d !xor(x,y)=MOD(x+y,2)
      LET a=aa !¼¡¤Ø
      LET b=bb
      LET d=d*2
   LOOP
   LET bitxor=c
END IF
END FUNCTION

EXTERNAL FUNCTION bitcount(x) !£±¤Ç¤¢¤ë¥Ó¥Ã¥È¤Î¸Ä¿ô¡¡¢¨x¤ÏÈóÉéÀ°¿ô
IF x<0 OR x<>INT(x) THEN !ÈóÉéÀ°¿ô°Ê³°¤Ê¤é
   PRINT "¥Ñ¥é¥á¡¼¥¿¤¬ÉÔŬÅö¤Ç¤¹¡£"
   STOP
ELSE
   LET c=0 !ÃÍ
   DO UNTIL x=0 !ºÇ²¼°Ì¤Î·å¤«¤é
      LET xx=INT(x/2) !¾¦
      LET c=c + (x-xx*2) !;¤ê

      LET x=xx !¼¡¤Ø
   LOOP
   LET bitcount=c
END IF
END FUNCTION

EXTERNAL FUNCTION sft(x,n) !n¥Ó¥Ã¥È¤Î¥·¥Õ¥È¤¹¤ë¡¡¢¨n¤ÏÀ°¿ô
IF n<>INT(n) THEN !À°¿ô°Ê³°¤Ê¤é
   PRINT "¥Ñ¥é¥á¡¼¥¿¤¬ÉÔŬÅö¤Ç¤¹¡£"
   STOP
ELSE
   IF n<0 THEN LET d=1/2 ELSE LET d=2
   FOR i=1 TO ABS(n)
      LET x=x*d
   NEXT i
   LET sft=x
END IF
END FUNCTION
 

¿ôÃÍÀÑʬ¼°

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2008ǯ12·î30Æü(²Ð)09»þ36ʬ6ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¥Ë¥å¡¼¥È¥ó¡¦¥³¡¼¥Ä§ ¿ôÃÍÀÑʬ¼°
Í­Íý¿ô¥â¡¼¥É¤Ç¤ª»î¤·¤¯¤À¤µ¤¤

OPTION BASE 0
PUBLIC NUMERIC MAXLEVEL
LET  MAXLEVEL=10 !'¼¡¿ô
DIM X(1),Y(MAXLEVEL),L(MAXLEVEL)
LET DISPMODE=0 !' 0 or else
LET INTEGRAL=1 !' INTEGRAL >= 1
LET SWITCH=0   !' 0...ÊĤ¸¤¿¸ø¼°  else...³«¤¤¤¿¸ø¼°
IF DISPMODE<>0 THEN
   IF INTEGRAL > 1 THEN
      PRINT "DIM A(";STR$(INTEGRAL);"),B(";STR$(INTEGRAL);"),N(";STR$(INTEGRAL);")"
      PRINT "FOR I=1 TO";INTEGRAL
      LET A$="(" & CHR$(34) & " & STR$(I) & " & CHR$(34) & ")=" & CHR$(34) & ":"
      LET B$="(I)"
   ELSE
      LET A$="=" & CHR$(34) & ":"
      LET B$=""
   END IF
   LET C$="! INPUT  PROMPT " & CHR$(34)
   PRINT C$;"²¼¸Â  ";A$;"A";B$
   PRINT C$;"¾å¸Â  ";A$;"B";B$
   PRINT C$;"ʬ³ä¿ô";A$;"N";B$
   PRINT "READ A";B$;",B";B$;",N";B$
   IF INTEGRAL > 1 THEN PRINT "NEXT"
   FOR I=1 TO INTEGRAL
      PRINT "DATA 0,1,10"
   NEXT I
   FOR I=2 TO MAXLEVEL
      PRINT "PRINT INTEGRAL";STR$(I);"(";
      IF INTEGRAL=1 THEN
         PRINT "A,B,N)"
      ELSE
         FOR J=1 TO INTEGRAL
            PRINT "A(";STR$(J);"),B(";STR$(J);"),";
         NEXT J
         FOR J=1 TO INTEGRAL
            PRINT "N(";STR$(J);")";
            IF J < INTEGRAL THEN PRINT ",";
         NEXT J
         PRINT ")"
      END IF
   NEXT I
   PRINT "END"
   PRINT
   PRINT "EXTERNAL  FUNCTION FUNC(";
   FOR I=1 TO INTEGRAL
      PRINT "X";STR$(I);
      IF I < INTEGRAL THEN PRINT ",";
   NEXT I
   PRINT ")"
   PRINT "LET S=1";
   FOR I=1 TO INTEGRAL
      PRINT "-X";STR$(I);"*X";STR$(I);
   NEXT I
   PRINT
   PRINT "IF S > 0 THEN"
   PRINT "LET FUNC=SQR(S)"
   PRINT "ELSE"
   PRINT "LET FUNC=0"
   PRINT "END IF"
   PRINT "END FUNCTION"
   PRINT
END IF
LET  X(1)=1
FOR N=1 TO MAXLEVEL-1
   FOR I=0 TO N
      CALL CLR(Y)
      LET  P=1
      LET  Y(0)=1
      FOR J=0 TO N
         IF I<>J THEN
            LET  X(0)=-J
            CALL MUL(Y,X)
            LET P=P*(I-J)
         END IF
      NEXT  J
      CALL INTEGRAL(Y)
      IF SWITCH=0 THEN
         LET L(I)=HORNER(Y,N)/P
      ELSE
         LET L(I)=(HORNER(Y,N+1)-HORNER(Y,-1))/P
      END IF
   NEXT I
   IF DISPMODE<>0 THEN
      PRINT "EXTERNAL  FUNCTION INTEGRAL";STR$(N+1);"(";
      IF INTEGRAL > 1 THEN
         FOR J=1 TO INTEGRAL
            PRINT "A";STR$(J);",B";STR$(J);",";
         NEXT J
         FOR J=1 TO INTEGRAL
            PRINT "N";STR$(J);
            IF J < INTEGRAL THEN PRINT ",";
         NEXT J
      ELSE
         PRINT "A,B,N";
      END IF
      PRINT ")"
      IF SWITCH=0 THEN LET A$=STR$(N) ELSE LET A$=STR$(N+2)
      IF INTEGRAL=1 THEN
         PRINT "LET H=(B-A)/N/";A$
         PRINT "LET S=0"
         PRINT "FOR K=0 TO N-1"
         PRINT "LET S=S";
         FOR I=0 TO N
            IF SWITCH=0 THEN LET B$=STR$(I) ELSE LET B$=STR$(I+1)
            IF L(I) < 0 THEN PRINT "-"; ELSE PRINT "+";
            PRINT STR$(ABS(L(I)));"*H*FUNC(A+H*(";A$;"*K+";B$;"))";
         NEXT I
         PRINT
         PRINT "NEXT"
      ELSE
         IF SWITCH=0 THEN
            PRINT "DIM R(0 TO ";STR$(N);")"
         ELSE
            PRINT "DIM R(";STR$(N+1);")"
         END IF
         FOR I=0 TO N
            IF SWITCH=0 THEN LET B$=STR$(I) ELSE LET B$=STR$(I+1)
            PRINT "R(";B$;")=";
            IF L(I) < 0 THEN  PRINT "-";
            PRINT STR$(ABS(L(I)))
         NEXT I
         FOR J=1 TO INTEGRAL
            PRINT "LET H";STR$(J);"=(B";STR$(J);"-A";STR$(J);")/N";STR$(J);"/";A$
         NEXT J
         PRINT "LET S=0"
         FOR J=INTEGRAL TO 1 STEP -1
            PRINT "FOR K";STR$(J);"=0 TO N";STR$(J);"-1"
         NEXT J
         FOR J=1 TO INTEGRAL
            IF SWITCH=0 THEN
               PRINT "FOR J";STR$(J);"=0 TO";N
            ELSE
               PRINT "FOR J";STR$(J);"=1 TO";N+1
            END IF
         NEXT J
         PRINT "LET S=S+";
         FOR J=1 TO INTEGRAL
            PRINT "R(J";STR$(J);")*";
         NEXT J
         FOR I=1 TO INTEGRAL
            PRINT "H";STR$(I);"*";
         NEXT I
         PRINT "FUNC(";
         FOR I=1 TO INTEGRAL
            PRINT "A";STR$(I);"+H";STR$(I);"*(";A$;"*K";STR$(I);"+J";STR$(I);")";
            IF I < INTEGRAL THEN PRINT ",";
         NEXT I
         PRINT ")"
         FOR I=1 TO INTEGRAL*2
            PRINT "NEXT"
         NEXT I
      END IF
      PRINT "LET INTEGRAL";STR$(N+1);"=S"
      PRINT "END FUNCTION"
   ELSE
      PRINT "¢é(x";STR$(N);",x0)f(x)dx=";
      FOR I=0 TO N
         IF L(I) < 0 THEN
            PRINT "-";
         ELSE
            IF I > 0 THEN PRINT "+";
         END IF
         PRINT STR$(ABS(L(I)));"*h*f(x";STR$(I);")";
      NEXT I
      PRINT
   END IF
   PRINT
NEXT N
END

EXTERNAL  SUB MUL(A(),B())
OPTION BASE 0
DIM C(MAXLEVEL)
FOR I=0 TO MAXLEVEL-1
   FOR J=0 TO 1
      LET  C(I+J)=C(I+J)+A(I)*B(J)
   NEXT J
NEXT I
CALL COPY(A,C)
END SUB

EXTERNAL  FUNCTION HORNER(A(),XX)
FOR N=MAXLEVEL TO 0 STEP -1
   IF A(N)<>0 THEN EXIT FOR
NEXT N
LET Y=A(N)
FOR I=N-1 TO 0 STEP -1
   LET  Y=Y*XX+A(I)
NEXT I
LET  HORNER=Y
END FUNCTION

EXTERNAL  SUB COPY(X(),Y())
FOR I=0 TO MAXLEVEL
   LET  X(I)=Y(I)
NEXT I
END SUB

EXTERNAL  SUB CLR(X())
FOR I=0 TO MAXLEVEL
   LET X(I)=0
NEXT I
END SUB

EXTERNAL  SUB INTEGRAL(A())
OPTION BASE 0
DIM B(MAXLEVEL)
FOR I=MAXLEVEL-1 TO 0 STEP -1
   LET  B(I+1)=A(I)/(I+1)
NEXT I
CALL COPY(A,B)
END SUB
 

¥ë¥¸¥ã¥ó¥É¥ë§·¸¿ô·×»»

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2008ǯ12·î30Æü(²Ð)09»þ40ʬ5ÉÃ
ÊÖ¿®¡¦°úÍÑ
  Í­¸Â¶è´ÖÀÑʬ
/1
| f(x)dx
/-1

¥¬¥¦¥¹¡¦¥ë¥¸¥ã¥ó¥É¥ë§¤Î·¸¿ô(ʬÅÀ¡¢½Å¤ß)¤ò»»½Ð¤¹¤ë¡£
1000·å¥â¡¼¥É¤ò»ÈÍѤ·¡¢¥ë¥¸¥ã¥ó¥É¥ë¿¹à¼°¤ò¥Ë¥å¡¼¥È¥óË¡ + ÁÈΩ½üË¡¤Ç²ò¤¯


OPTION BASE 0
OPTION ARITHMETIC DECIMAL_HIGH
PUBLIC NUMERIC MAXLEVEL,EPS
LET MAXLEVEL=10 !'¼¡¿ô
DIM X(MAXLEVEL),W(MAXLEVEL)
LET KETA=16 !'µá¤á¤ë·å¿ô
LET EPS=10^(-KETA)
LET DISPMODE=0 !' 0 or else
LET INTEGRAL=1 !' INTEGRAL >= 1
IF DISPMODE<>0 THEN
   CALL LEGENDREPARA(MAXLEVEL,X,W)
   PRINT "DIM X(";STR$(MAXLEVEL);"),W(";STR$(MAXLEVEL);")"
   FOR I=1 TO INTEGRAL
      PRINT "! INPUT  PROMPT ";CHR$(34);"²¼¸Â ";STR$(I);"=";CHR$(34);":A";STR$(I)
      PRINT "! INPUT  PROMPT ";CHR$(34);"¾å¸Â ";STR$(I);"=";CHR$(34);":B";STR$(I)
   NEXT I
   FOR I=1 TO INTEGRAL
      PRINT "LET A";STR$(I);"=0"
      PRINT "LET B";STR$(I);"=1"
   NEXT I
   FOR J=1 TO INTEGRAL
      PRINT "LET U";STR$(J);"=(B";STR$(J);"+A";STR$(J);")/2"
      PRINT "LET V";STR$(J);"=(B";STR$(J);"-A";STR$(J);")/2"
   NEXT J
   PRINT "FOR I=1 TO";MAXLEVEL
   PRINT "READ X(I),W(I)"
   PRINT "NEXT"
   PRINT "LET S=0"
   FOR J=1 TO INTEGRAL
      PRINT "FOR K";STR$(J);"=1 TO";MAXLEVEL
   NEXT J
   PRINT "LET  S=S+";
   FOR J=1 TO INTEGRAL
      PRINT "W(K";STR$(J);")*";
   NEXT J
   PRINT "FUNC(";
   FOR I=1 TO INTEGRAL
      PRINT "U";STR$(I);"+V";STR$(I);"*X(K";STR$(I);")";
      IF I < INTEGRAL THEN PRINT ",";
   NEXT I
   PRINT ")";
   FOR J=1 TO INTEGRAL
      PRINT "*V";STR$(J);
   NEXT J
   PRINT
   FOR J=1 TO INTEGRAL
      PRINT "NEXT"
   NEXT J
   PRINT "PRINT S"
   FOR I=1 TO MAXLEVEL
      PRINT "DATA ";
      PRINT USING "#." & REPEAT$("#",KETA):X(I);
      PRINT ",";
      PRINT USING "#." & REPEAT$("#",KETA) & "^^^^":W(I)
   NEXT I
   PRINT "END"
   PRINT
   PRINT "EXTERNAL  FUNCTION FUNC(";
   FOR I=1 TO INTEGRAL
      PRINT "X";STR$(I);
      IF I < INTEGRAL THEN PRINT ",";
   NEXT I
   PRINT ")"
   PRINT "LET S=1";
   FOR I=1 TO INTEGRAL
      PRINT "-X";STR$(I);"*X";STR$(I);
   NEXT I
   PRINT
   PRINT "IF S > 0 THEN"
   PRINT "LET FUNC=SQR(S)"
   PRINT "ELSE"
   PRINT "LET FUNC=0"
   PRINT "END IF"
   PRINT "END FUNCTION"
ELSE
   FOR N=2 TO MAXLEVEL
      PRINT TAB(8+KETA/2);"ʬÅÀ";TAB(8+KETA*1.5);"   ½Å¤ß"
      CALL LEGENDREPARA(N,X,W)
      FOR I=1 TO N
         PRINT "No.";I;":";
         PRINT USING "#." & REPEAT$("#",KETA):X(I);
         PRINT "  ";
         PRINT USING "#." & REPEAT$("#",KETA) & "^^^^":W(I)
      NEXT I
   NEXT N
END IF
END

EXTERNAL  SUB LEGENDREPARA(N,A(),W())
OPTION ARITHMETIC DECIMAL_HIGH
OPTION BASE 0
DIM P(MAXLEVEL),D(MAXLEVEL)
CALL  LEGENDREPOLY(N,P)
FOR I=0 TO N
   LET P(I)=P(I)/P(N)
NEXT I
FOR I=1 TO N
   CALL DERIVATIVE(P,D) !'Èùʬ
   LET XX=-1 !'½é´üÃÍ
   DO
      LET X=XX
      LET XX=X-HORNER(N,P,X)/HORNER(N,D,X) !'¥Ë¥å¡¼¥È¥óË¡
   LOOP UNTIL ABS(HORNER(N,P,XX)) < EPS AND ABS(X-XX) < EPS
   LET A(I)=XX !'ʬÅÀ
   LET W(I)=WEIGHT(N,XX) !'½Å¤ß
   CALL DIV(P,XX) !'ÁÈΩ½üË¡
NEXT I
END SUB

EXTERNAL  SUB LEGENDREPOLY(KK,NEWP()) !'¥ë¥¸¥ã¥ó¥É¥ë¿¹à¼°(·¸¿ô)
OPTION ARITHMETIC DECIMAL_HIGH
OPTION BASE 0
DIM P(KK+1),OLDP(KK),PP(KK)
LET  OLDP(0)=1
LET  P(1)=1
FOR I=0 TO KK
   LET NEWP(I)=0
NEXT I
FOR K=2 TO KK
   FOR J=1 TO K
      LET  NEWP(J)=NEWP(J)+(2*K-1)/K*P(J-1)
      LET  NEWP(J-1)=NEWP(J-1)-(K-1)/K*OLDP(J-1)
   NEXT J
   IF K < KK THEN
      FOR I=0 TO K
         LET  OLDP(I)=P(I)
         LET  P(I)=NEWP(I)
         LET  NEWP(I)=0
      NEXT I
   END IF
NEXT K
END SUB

EXTERNAL  FUNCTION LEGENDRE(K,X) !'¥ë¥¸¥ã¥ó¥É¥ë¿¹à¼°(ÃÍ)
OPTION ARITHMETIC DECIMAL_HIGH
OPTION BASE 0
DIM PP(K+1)
LET  PP(0)=1
LET  PP(1)=X
FOR N=1 TO K-1
   LET  PP(N+1)=((2*N+1)*X*PP(N)-N*PP(N-1))/(N+1)
NEXT N
LET  LEGENDRE=PP(K)
END FUNCTION

EXTERNAL  FUNCTION WEIGHT(N,X) !'½Å¤ß
OPTION ARITHMETIC DECIMAL_HIGH
LET WEIGHT=2*(1-X^2)/(N*LEGENDRE(N-1,X))^2
END FUNCTION

EXTERNAL  FUNCTION HORNER(N,A(),X)
OPTION ARITHMETIC DECIMAL_HIGH
LET  Y=A(N)
FOR I=N-1 TO 0 STEP -1
   LET  Y=Y*X+A(I)
NEXT I
LET  HORNER=Y
END FUNCTION

EXTERNAL  SUB DERIVATIVE(A(),B()) !'Èùʬ
OPTION ARITHMETIC DECIMAL_HIGH
FOR I=MAXLEVEL TO 1 STEP -1
   LET  B(I-1)=I*A(I)
NEXT I
LET B(MAXLEVEL)=0
END SUB

EXTERNAL  SUB DIV(A(),P) !'ÁÈΩ½üË¡
!'A(N)*X^N+A(N-1)*X^(N-1)+...+A(2)*X^2+A(1)*X+A(0)=(X-P)(C(N-1)*X^(N-1)+...+C(2)*X^2+C(1)*X+C(0))
OPTION BASE 0
OPTION ARITHMETIC DECIMAL_HIGH
DIM C(MAXLEVEL)
FOR I=MAXLEVEL TO 1 STEP -1
   LET  C(I-1)=A(I)+C(I)*P
NEXT I
CALL COPY(A,C)
END SUB

EXTERNAL  SUB COPY(X(),Y())
OPTION ARITHMETIC DECIMAL_HIGH
FOR I=0 TO MAXLEVEL
   LET  X(I)=Y(I)
NEXT I
END SUB
---------------------------------------------------
¥ë¥¸¥ã¥ó¥É¥ë¿¹à¼°É½¼¨
Í­Íý¿ô¥â¡¼¥É¤Ç¤ª»î¤·¤¯¤À¤µ¤¤

OPTION BASE 0
PUBLIC NUMERIC MAXLEVEL
LET  MAXLEVEL=20 !'¼¡¿ô
DIM P(MAXLEVEL)
PRINT "P(0)=1"
PRINT "P(1)=X"
FOR K=2 TO MAXLEVEL
   CALL LEGENDREPOLY(K,P) !'¾åµ­»²¾È(OPTION ARITHMETIC DECIMAL_HIGH¤ò³°¤¹)
   PRINT "P(";STR$(K);")=";
   CALL DISPLAY(P)
NEXT K
END

EXTERNAL  SUB DISPLAY(A())
FOR N=MAXLEVEL TO 0 STEP -1
   IF A(N)<>0 THEN EXIT FOR
NEXT N
IF N > 1 THEN
   IF A(N) < 0 THEN PRINT "-";
   IF ABS(A(N))<>1 THEN
      PRINT STR$(ABS(A(N)));"*X^";STR$(N);
   ELSE
      PRINT "X^";STR$(N);
   END IF
END IF
FOR I=N-1 TO 2 STEP -1
   IF A(I)<>0 THEN
      IF A(I) < 0 THEN PRINT "-"; ELSE PRINT "+";
      IF ABS(A(I))<>1 THEN
         PRINT STR$(ABS(A(I)));"*X^";STR$(I);
      ELSEIF ABS(A(I))=1 THEN
         PRINT "X^";STR$(I);
      END IF
   END IF
NEXT I
IF A(1)<>0 THEN
   IF N > 1 THEN
      IF A(1) < 0 THEN PRINT "-"; ELSE PRINT "+";
   END IF
   IF ABS(A(1))<>1 THEN
      PRINT STR$(ABS(A(1)));"*X";
   ELSEIF ABS(A(1))=1 THEN
      PRINT "X";
   END IF
END IF
IF A(0)<>0 THEN
   IF A(0) < 0 THEN PRINT "-"; ELSE PRINT "+";
   PRINT STR$(ABS(A(0)));
END IF
PRINT
END SUB
 

¥é¥²¡¼¥ë§·¸¿ô·×»»

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2008ǯ12·î30Æü(²Ð)09»þ41ʬ16ÉÃ
ÊÖ¿®¡¦°úÍÑ
  Ⱦ̵¸Â¶è´ÖÀÑʬ
/¡ç
| f(x)dx
/0

¥¬¥¦¥¹¡¦¥é¥²¡¼¥ë§¤Î·¸¿ô(ʬÅÀ¡¢½Å¤ß)¤ò»»½Ð¤¹¤ë¡£
1000·å¥â¡¼¥É¤ò»ÈÍѤ·¡¢¥é¥²¡¼¥ë¿¹à¼°¤ò¥Ë¥å¡¼¥È¥óË¡ + ÁÈΩ½üË¡¤Ç²ò¤¯


OPTION BASE 0
OPTION ARITHMETIC DECIMAL_HIGH
PUBLIC NUMERIC MAXLEVEL,EPS
LET MAXLEVEL=10
DIM X(MAXLEVEL),W(MAXLEVEL)
LET KETA=16
LET EPS=10^(-KETA)
LET DISPMODE=0 !' 0 or else
LET INTEGRAL=1 !' INTEGRAL >= 1
IF DISPMODE<>0 THEN
   CALL LAGUERREPARA(MAXLEVEL,X,W)
   PRINT "DIM X(";STR$(MAXLEVEL);"),W(";STR$(MAXLEVEL);")"
   PRINT "FOR I=1 TO";MAXLEVEL
   PRINT "READ X(I),W(I)"
   PRINT "NEXT"
   FOR I=1 TO INTEGRAL
      PRINT "INPUT  PROMPT ";CHR$(34);"GAMMA(";
      FOR J=1 TO INTEGRAL
         PRINT "X";STR$(J);
         IF J < INTEGRAL THEN PRINT ",";
      NEXT J
      PRINT ") X";STR$(I);"=";CHR$(34);":U";STR$(I)
   NEXT I
   PRINT "LET S=0"
   FOR I=1 TO INTEGRAL
      PRINT "FOR I";STR$(I);"=1 TO";MAXLEVEL
   NEXT I
   PRINT "LET  S=S+";
   FOR I=1 TO INTEGRAL
      PRINT "W(I";STR$(I);")*";
   NEXT I
   PRINT "FUNC(";
   FOR I=1 TO INTEGRAL
      PRINT "X(I";STR$(I);"),";
   NEXT I
   FOR I=1 TO INTEGRAL
      PRINT "U";STR$(I);
      IF I < INTEGRAL THEN PRINT ",";
   NEXT I
   PRINT ")*EXP(";
   FOR I=1 TO INTEGRAL
      PRINT "X(I";STR$(I);")";
      IF I < INTEGRAL THEN PRINT "+";
   NEXT I
   PRINT ")"
   FOR I=1 TO INTEGRAL
      PRINT "NEXT"
   NEXT I
   PRINT "PRINT S"
   FOR I=1 TO MAXLEVEL
      PRINT "DATA ";
      PRINT USING "##." & REPEAT$("#",KETA):X(I);
      PRINT ",";
      PRINT USING "#." & REPEAT$("#",KETA) & "^^^^":W(I)
   NEXT I
   PRINT "END"
   PRINT
   PRINT "EXTERNAL  FUNCTION FUNC(";
   FOR I=1 TO INTEGRAL
      PRINT "X";STR$(I);",";
   NEXT I
   FOR I=1 TO INTEGRAL
      PRINT "U";STR$(I);
      IF I < INTEGRAL THEN PRINT ",";
   NEXT I
   PRINT ")"
   PRINT "FUNC=";
   FOR I=1 TO INTEGRAL
      PRINT "EXP(-X";STR$(I);")*X";STR$(I);"^(U";STR$(I);"-1)";
      IF I < INTEGRAL THEN PRINT "*";
   NEXT I
   PRINT
   PRINT "END FUNCTION"
ELSE
   FOR N=2 TO MAXLEVEL
      CALL LAGUERREPARA(N,X,W)
      PRINT TAB(8+KETA/2);"ʬÅÀ";TAB(8+KETA*1.5);"   ½Å¤ß"
      FOR I=1 TO N
         PRINT "No.";I;":";
         PRINT USING "##." & REPEAT$("#",KETA):X(I);
         PRINT "  ";
         PRINT USING "#." & REPEAT$("#",KETA) & "^^^^":W(I)
      NEXT I
   NEXT N
END IF
END

EXTERNAL  SUB LAGUERREPARA(N,A(),W())
OPTION ARITHMETIC DECIMAL_HIGH
OPTION BASE 0
DIM LA(MAXLEVEL+1),D(MAXLEVEL)
CALL LAGUERREPOLY(N,LA)
FOR I=0 TO N
   LET LA(I)=LA(I)/LA(N)
NEXT I
FOR I=1 TO N
   CALL DERIVATIVE(LA,D)
   LET XX=0
   DO
      LET X=XX
      LET XX=X-HORNER(N,LA,X)/HORNER(N,D,X)
   LOOP UNTIL ABS(HORNER(N,LA,XX)) < EPS AND ABS(X-XX) < EPS
   LET A(I)=XX
   LET W(I)=WEIGHT(N,XX)
   CALL DIV(LA,XX)
NEXT I
END SUB

EXTERNAL  SUB LAGUERREPOLY(N,NEWP()) !'¥é¥²¡¼¥ë¿¹à¼°(·¸¿ô)
OPTION ARITHMETIC DECIMAL_HIGH
OPTION BASE 0
DIM P(N+1),OLDP(N)
LET OLDP(0)=1
LET P(1)=-1
LET P(0)=1
FOR I=0 TO N
   LET NEWP(I)=0
NEXT I
FOR K=2 TO N
   FOR J=0 TO K
      LET  NEWP(J)=NEWP(J)+(2*K-1)*P(J)-(K-1)^2*OLDP(J)
      LET  NEWP(J+1)=NEWP(J+1)-P(J)
   NEXT J
   IF K < N THEN
      FOR I=0 TO K
         LET  OLDP(I)=P(I)
         LET  P(I)=NEWP(I)
         LET  NEWP(I)=0
      NEXT I
   END IF
NEXT K
END SUB

EXTERNAL  FUNCTION LAGUERRE(NN,X) !'¥é¥²¡¼¥ë¿¹à¼°(ÃÍ)
OPTION ARITHMETIC DECIMAL_HIGH
OPTION BASE 0
DIM L(NN+1)
LET  L(0)=1
LET  L(1)=1-X
FOR N=1 TO NN-1
   LET  L(N+1)=(2*N+1-X)*L(N)-N*N*L(N-1)
NEXT N
LET LAGUERRE=L(NN)
END FUNCTION

EXTERNAL  FUNCTION WEIGHT(N,X)
OPTION ARITHMETIC DECIMAL_HIGH
LET WEIGHT=FAC(N)^2/(X*LAGUERREDIFF(N,X)^2)
END FUNCTION

EXTERNAL  FUNCTION LAGUERREDIFF(N,X)
OPTION ARITHMETIC DECIMAL_HIGH
LET LAGUERREDIFF=(LAGUERRE(N+1,X)-(N+1-X)*LAGUERRE(N,X))/X
END FUNCTION

EXTERNAL  FUNCTION FAC(X)
OPTION ARITHMETIC DECIMAL_HIGH
LET S=1
FOR I=2 TO X
   LET S=S*I
NEXT I
LET FAC=S
END FUNCTION

EXTERNAL  SUB DERIVATIVE(A(),B())
OPTION ARITHMETIC DECIMAL_HIGH
FOR I=MAXLEVEL TO 1 STEP -1
   LET  B(I-1)=I*A(I)
NEXT I
LET B(MAXLEVEL)=0
END SUB

EXTERNAL  FUNCTION HORNER(N,A(),X)
OPTION ARITHMETIC DECIMAL_HIGH
LET  Y=A(N)
FOR I=N-1 TO 0 STEP -1
   LET  Y=Y*X+A(I)
NEXT I
LET  HORNER=Y
END FUNCTION

EXTERNAL  SUB DIV(A(),P)
OPTION BASE 0
OPTION ARITHMETIC DECIMAL_HIGH
DIM C(MAXLEVEL)
FOR I=MAXLEVEL TO 1 STEP -1
   LET  C(I-1)=A(I)+C(I)*P
NEXT I
CALL COPY(A,C)
END SUB

EXTERNAL  SUB COPY(X(),Y())
OPTION ARITHMETIC DECIMAL_HIGH
FOR I=0 TO MAXLEVEL
   LET  X(I)=Y(I)
NEXT I
END SUB
 

¥¨¥ë¥ß¡¼¥È§·¸¿ô·×»»

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2008ǯ12·î30Æü(²Ð)09»þ42ʬ28ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ̵¸Â¶è´ÖÀÑʬ
/¡ç
| f(x)dx
/-¡ç

¥¬¥¦¥¹¡¦¥¨¥ë¥ß¡¼¥È§¤Î·¸¿ô(ʬÅÀ¡¢½Å¤ß)¤ò»»½Ð¤¹¤ë¡£
1000·å¥â¡¼¥É¤ò»ÈÍѤ·¡¢¥¨¥ë¥ß¡¼¥È¿¹à¼°¤ò¥Ë¥å¡¼¥È¥óË¡ + ÁÈΩ½üË¡¤Ç²ò¤¯


OPTION BASE 0
OPTION ARITHMETIC DECIMAL_HIGH
PUBLIC NUMERIC MAXLEVEL,EPS
LET MAXLEVEL=10
DIM X(MAXLEVEL),W(MAXLEVEL)
LET KETA=16
LET EPS=10^(-KETA)
LET DISPMODE=0 !' 0 or else
LET INTEGRAL=1 !' INTEGRAL >= 1
IF DISPMODE<>0 THEN
   CALL HERMITEPARA(MAXLEVEL,X,W)
   PRINT "DIM X(";STR$(MAXLEVEL);"),W(";STR$(MAXLEVEL);")"
   PRINT "FOR I=1 TO";MAXLEVEL
   PRINT "READ X(I),W(I)"
   PRINT "NEXT"
   PRINT "LET S=0"
   FOR I=1 TO INTEGRAL
      PRINT "FOR I";STR$(I);"=1 TO";MAXLEVEL
   NEXT I
   PRINT "LET  S=S+";
   FOR I=1 TO INTEGRAL
      PRINT "W(I";STR$(I);")*";
   NEXT I
   PRINT "FUNC(";
   FOR I=1 TO INTEGRAL
      PRINT "X(I";STR$(I);")";
      IF I < INTEGRAL THEN PRINT ",";
   NEXT I
   PRINT ")*EXP(";
   FOR I=1 TO INTEGRAL
      PRINT "X(I";STR$(I);")^2";
      IF I < INTEGRAL THEN PRINT "+";
   NEXT I
   PRINT ")"
   FOR I=1 TO INTEGRAL
      PRINT "NEXT"
   NEXT I
   PRINT "PRINT S,PI^";STR$(INTEGRAL/2)
   FOR I=1 TO MAXLEVEL
      PRINT "DATA ";
      PRINT USING "##." & REPEAT$("#",KETA):X(I);
      PRINT ",";
      PRINT USING "#." & REPEAT$("#",KETA) & "^^^^":W(I)
   NEXT I
   PRINT "END"
   PRINT
   PRINT "EXTERNAL  FUNCTION FUNC(";
   FOR I=1 TO INTEGRAL
      PRINT "X";STR$(I);
      IF I < INTEGRAL THEN PRINT ",";
   NEXT I
   PRINT ")"
   PRINT "LET FUNC=EXP(";
   FOR I=1 TO INTEGRAL
      PRINT "-X";STR$(I);"^2";
   NEXT I
   PRINT ")"
   PRINT "END FUNCTION"
ELSE
   FOR N=2 TO MAXLEVEL
      CALL HERMITEPARA(N,X,W)
      PRINT TAB(8+KETA/2);"ʬÅÀ";TAB(8+KETA*1.5);"   ½Å¤ß"
      FOR I=1 TO N
         PRINT "No.";I;":";
         PRINT USING "##." & REPEAT$("#",KETA):X(I);
         PRINT "  ";
         PRINT USING "#." & REPEAT$("#",KETA) & "^^^^":W(I)
      NEXT I
   NEXT N
END IF
END

EXTERNAL  SUB HERMITEPARA(N,A(),W())
OPTION ARITHMETIC DECIMAL_HIGH
OPTION BASE 0
DIM H(MAXLEVEL),D(MAXLEVEL)
CALL  HERMITEPOLY(N,H)
FOR I=0 TO N
   LET H(I)=H(I)/H(N)
NEXT I
FOR I=1 TO N
   CALL DERIVATIVE(H,D)
   LET XX=-15
   DO
      LET X=XX
      LET XX=X-HORNER(N,H,X)/HORNER(N,D,X)
   LOOP UNTIL ABS(HORNER(N,H,XX)) < EPS AND ABS(X-XX) < EPS
   LET A(I)=XX
   LET W(I)=WEIGHT(N,XX)
   CALL DIV(H,XX)
NEXT I
END SUB

EXTERNAL  SUB HERMITEPOLY(N,NEWP()) !'¥¨¥ë¥ß¡¼¥È¿¹à¼°(·¸¿ô)
OPTION ARITHMETIC DECIMAL_HIGH
OPTION BASE 0
DIM P(N+1),OLDP(N)
LET  OLDP(0)=1
LET  P(1)=2
FOR I=0 TO N
   LET NEWP(I)=0
NEXT I
FOR K=2 TO N
   FOR J=1 TO K
      LET  NEWP(J)=NEWP(J)+2*P(J-1)
      LET  NEWP(J-1)=NEWP(J-1)-2*(K-1)*OLDP(J-1)
   NEXT J
   IF K < N THEN
      FOR I=0 TO K
         LET  OLDP(I)=P(I)
         LET  P(I)=NEWP(I)
         LET  NEWP(I)=0
      NEXT I
   END IF
NEXT K
END SUB

EXTERNAL  FUNCTION HERMITE(NN,X) !'¥¨¥ë¥ß¡¼¥È¿¹à¼°(ÃÍ)
OPTION ARITHMETIC DECIMAL_HIGH
OPTION BASE 0
DIM H(NN+1)
LET  H(0)=1
LET  H(1)=2*X
FOR N=1 TO NN-1
   LET  H(N+1)=2*X*H(N)-2*N*H(N-1)
NEXT N
LET HERMITE=H(NN)
END FUNCTION

EXTERNAL  FUNCTION WEIGHT(N,X) !'½Å¤ß
OPTION ARITHMETIC DECIMAL_HIGH
LET WEIGHT=2^(N+1)*FAC(N)*SQR(PI)/HERMITE(N+1,X)^2
END FUNCTION

EXTERNAL  FUNCTION FAC(X)
OPTION ARITHMETIC DECIMAL_HIGH
LET S=1
FOR I=2 TO X
   LET S=S*I
NEXT I
LET FAC=S
END FUNCTION

EXTERNAL  FUNCTION HORNER(N,A(),X)
OPTION ARITHMETIC DECIMAL_HIGH
LET  Y=A(N)
FOR I=N-1 TO 0 STEP -1
   LET  Y=Y*X+A(I)
NEXT I
LET  HORNER=Y
END FUNCTION

EXTERNAL  SUB DERIVATIVE(A(),B())
OPTION ARITHMETIC DECIMAL_HIGH
FOR I=MAXLEVEL TO 1 STEP -1
   LET  B(I-1)=I*A(I)
NEXT I
LET B(MAXLEVEL)=0
END SUB

EXTERNAL  SUB DIV(A(),P)
OPTION BASE 0
OPTION ARITHMETIC DECIMAL_HIGH
DIM C(MAXLEVEL)
FOR I=MAXLEVEL TO 1 STEP -1
   LET  C(I-1)=A(I)+C(I)*P
NEXT I
CALL COPY(A,C)
END SUB

EXTERNAL  SUB COPY(X(),Y())
OPTION ARITHMETIC DECIMAL_HIGH
FOR I=0 TO MAXLEVEL
   LET  X(I)=Y(I)
NEXT I
END SUB
 

ÉÔÅù´Ö³Ö¿ôÃÍÀÑʬ

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2008ǯ12·î30Æü(²Ð)09»þ43ʬ55ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ÉÔÅù´Ö³Ö ¿ôÃÍÀÑʬ

/x(n)
| f(x)dx
/x(1)
ÀÑʬ¶è´Ö x(1)¡Áx(n)

PUBLIC NUMERIC MAXLEVEL
OPTION BASE 0
LET MAXLEVEL=10 !'ºÇÂ缡¿ô (MAXLEVEL > N)
LET N=5 !'¥Ç¡¼¥¿¿ô
DIM X(N),Y(N),A(MAXLEVEL),B(MAXLEVEL)
FOR I=1 TO N
   READ X(I),Y(I) !'y=x^2
NEXT I
CALL LARGRANGE(N,X,Y,A) !'¥é¥°¥é¥ó¥¸¥å¿¹à¼°
CALL INTEGRAL(A,B) !'ÀÑʬ
PRINT HORNER(N,B,X(N))-HORNER(N,B,X(1));X(N)^3/3-X(1)^3/3
!'CALL DERIVATIVE(A,B) !'Èùʬ
!'INPUT  PROMPT "f'(x) x=":XX
!'PRINT HORNER(N,B,XX);2*XX
DATA 0,0 !'Î¥»¶Ãͥǡ¼¥¿ XÃͤÏÅù´Ö³Ö¤Ç¤Ê¤¯¤Æ¤â¤¤¤¤
DATA 1,1
DATA 3,9
DATA 4,16
DATA 6,36
END

EXTERNAL  SUB LARGRANGE(N,X(),Y(),A())
OPTION BASE 0
DIM U(MAXLEVEL),V(MAXLEVEL)
CALL CLR(A)
LET U(1)=1
FOR I = 1 TO N
   LET  R = Y(I)
   CALL CLR(V)
   LET V(0)=1
   FOR J = 1 TO N
      IF I <> J THEN
         LET U(0)=-X(J)
         CALL MUL(V,U)
         LET  R = R / (X(I)-X(J))
      END IF
   NEXT J
   CALL SHORTMUL(V,R)
   CALL ADD(A,V)
NEXT I
END SUB

EXTERNAL  FUNCTION HORNER(N,A(),XX)
LET  Y=A(N)
FOR I=N-1 TO 0 STEP -1
   LET  Y=Y*XX+A(I)
NEXT I
LET  HORNER=Y
END FUNCTION

EXTERNAL  SUB MUL(A(),B())
OPTION BASE 0
DIM C(MAXLEVEL)
FOR I=0 TO MAXLEVEL-1
   FOR J=0 TO 1
      LET  C(I+J)=C(I+J)+A(I)*B(J)
   NEXT   J
NEXT   I
CALL COPY(A,C)
END SUB

EXTERNAL  SUB INTEGRAL(A(),B())
FOR I=MAXLEVEL-1 TO 0 STEP -1
   LET  B(I+1)=A(I)/(I+1)
NEXT I
LET B(0)=0
END SUB

EXTERNAL  SUB ADD(A(),B())
FOR I=0 TO MAXLEVEL
   LET  A(I)=A(I)+B(I)
NEXT I
END SUB

EXTERNAL  SUB COPY(X(),Y())
FOR I=0 TO MAXLEVEL
   LET  X(I)=Y(I)
NEXT I
END SUB

EXTERNAL  SUB CLR(X())
FOR I=0 TO MAXLEVEL
   LET  X(I)=0
NEXT I
END SUB

EXTERNAL  SUB SHORTMUL(A(),X)
FOR I=0 TO MAXLEVEL
   LET A(I)=A(I)*X
NEXT I
END SUB

EXTERNAL  SUB DERIVATIVE(A(),B())
FOR I=MAXLEVEL TO 1 STEP -1
   LET  B(I-1)=I*A(I)
NEXT I
LET B(MAXLEVEL)=0
END SUB

--------------------------------------------------------------
ÉÔÅù´Ö³Ö ¿ôÃÍÀÑʬ ¤½¤Î2

/x(m)
| f(x)dx
/x(1)
ÀÑʬ¶è´Ö x(1)¡Áx(m)

LET N=5 !'¥Ç¡¼¥¿¿ô  ¾ò·ï...MOD(N-1,M-1)=0
LET M=3 !'¾®¶è´Ö ´Ö³Ö¿ô
DIM X(N),Y(N),XX(M),YY(M)
FOR I=1 TO N
   READ X(I),Y(I) !'y=x^2
NEXT I
LET S=0
FOR I=1 TO N-M+1 STEP M-1 !'¾®¶è´Ö¤Ëʬ³ä¤¹¤ë X(1)¡ÁX(3),X(3)¡ÁX(5),X(5)¡ÁX(7),...
   FOR K=0 TO M-1
      LET XX(K+1)=X(I+K)
      LET YY(K+1)=Y(I+K)
   NEXT K
   LET S=S+INTEGRAL(XX,YY,M) !'Á´¶è´Öʬ¤ò­¤·¹ç¤ï¤»¤ë
   !'LET SS=SS+INTEGRAL2(XX,YY,M) !'²¼µ­»²¾È
NEXT I
PRINT S;(X(N)^3-X(1)^3)/3 !' ;SS
!'INPUT  PROMPT "f'(x) x=":XX
!'PRINT DERIVATIVE(N,X,Y,XX);2*XX !'²¼µ­»²¾È
DATA 0,0 !'Î¥»¶Ãͥǡ¼¥¿ XÃͤÏÅù´Ö³Ö¤Ç¤Ê¤¯¤Æ¤â¤¤¤¤
DATA 1,1
DATA 3,9
DATA 4,16
DATA 6,36
END

EXTERNAL  FUNCTION INTEGRAL(X(),Y(),M)
DECLARE EXTERNAL FUNCTION COMB
DIM H(M),XX(M),TEMP(M)
FOR I=1 TO M
   LET H(I)=1
   LET K=0
   FOR J=1 TO M
      IF I<>J THEN
         LET H(I)=H(I)/(X(I)-X(J))
         LET K=K+1
         LET XX(K)=X(J)
      END IF
   NEXT J
   LET SIGN=1
   FOR J=M TO 1 STEP -1
      LET SM=SM+SIGN*X(M)^J/J*COMB(XX,M,M-J,TEMP,1)*H(I)*Y(I)
      LET S1=S1+SIGN*X(1)^J/J*COMB(XX,M,M-J,TEMP,1)*H(I)*Y(I)
      LET SIGN=-SIGN
   NEXT J
NEXT I
LET INTEGRAL=SM-S1
END FUNCTION

EXTERNAL FUNCTION COMB(X(),N,R,A(),K)
IF R=0 THEN
   LET S=1
   FOR I=1 TO N
      IF A(I)=1 THEN LET S=S*X(I)
   NEXT I
   LET COMB=S
ELSE
   FOR I=K TO N-R+1
      LET A(I)=1
      LET SS=SS+COMB(X,N,R-1,A,I+1)
      LET A(I)=0
   NEXT I
   LET COMB=SS
END IF
END FUNCTION

--------------------------------------------------------------
ÉÔÅù´Ö³Ö ¿ôÃÍÀÑʬ ¤½¤Î3(¾åµ­»²¾È)

̤Äê·¸¿ôË¡

EXTERNAL  FUNCTION INTEGRAL2(X(),Y(),N)
DIM A(N,N),B(N)
FOR I=1 TO N
   FOR J=1 TO N
      LET A(I,J)=X(J)^(I-1)
   NEXT J
   LET B(I)=(X(N)^I-X(1)^I)/I
NEXT I
MAT A=INV(A)
MAT B=A*B
FOR I=1 TO N
   LET S=S+B(I)*Y(I)
NEXT I
LET INTEGRAL2=S
END FUNCTION

--------------------------------------------------------------
ÉÔÅù´Ö³Ö ¿ôÃÍÈùʬ(¾åµ­»²¾È)

EXTERNAL  FUNCTION DERIVATIVE(N,X(),Y(),XX)
DIM A(N,N),B(N)
FOR I=1 TO N
   FOR J=1 TO N
      LET A(I,J)=X(J)^I
   NEXT J
   LET B(I)=I*XX^(I-1)
   !'LET B(I)=I*(I-1)*XX^(I-2) !'2³¬Èùʬ
NEXT I
MAT A=INV(A)
MAT B=A*B
FOR I=1 TO N
   LET S=S+B(I)*Y(I)
NEXT I
LET DERIVATIVE=S
END FUNCTION

--------------------------------------------------------------
ÉÔÅù´Ö³Ö ¿ôÃÍÈùʬ(ÄêµÁ¤Î¤ß)

EXTERNAL  FUNCTION DIFF(N,X(),Y(),XX)
DIM A(N)
FOR I=1 TO N
   LET  L=1
   LET  KK=0
   FOR J=1 TO N
      IF J<>I THEN
         LET  KK=KK+1
         LET  L=L*(X(I)-X(J))
         LET  A(KK)=X(J)
      END IF
   NEXT  J
   LET  S1=0
   FOR J=1 TO N-1
      LET  S=1
      FOR K=1 TO N-1
         IF K<>J THEN LET S=S*(XX-A(K))
      NEXT K
      LET  S1=S1+S
   NEXT J
   LET  SS=SS+S1*Y(I)/L
NEXT I
LET  DIFF=SS
END FUNCTION
 

¿½ÅÀÑʬ

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2008ǯ12·î30Æü(²Ð)09»þ45ʬ18ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ºÆµ¢¸Æ½Ð¤·¤Ë¤è¤ë¿½ÅÀÑʬ ¥·¥ó¥×¥½¥ó§

PUBLIC NUMERIC LEVEL
INPUT  PROMPT "¿½ÅÀÑʬ LEVEL=":LEVEL
DIM A(LEVEL),B(LEVEL),N(LEVEL),AA(LEVEL)
FOR I=1 TO LEVEL
   !'INPUT  PROMPT "²¼¸Â  =":A(I)
   !'INPUT  PROMPT "¾å¸Â  =":B(I)
   !'INPUT  PROMPT "ʬ³ä¿ô=":N(I)
   READ A(I),B(I),N(I)
NEXT I
DATA 0,1,10
DATA 0,1,10
DATA 0,1,10
DATA 0,1,10
PRINT SIMPSONRECURSIVE(LEVEL,AA,A,B,N)
END

EXTERNAL  FUNCTION SIMPSONRECURSIVE(LEV,AA(),A(),B(),N())
IF LEV=0 THEN
   LET  SIMPSONRECURSIVE=FUNC(AA)
ELSE
   LET  H=(B(LEV)-A(LEV))/N(LEV)/2
   FOR K=0 TO N(LEV)-1
      LET  AA(LEV)=A(LEV)+H*K*2
      LET  S=S+1/3*H*SIMPSONRECURSIVE(LEV-1,AA,A,B,N)
      LET  AA(LEV)=A(LEV)+H*(2*K+1)
      LET  S=S+4/3*H*SIMPSONRECURSIVE(LEV-1,AA,A,B,N)
      LET  AA(LEV)=A(LEV)+H*(2*K+2)
      LET  S=S+1/3*H*SIMPSONRECURSIVE(LEV-1,AA,A,B,N)
   NEXT K
   LET SIMPSONRECURSIVE=S
END IF
END FUNCTION

EXTERNAL  FUNCTION FUNC(X())
LET S=1
FOR I=1 TO LEVEL
   LET S=S-X(I)*X(I)
NEXT I
IF S > 0 THEN
   LET FUNC=SQR(S)
ELSE
   LET FUNC=0
END IF
END FUNCTION

--------------------------------------------------------------
ºÆµ¢¸Æ½Ð¤·¤Ë¤è¤ë¿½ÅÀÑʬ ¥¬¥¦¥¹¡¦¥ë¥¸¥ã¥ó¥É¥ë§

PUBLIC NUMERIC W(10),X(10),LEVEL
INPUT  PROMPT "¿½ÅÀÑʬ LEVEL=":LEVEL
DIM A(LEVEL),B(LEVEL),XX(LEVEL),WW(LEVEL)
FOR I=1 TO LEVEL
   READ A(I),B(I)
NEXT I
DATA 0,1
DATA 0,1
DATA 0,1
DATA 0,1
RESTORE 10
FOR I=1 TO 10
   READ X(I),W(I)
NEXT I
PRINT LEGENDRERECURSIVE(LEVEL,XX,WW,A,B,10)
10 DATA -.9739065285171717,6.6671344308688138E-02 !'10ÅÀ ¥ë¥¸¥ã¥ó¥É¥ë§
   DATA -.8650633666889845,1.4945134915058059E-01
   DATA -.6794095682990244,2.1908636251598204E-01
   DATA -.4333953941292472,2.6926671930999636E-01
   DATA -.1488743389816312,2.9552422471475287E-01
   DATA  .1488743389816312,2.9552422471475287E-01
   DATA  .4333953941292472,2.6926671930999636E-01
   DATA  .6794095682990244,2.1908636251598204E-01
   DATA  .8650633666889845,1.4945134915058059E-01
   DATA  .9739065285171717,6.6671344308688138E-02
END

EXTERNAL  FUNCTION LEGENDRERECURSIVE(LEV,XX(),WW(),A(),B(),N)
   IF LEV=0 THEN
      LET LEGENDRERECURSIVE=FUNC(XX)
   ELSE
      FOR I=1 TO N
         LET XX(LEV)=X(I)*(B(LEV)-A(LEV))/2+(A(LEV)+B(LEV))/2
         LET WW(LEV)=W(I)*(B(LEV)-A(LEV))/2
         LET S=S+LEGENDRERECURSIVE(LEV-1,XX,WW,A,B,N)*WW(LEV)
      NEXT I
      LET LEGENDRERECURSIVE=S
   END IF
END FUNCTION

EXTERNAL  FUNCTION FUNC(X())
LET S=1
FOR I=1 TO LEVEL
   LET S=S-X(I)*X(I)
NEXT I
IF S > 0 THEN
   LET FUNC=SQR(S)
ELSE
   LET FUNC=0
END IF
END FUNCTION

--------------------------------------------------------------
ºÆµ¢¸Æ½Ð¤·¤Ë¤è¤ë¿½ÅÀÑʬ ¥Á¥§¥Ó¥·¥§¥Õ§

PUBLIC NUMERIC LEVEL
INPUT  PROMPT "¿½ÅÀÑʬ LEVEL=":LEVEL
DIM A(LEVEL),B(LEVEL),N(LEVEL),X(LEVEL),W(LEVEL)
FOR I=1 TO LEVEL
   !'INPUT  PROMPT "²¼¸Â  =":A(I)
   !'INPUT  PROMPT "¾å¸Â  =":B(I)
   !'INPUT  PROMPT "ʬ³ä¿ô=":N(I)
   READ A(I),B(I),N(I)
NEXT I
DATA 0,1,10
DATA 0,1,10
DATA 0,1,10
DATA 0,1,10
PRINT TCHEBYCHEFFRECURSIVE(LEVEL,X,W,A,B,N)
END

EXTERNAL  FUNCTION TCHEBYCHEFFRECURSIVE(LEV,XX(),WW(),A(),B(),N())
IF LEV=0 THEN
   LET TCHEBYCHEFFRECURSIVE=FUNC(XX)
ELSE
   FOR I=0 TO N(LEV)-1
      LET XX(LEV)=COS((2*I+1)/2/N(LEV)*PI)*(B(LEV)-A(LEV))/2+(A(LEV)+B(LEV))/2
      LET WW(LEV)=SQR((B(LEV)-XX(LEV))*(XX(LEV)-A(LEV)))
      LET S=S+TCHEBYCHEFFRECURSIVE(LEV-1,XX,WW,A,B,N)*WW(LEV)
   NEXT I
   LET TCHEBYCHEFFRECURSIVE=S*PI/N(LEV)
END IF
END FUNCTION

EXTERNAL  FUNCTION FUNC(X())
LET S=1
FOR I=1 TO LEVEL
   LET S=S-X(I)*X(I)
NEXT I
IF S > 0 THEN
   LET FUNC=SQR(S)
ELSE
   LET FUNC=0
END IF
END FUNCTION

--------------------------------------------------------------
ºÆµ¢¸Æ½Ð¤·¤Ë¤è¤ë¿½ÅÀÑʬ Æó½Å»Ø¿ô´Ø¿ôË¡(DEË¡)

[a,b]    q(t)=(b-a)/2*TANH(¦Ð/2*SINH(t))+(a+b)/2 q'(t)=¦Ð/2*(B-A)/2*COSH(X)*SECH(¦Ð/2*SINH(X))^2
[0,¡ç]   q(t)=EXP(¦Ð/2*SINH(t)) q'(t)=¦Ð/2*COSH(t)*EXP(¦Ð/2*SINH(t))
[-¡ç,¡ç] q(t)=SINH(¦Ð/2*SINH(t)) q'(t)=¦Ð/2*COSH(t)*COSH(¦Ð/2*SINH(t))

̵¸Â¶è´Ö¿½ÅÀÑʬ

PUBLIC NUMERIC LEVEL
INPUT  PROMPT "¿½ÅÀÑʬ LEVEL=":LEVEL
DIM X(LEVEL)
PRINT DE(LEVEL,X,1/16);PI^(LEVEL/2)
END

EXTERNAL  FUNCTION DE(LEV,X(),H)
IF LEV=0 THEN
   LET DE=FUNC(X)
ELSE
   FOR K=-4 TO 4 STEP H !'(Í×)Ä´À° K=-6¡Á6,H=1/1000 ÄøÅÙ
      LET X(LEV)=Q(K)
      LET  S=S+H*DE(LEV-1,X,H)*QQ(K)
   NEXT   K
   LET DE=S
END IF
END FUNCTION

EXTERNAL  FUNCTION Q(X)
LET Q=SINH(PI/2*SINH(X))
END FUNCTION

EXTERNAL  FUNCTION QQ(X)
LET QQ=PI/2*COSH(X)*COSH(PI/2*SINH(X))
END FUNCTION

EXTERNAL  FUNCTION FUNC(X())
LET S=0
FOR I=1 TO LEVEL
   LET S=S-X(I)*X(I)
NEXT I
LET  FUNC=EXP(S)
END FUNCTION
 

¥â¥ó¥Æ¥«¥ë¥íÀÑʬ

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2008ǯ12·î30Æü(²Ð)09»þ46ʬ32ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¿½ÅÀÑʬ¥â¥ó¥Æ¥«¥ë¥í

RANDOMIZE
PUBLIC NUMERIC LEVEL
INPUT  PROMPT "¿½ÅÀÑʬ LEVEL=":LEVEL
DIM A(LEVEL),B(LEVEL),N(LEVEL),AA(LEVEL)
FOR I=1 TO LEVEL
!'INPUT  PROMPT "²¼¸Â  =":A(I)
!'INPUT  PROMPT "¾å¸Â  =":B(I)
!'INPUT  PROMPT "ʬ³ä¿ô=":N(I)
   READ A(I),B(I),N(I)
NEXT I
PRINT MONTE(LEVEL,A,B,10000)
!'PRINT MONTE2(LEVEL,A,B,10000,2000)
!'PRINT MONTESIMPSON(LEVEL,A,B,10000)
!'PRINT MONTERECURSIVE(LEVEL,AA,A,B,N)
DATA 0,1,50
DATA 0,1,50
DATA 0,1,50
DATA 0,1,50
END

EXTERNAL  FUNCTION MONTE(LEV,A(),B(),N)
RANDOMIZE
DIM AA(LEV)
LET H=1
FOR I=1 TO LEV
   LET H=H*(B(I)-A(I))
NEXT I
FOR K=1 TO N
   FOR I=1 TO LEV
      LET  AA(I)=A(I)+(B(I)-A(I))*RND
   NEXT I
   LET S=S+FUNC(AA)
NEXT  K
LET MONTE=H*S/N
END FUNCTION

EXTERNAL  FUNCTION MONTE2(LEV,A(),B(),N,NN)
RANDOMIZE
DIM AA(LEV)
LET HMAX=-MAXNUM
LET HMIN=MAXNUM
LET HH=1
FOR I=1 TO LEV
   LET HH=HH*(B(I)-A(I))
NEXT I
FOR K=1 TO NN
   FOR J=1 TO LEV
      LET  AA(J)=A(J)+(B(J)-A(J))*RND
   NEXT J
   LET H=FUNC(AA)
   LET HMIN=MIN(HMIN,MIN(H,0))
   LET HMAX=MAX(H,HMAX)
NEXT K
LET H=HMAX-HMIN
FOR K=1 TO N
   FOR J=1 TO LEV
      LET  AA(J)=A(J)+(B(J)-A(J))*RND
   NEXT J
   LET Z=H*RND+HMIN
   IF FUNC(AA) > 0 THEN
      IF Z > 0 AND Z < FUNC(AA) THEN LET M1=M1+1
   ELSE
      IF Z < 0 AND Z > FUNC(AA) THEN LET M2=M2+1
   END IF
NEXT K
LET MONTE2=HH*(M1-M2)/N*H
END FUNCTION

EXTERNAL  FUNCTION MONTERECURSIVE(LEV,AA(),A(),B(),N()) !'ºÆµ¢¼°¥â¥ó¥Æ¥«¥ë¥í
IF LEV=0 THEN
   LET  MONTERECURSIVE=FUNC(AA)
ELSE
   LET  H=B(LEV)-A(LEV)
   FOR K=1 TO N(LEV)
      LET  AA(LEV)=A(LEV)+H*RND
      LET S=S+MONTERECURSIVE(LEV-1,AA,A,B,N)
   NEXT K
   LET MONTERECURSIVE=H*S/N(LEV)
END IF
END FUNCTION

EXTERNAL  FUNCTION MONTESIMPSON(LEV,A(),B(),N)  !'¥â¥ó¥Æ¥«¥ë¥í¡Ü¥·¥ó¥×¥½¥ó§
RANDOMIZE
DIM AA(LEV),T(LEV),HH(LEV)
LET H=1
FOR I=1 TO LEV
   LET H=H*(B(I)-A(I))
   LET HH(I)=(B(I)-A(I))/N/2
NEXT I
FOR K=1 TO N
   FOR I=1 TO LEV
      LET T(I)=(B(I)-A(I))*RND+A(I)
      LET AA(I)=A(I)+T(I)
   NEXT I
   LET S=S+1/3*H*FUNC(AA)
   FOR I=1 TO LEVEL
      LET AA(I)=A(I)+HH(I)+T(I)
   NEXT I
   LET S=S+4/3*H*FUNC(AA)
   FOR I=1 TO LEVEL
      LET AA(I)=A(I)+2*HH(I)+T(I)
   NEXT I
   LET S=S+1/3*H*FUNC(AA)
NEXT  K
LET MONTESIMPSON=S/N/2
END FUNCTION

EXTERNAL  FUNCTION FUNC(X())
LET S=1
FOR I=1 TO LEVEL
   LET S=S-X(I)*X(I)
NEXT I
IF S > 0 THEN
   LET FUNC=SQR(S)
ELSE
   LET FUNC=0
END IF
END FUNCTION

-----------------------------------------------
̵¸Â¶è´Ö ¿½ÅÀÑʬ¥â¥ó¥Æ¥«¥ë¥í

PUBLIC NUMERIC LEVEL
INPUT  PROMPT "¿½ÅÀÑʬ LEVEL=":LEVEL
DIM X(LEVEL)
PRINT MONTEDE(LEVEL,X,10000);PI^(LEVEL/2)
END

EXTERNAL  FUNCTION MONTEDE(LEV,X(),N) !'¥â¥ó¥Æ¥«¥ë¥í + DEË¡
RANDOMIZE
LET M=4 !'(Í×) Ä´À°
LET H=2*M/N
FOR J=1 TO N
   LET V=1
   FOR I=1 TO LEV
      LET K=RND*M*2-M
      LET X(I)=Q(K)
      LET V=V*QQ(K)
   NEXT I
   LET S=S+H^LEV*FUNC(X)*V
NEXT J
LET MONTEDE=S*N^(LEV-1)
END FUNCTION

EXTERNAL  FUNCTION FUNC(X())
FOR I=1 TO LEVEL
   LET S=S-X(I)*X(I)
NEXT I
LET  FUNC=EXP(S)
END FUNCTION

EXTERNAL  FUNCTION Q(X)
LET Q=SINH(PI/2*SINH(X))
END FUNCTION

EXTERNAL  FUNCTION QQ(X)
LET QQ=PI/2*COSH(X)*COSH(PI/2*SINH(X))
END FUNCTION
 

¤ª¤Þ¤±

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2008ǯ12·î30Æü(²Ð)09»þ47ʬ40ÉÃ
ÊÖ¿®¡¦°úÍÑ
           /1 /1   /1
¿½ÅÀÑʬ |  | ...| sqr(1-x*x-y*y-...)dxdy...¤Î¸¡¾ÚÍѤǤ¹
         /0 /0   /0

Ⱦ·Â¤ò1/2(R=.5)¤Ç¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤

!' S(n+2)=V(n)*2*¦Ð*r S(n)...n¼¡¸µµå¤ÎɽÌÌÀÑ
!' V(n)=S(n)*r/n      V(n)...n¼¡¸µµå¤ÎÂÎÀÑ
!' V(n)=¦Ð^(n/2)/GAMMA(n/2+1)*r^n
LET MAXLEVEL=20
DIM S(MAXLEVEL+2),V(MAXLEVEL+2)
INPUT  PROMPT "Ⱦ·Â=":R !' ¸¡¾Ú»þ R=.5
LET S(2)=2*PI*R
LET V(2)=PI*R^2
LET S(3)=4*PI*R^2
LET V(3)=4/3*PI*R^3
FOR N=2 TO MAXLEVEL
   LET S(N+2)=V(N)*2*PI*R
   LET V(N+2)=S(N+2)*R/(N+2)
   PRINT N;"¼¡¸µµå¤ÎÂÎÀÑ";V(N)   !';TAB(40);"ɽÌÌÀÑ";S(N)
NEXT N
END


--- ¤ª¤Þ¤± ---

Í­Íý¿ô¥â¡¼¥É¤Ç¤ª»î¤·¤¯¤À¤µ¤¤

LET MAXLEVEL=20
DIM S(MAXLEVEL+2,3),V(MAXLEVEL+2,3)
LET S(2,1)=2
LET S(2,2)=1
LET S(2,3)=1
LET S(3,1)=4
LET S(3,2)=1
LET S(3,3)=2
LET V(2,1)=1
LET V(2,2)=1
LET V(2,3)=2
LET V(3,1)=4/3
LET V(3,2)=1
LET V(3,3)=3
FOR N=2 TO MAXLEVEL
   LET S(N+2,1)=V(N,1)*2
   LET S(N+2,2)=V(N,2)+1
   LET S(N+2,3)=V(N,3)+1
   LET V(N+2,1)=S(N+2,1)/(N+2)
   LET V(N+2,2)=S(N+2,2)
   LET V(N+2,3)=S(N+2,3)+1
   PRINT STR$(N);"¼¡¸µµå¤ÎÂÎÀÑ   ";
   IF V(N,1)<>1 THEN LET A$=STR$(V(N,1)) & "*" ELSE LET A$=""
   IF V(N,2)=1 THEN LET P$="¦Ð" ELSE LET P$="¦Ð^" & STR$(V(N,2))
   IF V(N,3)=1 THEN LET R$="*r" ELSE LET R$="*r^" & STR$(V(N,3))
   PRINT A$;P$;R$
   PRINT STR$(N);"¼¡¸µµå¤ÎɽÌÌÀÑ ";
   IF S(N,1)<>1 THEN LET A$=STR$(S(N,1)) & "*" ELSE LET A$=""
   IF S(N,2)=1 THEN LET P$="¦Ð" ELSE LET P$="¦Ð^" & STR$(S(N,2))
   IF S(N,3)=1 THEN LET R$="*r" ELSE LET R$="*r^" & STR$(S(N,3))
   PRINT A$;P$;R$
   PRINT
NEXT N
END


--- ¤ª¤Þ¤± 2---

!'£î¼¡¸µµå¤ÎÂÎÀÑ
!'V(n)=1/(1*3*5*7*..*N)*2^((N+1)/2)*¦Ð^((N-1)/2)*R^N ...MOD(N,2)=1
!'V(n)=1/(2*4*6*8*..*N)*2^(N/2)    *¦Ð^(N/2)    *R^N ...MOD(N,2)=0
LET MAXLEVEL=20
FOR N=2 TO MAXLEVEL
   LET S=1
   FOR I=N TO 2 STEP -2
      LET  S=S/I
   NEXT I
   PRINT N;"¼¡¸µµå¤ÎÂÎÀÑ   ";STR$(S*2^((N+MOD(N,2))/2));"*¦Ð^";STR$((N-MOD(N,2))/2);"*r^";STR$(N)
   PRINT N;"¼¡¸µµå¤ÎɽÌÌÀÑ ";STR$(N*S*2^((N+MOD(N,2))/2));"*¦Ð^";STR$((N-MOD(N,2))/2);"*r^";STR$(N-1)
   PRINT
NEXT N
END

¢¨ Êص¹¾å¡Öµå¡×¡ÖÂÎÀѡסÖɽÌÌÀѡפȤ·¤Æɽ¼¨¤·¤Æ¤¤¤Þ¤¹¡£
¢¨ 2¼¡¸µ¤Ë¤ª¤¤¤Æ¡¢µå¤È¤Ï¡Ö±ß¡×¡¢ÂÎÀѤȤϡÖÌÌÀѡס¢É½ÌÌÀѤȤϡֱ߼þ¡×¤Î¤³¤È¤Ç¤¹¡£
¢¨ 4¼¡¸µ°Ê¾å¤Ë¤ª¤¤¤Æ¤â¡¢¤³¤ì¤é¤Îɽ¼¨¤¬Àµ¤·¤¤¤«¤É¤¦¤«Ä꤫¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
¢¨ n¼¡¸µÊªÂΤΡÖɽÌÌÀѡפȤϡ¢n-1¼¡¸µÊªÂΤΤ³¤È¤Ç¤¹¡£
 

PLOT TEXT

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2008ǯ12·î30Æü(²Ð)10»þ05ʬ24ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.204[¸µµ­»ö¤Ø]

¸½¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¤PLOT TEXTʸ¤Ïɽ¸þ¤­Áê»÷ÊÑ´¹¤Ë¤Î¤ßÂбþ¤·¤Æ¤¤¤Þ¤¹¡£
¾ÜºÙ¤È¡¤Âкö¤Ï
http://hp.vector.co.jp/authors/VA008683/G_COMMANDS.htm
¤Ë¤¢¤ê¤Þ¤¹¡£
 

Re: PLOT TEXT

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2008ǯ12·î30Æü(²Ð)14»þ22ʬ40ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.221[¸µµ­»ö¤Ø]

ÇòÀÐ ÀèÀ¸¤Ø

Åö»þ¤â¡¢ASK PIXEL ARRAYʸ¤È¡¢MAT PLOT CELLSʸ¤Ç¡¢»þ·×ʸ»úÈפÎÁ´ÂΤò
Êñ¤ó¤Ç ¤ä¤Ã¤Æ¤ß¤¿¤Î¤Ç¤¹¤¬Ãø¤·¤¤Â®ÅÙÄã²¼¤Ç¡¢¤À¤á¤Ç¤·¤¿¡£
ʸ»ú¤Î¤ß¤Î£±£²Îΰè¤Ëʬ¤±¤Æ¡¢Í¾·×¤Ê²èÁǤòÁ÷¤é¤Ê¤¤¤è¤¦¤Ë¤¹¤ì¤Ð¤É¤¦¤«¡¢
¤â¤¦°ìÅٻ¤Æ¤ß¤Þ¤¹¡£Â¾¤Ë¡¢²¿¤«ÂåÂؤ¹¤ëÊýË¡¤¬¤¢¤ê¤Þ¤·¤¿¤é¡¢¤´¶µ¼¨¤¯¤À¤µ¤¤¡£
 

£·¥»¥°¥á¥ó¥È¿ô»úɽ¼¨¤Î¥Ç¥¸¥¿¥ë»þ·×

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2008ǯ12·î31Æü(¿å)09»þ21ʬ11ÉÃ
ÊÖ¿®¡¦°úÍÑ
  °ÊÁ°ºî¤Ã¤¿ÏÀÍý²óÏ©¥µ¥Ö¥ë¡¼¥Á¥ó¤Î°ìÉô¤ò»È¤Ã¤ÆÅŻҹ©ºî¤Õ¡Á¡Ê¥Á¥Ã¥×¤ÎÁȤßΩ¤Æ¡Ë¤Îµ­½Ò¤Ç¤¹¡£
!£·¥»¥°¥á¥ó¥È¿ô»úɽ¼¨¤Î¥Ç¥¸¥¿¥ë»þ·×¡ÊClock¡Ë

LET w=400 !²èÌ̤ÎÂ礭¤µ
LET h=120
SET bitmap SIZE w+1,h+1 !¥É¥Ã¥Èñ°Ì¤Ë¤¹¤ë
SET WINDOW 0,w,h,0 !¥¯¥é¥¤¥¢¥ó¥ÈºÂɸ¡Êº¸¾å¤¬¸¶ÅÀ¡Ë


LET S0=-1
DO
   LET t$=TIME$ !»þ¹ï¤òhh:mm:ss·Á¼°¤ÇÆÀ¤ë

   LET S=VAL(t$(7:8)) !ÉÃ
   IF S<>S0 THEN !¹¹¿·¤µ¤ì¤¿¤é
      LET S0=S

      LET H=VAL(t$(1:2)) !»þ
      LET M=VAL(t$(4:5)) !ʬ

      CALL clock_display(INT(H/10),MOD(H,10),INT(M/10),MOD(M,10),INT(S/10),MOD(S,10))
   END IF
LOOP



!ÅÅ»ÒÉôÉÊ¡ÊÇÛÃÖ¤ÈÇÛÀþ¡Ë

!         ¢­BCD(h10,h1,m10,m1,s10,s1)
!  ¨£¨¡ ¥Ç¡¼¥¿¥é¥Ã¥Á
!  ¨¢     ¢­BCD
!  ¨¢   ¥Ç¥³¡¼¥À
!  ¨¢     ¢­abcdefg
!  ¨¦¢ª 88:88:88
!         ¨¢
!         GND
SUB clock_display(h10,h1,m10,m1,s10,s1) !ɽ¼¨Éô
   SET DRAW mode hidden !¤Á¤é¤Ä¤­ËÉ»ß(³«»Ï)
   CLEAR

   DRAW LED(1,GND) WITH SCALE(20)*SHIFT(155,40) !¥³¥í¥ó
   DRAW LED(1,GND) WITH SCALE(20)*SHIFT(155,80)

   !¥À¥¤¥Ê¥ß¥Ã¥¯ÅÀÅôɽ¼¨
   DRAW DRIVER7segment(h10) WITH SCALE(20)*SHIFT(50,60) !»þ
   DRAW DRIVER7segment(h1) WITH SCALE(20)*SHIFT(110,60)

   DRAW DRIVER7segment(m10) WITH SCALE(20)*SHIFT(200,60) !ʬ
   DRAW DRIVER7segment(m1) WITH SCALE(20)*SHIFT(260,60)

   DRAW DRIVER7segment(s10) WITH SCALE(15)*SHIFT(320,70) !ÉÃ
   DRAW DRIVER7segment(s1) WITH SCALE(15)*SHIFT(370,70)

   SET DRAW mode explicit !¤Á¤é¤Ä¤­ËÉ»ß(½ªÎ»)
END SUB

PICTURE DRIVER7segment(BCD) !£·¥»¥°¥á¥ó¥È¿ô»úɽ¼¨¤Ë¤¹¤ë
   CALL DECODE7segment(BCD, Za,Zb,Zc,Zd,Ze,Zf,Zg)
   DRAW LED7segmentKwithoutDP(Za,Zb,Zc,Zd,Ze,Zf,Zg)
END PICTURE


!ÅÅ»ÒÉôÉʡʾå°Ì¡Ë

SUB DECODE7segment(n, Za,Zb,Zc,Zd,Ze,Zf,Zg) !£·¥»¥°¥á¥ó¥È¿ô»úɽ¼¨¥Ç¥³¡¼¥À
   IF n=0 THEN
      LET ptn$="1111110" !abcdedfg¤Î¥ª¥ó¡¦¥ª¥Õ¾õÂÖ
   ELSEIF n=1 THEN
      LET ptn$="0110000"
   ELSEIF n=2 THEN
      LET ptn$="1101101"
   ELSEIF n=3 THEN
      LET ptn$="1111001"
   ELSEIF n=4 THEN
      LET ptn$="0110011"
   ELSEIF n=5 THEN
      LET ptn$="1011011"
   ELSEIF n=6 THEN
      LET ptn$="1011111"
   ELSEIF n=7 THEN
      LET ptn$="1110000"
   ELSEIF n=8 THEN
      LET ptn$="1111111"
   ELSEIF n=9 THEN
      LET ptn$="1111011"
   ELSE
      PRINT "ÉÔÀµ¤ÊÃͤǤ¹¡£"; n
   END IF

   LET Za=VAL(ptn$(1:1))
   LET Zb=VAL(ptn$(2:2))
   LET Zc=VAL(ptn$(3:3))
   LET Zd=VAL(ptn$(4:4))
   LET Ze=VAL(ptn$(5:5))
   LET Zf=VAL(ptn$(6:6))
   LET Zg=VAL(ptn$(7:7))
END SUB

!    --a-      ÇÛÃÖ°ÌÃÖ
!  f|    |b
!    --g-
!  e|    |c
!    --d-
PICTURE LED7segmentKwithoutDP(a,b,c,d,e,f,g) !£·¥»¥°¥á¥ó¥È¿ô»úɽ¼¨´ï  ¢¨¥«¥½¡¼¥É¡¦¥³¥â¥ó
   DRAW bar(a,GND) WITH SHIFT(0,-2) !¢¨º¸¾å¤¬¸¶ÅÀ
   DRAW bar(b,GND) WITH ROTATE(PI/2)*SHIFT(1,-1)
   DRAW bar(c,GND) WITH ROTATE(PI/2)*SHIFT(1,1)
   DRAW bar(d,GND) WITH SHIFT(0,2)
   DRAW bar(e,GND) WITH ROTATE(PI/2)*SHIFT(-1,1)
   DRAW bar(f,GND) WITH ROTATE(PI/2)*SHIFT(-1,-1)
   DRAW bar(g,GND) WITH SHIFT(0,0)
END PICTURE


!ÅÅ»ÒÉôÉʡʲ¼°Ì¡Ë

PICTURE bar(a,k) !ȯ¸÷¥À¥¤¥ª¡¼¥É¤òɽ¼¨¤¹¤ë
   IF a=1 AND k=0 THEN
      PLOT AREA: -1,-0.3; 1,-0.3; 1,0.3; -1,0.3 !ÅÀÅô¡¡¢¨ÅɤêÄÙ¤·
   ELSE
      PLOT LINES: -1,-0.2; 1,-0.2; 1,0.2; -1,0.2; -1,-0.2 !¾ÃÅô¡¡¢¨ÏÈ
   END IF
END PICTURE

PICTURE LED(a,k) !ȯ¸÷¥À¥¤¥ª¡¼¥É¤òɽ¼¨¤¹¤ë
   IF a=1 AND k=0 THEN
      DRAW disk WITH SCALE(0.4) !ÅÀÅô
   ELSE
      DRAW circle WITH SCALE(0.4) !¾ÃÅô
   END IF
END PICTURE

END
 

Re: £·¥»¥°¥á¥ó¥È¿ô»úɽ¼¨¤Î¥Ç¥¸¥¿¥ë»þ·×

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 1·î 1Æü(ÌÚ)03»þ00ʬ30ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.223[¸µµ­»ö¤Ø]

!¡¡»³Ã椵¤ó¤Î£·¥»¥°¿ô»ú¤Ç¡¢µ¤¤¬ÉÕ¤¤¤¿¡£¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
!¡¡plot_lines ¤Î¡¢vector_font¤Ç¡¢PLOT TEXT ¤ò¡¢¥«¥Ð¡¼¤Ç¤­¤¿¡£
!¡¡¤ä¤äĹʸ¤È¡¢¤ä¤»¤¿»ú·Á¤ÏÆñÅÀ¤Ê¤¬¤é¡¢»þ·×¤Î¿ô»ú¤â¡¢¶ÀÁü¤Ë¤Ê¤Ã¤¿¡£
!
!-------------------
LET N=2
LET NN=2^N
SET WINDOW -250/NN,250/NN,250/NN,-250/NN
SET TEXT COLOR 4
SET TEXT BACKGROUND "OPAQUE"
LET ¦Õ=0
LET stp=-PI/180*6
DO
   LET t=INT(TIME)
   IF t0<>t THEN
      LET t0=t
      IF 2*PI<=ABS(¦Õ) THEN LET stp=-stp
      LET ¦Õ=REMAINDER(¦Õ, 2*PI) +stp
      !-----
      SET DRAW mode hidden
      CLEAR
      DRAW D4(N) WITH SHIFT(-300/2,-300/2/SQR(3))*ROTATE(¦Õ*(-1)^N)*SCALE(1,(-1)^N)
      DRAW center WITH SHIFT(-300/2/NN,-300/2/NN/SQR(3))*ROTATE(¦Õ)
      PLOT TEXT,AT 137/NN,-234/NN:"±¦¥¯¥ê¥Ã¥¯¤ÇÄä»ß"
      SET DRAW mode explicit
   ELSE
      WAIT DELAY 0.05 !¡¡¾ÊÅÅÎϸú²Ì
   END IF
   MOUSE POLL mx,my,mlb,mrb
LOOP UNTIL mrb>=1 !¡¡±¦¥¯¥ê¥Ã¥¯¤ÇÄä»ß

PICTURE center
   SET LINE COLOR 2
   SET LINE width 2
   PLOT LINES:0,0;300/NN,0;300/2/NN,300/2/NN*SQR(3);0,0
   SET LINE width 1
   SET LINE COLOR 1
END PICTURE

!------
PICTURE D4(k)
   IF 0< k THEN
      DRAW D4(k-1) WITH SCALE(1/2,1/2)*SHIFT(300/4,SQR(3)*300/4) !¡¡Æ⦤ξå
      DRAW D4(k-1) WITH SCALE(1/2,-1/2)*SHIFT(300/4,SQR(3)*300/4) !¡¡Æ⦤ÎÃæ
      DRAW D4(k-1) WITH SCALE(1/2,1/2)*ROTATE(-PI*2/3)*SHIFT(300/4,SQR(3)*300/4) !Æ⦤κ¸
      DRAW D4(k-1) WITH SCALE(1/2,1/2)*ROTATE(PI*2/3)*SHIFT(300,0) !¡¡Æ⦤α¦
   ELSE
      DRAW »þ·×¿Þ WITH ROTATE(-¦Õ)*SHIFT(300/2,300/2/SQR(3))
      PLOT LINES:0,0;300,0;300/2,SQR(3)*300/2;0,0 !¡¡³°Â¦¤Î´ð½à»°³Ñ·Á¡ÊľÀܤÎÉÁ²è¤Ï̵¤·¡£)
   END IF
END PICTURE

!------
PICTURE »þ·×¿Þ
   SET AREA COLOR 1
   FOR i=1 TO 60
      LET a=PI/30*(i-15)
      IF MOD(i,5)=0 THEN
         CALL linefont(i/5, 60*COS(a), 60*SIN(a)) !¿ô»ú
         DRAW disk WITH SCALE(1)*SHIFT(72*COS(a),72*SIN(a)) !£µÊ¬ÌÜÀ¹¤ê
      ELSE
         DRAW disk WITH SCALE(.5)*SHIFT(72*COS(a),72*SIN(a)) !£±Ê¬ÌÜÀ¹¤ê
      END IF
   NEXT i
   !---¡¡00:00 ¤«¤é£ôÉà ¤Î¿Ë²óž Gear
   DRAW hand(1) WITH SCALE(2.5, 0.75)*ROTATE(t*PI/21600) !¡¡»þ¿Ë
   DRAW hand(1) WITH ROTATE(t*PI/1800) !¡¡Ê¬¿Ë
   DRAW hand(2) WITH SCALE(0, 1.1)*ROTATE(t*PI/30) !¡¡ÉÿË
   !---¡¡Ãæ¿´¤Î¾þ¤ê
   DRAW disk WITH SHIFT(0,0)*SCALE(4)
END PICTURE

PICTURE hand(c) !¡¡£³¿Ë¶¦ÍÑ
   SET AREA COLOR c
   PLOT AREA: -1,15; 1,15; 1,-60; -1,-60
END PICTURE

!-------------------------------------
SUB linefont(i,x,y) !¡¡plot text ¤ÎÂåÂØ
   SELECT CASE i
   CASE 1
      PLOT LINES:x+2.6,y-5;x+2.6,y+5 ! 1
   CASE 2
      PLOT LINES:x-2.6,y-5;x+2.6,y-5;x+2.6,y;x-2.6,y;x-2.6,y+5;x+2.6,y+5 ! 2
   CASE 3
      PLOT LINES:x-2.6,y-5;x+2.6,y-5;x+2.6,y+5;x-2.6,y+5 ! 3a
      PLOT LINES:x-2.6,y;x+2.6,y ! 3b
   CASE 4
      PLOT LINES:x-2.6,y-5;x-2.6,y;x+2.6,y ! 4a
      PLOT LINES:x+2.6,y-5;x+2.6,y+5 ! 4b
   CASE 5
      PLOT LINES:x+2.6,y-5;x-2.6,y-5;x-2.6,y;x+2.6,y;x+2.6,y+5;x-2.6,y+5 ! 5
   CASE 6
      PLOT LINES:x+2.6,y-5;x-2.6,y-5;x-2.6,y+5;x+2.6,y+5;x+2.6,y;x-2.6,y ! 6
   CASE 7
      PLOT LINES:x-2.6,y-5;x+2.6,y-5;x+2.6,y+5 ! 7
   CASE 8
      PLOT LINES:x-2.6,y;x-2.6,y-5;x+2.6,y-5;x+2.6,y+5;x-2.6,y+5;x-2.6,y;x+2.6,y ! 8
   CASE 9
      PLOT LINES:x+2.6,y;x-2.6,y;x-2.6,y-5;x+2.6,y-5;x+2.6,y+5;x-2.6,y+5 ! 9
   CASE 10
      LET x=x-7
      PLOT LINES:x+2.6,y-5;x+2.6,y+5 ! 1
      LET x=x+11
      PLOT LINES:x-2.6,y+5;x-2.6,y-5;x+2.6,y-5;x+2.6,y+5;x-2.6,y+5 ! 0
   CASE 11
      LET x=x-5
      PLOT LINES:x+2.6,y-5;x+2.6,y+5 ! 1
      LET x=x+9
      PLOT LINES:x+2.6,y-5;x+2.6,y+5 ! 1
   CASE 12
      LET x=x-7
      PLOT LINES:x+2.6,y-5;x+2.6,y+5 ! 1
      LET x=x+11
      PLOT LINES:x-2.6,y-5;x+2.6,y-5;x+2.6,y;x-2.6,y;x-2.6,y+5;x+2.6,y+5 ! 2
   CASE ELSE
   END SELECT
END SUB

END
 

Re: £·¥»¥°¥á¥ó¥È¿ô»úɽ¼¨¤Î¥Ç¥¸¥¿¥ë»þ·×

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ 1·î 2Æü(¶â)21»þ16ʬ48ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.224[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

ʸ»ú¤Î¶ÀÁü¤òÉÁ²è¤Ç¤­¤ë¤è¤¦¤Ë¤·¤Þ¤·¤¿¡£MAT PLOT CELLS¤Ç¤Ï¤½¤ÎÎΰè¤Î¤¹¤Ù¤Æ¤Î²èÁǤòÉÁ²è¤·»þ´Ö¤¬¤«¤«¤ë¤Î¤Ç¡¢Ê¸»úÀþ¤Î¤¢¤ë²èÁǤΤßÆɹþ¤ß¡¢MAT PLOT POINTS¤ÇÉÁ²è¤¹¤ë¤è¤¦¤Ë¤·¤Þ¤·¤¿¡£

SECOND¤µ¤ó¤Î¥×¥í¥°¥é¥à¤Î£³¹ÔÌܤÎSET WINDOWʸ¤Î¸å¤í¤Ë¤Ä¤®¤Î¥×¥í¥°¥í¥à¤òÁÞÆþ¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£´û¸¤ÎSUB linefont¤ÏÇѤ·¤Æ¤¯¤À¤µ¤¤¡£
CenturyÂΤÏÆüËܸì¤ËÂбþ¤·¤Æ¤Ê¤¤¤Î¤Ç"±¦¥¯¥ê¥Ã¥¯¤ÇÄä»ß"¤ò"Right Click to Stop"¤Ë¤â¤É¤·¤Æ¤¯¤À¤µ¤¤¡£

MAT PLOTʸ¤Ï3¼¡¸µ¤ÎÇÛÎó¤Ë¤ÏŬ±þ¤·¤Æ¤Ê¤¤¤Î¤Ç¡¢¤¢¤Þ¤ê¥¹¥Þ¡¼¥È¤Ç¤Ï¤Ê¤¤¤Ç¤¹¤¬¤Ê¤ó¤È¤«1ÉðÊÆâ¤ËÉÁ²è¤Ç¤­¤ë¤È»×¤¤¤Þ¤¹¡£ÃÙ¤ì¤ë¾ì¹ç¤Ïʸ»ú¥µ¥¤¥º(th=13)¤ò¾®¤µ¤¯¤·¤Æ¤ß¤Æ²¼¤µ¤¤¡£

!
ASK TEXT HEIGHT ath
ASK TEXT JUSTIFY atjx$,atjy$
SET POINT STYLE 1
SET TEXT JUSTIFY "CENTER","HALF"
LET th=13
SET TEXT HEIGHT th
SET TEXT FONT "Century" ,0
ASK TEXT WIDTH("WW") tw
ASK PIXEL SIZE (0,0;1.2*th,1.2*tw) px,py
LET p=ABS(px*py)
DIM f0(p,2),f1(p,2),f2(p,2),f3(p,2),f4(p,2),f5(p,2),f6(p,2),f7(p,2),f8(p,2),f9(p,2),f10(p,2),f11(p,2),f12(p,2)
LET pitchx=WORLDX(PIXELX(0)+1)
LET pitchy=WORLDY(PIXELY(0)+1)
FOR i=1 TO 12
   PLOT TEXT ,AT 0,0 : STR$(i)
   MAT f0=ZER
   LET k=0
   FOR x=-0.6*tw TO 0.6*tw STEP pitchx
      FOR y=0.6*th TO -0.6*th STEP pitchy
         ASK PIXEL VALUE (x,y) pc
         IF pc=1 THEN ! Ãæ´Ö¿§(³¥¿§)¤òÆɤ߹þ¤à¤Ê¤é¾ò·ï¤ò pc<>0
            LET k=k+1
            LET f0(k,1)=x
            LET f0(k,2)=y
         END IF
      NEXT y
   NEXT x
   CALL font_read
   CLEAR
NEXT i
SET TEXT HEIGHT ath
SET TEXT JUSTIFY atjx$,atjy$
!
SUB font_read
   MAT f12=ZER(k,2)
   FOR j=1 TO k
      LET f12(j,1)=f0(j,1)
      LET f12(j,2)=f0(j,2)
   NEXT j
   SELECT CASE i
   CASE 1
      MAT f1=f12
   CASE 2
      MAT f2=f12
   CASE 3
      MAT f3=f12
   CASE 4
      MAT f4=f12
   CASE 5
      MAT f5=f12
   CASE 6
      MAT f6=f12
   CASE 7
      MAT f7=f12
   CASE 8
      MAT f8=f12
   CASE 9
      MAT f9=f12
   CASE 10
      MAT f10=f12
   CASE 11
      MAT f11=f12
   CASE ELSE
   END SELECT
END SUB
SUB linefont(fi,x,y)
   SELECT CASE fi
   CASE 1
      DRAW  numplot(f1) WITH SHIFT(x,y)
   CASE 2
      DRAW  numplot(f2) WITH SHIFT(x,y)
   CASE 3
      DRAW  numplot(f3) WITH SHIFT(x,y)
   CASE 4
      DRAW  numplot(f4) WITH SHIFT(x,y)
   CASE 5
      DRAW  numplot(f5) WITH SHIFT(x,y)
   CASE 6
      DRAW  numplot(f6) WITH SHIFT(x,y)
   CASE 7
      DRAW  numplot(f7) WITH SHIFT(x,y)
   CASE 8
      DRAW  numplot(f8) WITH SHIFT(x,y)
   CASE 9
      DRAW  numplot(f9) WITH SHIFT(x,y)
   CASE 10
      DRAW  numplot(f10) WITH SHIFT(x,y)
   CASE 11
      DRAW  numplot(f11) WITH SHIFT(x,y)
   CASE 12
      DRAW  numplot(f12) WITH SHIFT(x,y)
   END SELECT
END SUB
PICTURE numplot(fm(,))
   MAT PLOT POINTS : fm
END PICTURE
!
 

Re: £·¥»¥°¥á¥ó¥È¿ô»úɽ¼¨¤Î¥Ç¥¸¥¿¥ë»þ·×

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 1·î 2Æü(¶â)21»þ36ʬ40ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.225[¸µµ­»ö¤Ø]

¹ÓÅĹÀÆ󤵤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
¤¿¤À»ä¤Î¥Ñ¥½¥³¥ó¤Ï¡¢Pentium-3, 500MHz ¤Ê¤Î¤Ç¡¢¤ä¤ä®ÅÙÉÔ­¤Ç¡¢£²ÉÃÈô¤Ó¤¬Áý¤¨¤Æ¡¢
»ÈÍѤǤ­¤Þ¤»¤ó¤Ç¤·¤¿¡£¤´¤á¤ó¤Ê¤µ¤¤¡£¤Ç¤â¡¢MAT PLOT CELLS ¤ËÈæ¤Ù³ÊÃʤ˹⮤Ǥ¹¡£
 

¡ÈÆȼ«¤Î³ÈÄ¥¡É

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 1·î 2Æü(¶â)21»þ47ʬ5ÉÃ
ÊÖ¿®¡¦°úÍÑ
 


½½¿ÊBASIC ¤Î¡ÈÆȼ«¤Î³ÈÄ¥¡É¤À¤±¤ò¡¢help ¤«¤é½ñ¤­½Ð¤·¤Æ¤ß¤¿¡£

¤³¤ì¤ò¤ß¤ë¤È¡¢DRAW GRID ¤ä¡¢Ê£ÁÇ¿ô¤Ê¤É¡¢½ÅÍפʷ׻»µ¡Ç½¤Þ¤Ç³ºÅö
¤·¤Æ¤ª¤ê¡¢½ã¿è¤Ê Full Basic ¤Ç¤Ê¤¯¤Æ¡¢Îɤ«¤Ã¤¿¤È»×¤¤¤Þ¤¹¡£


----------------------------------------------
OPTION ARITHMETIC DECIMAL_HIGH¡¡ 10¿Ê1000·å(Ķ±Û´Ø¿ô¤Ï17·å(ËöÈø¶ö¿ô))
OPTION ARITHMETIC COMPLEX¡¡¡¡¡¡¡¡Ê£ÁÇ¿ô
OPTION ARITHMETIC RATIONAL¡¡¡¡¡¡ Í­Íý¿ô(̵Íý´Ø¿ô¤Ï10¿Ê17·å(ËöÈø¶ö¿ô))
----------------------------------------------
RANDOMIZE 5489 ( °ú¿ô¤Ë0¡Á4294967295)
----------------------------------------------
FACT(x)¡¡¡¡ x¤Î³¬¾è
PERM(n,r)¡¡ ½çÎó¤Î¿ô
COMB(n,r)¡¡ Æó¹à·¸¿ô¡ÊÁȹ礻¤Î¿ô¡Ë
ROUND(x)¡¡¡¡x¤Î¾®¿ôÅÀ°Ê²¼¤ò´Ý¤á¤¿ÃÍ¡£
----------------------------------------------
BLEN(a$)¡¡¡¡¡¡¡¡¡¡¥Ð¥¤¥È¤òñ°Ì¤È¤¹¤ëa$¤Îʸ»úÎóĹ¡£
SUBSTR$(a$,m,n)¡¡ a$¤Îmʸ»úÌܤ«¤énʸ»úÌܤޤǤÎÉôʬʸ»úÎó
MID$(a$,m,n)¡¡¡¡¡¡a$¤Îmʸ»úÌܤ«¤é¤Înʸ»ú
LEFT$(a$,n)¡¡¡¡¡¡ a$¤Î¤Ï¤¸¤á¤Înʸ»ú
RIGHT$(a$,n)¡¡¡¡¡¡a$¤ÎËöÈø¤Înʸ»ú
----------------------------------------------
GetKeyState(n)¡¡¡¡¥­¡¼¤Î¾õÂÖ¤òÄ´¤Ù¤ë
----------------------------------------------
MAT A=CROSS(B,C)¡¡¡¡B,C¤Î³°ÀÑ(¥Ù¥¯¥È¥ëÀÑ)
--------------------------------------------
MAT REDIM¡¡¡¡¡¡¡¡¡¡ÇÛÎó¤Îź»ú¤Î¾å²¼¸Â¤òºÆÄêµÁ
----------------------------------------------
DIM A(N),B(2*N)¡¡¡¡Åº»ú¤Î¾å²¼¸Â»ØÄê¤ËÊÑ¿ô¤ò´Þ¤à¿ôÃͼ°
----------------------------------------------
¿§Ì¾¡¡"WHITE","BLACK","BLUE","GREEN","RED","CYAN","MAGENTA","YELLOW","GRAY","SILVER",
¡¡¡¡¡¡"Çò","¹õ","ÀÄ","ÎÐ","ÀÖ","²«"
----------------------------------------------
SET LINE WIDTH ¿ôÃͼ°¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Àþ¤ÎÂÀ¤µ
PLOT BEZIER: x1, y1 ; x2, y2 ; x3, y3; x4, y4¡¡¡¡¥Ù¥¸¥§¶ÊÀþ¤òÉÁ¤¯¡£
SET BEAM MODE "IMMORTAL"¡¡ PLOT LINES°Ê³°¤Î¼Â¹Ô¤ÇÉÁÅÀ¤Î¾õÂÖ¤òÊѤ¨¤Ê¤¤¡£
SET BEAM MODE "RIGOROUS"¡¡ ÉÁÅÀ¤Î¾õÂÖ¤òJIS¤Îµ¬ÄêÄ̤ê¤Ëoff¤Ë¤¹¤ë¡£
----------------------------------------------
PLOT LABEL ,AT x,y : ʸ»úÎó¼°
PLOT LABEL ,AT x,y ,USING ½ñ¼°»ØÄê : ¼°, ¼° , ¡Ä, ¼°
SET TEXT FONT FontName$ ¡¤size
ASK TEXT WIDTH(ʸ»úÎó¼°) ¿ôÃÍÊÑ¿ô¡¡¡¡¡¡Ê¸»úÎó¤ÎÌäÂêºÂɸ·Ï¤Ë¤ª¤±¤ë²£Éý
SET TEXT BACKGROUND "TRANSPARENT"
SET TEXT BACKGROUND "OPAQUE"
----------------------------------------------
DRAW GRID¡¡¡¡¡¡¡¡ £ø¼´Êý¸þ ´Ö³Ö£±¡¤£ù¼´Êý¸þ ´Ö³Ö£±¤Î³Ê»Ò¤òÉÁ¤¯¡£
DRAW GRID(p,q)¡¡¡¡£ø¼´Êý¸þ ´Ö³Öp¡¤£ù¼´Êý¸þ ´Ö³Öq¤Î³Ê»Ò¤òÉÁ¤¯¡£
DRAW AXES¡¡¡¡¡¡¡¡ ÌÜÀ¹¤ê´Ö³Ö¤¬£ø¼´Êý¸þ£±¡¤£ù¼´Êý¸þ£±¤Î£ø¼´¤È£ù¼´¤òÉÁ¤¯¡£
DRAW AXES(p,q)¡¡¡¡ÌÜÀ¹¤ê´Ö³Ö¤¬£ø¼´Êý¸þp¡¤£ù¼´Êý¸þq¤Î£ø¼´¤È£ù¼´¤òÉÁ¤¯¡£
DRAW GRID0
DRAW AXES0
SET AXIS COLOR¡¡¡¡¼´¤Î¿§¡¡¡¡ÇÑ»ßͽÄê
----------------------------------------------
DRAW circle¡¡¡¡¡¡¸¶ÅÀ¤òÃæ¿´¤È¤¹¤ëȾ·Â1¤Î±ß¤òÉÁ¤¯¡£
DRAW disk¡¡¡¡¡¡¡¡¸¶ÅÀ¤òÃæ¿´¤È¤¹¤ëȾ·Â1¤Î±ß¤È¤½¤ÎÆâÉô¤ò¸½ºß¤Îarea color¤ÇÅɤê¤Ä¤Ö¤¹¡£
----------------------------------------------
MOUSE POLL x,y,left,right¡¡¥Þ¥¦¥¹¤Î°ÌÃÖ¤òx,y¡¡left,right¤Ë¥Þ¥¦¥¹¥Ü¥¿¥ó¤Î¾õÂÖ
----------------------------------------------
PIXELX(x) ¡¡ÌäÂêºÂɸx¤ËÂбþ¤¹¤ë¥Ô¥¯¥»¥ëxºÂɸ
PIXELY(y) ¡¡ÌäÂêºÂɸy¤ËÂбþ¤¹¤ë¥Ô¥¯¥»¥ëyºÂɸ
WORLDX(x) ¡¡¥Ô¥¯¥»¥ëxºÂɸ¤òÌäÂêºÂɸ¤ËÊÑ´¹
WORLDY(y) ¡¡¥Ô¥¯¥»¥ëyºÂɸ¤òÌäÂêºÂɸ¤ËÊÑ´¹
PROBLEMX(x) WORLDX(x)¤ÈƱµÁ
PROBLEMY(y) WORLDY(y)¤ÈƱµÁ
----------------------------------------------
SET BITMAP SIZE width, height¡¡ÉÁ²èÎΰè¤Î²èÁÇ¿ô
----------------------------------------------
FLOOD x,y¡¡ÅÀ(x,y)¤ò»ÏÅÀ¤È¤·¤ÆÅÀ(x,y)¤ÈƱ¿§¤Ç¤Ä¤Ê¤¬¤ëÎΰè¤ò¸½ºß¤Îarea color¤ÇÅɤê¤Ä¤Ö¤¹¡£
PAINT x,y¡¡ÅÀ(x,y)¤ò»ÏÅÀ¤È¤·¤Æline color¤ÎÅÀ¤ò¶­³¦¤È¤¹¤ëÎΰè¤ò¸½ºß¤Îarea color¤ÇÅɤê¤Ä¤Ö¤¹¡£
----------------------------------------------
GLOAD ¥Õ¥¡¥¤¥ë̾¡¡¡¡»ØÄꤵ¤ì¤¿Ì¾Á°¤Î²èÁü¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤à¡£
GSAVE ¥Õ¥¡¥¤¥ë̾¡¡¡¡»ØÄꤵ¤ì¤¿Ì¾Á°¤Ç²èÁü¤òÊݸ¤¹¤ë¡£
----------------------------------------------
SET COLOR MODE "NATIVE"¡¡ ¿§»ØÄꡧ²¼°Ì8¥Ó¥Ã¥È¤¬ÀÖ¡¤Ãæ°Ì8¥Ó¥Ã¥È¤¬ÎС¤¾å°Ì8¥Ó¥Ã¥È¤¬ÀÄ
SET COLOR MODE "REGULAR"¡¡¥Ñ¥ì¥Ã¥È¤òÍѤ¤¤ëÄ̾ï¥â¡¼¥É
COLORINDEX(r,g,b)¡¡¡¡¡¡¡¡ ¿§»Øɸ¤òÆÀ¤ë´Ø¿ô
----------------------------------------------
SET DRAW MODE HIDDEN¡¡¡¡ ÆâÉô¤Ë¤¢¤ë¥Ó¥Ã¥È¥Þ¥Ã¥×¥á¥â¥ê¤Ë¤Î¤ßÉÁ²è¤¹¤ë¥â¡¼¥É
SET DRAW MODE EXPLICIT¡¡ ²èÌ̤ȥӥåȥޥåץá¥â¥ê¤ÎÁÐÊý¤ËÉÁ²è¤¹¤ë¥â¡¼¥É¡Êɸ½à¤Î¾õÂÖ¡Ë
SET DRAW MODE NOTXOR¡¡¡¡ ²èÌ̤ο§¤È»ØÄꤵ¤ì¤¿¿§¤ÎNOTXOR¤Î¿§¤ÇÉÁ¤¯
SET DRAW MODE OVERWRITE¡¡»ØÄꤵ¤ì¤¿¿§¤ÇÉÁ¤¯¡Êɸ½à¤Î¾õÂÖ¡Ë
----------------------------------------------
WAIT DELAY ¿ôÃͼ°¡¡¡¡»ØÄꤵ¤ì¤¿Éÿô¤À¤±µÙ»ß
PAUSE¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Enter¥­¡¼¤òÂԤġ£
PAUSE ʸ»úÎó¼°¡¡¡¡¡¡ ʸ»úÎó¼°¤ÎÃͤòɽ¼¨¤·¤ÆEnter¥­¡¼¤òÂԤġ£
----------------------------------------------
EXECUTE ¥Õ¥¡¥¤¥ë̾
EXECUTE ¥Õ¥¡¥¤¥ë̾ WITH (¼°¡¤¼°¡¤Ž¥Ž¥Ž¥¡¤¼°)
EXECUTE NOWAIT ¥Õ¥¡¥¤¥ë̾
EXECUTE NOWAIT ¥Õ¥¡¥¤¥ë̾ WITH (¼°¡¤¼°¡¤Ž¥Ž¥Ž¥¡¤¼°)
PLAY ʸ»úÎó¼°¡¡¡¡¡¡¡¡¡¡´ØÏ¢ÉÕ¤±¤òÍøÍѤ·¤Æʸ»úÎó¼°¤¬É½¤¹¥Õ¥¡¥¤¥ë¤òplay¤¹¤ë¡£
PLAY NOWAIT ʸ»úÎó¼° ¡¡»ØÄꤵ¤ì¤¿¥×¥í¥°¥é¥à¤Î¼Â¹Ô¤¬½ª¤ï¤ë¤Î¤òÂÔ¤¿¤º¤Ë¼¡¤Î¹Ô¤Ë¿Ê¤à¡£
ASSOC PRINT ʸ»úÎó¼°¡¡¡¡´ØÏ¢ÉÕ¤±¤òÍøÍѤ·¤Æʸ»úÎó¼°¤¬É½¤¹¥Õ¥¡¥¤¥ë¤òprint¤¹¤ë¡£
----------------------------------------------
SWAP x,y¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÊÑ¿ôx,y¤ÎÃͤò¸ò´¹¤¹¤ë¡£
BEEP¡¡¡¡¡¡ ¡¡¡¡¡¡¡¡¡¡¡¡·Ù¹ð²»¤òȯ¤¹¤ë¡£
BEEP ¿ôÃͼ°1, ¿ôÃͼ°2¡¡¡¡(NT/2000/XP) ¿ôÃͼ°1¤Ï¿¶Æ°¿ô(Hz)¡¤¿ôÃͼ°2¤Ï·Ñ³»þ´Ö(ms)
PLAYSOUND ʸ»úÎó¼°¡¡¡¡¡¡¡¡¡¡¥µ¥¦¥ó¥É¥Õ¥¡¥¤¥ë¤òºÆÀ¸¤¹¤ë¡£
PLAYSOUND ʸ»úÎó¼° ,ASYNC¡¡¡¡ºÆÀ¸¤¬½ª¤ï¤ë¤Î¤òÂÔ¤¿¤º¤Ë¼¡¤Î¹Ô¤Ë¿Ê¤à¡£
----------------------------------------------
SET #·ÐÏ©ÈÖ¹æ : ENDOFLINE CHR$(13)&CHR$(10)
SET #·ÐÏ©ÈÖ¹æ : ENDOFLINE CHR$(10)&CHR$(13)
SET #·ÐÏ©ÈÖ¹æ : ENDOFLINE CHR$(13)
SET #·ÐÏ©ÈÖ¹æ : ENDOFLINE CHR$(10)
ASK #·ÐÏ©ÈÖ¹æ : FILESIZE ¿ôÃÍÊÑ¿ô¡¡¡¡¥Ð¥¤¥Èñ°Ì¤Î¥Õ¥¡¥¤¥ëĹ
SET DIRECTORY a$¡¡¡¡¡¡¡¡¡¡¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤ò¡¢a$¤¬»ØÄꤹ¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ËÊѹ¹
ASK DIRECTORY s$¡¡¡¡¡¡¡¡¡¡¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤òɽ¤¹Ê¸»úÎó¤ò¡¢Ê¸»úÎóÊÑ¿ôs$¤ËÂåÆþ
FILE GETNAME s$¡¡¡¡¡¡¡¡¡¡¡¡¥Õ¥¡¥¤¥ë¤ò³«¤¯¥À¥¤¥¢¥í¥°¤òɽ¼¨¤·¡¤»ØÄꤹ¤ë¥Õ¥¡¥¤¥ë̾¤òs$¤ËÂåÆþ
FILE GETNAME s$, ʸ»úÎó¼°¡¡¡¡Ê¸»úÎó¼°¤ò´ûÄê¤Î³ÈÄ¥»Ò¤È¤·¤Æ¥Õ¥¡¥¤¥ë¥À¥¤¥¢¥í¥°¤ò³«¤¯
FILE SPLITNAME (a$) path$, name$, ext$¡¡¡¡¥Õ¥¡¥¤¥ë̾¤òɽ¤¹Ê¸»úÎó¼°a$¤ò¡¤3¤Ä¤Ëʬ³ä
FILE RENAME a$,b$¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡a$¤¬¼¨¤¹¥Õ¥¡¥¤¥ë¤Î̾Á°¤òb$¤ËÊѤ¨¤ë
FILE DELETE a$¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡a$¤¬¼¨¤¹¥Õ¥¡¥¤¥ë¤òºï½ü¤¹¤ë¡£
FILE LIST ʸ»úÎó¼°,s$¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡s$¤Ë¤Ï£±¼¡¸µÊ¸»úÎóÇÛÎó¤ò½ñ¤¯¡£
FILES(ʸ»úÎó¼°)¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Ê¸»úÎ󼰤˹çÃפ¹¤ë¥Õ¥¡¥¤¥ë¤Î¿ô¡£
----------------------------------------------
OPEN # ¿ôÃͼ° : PRINTER¡¡¡¡·ÐÏ©¤Ë¥×¥ê¥ó¥¿¤ò³ä¤êÅö¤Æ¤ë
----------------------------------------------
OPEN # ¿ôÃͼ° : TextWindow1
OPEN # ¿ôÃͼ° : TextWindow1 ,ACCESS INPUT
OPEN # ¿ôÃͼ° : TextWindow1 ,ACCESS OUTPUT
OPEN # ¿ôÃͼ° : TextWindow1 ,ACCESS OUTIN
----------------------------------------------
COMPLEX(x , y)¡¡Ê£ÁÇ¿ô¡¡x+ y i  ¡¡¡¡//Ê£ÁÇ¿ô¥â¡¼¥É
RE(z)¡¡¡¡¡¡¡¡¡¡z¤Î¼ÂÉô
IM(z)¡¡¡¡¡¡¡¡  z¤ÎµõÉô
CONJ(z)¡¡¡¡¡¡  z¤Î¶¦ÌòÊ£ÁÇ¿ô¡¡CONJ(x + y i)= x - y i
ARG(z)¡¡¡¡¡¡¡¡ z¤ÎÊгѡ¢angle radians(-¦Ð< ~<=¦Ð)¡¡angle degrees(-180¡ë< ~<=180¡ë)
ABS(z)¡¡¡¡¡¡¡¡ z¤ÎÀäÂÐÃÍ
SQR(z)¡¡¡¡¡¡¡¡ z¤ÎÊ¿Êýº¬¡ÊÊгѡ§-90¡ë< ~<=90¡ë)
SQR(-1)= i
EXP(z)¡¡¡¡¡¡¡¡ »Ø¿ô´Ø¿ô¡Ê³ÑÅÙñ°Ì¤Ï¾ï¤Ë¥é¥¸¥¢¥ó)
LOG(z)¡¡¡¡¡¡¡¡ z¤Î¼«Á³Âпô¡£¼ÂÉô¤Ïlog|z|,µõÉô¤Ïarg z(ñ°Ì¤Ï¾ï¤Ë¥é¥¸¥¢¥ó¤Ç -¦Ð¡Á¦Ð¡Ë¡£
¿Þ·ÁÊÑ·Á´Ø¿ô¤ÎÊ£ÁÇ¿ô¤Ø¤Î³ÈÄ¥( shift(z), scale(z),,, )
----------------------------------------------
NUMER(x)¡¡¡¡¡¡x¤Îʬ»Ò(numerator)      //Í­Íý¿ô¥â¡¼¥É
DENOM(x)¡¡¡¡¡¡x¤ÎʬÊì(denominator)
GCD(x,y)¡¡¡¡¡¡x¤Èy¤ÎºÇÂç¸øÌó¿ô(Greatest Common Divisor)¡£·ë²Ì¤ÏÀµÉä¹æ¤ò¤â¤Ä¡£
INTSQR(x)¡¡¡¡ x¤ÎÀµ¤ÎÊ¿Êýº¬¤Î¾®¿ôÅÀ°Ê²¼¤òÀÚ¤ê¼Î¤Æ¤¿¿ôÃÍ¡£INT(SQR(x))
INTLOG2(x)¡¡¡¡x¤ÎÀ°¿ôÉôʬ¤Î2¤òÄì¤È¤¹¤ëÂпô¤ÎÀ°¿ôÉôʬ¡£INT(LOG2(INT(x)))

 

£²£°£°£¹Ç¯Àꤤ

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ 1·î 4Æü(Æü)18»þ27ʬ13ÉÃ
ÊÖ¿®¡¦°úÍÑ
  2009ǯºîÉʤòÄ©Àï
­¡¡Ê£¹£°£°£²¡Ý£²£°£°£¹¡Ë¡à£¹¡á£·£·£·¡¡¡Ê¥é¥Ã¥­¡¼¥»¥Ö¥ó¡ª¡ª¡ªÂçÅö¤¿¤ê¡Ë

­¢À¾Îñ£²£°£°£¹Ç¯¡áÊ¿À®£²£±Ç¯¡á£³¡ß£·Ç¯
¤è¤ê£³¡¤£·¤Ç¡¡£³¡ß£·¡ß£³£·¡á£·£·£·

­££²£°£°£¹¡á£·¡ß£·¡ß£·¡ß£·¡Ý£·¡ß£·¡ß£·¡Ý£·¡ß£·

­¤£·£·£·£·£·¡°£·
¢á£·£·£·£·£·¡°£·£·
¢á£·£·£·£·£·¡°£·£·£·
¢á£·£·£·£·£·¡°£·£·£·£·
¢á£·£·£·£·£·¡°£·£·£·£·£·
¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦
¢á£·£·£·£·£·¡°£·£·£·¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£·
¢á£°¡Ê£Í£Ï£Ä£²£°£°£¹¡Ë
 

Re: ¡ÈÆȼ«¤Î³ÈÄ¥¡É

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ 1·î 4Æü(Æü)21»þ51ʬ27ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.227[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¤³¤ì¤â¤¢¤ê¤Þ¤¹¤è¡£

----------------------------------------------
¼±ÊÌ̾¤Ë´Á»ú¤¬»È¤¨¤ë¤è¤¦¤Ëʸˡ¤ò³ÈÄ¥¤·¤Æ¤¤¤ë¡£
¼±ÊÌ̾¤Ë»È¤¨¤ë¤Î¤Ï¡¤JISʸ»ú¥³¡¼¥Éɽ¤Ç"£°"(¿ô»ú¤Î¥¼¥í)°Ê¹ß¤Îʸ»ú¡£
¤¿¤À¤·¡¤Á´³Ñ±Ñ¿ô»ú¤Ç»Ï¤Þ¤ë̾Á°¤ÏÉԲġ£
----------------------------------------------

Á´³Ñʸ»ú22ʸ»ú¤«¤é¤Ê¤ëÊÑ¿ô̾¤Ç¤¹¡£(Ãí°Õ;´Ä¶­°Í¸ʸ»ú¤â¤¢¤ê¤Þ¤¹)
10 LET ¤«¤££±£Â£ä¥µ¦²¦Â§¥§ñ¨ª­±­·­Ê­Ö­à­ß­ä­å­ê­ó°¡=3
20 PRINT ¤«¤££±£Â£ä¥µ¦²¦Â§¥§ñ¨ª­±­·­Ê­Ö­à­ß­ä­å­ê­ó°¡+5
30 END
 

Re: ¡ÈÆȼ«¤Î³ÈÄ¥¡É

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 1·î 4Æü(Æü)22»þ42ʬ47ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.229[¸µµ­»ö¤Ø]

´Á»ú¡¡¤Ë¤Ä¤¤¤Æ¤Ï¡¢¼¡¤ÎÍͤ˽ñ¤«¤ì¤Æ¤¤¤Þ¤·¤¿¡£

¡ÖFull BASIC¤Ï¥³¡¼¥ÉÈֹ椬0¤«¤é127¤Þ¤Ç¤Îʸ»ú¤ò»ÈÍѤ¹¤ë¤³¤È¤òÁ°Äó¤Ë
¡¡µ¬³Ê²½¤µ¤ì¤Æ¤¤¤ë¡£¤½¤Î¤¿¤á¡¤JIS¤Ë¤Ï128ÈְʹߤÎʸ»ú¤ò°·¤¦¤³¤È¤Ë¤·¤Æ¤â
¡¡¤è¤¤¤È¤¤¤¦ÄøÅ٤Τ³¤È¤·¤«½ñ¤«¤ì¤Æ¤¤¤Ê¤¤¡£¡×

¤³¤ì¤ò¸«¤ë¤È¡¢¤à¤º¤«¤·¤¤È½ÃǤǤ¹¤Í¡£
»ÅÊý¤¬Ìµ¤¤¤Î¤Ç¡¢¤È¤ê¤¢¤¨¤º¡¢ÇòÀÐÀèÀ¸¤¬¡¢"Æȼ«¤Î³ÈÄ¥"¤È¥Þ¡¼¥¯¤µ¤ì¤¿¸Ä½ê
¤À¤±¤Ë¡¢¤·¤Æ¤¤¤Þ¤¹¡£
 

Re: ¡ÈÆȼ«¤Î³ÈÄ¥¡É

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ 1·î 5Æü(·î)00»þ08ʬ3ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.230[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¤Ê¤ë¤Û¤É¡£JIS¤Ë¤â¤¢¤¤¤Þ¤¤¤Êµ¬Ä꤬¤¢¤ë¤Î¤Ç¤¹¤Í¡£

¤È¤³¤í¤Ç¡¢¤¢¤Î¤ª¤«¤·¤ÊÊÑ¿ô̾¤òºî¤Ã¤Æ¤¤¤Æ»×¤Ã¤¿¤Î¤Ç¤¹¤¬¡¢ÇòÀÐÀèÀ¸¤ËÄó°Æ¤¬¤¢¤ê¤Þ¤¹¡£
JIS¥³¡¼¥É¤Ç¥®¥ê¥·¥ãʸ»ú¤è¤ê¸å¤í¤«¤é´Á»ú¤ÎÁ°¤Þ¤Ç¤ò¡¢¼±ÊÌ̾¤«¤é½ü³°¤·¤Æ¤Ï¤¤¤«¤¬¤Ç¤·¤ç¤¦¤«¡£
¥í¥·¥¢Ê¸»ú¤òÆɤá¤ë¿Í¤Ï¾¯¤Ê¤¤¤Ç¤·¤ç¤¦¤·¡¢·ÓÀþÁÇÊÒ¤¬¼±ÊÌ̾¤Ë¤Õ¤µ¤ï¤·¤¤¤È¤â»×¤¨¤Þ¤»¤ó¡£´Ä¶­°Í¸ʸ»ú¤Î»ÈÍѲóÈò¤Ë¤â¤Ê¤ê¤Þ¤¹¡£
JISµ¬³Ê¤È¤Î¤«¤Í¤¢¤¤¤â¤¢¤ë¤Ç¤·¤ç¤¦¤¬¡¢¤´¸¡Æ¤¤ò¤ª´ê¤¤¤·¤Þ¤¹¡£¡Êº¹¤·½Ð¤¬¤Þ¤·¤¯¿½¤·Ìõ¤¢¤ê¤Þ¤»¤ó¡Ë
 

Re: ¡ÈÆȼ«¤Î³ÈÄ¥¡É

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 1·î 6Æü(²Ð)10»þ04ʬ15ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.231[¸µµ­»ö¤Ø]

¸ø³«¤¹¤ë¥×¥í¥°¥é¥à¤Ï¡¤²Äǽ¤Ê¸Â¤ê¡¤
http://hp.vector.co.jp/authors/VA008683/QA1.htm
¤Ë¼¨¤¹¥¬¥¤¥É¥é¥¤¥ó¤Ë¤·¤¿¤¬¤Ã¤Æ¤¯¤À¤µ¤¤¡£
Æȼ«³ÈÄ¥µ¡Ç½¤Ï¡¤Â¾¤ËÂåÂؼêÃʤ¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ë¤«¤®¤êÍѤ¤¤ë¤Î¤¬Â縶§¤Ç¤¹¡£
¤¿¤È¤¨¤Ð¡¤´Á»ú¤Ê¤É¤Î¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ò¼±ÊÌ̾¤ËÍѤ¤¤ë¤³¤È¤Ï¡¤ÂåÂؼêÃʤ¬Â¸ºß¤¹¤ë¤Î¤Ç¡¤¿ä¾©¤·¤Þ¤»¤ó¡£
¡Ê³°¹ñ¿Í¤¬¸«¤¿¤éÉáÄ̤δÁ»ú¤Ç¤âÊѤƤ³¤Êʸ»ú¤Ç¤¹¡Ë
 

Re: ¡ÈÆȼ«¤Î³ÈÄ¥¡É

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ 1·î 6Æü(²Ð)18»þ57ʬ16ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.232[¸µµ­»ö¤Ø]

ÇòÀС¡ÏÂÉפµ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

ÁᮤΤ´²óÅú¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
¸Ä¿Í¤ÇÍøÍѤ¹¤ë°Ê³°¤Ç¤Ï¡¢³ÈÄ¥µ¡Ç½¤Ï»ÈÍѤ·¤Æ¤Ï¤¤¤±¤Ê¤¤¤È¤¤¤¦¤³¤È¤Ç¤¹¤Í¡£
´Á»ú»ÈÍѤϤȤ⤫¤¯¡¢³ÈÄ¥µ¡Ç½¤ÏÊØÍø¤Ê¤À¤±¤Ë¸¶Â§¤ò¼é¤ë¤Î¤Ï¤Ê¤«¤Ê¤«¸·¤·¤¤¤Ç¤¹¤¬¡Ä¡£
 

Knight's Tour¡Ê¥Ê¥¤¥È¡¦¥Ä¥¢¡¼¡Ë

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 1·î 7Æü(¿å)16»þ10ʬ5ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  !
!¡¡Knight's Tour¡Ê¥Ê¥¤¥È¡¦¥Ä¥¢¡¼¡Ë
!
!¡¡Ãí°Õ¡ª½ÐȯÅÀ¤ËÌá¤ë·ÐÏ© Closed Tour ¤Î¤ß¤Ë¡¢¸ÂÄꤷ¤Æ·×»»¡£¢ÎOpen Tour
!
!¡¡KNIGHTGR.UB
!¡¡Original Version¡¡¡¡1990/10/01 by unknown
!¡¡Modified Version¡¡¡¡1997/04/10 by Aiichi Yamasaki
!¡¡Modified Version¡¡¡¡2009/01/06 uBASIC ¤«¤é¡¢½½¿ÊBasic ¤Ø°Ü¿¢¡£
!--------------------
OPTION BASE 0
SET TEXT background "OPAQUE"
SET POINT STYLE 4
!
LET DF=0 !¡¡0:Ä̾1:õº÷²áÄø¤Îstep¡¡2:õº÷´°Î»Ëè¤Îstep //debug
LET Xw=6 !8 !¡¡Èפ⣶Ò
LET Yw=6 !8 !¡¡ÈפνĶÒ
!-----
! Schwenk's Theorem
! For any m ¡ß n board with m less than or equal to n,
! a closed knight's tour is always possible
! unless one or more of these three conditions are true:
!£±¡Ëm and n are both odd
!£²¡Ëm = 1, 2, or 4; m and n are not both 1
!£³¡Ëm = 3 and n = 4, 6, or 8
!
LET m= MIN(Xw,Yw)
LET n= MAX(Xw,Yw)
!
IF MOD(m,2)=1 AND MOD(n,2)=1 THEN CALL outer
IF (m=1 OR m=2 OR m=4) AND (m<>1 OR n<>1) THEN CALL outer
IF m=3 AND (n=4 OR n=6 OR n=8) THEN CALL outer

SUB outer
   beep
   PRINT "Xw=";Xw;"Yw=";Yw;" ¡Ä No Closed Tour."
   STOP
END SUB

!-----
LET D0=INT(192/MAX(MAX(Xw,Yw),8)) !¡¡ÈפΣ±ÌÜÉý
SET WINDOW -55/D0, 445/D0, 370/D0,-130/D0
PLOT TEXT,AT 0,-50/D0:"Knight's Tour"
LET Xct= 0
LET Yct= -30/D0 !¡¡count--time ¤Î°ÌÃÖ
CALL guide( 205/D0, 10/D0) ! x,y
!-----init
DIM P_(-2 TO Yw+1,-2 TO Xw+1), E_(-2 TO Yw+1,-2 TO Xw+1), I_(Xw*Yw), DX_(7), DY_(7)
MAT READ DX_,DY_
DATA  2, 1,-1,-2,-2,-1, 1, 2
DATA  1, 2, 2, 1,-1,-2,-2,-1
!-----
IF DF<>0 THEN MAT PRINT USING REPEAT$("## ",8): DX_ ! //debug
IF DF<>0 THEN MAT PRINT USING REPEAT$("## ",8): DY_ ! //debug
!-----init P_
MAT P_=CON
FOR y=0 TO Yw-1
   FOR x=0 TO Xw-1
      LET P_(y,x)=0
   NEXT x
NEXT y
!-----init E_
MAT E_=20*CON
FOR y=0 TO Yw-1
   FOR x=0 TO Xw-1
      LET E_(y,x)=0
   NEXT x
NEXT y
FOR y=0 TO Yw-1
   FOR x=0 TO Xw-1
      LET c=8
      FOR i=0 TO 7
         LET c=c-P_(y+DY_(i),x+DX_(i))
      NEXT i
      LET E_(y,x)=c
   NEXT x
NEXT y
!-----
IF DF<>0 THEN MAT PRINT USING REPEAT$(" ##",Xw+4) :P_ ! //debug
IF DF<>0 THEN MAT PRINT USING REPEAT$(" ##",Xw+4) :E_ ! //debug
!-----
LET sp=0 !¡¡0~(Xw*Yw-1) ³¬ÁØ°ÌÃ֡ʺƵ¢·¿¤ÎStackPointer¤ËÁêÅö¡Ë
LET xx=0 !¡¡³«»ÏÃÏÅÀ
LET yy=0 !¡¡(0,0)
LET I_(sp)=-1 !¡¡Á´³¬ÁؤÎÊý¸þ¥«¥¦¥ó¥¿¡¼
LET Count=0
LET t0=TIME
IF DF<>0 THEN CALL PUTL(xx,yy,0,0,2) ! //debug
DO
   LET I_(sp)=I_(sp)+1
   LET ii=I_(sp)
   IF 7< ii THEN
      CALL BACK !¡¡£±ÁØÌ᤹¡£
   ELSE
      IF P_(yy+DY_(ii),xx+DX_(ii))=0 THEN !¡¡½ÅÊ£¸¡ºº¡£
         IF DF<>0 THEN CALL PUTL(xx,yy,DX_(ii),DY_(ii),2) ! //debug
         LET xx=xx+DX_(ii)
         LET yy=yy+DY_(ii)
         LET P_(yy,xx)=1
         !-----dec E_
         LET E_(yy,xx)= E_(yy,xx)+10
         FOR i=0 TO 7
            LET E_(yy+DY_(i),xx+DX_(i))= E_(yy+DY_(i),xx+DX_(i))-1
         NEXT i
         IF DF<>0 THEN CALL DISP_E ! õº÷²áÄø¤ÎÇÛÎó E_ ¥â¥Ë¥¿¡¼ //debug
         !-----¡¡£±Áؿʤá¤ë¡£
         LET sp=sp+1
         LET I_(sp)=-1
         IF sp=Xw*Yw THEN
            CALL FIN !¡¡£±·ÐÏ©¤Î´°À®¡£
            CALL BACK !¡¡£±ÁØÌ᤹¡£
         ELSEIF fnCHECK(xx,yy)<>0 THEN !¡¡¼¡¤Î½ÅÊ£¸¡ººÁ°¤Î¡¢Í½¸«¸¡ºº¡£
            CALL BACK !¡¡£±ÁØÌ᤹¡£
         END IF
      END IF
   END IF
LOOP

SUB BACK
   LET P_(yy,xx)=0
   !-----inc E_
   LET E_(yy,xx)= E_(yy,xx)-10
   FOR i=0 TO 7
      LET E_(yy+DY_(i),xx+DX_(i))= E_(yy+DY_(i),xx+DX_(i))+1
   NEXT i
   !-----
   LET sp=sp-1
   IF sp=0 THEN STOP !¡¡½ªÎ»¡¢Count¡§£±ÇÜ
   !IF sp< 0 THEN STOP !¡¡½ªÎ»¡¢Count¡§£²Çܡʳ«»ÏÅÀ¤â²óž¡¢µ¢Ï©¤Þ¤ÇÊÌ·ÐÏ©¤Ë¤Ê¤ë¡Ë
   LET ii=I_(sp)
   LET xx=xx-DX_(ii)
   LET yy=yy-DY_(ii)
   IF DF<>0 THEN CALL PUTL(xx,yy,DX_(ii),DY_(ii),0) ! //debug
END SUB

FUNCTION fnCHECK(x,y) !¡¡Í½¸«¸¡ºº¡£
   LET c=0
   IF sp< Xw*Yw-1 THEN
      LET fnCHECK=1 !¡¡µ¢¤ê¤Î°ú¿ô¡á£±
      IF ABS(I_(1)-I_(0))=4 THEN EXIT FUNCTION !return(1)
      FOR i=0 TO 7
         IF E_(y+DY_(i),x+DX_(i))< 2 THEN
            IF E_(y+DY_(i),x+DX_(i))=0 THEN EXIT FUNCTION !return(1)
            LET c=c-1
         END IF
      NEXT i
      IF c< -1 THEN
         IF sp<>1 THEN EXIT FUNCTION !return(1)
      END IF
      FOR y=0 TO Yw-1
         FOR x=0 TO Xw-1
            IF E_(y,x)< 2 THEN
               IF E_(y,x)=0 THEN  EXIT FUNCTION !return(1)
               LET c=c+1
               IF c>1 THEN  EXIT FUNCTION !return(1)
            END IF
         NEXT x
      NEXT y
   END IF
   LET fnCHECK=0 !¡¡µ¢¤ê¤Î°ú¿ô¡á£°
END FUNCTION !return(0)

SUB PUTL(x,y,dx,dy,c)
   SET LINE COLOR c
   PLOT LINES: x,y; x+dx,y+dy
   PLOT POINTS: x+dx,y+dy
END SUB

SUB DISP_E
   PRINT
   MAT PRINT USING REPEAT$(" ##",Xw+4) :E_
   IF DF=1 THEN pause !¡¡//debug
END SUB

SUB FIN
!-----disp_A
   SET AREA COLOR 0
   PLOT AREA :0,0; Xw-1,0; Xw-1,Yw-1; 0,Yw-1
   LET x=0
   LET y=0
   CALL PUTL(x,y,0,0,2)
   FOR s=0 TO Xw*Yw-1
      CALL PUTL(x,y,DX_(I_(s)),DY_(I_(s)),2)
      LET x=x+DX_(I_(s))
      LET y=y+DY_(I_(s))
   NEXT s
   !-----disp cout--time
   LET Count=Count+1
   LET t1=INT(TIME-t0)
   IF t1< 0 THEN LET t1=t1+86400
   PLOT TEXT,AT Xct,Yct :"count= "& STR$(Count)& " ----- "&
&& USING$("%%",MOD(INT(t1/3600),24))& ":"&
&& USING$("%%",MOD(INT(t1/60),60))& ":"& USING$("%%",MOD(t1,60))
   IF DF=2 THEN pause !¡¡//debug
END SUB

!----------¥¬¥¤¥Éɽ¼¨-----
SUB guide(x,y)
   PLOT TEXT,AT x,y: "H V¡¡¡¡°ì½ä¤¹¤ë·ÐÏ©¤Î¿ô"
   PLOT TEXT,AT x,y +20/D0,USING "3x4: can't close¡¡¡¡### open »²¹Í": 2
   PLOT TEXT,AT x,y +40/D0,USING "5x5: can't close¡¡¡¡### open »²¹Í": 304
   PLOT TEXT,AT x,y +60/D0,USING "5x6: ##,###,###,###,### closed": 8
   PLOT TEXT,AT x,y +80/D0,USING "6x6: ##,###,###,###,### closed": 9862
   PLOT TEXT,AT x,y+100/D0,USING "8x8: ##,###,###,###,### closed": 26534728821064
   !
   PLOT TEXT,AT x,y+140/D0:"Knight ¤Î°ÜÆ°µ¬Â§"
   LET x=x+2
   LET y=y+160/D0+2
   SET LINE COLOR 2
   SET AREA COLOR 2
   LET j=SQR(5)
   FOR i=ATN(0.5) TO 2*PI STEP PI/2
      DRAW knight WITH ROTATE(i)*SHIFT(x,y)
      DRAW knight WITH ROTATE(-i)*SHIFT(x,y)
   NEXT i
   FOR j=-2 TO 2
      FOR i=-2 TO 2
         PLOT POINTS: x+i, y+j
      NEXT i
   NEXT j
END SUB

PICTURE knight
   PLOT LINES: 0,0; j,0
   PLOT AREA: j-0.4,-0.16; j,0; j-0.4,0.16; j-0.24,0
   PLOT POINTS: j,0
END PICTURE

END
 

Re: ¡ÈÆȼ«¤Î³ÈÄ¥¡É

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 1·î 7Æü(¿å)16»þ59ʬ52ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.233[¸µµ­»ö¤Ø]

JIS¤ÎÈϰϳ°¤Îµ¡Ç½¤Ë¤Ä¤¤¤Æ¤Ï¡¤¾­Í衤Êѹ¹¤â¤¢¤ê¤¨¤Þ¤¹¡£
¤¿¤È¤¨¤Ð¡¤¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤Î¼±ÊÌ̾¤ò»È¤¨¤Ê¤¯¤¹¤ëÊѹ¹¤Î²ÄǽÀ­¤â¤¢¤ê¤Þ¤¹¡£
¡Ê¹ñºÝ²½¤Î´ÑÅÀ¤ò½Å»ë¤¹¤ì¤Ð¤½¤ÎÊý¸þ¤Ë¿Ê¤à¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£¡Ë
¤Ê¤Î¤Ç¡¤µ¬³Ê³°¤Îµ¡Ç½¤Î»ÈÍѤϲÄǽ¤Ê¤«¤®¤êÈò¤±¤Æ¤¯¤À¤µ¤¤¡£
 

PAUSE ¥Ü¥¿¥ó

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 1·î 7Æü(¿å)17»þ15ʬ48ÉÃ
ÊÖ¿®¡¦°úÍÑ
  PAUSE ¤Î WINHANDLE(ʸ»úÎó¼°) ¤¬¡¢²ò¤ê¤Þ¤»¤ó¡£
Box °ÌÃ֤ΰÜÆ°¤Ï¡¢¤É¤¦¤¹¤ì¤Ð¤è¤¤¤Ç¤·¤ç¤¦¤«¡£
 

Re: PAUSE ¥Ü¥¿¥ó

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 1·î 7Æü(¿å)20»þ35ʬ51ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.236[¸µµ­»ö¤Ø]

PAUSE¤Î¥Õ¥©¡¼¥à¤Ï¾ïÃ󤷤ʤ¤¤Î¤Ç¡¤¥Ï¥ó¥É¥ë¤Î¼èÆÀ¤ÏÆñ¤·¤¤¤«¤È»×¤¤¤Þ¤¹¡£
¡ÊPAUSEʸ¤Î¤Ê¤«¤Ç¥¦¥£¥ó¥É¥¦¤ÎºîÀ®¤«¤é¾Ãµî¤Þ¤Ç¤ÎÆ°ºî¤¬´°·ë¤·¤Æ¤·¤Þ¤Ã¤Æ¤¤¤ë¡Ë
BASIC¤ÎÊ£¿ôµ¯Æ°¤ò¹Ô¤¦¤è¤¦¤Ê¤³¤È¤ò¤¹¤ì¤Ð¤Ç¤­¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¤¬¡¤°ìÈ̤ˤϡ¤
Win32API¤ò»È¤Ã¤ÆÆȼ«¤Î¥¦¥£¥ó¥É¥¦¤òºî¤ë¤Î¤¬½çÅö¤Ê²ò·èºö¤Î¤è¤¦¤Ë»×¤¤¤Þ¤¹¡£
 

Re: PAUSE ¥Ü¥¿¥ó

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 1·î 7Æü(¿å)21»þ03ʬ44ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.237[¸µµ­»ö¤Ø]

ÇòÀÐ ÀèÀ¸¤Ø

¡¡¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
 

Re: ¡ÈÆȼ«¤Î³ÈÄ¥¡É

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ 1·î 8Æü(ÌÚ)12»þ57ʬ40ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.233[¸µµ­»ö¤Ø]

ÇÛÎó¤Îź»ú¤ÎºÆÄêµÁ¤òJIS¤Îµ¬³ÊÆâ¤Ç¤Ç¤­¤ë¤è¤¦¤Ë¤·¤Þ¤·¤¿¡£

JIS¤Ë½¾¤¦¤È¡¢ÇÛÎó¤ÎÀë¸À¤Çź»ú¤Ë¤Ï¿ôÃÍÄê¿ô¤·¤«»È¤¨¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£
¤¢¤é¤«¤¸¤á¤¢¤ëÄøÅÙÂ礭¤¯ÇÛÎó¤òÀë¸À¤·¤Æ¤ª¤­¡¢MATʸ¤ÇÇÛÎó¤ÎÂ礭¤µ¤òÊѹ¹¤Ç¤­¤Þ¤¹¡£

DIM A(100),B(100),C(100)
LET m=3
LET n=8
MAT A=ZER(m)
MAT B=ZER(m*n)
MAT C=ZER(m TO n)

¤È¤³¤í¤¬MATʸ¤Ç¤Ïź»ú¤Î²¼¸Â¤òÊѹ¹¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¤¿¤á¡¢C¤Î²¼¸Â¤Ï1,¾å¸Â¤Ï6(=n-m+1)¤Ë¤Ê¤ê¤Þ¤¹¡£
¥Ø¥ë¥×¤Ç¤Ï¡Øź»ú¤Î²¼¸Â¤òÊѤ¨¤¿¤¤¤È¤­¤Ï¡¤MAT READʸ¤«¡¤³ÈÄ¥µ¡Ç½¤ÎMAT REDIMʸ¤òÍѤ¤¤ë¡£¡Ù¤È¤¢¤ê¤Þ¤¹¡£
MAT READ C(m TO n) ¤È¤¹¤ì¤Ð¤è¤¤¤ï¤±¤Ç¤¹¤¬¡¢DATAʸ¤òÆɤޤ»¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
MAT REDIM C(m TO n) ¤Ê¤é¤ÐÇÛÎóÍ×ÁǤϤ½¤Î¤Þ¤Þ¤Çź»ú¤Î²¼¸Â¤òÊѹ¹¤Ç¤­¤Þ¤¹¤¬JISµ¬³Ê³°¤Ç¤¹¡£

¼¡¤Î³°ÉôÉû¥×¥í¥°¥é¥à redim ¤Ï¡¢MAT REDIMʸ¤ÈƱÍͤε¡Ç½¤ò»ý¤Á¤Þ¤¹¡£

DECLARE EXTERNAL SUB redim
DIM A(100)
LET m=3
LET n=8
CALL redim(A,m,n)  ! MAT REDIM A(m TO n)¤ÈƱµÁ
PRINT LBOUND(A),UBOUND(A)
END
!
EXTERNAL SUB redim(p(),m,n) !ÇÛÎó¤Îź»ú¤Î¾å²¼¸Â¤òºÆÄêµÁ
WHEN EXCEPTION IN
   DIM q(10000)
   MAT q=p
   MAT READ p(m TO n)
   DATA 0
USE
END WHEN
FOR i=m TO n
   LET p(i)=q(LBOUND(q)+i-m)
NEXT i
END SUB
 

MAT REDIM¤ÎÂåÂØ

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 1·î 8Æü(ÌÚ)18»þ35ʬ32ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.239[¸µµ­»ö¤Ø]

EXTERNAL SUB redim(p(),m,n) !ÇÛÎó¤Îź»ú¤Î¾å²¼¸Â¤òºÆÄêµÁ
DATA 0
MAT READ p(m TO m)
MAT p=ZER(m TO n)
END SUB
¤Ç¤¤¤±¤Þ¤¹¡£
 

£²½Å¿¶»Ò¥á¡¼¥¿¡¼ÉաʲòÀϤ·¤¿¤¤Êý¤Ø¡ËºÆÅê¹Æ

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 1·î10Æü(ÅÚ)02»þ54ʬ20ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  !£²½Å¿¶»Ò¥á¡¼¥¿¡¼ÉաʲòÀϤ·¤¿¤¤Êý¤Ø¡ËºÆÅê¹Æ

!£²½Å¿¶¤ê»ÒÆÃÍ­¤Î²¼¹ß¾×·â»þ¤Ë¡¢¤½¤ÎµÞÊѤ¹¤ë²áÄø¤¬¡¢
!±é»»¥Ô¥Ã¥Á¤Î´Ö¤ËÆþ¤Ã¤ÆæÍ¡¢Á´¥¨¥Í¥ë¥®¡¼¤¬ÊÑÆ°¤¹¤ë·×»»¥¨¥é¡¼¤¬¸«¤é¤ì¤ë¡£
!±é»»¥Ô¥Ã¥Á¤¬¾®¤µ¤¤¤È¡¢´ËϤ¹¤ë¤¬¡¢Ä㮥ѥ½¥³¥ó¤Ç¤Ï¡¢ÉÁ²è¥Ô¥Ã¥Á¤¬È¼¤ï¤Ê¤¤¡£

!-----
LET g= 9.8 ! m/s^2¡¡½ÅÎϲîÅÙ
LET m1=.188 ! kg¡¡¤ª¤â¤ê
LET m2=.188 ! kg
LET L1= 5 !¡¡m¡¡ÄߤêËÀ
LET L2= 5 !¡¡m
LET r1=.75*SQR(m1) !¡¡¤ª¤â¤ê¤ÎÉÁ²è·Â
LET r2=.75*SQR(m2)
!
LET dt=0.05 !sec. ±é»»¥Ô¥Ã¥Á¡£¹â®µ¡ ¤Û¤É¡¢¾®¤µ¤¯¡£(0.05¤Ï¡¢Pentium3 500MHz)
!
!¢¨0.01¤¯¤é¤¤¤¬Ë¾¤Þ¤·¤¤¤¬¡¢ÉÁ²è¥Ô¥Ã¥Á(²èÌ̤Ëɽ¼¨)¤¬¡¢¤Ä¤¤¤ÆÍè¤ì¤Ê¤¯¤Ê¤Ã¤¿¤éÌ᤹¡£
!¡¡£²¤Ä¤Î¥Ô¥Ã¥Á¤¬¡¢¥º¥ì¤Æ¤¤¤ë¤ÈʪÍýŪ¤Ê®Å٤ǤϤʤ¯¤Ê¤ë¡£
!
!------------ £²½Å¿¶¤ê»Ò¤ÎÊýÄø¼°
! d(d¦È1)/dt^2=
! [ g*{sin¦È2*cos¦¤-¦Ì*sin¦È1}-{L2*(¦È2/dt)^2+L1*(¦È1/dt)^2*cos¦¤}*sin¦¤]
!¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡/[ L1*{¦Ì-cos¦¤^2}]
! d(d¦È2)/dt^2=
! [ g*¦Ì*{sin¦È1*cos¦¤-sin¦È2}+{¦Ì*L1*(¦È1/dt)^2+L2*(¦È2/dt)^2*cos¦¤}*sin¦¤]
!¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡/[ L2*{¦Ì-cos¦¤^2}]
!
! g= ½ÅÎϲîÅÙ¡¡¦Ì=(m1+m2)/m2¡¡¦¤=¦È1-¦È2
!
!---------- ¼°¤ÎÀ°Íý¡Ê¦È1¦È2 ¶¦¤Ë¡¢½ÅÎÏÊý¸þ£°¤«¤é¤Îº¸²ó¤ê³Ñ¡Ë
LET ¦Ì2=m2/(m1+m2)
LET L21=L2/L1
!
!ss1=-g/L1*sin¦È1 -¦Ì2*L21*¦Ø2^2*sin¦¤
!ss2=-g/L2*sin¦È2 +¡¡¡¡¡¡¡¡¦Ø1^2*sin¦¤/L21
!D=1-¦Ì2*COS¦¤^2
!d(¦È1)/dt=¦Ø1
!d(¦È2)/dt=¦Ø2
!d(¦Ø1)/dt=[¡¡¡¡¡¡¡¡¡¡¡¡ss1 - L21*¦Ì2*cos¦¤*ss2 ] /D
!d(¦Ø2)/dt=[ -cos¦¤/L21*ss1 + ¡¡¡¡¡¡¡¡¡¡¡¡¡¡ss2 ] /D
!
!---------- ÈùʬÊýÄø¼°¤Î¤Þ¤Þ¡¢¥ë¥ó¥²¡¦¥¯¥Ã¥¿Ë¡¤ÇÉÁ²è¡£
LET ¦È1=PI*0.8 ! ½é´ü³ÑÅÙ
LET ¦È2=PI*0.8
LET w1=0 !¡¡½é´ü³Ñ®ÅÙ
LET w2=0
!
DEF ss1(w2,¦È1,¦È2)=-g/L1*SIN(¦È1) -¦Ì2*L21*w2^2*SIN(¦È1-¦È2)
DEF ss2(w1,¦È1,¦È2)=-g/L2*SIN(¦È2) +        w1^2*SIN(¦È1-¦È2)/L21
DEF D(¦È1,¦È2)=1-¦Ì2*COS(¦È1-¦È2)^2
!
DEF ¦Á1(w1,w2,¦È1,¦È2)=( ss1(w2,¦È1,¦È2) -L21*¦Ì2*COS(¦È1-¦È2)*ss2(w1,¦È1,¦È2) )/D(¦È1,¦È2)
DEF ¦Á2(w1,w2,¦È1,¦È2)=(-ss1(w2,¦È1,¦È2)*COS(¦È1-¦È2)/L21     +ss2(w1,¦È1,¦È2) )/D(¦È1,¦È2)

SUB RungeKutta
   LET w11=w1
   LET w12=w2
   LET ¦Á11=¦Á1(w1,w2,¦È1,¦È2)
   LET ¦Á12=¦Á2(w1,w2,¦È1,¦È2)
   !
   LET w21=w1+¦Á11*dt/2
   LET w22=w2+¦Á12*dt/2
   LET ¦Á21=¦Á1(w21,w22,¦È1+w11*dt/2,¦È2+w12*dt/2)
   LET ¦Á22=¦Á2(w21,w22,¦È1+w11*dt/2,¦È2+w12*dt/2)
   !
   LET w31=w1+¦Á21*dt/2
   LET w32=w2+¦Á22*dt/2
   LET ¦Á31=¦Á1(w31,w32,¦È1+w21*dt/2,¦È2+w22*dt/2)
   LET ¦Á32=¦Á2(w31,w32,¦È1+w21*dt/2,¦È2+w22*dt/2)
   !
   LET w41=w1+¦Á31*dt
   LET w42=w2+¦Á32*dt
   LET ¦Á41=¦Á1(w41,w42,¦È1+w31*dt,¦È2+w32*dt)
   LET ¦Á42=¦Á2(w41,w42,¦È1+w31*dt,¦È2+w32*dt)
   !
   LET ¦È1=¦È1+(w11+2*w21+2*w31+w41)*dt/6
   LET ¦È2=¦È2+(w12+2*w22+2*w32+w42)*dt/6
   LET w1=w1+(¦Á11+2*¦Á21+2*¦Á31+¦Á41)*dt/6
   LET w2=w2+(¦Á12+2*¦Á22+2*¦Á32+¦Á42)*dt/6
END SUB

!----¥¨¥Í¥ë¥®¡¼¡¦¥á¡¼¥¿¡¼
DEF ep1=m1*g*(L1-L1*COS(¦È1)) !°ÌÃÖ£±
DEF em1=(L1*w1)^2*m1/2 !±¿Æ°£±
DEF ep2=m2*g*( (L1-L1*COS(¦È1)+L2)-L2*COS(¦È2) ) !°ÌÃÖ£²
DEF em2=( (L1*w1)^2+(L2*w2)^2-2*L1*w1*L2*w2*COS(PI+¦È1-¦È2) )*m2/2 !±¿Æ°£²
!
!----run
LET w=13
SET WINDOW -w,w,-w,w
SET COLOR MIX(15) .5,.5,.5
SET TEXT background "OPAQUE"
LET t0=TIME
DO
   LET t=TIME
   IF dt=<ABS(t-t0) THEN
      SET DRAW mode hidden
      CLEAR
      DRAW grid(5,5)
      PLOT TEXT,AT -w*0.92,w*0.9:"¤ª¤â¤ê¤Î¥¨¥Í¥ë¥®¡¼[J]"
      PLOT TEXT,AT -w*0.92,w*0.83:"°ÌÃÖ£±¡¡±¿Æ°£±¡¡ °ÌÃÖ£²¡¡±¿Æ°£²"
      PLOT TEXT,AT -w*0.96,w*0.76,USING"##.#### ##.####¡¡##.#### ##.####":ep1,em1,ep2,em2
      PLOT TEXT,AT -w*0.86,w*0.69,USING"##.####¡¡¡¡¡¡¡¡¡¡##.####":ep1+em1,ep2+em2
      PLOT TEXT,AT -w*0.62,w*0.62,USING"##.####":ep1+em1+ep2+em2
      PLOT TEXT,AT w*0.25,w*0.9:"¥Þ¥¦¥¹ ±¦¥Ü¥¿¥ó¤Ç¡¢½ªÎ»¡£"
      PLOT TEXT,AT w*0.4,w*0.76,USING"±é»»¥Ô¥Ã¥Á=#.### ÉÃ":dt
      PLOT TEXT,AT w*0.4,w*0.69,USING"ÉÁ²è¥Ô¥Ã¥Á=#.### ÉÃ":t-t0
      LET t0=t
      DRAW Pendulum0 WITH ROTATE(¦È1)
      CALL RungeKutta !¡¡¼¡¤Î¦È1,¦È2 ¤Ø¹¹¿·
      SET DRAW mode explicit
      !stop
   END IF
   WAIT DELAY 0 !¡¡¾ÊÅÅÎϸú²Ì
   MOUSE POLL mx,my,mlb,mrb
LOOP UNTIL mrb=1

PICTURE Pendulum0
   DRAW circle WITH SCALE(0.2)
   DRAW Pendulum1(L1,r1,"1")
   DRAW Pendulum1(L2,r2,"2") WITH ROTATE(¦È2-¦È1)*SHIFT(0,-L1)
END PICTURE

PICTURE Pendulum1(L,r,w$)
   PLOT LINES: 0,0;0,-L
   DRAW disk WITH SCALE(r)*SHIFT(0,-L)
   PLOT TEXT,AT r, r-L:w$
END PICTURE

END
 

¥»¥ó¥¿¡¼»î¸³ÄøÅÙ¤Î¥×¥í¥°¥é¥à±é½¬

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 1·î15Æü(ÌÚ)10»þ44ʬ57ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ľÀþ¾å¤Î¿ìÊâÌäÂê
¡¡¥³¥¤¥ó¤òÅꤲ¤Æ¡¢É½¤¬½Ð¤¿¤é¡Ü£±¡¢Î¢¤Ê¤é¡Ý£±¤È¿ôľÀþ¾å¤òÆ°¤¯¡£

¡ü¥·¥ß¥å¥ì¡¼¥·¥ç¥ó¤Ë¤è¤ë²òË¡¡Ê¥â¥ó¥Æ¥«¥ë¥íË¡¡Ë
RANDOMIZE

LET N=6 !¥³¥¤¥ó¤òÅꤲ¤ë²ó¿ô

DIM s(-N TO N) !ÅÀx¤ËÌá¤ë²ó¿ô
MAT s=ZER

LET iter=50000 !»î¹Ô²ó¿ô
FOR i=1 TO iter

   LET x=0 !¸¶ÅÀ
   FOR k=1 TO N !¥³¥¤¥ó¤òÅꤲ¤ë
      IF RND<0.5 THEN LET x=x+1 ELSE LET x=x-1 !ɽ¤Ê¤é¡Ü£±¡¢Î¢¤Ê¤é¡Ý£±
   NEXT k
   LET s(x)=s(x)+1 !·ë²Ì

NEXT i

FOR i=-N TO N !ÅÀx¤ËÌá¤ë³ÎΨ
   PRINT i;s(i)/iter
NEXT i
PRINT

FOR i=-N TO N !¾ì¹ç¤Î¿ô
   PRINT USING "###: ###.##": i,s(i)/s(N) !x=N¤ò£±¤È¤¹¤ë
NEXT i

END


¡üÍýÏÀÃͤλ»½Ð

¥³¥¤¥ó¤ò£î²óÅꤲ¤Æ¡¢£ë²óɽ¤¬½Ð¤¿¤¹¤ë¡£
°ÌÃÖx=1*k+(-1)*(n-k)=2*k-n¤È¤Ê¤ë¡£³ÎΨ¤Ï¡¢n£Ãk(1/2)^k*(1-1/2)^(n-k)¡£

¤¿¤È¤¨¤Ð¡¢n=6¤Ç¸¶ÅÀ¤Î¾ì¹ç¡¢0=2*k-n¤è¤ê¡¢k=3¡£
LET x=0 !¸¶ÅÀ

LET k=(x+N)/2 !À°¿ô²ò¤¬¤¢¤ì¤Ð
IF k=INT(k) THEN
   PRINT k; comb(N,k)*(1/2)^k*(1-1/2)^(N-k)
ELSE
   PRINT "Åþ㤷¤Þ¤»¤ó¡£"
END IF

END


Åꤲ¤ë²ó¿ô¤´¤È¤Î¡Ö¾ì¹ç¤Î¿ô¡×¤Î°ìÍ÷ɽ¤Ï¡¢¥Ñ¥¹¥«¥ë¤Î»°³Ñ·Á¤ò¤Ä¤¯¤ì¤Ð¤è¤¤¡£
!¥Ñ¥¹¥«¥ë¤Î»°³Ñ·Á

LET N=10 !¥³¥¤¥ó¤òÅꤲ¤ë²ó¿ô

LET a=1 !¥Ñ¥¹¥«¥ë¤Î»°³Ñ·Á
LET b=0
LET c=1

DIM P(-N TO N) !¿ôľÀþ¾å¤Î³ÆÅÀ
MAT P=ZER
LET P(0)=1 !¸¶ÅÀ¤Ë°ÌÃÖÉÕ¤±¤ë

FOR i=-N TO N !ÌÜÀ¹¤ê
   PRINT USING " ####": i;
NEXT i
PRINT
FOR i=-N TO N !¿ôľÀþ
   PRINT "----+";
NEXT i
PRINT

FOR i=0 TO N !»ØÄê²ó¿ô

   MAT PRINT USING(REPEAT$(" ####",2*N+1)): P; !¸½¾õ
   PRINT USING " ### ²ó¤Î¾ì¹ç": i

   LET T1=0 !º¸¡¡¢¨º¸Ã¼
   LET T2=P(-N) !Ãæ±û
   FOR x=-N TO N !º¸¤«¤é±¦¤ØÁöºº¤¹¤ë
      IF x+1>N THEN LET T3=0 ELSE LET T3=P(x+1) !±¦

      LET P(x)=a*T1+b*T2+c*T3

      LET T1=T2 !¼¡¤Ø
      LET T2=T3
   NEXT x

NEXT i

END
 

comb´Ø¿ô¤ÎÉÔ¶ñ¹ç

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 1·î16Æü(¶â)10»þ42ʬ29ÉÃ
ÊÖ¿®¡¦°úÍÑ
  Í­Íý¿ô¥â¡¼¥É¤Ç£±¤È¤Ê¤ë¡£

PRINT comb(3,6) !3C6
PRINT comb(3,-4)
END
 

Re: comb´Ø¿ô¤ÎÉÔ¶ñ¹ç

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 1·î16Æü(¶â)18»þ12ʬ34ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.244[¸µµ­»ö¤Ø]

¤´Êó¹ð¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
½¤Àµ¤·¤Þ¤¹¡£

> Í­Íý¿ô¥â¡¼¥É¤Ç£±¤È¤Ê¤ë¡£
>
> PRINT comb(3,6) !3C6
> PRINT comb(3,-4)
> END
 

Re: ¥»¥ó¥¿¡¼»î¸³ÄøÅÙ¤Î¥×¥í¥°¥é¥à±é½¬

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 1·î17Æü(ÅÚ)13»þ27ʬ49ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.243[¸µµ­»ö¤Ø]

ºîɽ¤Èɽ¤Î·×»»¡¢¿ôÎó¤ÎÀ¸À®
¡¦£²¼¡¸µÇÛÎó¤ò»È¤ï¤º¡¢½ç¼¡µá¤á¤ë

!¶å¶åɽ¡Ê¾è»»É½¡Ë¤È¡Á¿ô

!£±¤ÎÃÊ¡¡¡Ý¡¡¼«Á³¿ô
!£²¤ÎÃÊ¡¡¡Ý¡¡¶ö¿ô
!³ÆÃÊ¡¡¡Ý¡¡ÇÜ¿ô


LET N=9 !¢¨½ñ¼°¡ÊPRINT USING¡Ë¤Î·å¤òÄ´À°¤¹¤ì¤ÐÊѹ¹²Äǽ

DIM A(0 TO 2*N) !¿ôÎó An
DIM S(0 TO 2*N) !¿ôÎó Sn


!¡üÊ¿Êý¿ô¡Ê»Í³Ñ¿ô¡Ë¡¡n^2
MAT A=ZER
PRINT

FOR i=1 TO N
   FOR j=1 TO N
      LET t=i*j !¾è»»

      IF i=j THEN !ÂгÑÀþ¾å¤Ê¤é
         PRINT USING "(####)": t;
         LET A(i)=t
      ELSE
         PRINT USING " #### ": t;
      END IF

   NEXT j
   PRINT
NEXT i
PRINT


!»Í³Ñ¿í¿ô¡ÊÊ¿Êý¿ô¤ÎÏ¡ËSquare Pyramid Numbers
!¡¡¦²[k=1,n]k^2
! =1^2 + 2^2 + 3^2 + ¡Ä + (n-1)^2 + n^2
! =n*(n+1)*(2*n+1)/6
MAT S=ZER

FOR i=1 TO N
   LET S(i)=S(i-1)+A(i) !Ï¡¡¢¨A()¤Ï¾åµ­¤ÎÊ¿Êý¿ô
NEXT i
FOR i=1 TO N !¡Á¿ô¤òɽ¼¨¤¹¤ë
   PRINT S(i);
NEXT i
PRINT
PRINT


!´ñ¿ô¤ÎÏ¡¡1 + 3 + 5 + ¡Ä + (2*n-3) + (2*n-1)
!¡¡¦²[k=1,n](2*k-1)
! =n^2
MAT S=ZER

FOR i=1 TO N
   LET S(i)=A(i)-A(i-1) !³¬º¹¡¡¢¨A()¤Ï¾åµ­¤ÎÊ¿Êý¿ô
NEXT i
FOR i=1 TO N !¡Á¿ô¤òɽ¼¨¤¹¤ë
   PRINT S(i);
NEXT i
PRINT
PRINT



!¡ü»ÍÌÌÂοô¡Ê»°³Ñ¿ô¤ÎÏ¡¢»°³Ñ¿í¿ô tetrahedral number¡Ë
!¡¡¦²[k=1,n]k*(n-k+1)
! =1*n+2*(n-1)+3*(n-2)+ ¡Ä +(n-1)*2+n*1
! =n*(n+1)*(n+2)/6
MAT A=ZER
PRINT

FOR i=1 TO N
   FOR j=1 TO N
      LET t=i*j !¾è»»

      LET A(i+j-1)=A(i+j-1)+t !±¦¼Ð¤á¡Ê¡¿¡Ë¤Ë²Ã»»¤¹¤ë
      PRINT USING "####": t;

   NEXT j
   PRINT
   IF i<N THEN PRINT "¡¡";REPEAT$("¡¡¡¿",N-1) !¹Ô´Ö
NEXT i
PRINT

FOR i=1 TO N !¡Á¿ô¤òɽ¼¨¤¹¤ë
   PRINT A(i);
NEXT i
PRINT
PRINT



!¡üΩÊý¿ô¡¡n^3
MAT A=ZER
PRINT

FOR i=1 TO N
   FOR j=1 TO N
      LET t=i*j !¾è»»

      IF i<j THEN !£Ì»ú¤Ë²Ã»»¤¹¤ë
         LET A(j)=A(j)+t
         PRINT USING "¨¢####": t;
      ELSE
         LET A(i)=A(i)+t
         PRINT USING "¡¡####": t;
      END IF

   NEXT j
   PRINT "¨¢" !¹ÔËö
   PRINT REPEAT$("¨¡¨¡¨¡",i);"¨¥";REPEAT$("¡¡¡¡¨¢",N-i) !¹Ô´Ö
NEXT i
PRINT

FOR i=1 TO N !¡Á¿ô¤òɽ¼¨¤¹¤ë
   PRINT A(i);
NEXT i
PRINT
PRINT



!ΩÊý¿ô¤ÎÏÂ
!¡¡¦²[k=1,n]k^3=(n*(n+1)/2)^2¤ÎƳ½Ð
!¡¡1*¦²[k=1,n]k + 2*¦²[k=1,n]k + 3*¦²[k=1,n]k + ¡Ä + (n-1)*¦²[k=1,n]k + n*¦²[k=1,n]k
! =(1+2+ ¡Ä +(n-1)+n)*¦²[k=1,n]k
! =(¦²[k=1,n]k)^2
PRINT

FOR i=1 TO N
   FOR j=1 TO N
      LET t=i*j !¾è»»
      PRINT USING " ####": t;
   NEXT j
   PRINT "¡¡¢«£±ÃÊÌܤÎ";i;"ÇÜ"
NEXT i
PRINT

MAT S=ZER
FOR i=1 TO N
   LET S(i)=S(i-1)+A(i) !¢¨A()¤Ï¾åµ­¤ÎΩÊý¿ô
NEXT i
FOR i=1 TO N !¡Á¿ô¤òɽ¼¨¤¹¤ë
   PRINT S(i);
NEXT i
PRINT
PRINT


END
 

°ì¸Ä¤Î¿À·ÐºÙ˦(neuro)

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 1·î18Æü(Æü)10»þ37ʬ30ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  !
! °ì¸Ä¤Î¿À·ÐºÙ˦(neuro)
! ¤½¤Î ¥«¥ª¥¹(chaos)¤ò¡¢Ãµ¤·¡¢¸«¤ë¡¢¥Ä¡¼¥ë
!
!----------------------------
!¡¡"Neuro12"
!
!¡¡2009.1.18
!----------------------------
OPTION ARITHMETIC NATIVE
OPTION BASE 0
SET TEXT background "OPAQUE"
SET POINT STYLE 1
SET AREA COLOR 0
LET DLY=50
DIM St(1,DLY) ,Sy(2000), B4(0,500)
!
LET Kr=0.5
LET Af=1
LET Ei=-70
LET Ss=0.31 !¡¡Ss=(Kr-1)(theta-s(t))¡¡¡Äs(t)=0
LET theta=Ss/(Kr-1)

DEF Ri(Yi,Ss)=Kr*Yi-Af/(1+EXP(Ei*Yi))+Ss

PLOT TEXT,AT .04,.96:"*** Neuro Cell"
PLOT TEXT,AT .04,.92:"Right Click to Stop"
PLOT TEXT,AT .04,.89:"Left  Click & Drag '|' Line"
!
!-----
LET Y0=Af/100
LET Af2=Af
DO
   LET Af=Af2
   CALL ma200_
   ! ma100_
   !----- clear
   SET WINDOW -Af*2.07-Af*1.06,Af*2.07-Af*1.06,-Af*2.07-Af*1.05,Af*2.07-Af*1.05
   PLOT AREA: -Af,-Af;Af,-Af;Af,Af;-Af,Af
   !----- box outline
   SET LINE COLOR "blue"
   PLOT LINES: -Af,-Af; Af,-Af; Af,Af; -Af,Af; -Af,-Af
   !-----
   PLOT TEXT,AT Af*.03,Af*.85: "+Af Y(t+1)"
   PLOT TEXT,AT -Af*.97,Af*0.13: "Y(t)"
   PLOT TEXT,AT -Af*.97, 0: "-Af"
   PLOT TEXT,AT Af*.8, 0: "+Af"
   PLOT TEXT,AT Af*.03,-Af*.98: "-Af"
   !----- Sy(w)=Y(t)
   LET imax=pixelx(Af)-pixelx(-Af)
   LET dA1=(Af+Af)/imax
   FOR i=0 TO imax
      LET Sy(i)=Ri(-Af+i*dA1, Ss)
   NEXT i
   !-----
   DO
      LET Y1=Ri(Y0,Ss)
      !----- erase old signal
      LET W0=St(0,t)
      LET W1=St(1,t)
      FOR i=0 TO DLY-1
         IF W0=St(0,i) AND W1=St(1,i) AND t<>i THEN EXIT FOR
      NEXT i
      IF DLY=i THEN
         SET LINE COLOR 0
         PLOT LINES: W0,W0; W0,W1;
         PLOT LINES: W1,W1
      END IF
      !----- axis
      SET LINE COLOR "cyan" ! axis_Y(t)¡Ä ¡½
      PLOT LINES: -Af,0; Af,0
      SET LINE COLOR "magenta" ! axis_Y(t+1)¡Ä¡Ã
      PLOT LINES: 0,-Af; 0,Af
      !----- draw curve Y(t)
      SET LINE COLOR 1
      FOR i=0 TO imax
         PLOT LINES: -Af+i*dA1, Sy(i);
      NEXT i
      PLOT LINES
      !----- signal
      SET LINE COLOR "cyan" ! input_Y(t)¡Ä¡Ã
      PLOT LINES: Y0,Y0; Y0,Y1;
      SET LINE COLOR "magenta" ! output_Y(t+1)¡Ä ¡½
      PLOT LINES: Y1,Y1
      !-----
      LET St(0,t)=Y0
      LET St(1,t)=Y1
      LET t=MOD(t+1,DLY)
      LET Y0=Y1
      !-----
      WAIT DELAY .02
      MOUSE POLL x,y,mlb,mrb
   LOOP UNTIL mlb=1 OR mrb=1
   !
   !----- cursor input
   IF mlb=1 THEN
      SET WINDOW -0.1*Af,Af, -Af*2.1+Af*1.08,Af*2.1+Af*1.08
      DO
         MOUSE POLL x,y,mlb,mrb
         IF 0<=x AND x<=Af THEN
            IF y< Af THEN
               IF bx4<>pixelx(x) THEN
                  LET Ss=x
                  LET theta=Ss/(Kr-1)
                  CALL cursor4( bx4,B4)
               END IF
            ELSEIF x< Af*.43 THEN
               IF y< Af*1.4 THEN
               ELSEIF y< Af*1.7 THEN
                  IF bx3<>pixelx(x) THEN
                     LET Ei=x*120/(Af*.43)-120
                     CALL cursor13( bx3, 1.7, 1.4)
                  END IF
               ELSEIF y< Af*2.1 THEN
                  IF bx2<>pixelx(x) THEN
                     LET Kr=x*1/(Af*.43)
                     LET theta=Ss/(Kr-1)
                     CALL cursor13( bx2, 2.1, 1.8)
                  END IF
               ELSEIF y< Af*2.5 THEN
                  IF bx1<>pixelx(x) THEN
                     LET Af2=x*2/(Af*.43)+0.5
                     MAT St=ZER
                     LET Y0=Af/100
                     CALL cursor13( bx1, 2.5, 2.2)
                  END IF
               END IF
            END IF
         END IF
         WAIT DELAY .05
      LOOP UNTIL mlb=0
   END IF
LOOP UNTIL mrb=1

SUB cursor4( bx,B(,))
   MAT PLOT CELLS, IN worldx(bx),Af; worldx(bx),-Af: B
   LET bx=pixelx(x)
   ASK PIXEL ARRAY (x,Af) B
   SET LINE COLOR "red"
   PLOT LINES: x,-Af; x,Af
   PLOT TEXT,AT 0,Af,USING "Kr=#.### :Af=#.### :Ei=####.# :Ss=#.### :theta=####.###": Kr, Af, Ei, Ss, theta
END SUB

SUB cursor13( bx, uy,ly)
   SET LINE COLOR 0
   PLOT LINES: worldx(bx),Af*uy-dAy; worldx(bx),Af*ly+dAy
   LET bx=pixelx(x)
   SET LINE COLOR "red"
   PLOT LINES: x,Af*uy-dAy; x,Af*ly+dAy
   PLOT TEXT,AT 0,Af,USING "Kr=#.### :Af=#.### :Ei=####.# :Ss=#.### :theta=####.###": Kr, Af2, Ei, Ss, theta
END SUB

SUB ma200_
!----- clear
   SET WINDOW -0.1*Af,Af, -Af*2.1+Af*1.08,Af*2.1+Af*1.08
   PLOT AREA: 0,-Af;Af,-Af;Af,Af;0,Af
   !----- box outline
   SET LINE COLOR "blue"
   PLOT LINES: 0,-Af; Af,-Af; Af,Af; 0,Af; 0,-Af
   PLOT LINES: 0,0; Af,0
   !-----
   PLOT TEXT,AT -.06*Af,.9*Af : "+Af"
   PLOT TEXT,AT -.07*Af,-.05*Af : "Y(t)"
   PLOT TEXT,AT -.06*Af,-Af : "-Af"
   PLOT TEXT,AT Af*.5,-Af*.98: "0 <--- Ss ---> +Af"
   !-----
   LET dA2=Af/(pixelx(Af)-pixelx(0))
   LET dAy=Af/(pixely(Af)-pixely(0))
   LET Yt=0 ! Y(t)
   FOR j=0 TO Af STEP dA2 ! j= Ss= (Kr-1)*theta
      FOR i=0 TO 99
         LET Yt=Ri(Yt,j)
         PLOT POINTS: j,Yt
      NEXT i
   NEXT j
   !----- setup cursor Ss
   LET x=Ss
   ASK PIXEL SIZE (x,Af;x,-Af) i,j
   MAT B4=ZER(0,j-1)
   ASK PIXEL ARRAY (x,Af) B4
   LET bx4=pixelx(x)
   CALL cursor4( bx4, B4)
   !-----
   LET x=(Ei+120)*Af*.43/120 !// Ei=x*120/(Af*.43)-120
   LET bx3=pixelx(x)
   CALL cursor130( bx3, 1.7, 1.4, "Ei")
   LET x=Kr*Af*.43 !// Kr=x*1/(Af*.43)
   LET bx2=pixelx(x)
   CALL cursor130( bx2, 2.1, 1.8, "Kr")
   LET x=(Af-0.5)*Af*.43/2 !// Af2=x*2/(Af*.43)+0.5
   LET bx1=pixelx(x)
   CALL cursor130( bx1, 2.5, 2.2, "Af")
END SUB

SUB cursor130( bx, uy, ly, w$)
   PLOT TEXT,AT -.06*Af,Af*(uy-0.2): w$
   SET LINE COLOR "blue"
   PLOT LINES: 0,Af*uy; Af*.43,Af*uy; Af*.43,Af*ly; 0,Af*ly; 0,Af*uy
   CALL cursor13( bx, uy, ly)
END SUB

END
 

ɺή¤¹¤ë¥Ë¥å¡¼¥é¥ë¡¦¥Í¥Ã¥È

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 1·î18Æü(Æü)11»þ12ʬ0ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  !
!¡¡ÉºÎ®¤¹¤ë¥Ë¥å¡¼¥é¥ë¡¦¥Í¥Ã¥È¡Ê¹¹¿·¡ËºÆÅê¹Æ
!
!----
OPTION ARITHMETIC NATIVE
OPTION BASE 0
SET WINDOW -10,10, 20,0
SET TEXT background "OPAQUE"
!
DIM E(99),R(99),theta(99),F(99)
DIM Y(99),X(99),NetWork(99,99)
DIM P_(1 TO 5, 99),Px(99)
DIM Sum(1 TO 5)
MAT READ P_
! 1)
DATA 1,1,0,0,0,0,0,0,1,1
DATA 1,1,1,0,0,0,0,1,1,1
DATA 0,1,1,1,0,0,1,1,1,0
DATA 0,0,1,1,1,1,1,1,0,0
DATA 0,0,0,1,1,1,0,0,0,0
DATA 0,0,0,0,1,1,1,0,0,0
DATA 0,0,1,1,1,1,1,1,0,0
DATA 0,1,1,1,0,0,1,1,1,0
DATA 1,1,1,0,0,0,0,1,1,1
DATA 1,1,0,0,0,0,0,0,1,1
! 2)
DATA 0,0,0,0,0,1,0,0,0,0
DATA 0,0,0,0,1,1,1,0,0,0
DATA 0,0,0,0,1,1,1,0,0,0
DATA 0,0,0,1,1,1,1,1,0,0
DATA 0,0,0,1,1,0,1,1,0,0
DATA 0,0,1,1,1,0,1,1,1,0
DATA 0,0,1,1,0,0,0,1,1,0
DATA 0,1,1,1,0,0,0,1,1,1
DATA 0,1,1,1,1,1,1,1,1,1
DATA 0,1,1,1,1,1,1,1,1,1
! 3)
DATA 0,0,1,1,1,0,0,0,1,1
DATA 0,1,1,1,1,1,1,1,1,1
DATA 1,1,1,0,1,1,1,1,0,0
DATA 1,1,0,0,0,1,1,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,1,1,0,0,0,1,1
DATA 0,0,1,1,1,1,0,1,1,1
DATA 1,1,1,1,1,1,1,1,1,0
DATA 1,1,0,0,0,1,1,1,0,0
DATA 0,0,0,0,0,0,0,0,0,0
! 4)
DATA 0,0,1,0,0,0,0,1,0,0
DATA 0,0,1,1,0,0,1,1,0,0
DATA 0,0,1,1,1,1,1,1,0,0
DATA 0,0,1,1,1,1,1,1,0,0
DATA 0,0,1,1,1,1,1,1,0,0
DATA 0,1,1,1,1,1,1,1,1,0
DATA 1,1,1,1,1,1,1,1,1,1
DATA 0,0,0,1,1,1,1,0,0,0
DATA 0,0,0,0,1,1,1,0,0,0
DATA 0,0,0,0,0,1,0,0,0,0
! 5)
DATA 0,0,0,0,1,1,0,0,0,0
DATA 0,1,1,0,1,1,0,1,1,0
DATA 0,1,0,0,1,1,0,0,1,0
DATA 0,0,0,0,1,1,0,0,0,0
DATA 1,1,1,1,1,1,1,1,1,1
DATA 1,1,1,1,1,1,1,1,1,1
DATA 0,0,0,0,1,1,0,0,0,0
DATA 0,1,1,0,1,1,0,1,1,0
DATA 0,1,1,0,1,1,0,1,1,0
DATA 0,0,0,0,1,1,0,0,0,0

!----- ½é´üÃÍ¥µ¥ó¥×¥ë£±¡Ê´¶¤Çõ¤¹¤Î¤Ï̵Íý¤«¤â¡£¡Ë
! MAT theta=(-1.27)*CON
! LET Af=1.6
! LET Kr=0.92
! LET Kf=0.4
! LET Ei=-10
!
!----- ½é´üÃÍ¥µ¥ó¥×¥ë£²
MAT theta=ZER !¡¡¥Ë¥å¡¼¥í¥óÉÔ±þ¤Î¸ÇÄêÀ®Ê¬ (¤·¤­¤¤ÃÍ)
LET Af=1 !¡¡¥Ë¥å¡¼¥í¥ó¼«¿È¤Î´¶ÅÙ¤òÉÔ±þ¤Ë¤¹¤ëÉéÀ­¤Î¼«¸Êµ¢´Ô·ë¹ç·¸¿ô ¤È¡¢
LET Kr=0.95 !¡¡¤½¤Î¸º¿êÄê¿ô(0< ,< 1)
LET Kf=0.4 !¡¡¥Ë¥å¡¼¥í¥ó¤¬¡¢Â¾¤Î¥Ë¥å¡¼¥í¥ó¤«¤é¼õ¤±¤ëÁê¸ß·ë¹ç¤Î¸º¿êÄê¿ô(0< ,< 1)
LET Ei=-100 !¡¡£²ÃͲ½´Ø¿ô¡¢S»ú·Á sigmoid() ¤ÎÆþÎÏ·¸¿ô
!
!----- °ú¤­¶â¤È¤Ê¤ëÁê¸ß·ë¹ç¤Î»É·ã¤ÎºîÀ®¡Ê̵¿®¹æ¤«¤é¤ÎÎ嵯¤Ï¤Ç¤­¤Ê¤¤¡£¡Ë
RANDOMIZE !15 !6
DO
   LET j=0
   FOR i=0 TO 99
      LET F(i)=RND-0.5
      LET j=j+F(i)
   NEXT i
LOOP UNTIL ABS(j)< .002
!
!----- ´Ä¶­¤Î½àÈ÷
SET LINE COLOR 2
FOR n_=1 TO 5
   LET w=0
   !----- ¥µ¥ó¥×¥ë¡¦¥Ñ¥¿¡¼¥ó¤Îɽ¼¨
   FOR j=0 TO 9
      FOR i=0 TO 9
         IF P_(n_,j*10+i)>0 THEN
            DRAW circle WITH SCALE(0.03)*SHIFT(i*.08-9, j*.08+n_+.9)
            LET w=w+1
         END IF
      NEXT i
   NEXT j
   PLOT TEXT,AT -6,n_+1.5:"Dots/Body="&STR$(w)&"/100"
   PLOT TEXT,AT -8,n_+1.5:":"&STR$(Sum(n_))
   LET DC=w/100 ! Ê¿¶ÑÃÍ¡ÊľήÀ®Ê¬¡Ë
   !-----
   !¡¡£µ¤Ä¤Î¥Ñ¥¿¡¼¥ó¤ÎÊ¿¶ÑÃͤ«¤é¤ÎÊк¹¡Ê¸òήÀ®Ê¬¡Ë¤ò¡¢
   !¡¡£±¤Ä¤Î¹ÔÎó NetWork(,) ¤ÎÃæ¤Ë¡¢Ëä¤á¹þ¤à¡£Áê¸ß·ë¹ç·¸¿ô¤Î¹ÔÎó ºîÀ®¡£
   !
   !¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ¡¡   5¡¡(p) ¡²¡¡ (p) ¡²
   !¡¡¶¦Ê¬»¶¹ÔÎó¤ÎºîÀ® ¦Øij=¦²(¦Öi-¦Ö)*(¦Öj-¦Ö)¡¡¡¡¡Ä»²¾È¡£
   !¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡p=1
   !-----

   FOR i=0 TO 99
      FOR j=0 TO 99
         LET NetWork(i,j)=NetWork(i,j)+(P_(n_,i)-DC)*(P_(n_,j)-DC)
      NEXT j
   NEXT i
NEXT n_
!-----
!¡¡£µ¤Ä¤¬¡¢¼«¸Ê¤Î¶¦Ê¬»¶¤Î·Á¤Ç¹ç»»¤µ¤ì¡¢£±¤Ä¤Ê¤Ã¤¿¹ÔÎó NetWork(,) ¤Ç¡¢
!¡¡£±£°£°¸Ä¤Î¥Ë¥å¡¼¥í¥ó¤òÀܳ¤·¡¢ÉºÎ®¤µ¤»¤ë¤È¡¦¡¦¡¦
!
!¡¡¡Ê ¼þ´ü¤Î̵¤¤·×»»¤Ç¤¹¤¬¡¢±é»»·å¤ÎÀ©¸Â¤Ë¤è¤ë´Ý¤á¤Î¤¿¤á¤Ë¡¢¼þ´üŪ
!¡¡¡¡¡¡Æ°ºî¤ØÍî¤Á¤Æ¤¤¤Þ¤¹¡¦¡¦Ä¹¡¹¤È¡¢ÉºÃ夷¤Ê¤¤¤È¤­¤Ï¡¢Run ¤·¤Ê¤ª¤¹¡£¡Ë
!
!-----
PLOT TEXT,AT -9, 1:"ɺή¤¹¤ë¥Ë¥å¡¼¥é¥ë¡¦¥Í¥Ã¥È"
PLOT TEXT,AT -9, 9:"±¦¥¯¥ê¥Ã¥¯¤Ç ½ªÎ»"
PLOT TEXT,AT -9,10:"º¸¥¯¥ê¥Ã¥¯ STOP/START"
SET LINE COLOR 1
DO
   DO
      LET T=T+1
      PLOT TEXT,AT -9,8:"t="&STR$(T)
      CALL DispX
      CALL Compare
      CALL Xi00
      MOUSE POLL mx,my,mlb,mrb
      WAIT DELAY 0
   LOOP UNTIL mlb=1 OR mrb=1
   !----- left click stop/start
   IF mlb=1 THEN
      DO
         WAIT DELAY 0.02
         MOUSE POLL mx,my,mlb,mrb
      LOOP UNTIL mlb=0
      DO
         WAIT DELAY 0.02
         MOUSE POLL mx,my,mlb,mrb
      LOOP UNTIL mlb=1 OR mrb=1
      WAIT DELAY 0.1
   END IF
   !----- right click stop end.
LOOP UNTIL mrb=1

!----- ³Æ¥Ë¥å¡¼¥í¥ó0~99 ¤Î¶îÆ°
SUB Xi00
   FOR i=0 TO 99
      LET w=0
      FOR j=0 TO 99
         LET w=w+NetWork(i,j)*X(j)
      NEXT j
      LET F(i)=Kf*F(i)+w
      LET R(i)=Kr*(R(i)+theta(i))-Af*X(i)-theta(i)
      LET Y(i)=R(i)+F(i)
   NEXT i
   FOR i=0 TO 99
      IF Ei*Y(i)< 709 THEN !¡¡·å¤¢¤Õ¤ìËÉ»ß
         LET X(i)=1/(1+EXP(Ei*Y(i)))
      ELSE
         LET X(i)=1/(1+EXP(709))
      END IF
   NEXT i
END SUB

!----- ³Æ¥Ë¥å¡¼¥í¥ó¤Î½ÐÎÏ X(0~99) ȯ²Ð¤Î¡¢²èÌÌɽ¼¨¡£
SUB DispX
   SET DRAW mode hidden
   SET AREA COLOR 0
   PLOT AREA:-10,10; 0,10; 0,0; 10,0; 10,20;-10,20
   SET AREA COLOR 2 !¡¡//fire
   FOR V=0 TO 9
      FOR H=0 TO 9
         LET i=V*10+H
         IF 0.5=< X(i) THEN
            PLOT AREA: H,V; H+1,V; H+1,V+1; H,V+1
            LET Px(i)=1
            SET COLOR MIX(0) 0,1,1 ! B.G.color cyan( text)
         ELSE
            PLOT LINES: H,V; H,V+1; H+1,V+1
            LET Px(i)=0
            SET COLOR MIX(0) 1,1,1 ! B.G.color 0
         END IF
         !----- ¥Ë¥å¡¼¥í¥ó¤ÎÆâÉô(-~0~+) 0=< ¤Ïȯ²Ð
         PLOT TEXT,AT H*2-10, V*0.8+12, USING"###.###":Y(i)
      NEXT H
   NEXT V
   SET COLOR MIX(0) 1,1,1 ! B.G.color 0
   SET DRAW mode explicit
END SUB

!----- À¸À®¥Ñ¥¿¡¼¥ó¤ÎʬÊÌ ·×¿ô¤Î¡¢²èÌÌɽ¼¨¡£
SUB Compare
   FOR n_=1 TO 5
      FOR i=0 TO 99
         IF P_(n_,i)<>Px(i) THEN EXIT FOR
      NEXT i
      IF 99< i THEN
      !¡¡----- °ìÃ×
         LET PC_=10 !¡¡//timer ON 1st.to 2nd.Cursor
         IF PB_=n_ THEN EXIT SUB
         IF PN_>0 THEN PLOT TEXT,AT -8, PN_+1.5: ":"& STR$(Sum(PN_))& " " !¡¡//old 1st.2nd.Cursor OFF
         LET PB_=n_ !¡¡//flag 2nd.Cursor
         LET PN_=n_ !¡¡//flag 1st.Cursor
         LET Sum(n_)=Sum(n_)+1 !¡¡·×¿ô
         SET COLOR MIX(0) 0,1,1 !¡¡//new 1st.Cursor ON (B.G.color)
         PLOT label,AT -8, n_+1.5: ":"& STR$(Sum(n_))& " "
         SET COLOR MIX(0) 1,1,1
         beep
         EXIT SUB
         !-----
      END IF
   NEXT n_
   !¡¡----- ÉÔ°ìÃ×
   IF PB_=0 THEN EXIT SUB
   IF PC_>1 THEN
      LET PC_=PC_-1
      EXIT SUB
   END IF
   SET COLOR MIX(0) .75,.75,.75 !¡¡//new 2nd.Cursor ON (B.G.color)
   PLOT TEXT,AT -8, PB_+1.5: ":"& STR$(Sum(PB_))& " "
   SET COLOR MIX(0) 1,1,1
   LET PB_=0
END SUB

END
 

º£Ç¯¤Î¥»¥ó¥¿¡¼»î¸³BASIC

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 1·î20Æü(²Ð)10»þ36ʬ8ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¡üÌäÂê¤È¥×¥í¥°¥é¥à

p,q¤Ï°Û¤Ê¤ë¼«Á³¿ô¤È¤¹¤ë¡£
Í¿¤¨¤é¤ì¤¿¼«Á³¿ôk¤Ë¤Ä¤¤¤Æ¡¢d°Ê²¼¤Î¼«Á³¿ôk¤Î¤¦¤Á¤Ç
¡¡k=m*p+n*q¡¢m,n¤Ï£°°Ê¾å¤ÎÀ°¿ô
¤Çɽ¤¹¤³¤È¤¬¤Ç¤­¤ë¤â¤Î¤ò¾®¤µ¤¤½ç¤ËÎóµó¤¹¤ë¡£

Îã. p=3,q=7,d=15¤Î¤È¤­¡¢ 3  6  7  9  10  12  13  14  15   Áí¿ô= 9
Îã. p=3,q=7,d=100¤Î¤È¤­¡¢Áí¿ô= 94¡£


100 INPUT PROMPT "p=": P
110 INPUT PROMPT "q=": Q
120 INPUT PROMPT "d=": D
130 LET U=0
140 FOR K=1 TO D !d°Ê²¼¤Î¼«Á³¿ôk¤Î¤¦¤Á¤Ç
150    IF K-INT(K/P)*P=0 THEN GOTO 210 !k¤¬p¤ÎÇÜ¿ô¤Î¾ì¹ç¡Êk=m*p+0¡Ë¡¡¢¨MOD(K,P)=0
160    FOR M=0 TO INT(K/P) !£°¤«¤éP¤Ç³ä¤Ã¤¿¾¦¤Þ¤Ç¡¡¢èk=m*p+r
170       LET R=K-M*P !k-m*p=n*q
180       IF R-INT(R/Q)*Q=0 THEN GOTO 210 !r¤¬q¤ÎÇÜ¿ô¤Î¾ì¹ç¡¡¢¨MOD(R,Q)=0
190    NEXT M
200    GOTO 230 !³ºÅö¤Ê¤·¡£¼¡¤Ø
210    PRINT K !¾ò·ï¤òËþ¤¿¤¹
220    LET U=U+1
230 NEXT K
240 PRINT "Áí¿ô="; U
250 END



¡üP=3,Q=7,D=100¤Ç¤ÎÁí¿ô¤òµá¤á¤ëÌäÂê¤Î²òË¡¤Ë¤Ä¤¤¤Æ
¡¡¥È¥ì¡¼¥¹¤¹¤ë¤Ë¤Ï¼ê½ç¤¬Â¿¤¹¤®¤ë¡£À¤³¦¤Î¥Ê¥Ù¥¢¥Ä¤Ç¤Ï¤Ê¤¤¤¬¡¢¤Û¤È¤ó¤É¥¢¥Û¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤¦¡£

¤½¤³¤Ç¡¢¡¦¡¦¡¦

¡¦³ÈÄ¥¥æ¡¼¥¯¥ê¥Ã¥É¤Î¸ß½üË¡¡¡m*3+n*7=gcd(3,7)=1=k¡¡¤è¤ê
¡¡À°¿ôÁÈ(m,n)¤Ç¡¢k¤ÎÇÜ¿ô¤òɽ¤¹¤³¤È¤¬¤Ç¤­¤ë¡£¡Ê°ì°Õ¤Ç¤Ï¤Ê¤¤¡Ë

¤³¤ì¤è¤ê
¡¡ÌäÂêʸ¤Ë¥Ò¥ó¥È¤¬¤¢¤ë¡£
¡¡1¡Á3*7=21¤Þ¤Ç¤ÎÀ°¿ô¤¬É½¸½¤Ç¤­¤ë¤«³Îǧ¤¹¤ë¡£¡¡1,2,4,5,8,11¤¬ÌµÍý¡£


¡¦¡Ö£³¤ÎÇÜ¿ô¤È£·¤ÎÇÜ¿ô¤È¤ÎÏ¡פÎÀþ·ÁÀ­¤Ï¡¢¡Öº¸¼Ð¤á¡×¤Ë¤Ê¤ë¡£¡Ê7=2*3+1¤º¤Ä¤º¤ì¤ë¡Ë

¡¡½Ä¡§£³¤ÎÇÜ¿ô¡¢²£¡§£·¤ÎÇÜ¿ô
   0   7  14  21  28  35  42  49  56  63  70  77  84
   3  10  17  24  31  38  45  52  59  66  73  80  87
   6  13  20  27  34  41  48  55  62  69  76  83  90
   9  16  23  30  37  44  51  58  65  72  79  86  93
  12  19  26  33  40  47  54  61  68  75  82  89  96
  15  22  29  36  43  50  57  64  71  78  85  92  99
  18  25  32  39  46  53  60  67  74  81  88  95 102
  21  28  35  42  49  56  63  70  77  84  91  98 105
  24  31  38  45  52  59  66  73  80  87  94 101 108
  27  34  41  48  55  62  69  76  83  90  97 104 111
  30  37  44  51  58  65  72  79  86  93 100 107 114
  33  40  47  54  61  68  75  82  89  96 103 110 117
  36  43  50  57  64  71  78  85  92  99 106 113 120
  39  46  53  60  67  74  81  88  95 102 109 116 123
  42  49  56  63  70  77  84  91  98 105 112 119 126
  45  52  59  66  73  80  87  94 101 108 115 122 129

¤³¤ì¤è¤ê
¡¡°ìÌÜÎÆÁ³¡ª¡©


¡¦¡¦¡¦¤È¹Í¤¨¤Æ¤ß¤¿¡£
 

Re: º£Ç¯¤Î¥»¥ó¥¿¡¼»î¸³BASIC

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 1·î21Æü(¿å)11»þ08ʬ47ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.249[¸µµ­»ö¤Ø]

¡ü210¹ÔÌܤǡ¢¾ò·ï¤òËþ¤¿¤¹M¤ÈN¤òɽ¼¨¤¹¤ë¤è¤¦¤Ë²þÎɤ·¤Æ¤ß¤¿¡£

¡¦150¹ÔÌܤòºï½ü
¡¦210¹ÔÌܤËM,N¤Î·×»»¤òÄɲÃ

100 INPUT PROMPT "p=": P
110 INPUT PROMPT "q=": Q
120 INPUT PROMPT "d=": D
130 LET U=0
140 FOR K=1 TO D !d°Ê²¼¤Î¼«Á³¿ôk¤Î¤¦¤Á¤Ç
150    !
160    FOR M=0 TO INT(K/P) !£°¤«¤éK¤òP¤Ç³ä¤Ã¤¿¾¦¤Þ¤Ç
170       LET R=K-M*P !k-m*p=n*q
180       IF R-INT(R/Q)*Q=0 THEN GOTO 210 !r¤¬q¤ÎÇÜ¿ô¤Î¾ì¹ç¡¡¢¨MOD(R,Q)=0
190    NEXT M
200    GOTO 230 !³ºÅö¤Ê¤·¡£¼¡¤Ø
210    PRINT K; M;INT(R/Q) !¾ò·ï¤òËþ¤¿¤¹M,N¡¡¢¨
220    LET U=U+1
230 NEXT K
240 PRINT "Áí¿ô="; U
250 END


¡ö¥¢¥ë¥´¥ê¥º¥à¤Î¿ô³ØŪÇØ·Ê
ÉÔÄêÊýÄø¼° k=m*p+n*q ¤Ï¡¢k-m*p=n*q ¤ÈÊÑ·Á¤µ¤ì¤ë¡£
¹çƱ¼°¤Çɽ¤¹¤È¡¢k-m*p¢á0 mod q ¤È¤Ê¤ë¡£

m ¤Ï£°°Ê¾å¤ÎÀ°¿ô¡¢p ¤Ï¼«Á³¿ô¤è¤ê¡¢m*p¡æ0 ¤È¤Ê¤ë¡£¡¡Æ±Íͤˡ¢n*q¡æ0¡£
¤Þ¤¿¡¢n*q=k-m*p¡æ0 ¤è¤ê¡¢k¡æm*p ¤È¤Ê¤ë¡£
¤·¤¿¤¬¤Ã¤Æ²ò¤¬¤¢¤ì¤Ð¡¢m¤Ï0¡ÁINT(K/P)¤Ç¸«¤Ä¤«¤ë¡£



¡ü(m,n)¤ÎÁȤϰìÄ̤ê¤Ç¤Ê¤¤¡£¤½¤ÎÁȤòÄ´¤Ù¤ë¡£

¡¦180¹ÔÌܤòÊѹ¹¤ÈÄɲáÊ210,220¹ÔÌÜ¡Ë
¡¦150,200,210,220¹ÔÌܤòºï½ü

100 INPUT PROMPT "p=": P
110 INPUT PROMPT "q=": Q
120 INPUT PROMPT "d=": D
130 LET U=0
140 FOR K=1 TO D !d°Ê²¼¤Î¼«Á³¿ôk¤Î¤¦¤Á¤Ç
150    !
160    FOR M=0 TO INT(K/P) !£°¤«¤éK¤òP¤Ç³ä¤Ã¤¿¾¦¤Þ¤Ç
170       LET R=K-M*P !k-m*p=n*q
180       IF R-INT(R/Q)*Q=0 THEN !r¤¬q¤ÎÇÜ¿ô¤Î¾ì¹ç¡¡¢¨MOD(R,Q)=0
             PRINT K; M;INT(R/Q) !¾ò·ï¤òËþ¤¿¤¹M,N
             LET U=U+1
          END IF
190    NEXT M
200    !
210    !
220    !
230 NEXT K
240 PRINT "Áí¿ô="; U !¢¨°ÕÌ£¤¬ÊѤï¤ë
250 END
 

letʸ¤ÎÊÑ¿ô̾ʤÓ

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ 1·î25Æü(Æü)00»þ25ʬ45ÉÃ
ÊÖ¿®¡¦°úÍÑ
  JIS¤Ë¤è¤ë¤È¡¢letʸ¤Ë¤Ï¼¡¤Î¤è¤¦¤Ê¹½Ê¸¤¬¤¢¤ê¤Þ¤¹¡£¤ß¤Ê¤µ¤ó¤´Â¸¤¸¤Ç¤·¤¿¤«¡£

10 DIM M(8)
20 LET a,b,c=5
30 PRINT a;b;c
40 LET a,b,c,M(b)=b+2
50 PRINT a;b;c
60 MAT PRINT M;
70 LET m$,n$="xyz"
80 PRINT m$,n$
90 END
 

³ÊǼ¤Ç¤­¤ë¡¡¥Þ¥È¥ê¥Ã¥¯¥¹

 Åê¹Æ¼Ô¡§Í¿ºä¡¡¡¡¾ºÊ¿  Åê¹ÆÆü¡§2009ǯ 1·î26Æü(·î)10»þ22ʬ43ÉÃ
ÊÖ¿®¡¦°úÍÑ
  º£Æü¤Ï
full  basic  ¤Ç¡¡¡¡Í­¸ÂÍ×ÁÇË¡¤Î¡¡¹½Â¤²òÀÏ¥½¥Õ¥È¤ò¡¡¡¡³«È¯¤·¤Æ¤¤¤Þ¤¹
C++¡¡¤Ç¤â¡¡¤·¤Æ¤¤¤Þ¤¹¤¬
full  basic  ¤Ï¡¡¡¡¥°¥é¥Ò¥Ã¥¯¤¬¡¡¡¡´Êñ¤Ç¡¡¡¡£ã++¡¡¤è¤ê¡¡¡¡ÊØÍø¤Ç¤¹
¤·¤«¤·
»þ´Ö¤¬¡¡¡¡¤«¤«¤ê¤Þ¤¹

²òÀϲÄǽÍ×ÁÇ¿ô¤Ï
£³GRAM¡¡¡¡¤Ç

full  basic  £¶£°£°£°¡¡Í×ÁÇ
C++¡¡¡¡¡¡¡¡¡¡£±£²£°£°£°¡¡Í×ÁǤǤ¹


¹½Â¤²òÀϤǤϡ¡¡¡Í×ÁÇ¿ô¡¡¡¡£¶£°£°£°Í×ÁǤǤÏ
ÉÔ­¤Ç¤¹
²òÀϲÄǽÍ×ÁÇ¿ô¡¡¡¡¤Ä¤Þ¤ê
³ÊǼ²Äǽ¥Þ¥È¥ê¥Ä¥¯¥¹¿ô¤ò¡¡¡¡Áý¤ä¤¹¤Ë¤Ï
¤É¤¦¤¹¤ì¤Ð¤¤¤¤¤Ç¤·¤ç¤¦¤«¡¡¡©¡©¡©

¤Þ¤¿
full  basic  ¤Ï
£¶£´bit¡¡¤Ë¡¡¡¡Âбþ¡¡¡¡¤·¤Æ¤¤¤Þ¤¹¤«

À§Èó
¶µ¤¨¤Æ²¼¤µ¤¤

¤è¤í¤·¤¯
 

Re: ³ÊǼ¤Ç¤­¤ë¡¡¥Þ¥È¥ê¥Ã¥¯¥¹

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 1·î26Æü(·î)17»þ40ʬ30ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.252[¸µµ­»ö¤Ø]

Full BASICµ¬³Ê¤Ë¤Ï¡¤À°¿ô·¿¤Î³µÇ°¤¬¤¢¤ê¤Þ¤»¤ó¡£
µ¬³Ê¤ÎÈϰϤǤϡ¤32¥Ó¥Ã¥È¤ÎÊÑ¿ô¤â64¥Ó¥Ã¥È¤ÎÊÑ¿ô¤â»È¤¨¤Þ¤»¤ó¡£
¤Þ¤¿¡¤Full BASIC¤Ë¤Ï¡¤ÇÛÎó¤ÎÂ礭¤µ¤Ë´Ø¤¹¤ëµ¬Ä꤬¤¢¤ê¤Þ¤»¤ó¡£
µ¬³Ê¾å¤Ï¡¤
DECLARE NUMERIC m(0 TO 10000000)
¤Î¤è¤¦¤ÊµðÂç¤ÊÇÛÎó¤ÎÀë¸À¤âµö¤µ¤ì¤Þ¤¹¡£
(²¾¾Î)½½¿ÊBASIC¤Ï¥á¥â¥ê¤Î»ÈÍѸúΨ¤¬¤è¤¯¤Ê¤¤¤Î¤Ç¡¤
True BASIC¤ò»î¤·¤Æ¤ß¤ë¤È¤è¤¤¤«¤âÃΤì¤Þ¤»¤ó¡£

(²¾¾Î)½½¿ÊBASIC¤Î¸½ºß¤Î¥Ð¡¼¥¸¥ç¥ó¤Î¤Ê¤«¤ÇºÇŬ²½¤ò¿Þ¤ê¤¿¤¤¤Î¤Ç¤¢¤ì¤Ð¡¤
¥Ø¥ë¥×¤Î¸À¸ì»ÈÍѤξܺ٤κǸå¤Î¥Ú¡¼¥¸¡ÖÀ©¸Â¡×¤Ë½ñ¤¤¤Æ¤¢¤ë

¡ú ÊÑ¿ôÍÑ´ÉÍýÍѲ¾ÁÛ¥á¥â¥ê¡¼
Ä̾ÊÑ¿ô´ÉÍýÍѤ˳ä¤êÅö¤Æ¤ë²¾ÁÛ¥á¥â¥ê¡¼¤Ï¡¤¼ÂÁõʪÍý¥á¥â¥êÍÆÎ̤«¤é16M¥Ð¥¤¥È¤ò¸º¤¸¤¿Ã͡ʤ¿¤À¤·¡¤ºÇ¾®1M¥Ð¥¤¥È,ºÇÂç512M¥Ð¥¤¥È¡Ë¤ò¾å¸Â¤È¤¹¤ë¡£
¤Ê¤ª¡¤BASIC.INI¤Ë¥­¡¼¤òÄɲ乤뤳¤È¤ÇľÀÜ»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£

¤ò»²¾È¤·¤Æ¡¤BASIC.INI¤ò½ñ¤­´¹¤¨¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
¤Ê¤ª¡¤Win32¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ï2GB¤Ç¡¤¤½¤Î°ìÉô¤ËÊÑ¿ô´ÉÍýÍÑ¥á¥â¥ê¤ò³ä¤êÅö¤Æ¤ë¤Î¤Ç¡¤2048M¥Ð¥¤¥È°Ê¾å¤ò»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¤·¡¤2048MB¤è¤ê¾®¤µ¤¯¤Æ¤â2048MB¤Ë¶á¤¤¿ôÃͤò»ØÄꤹ¤ë¤ÈBASICËÜÂΤ¬Àµ¾ï¤ËÆ°ºî¤·¤Þ¤»¤ó¡£
¤Ê¤ª¡¤2¿Ê¥â¡¼¥É¤Î¾ì¹ç¡¤ÇÛÎó¤ÏÊÑ¿ô´ÉÍý´ÉÍýÍÑ¥á¥â¥ê¤ò¤Û¤È¤ó¤É¾ÃÈñ¤·¤Ê¤¤¤Î¤Ç¡¤ÊÑ¿ô´ÉÍýÍÑ¥á¥â¥ê¤Î³ä¤êÅö¤Æ¤ò¸º¤é¤¹¤Û¤¦¤¬¸ú²ÌŪ¤Ê²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£

¡ÊÃí¡ËBASIC.INI¤ò»È¤¤¤¿¤¤¤È¤­¤Ï¡¤¥¢¡¼¥«¥¤¥ÖÈǤò¥À¥¦¥ó¥í¡¼¥É¤·Å¸³«¤·¤¿¤â¤Î¤ò»È¤Ã¤Æ¤¯¤À¤µ¤¤¡£
¡Ê¥ì¥¸¥¹¥È¥ê¤ò»ÈÍѤ¹¤ë¾ì¹ç¤Ï¥ì¥¸¥¹¥È¥ê¤ÎÅö³º¹àÌܤò½¤Àµ¤¹¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡Ë

¡Ê»²¾È¡Ëµì·Ç¼¨ÈIJáµî¥í¥°
http://www.geocities.jp/thinking_math_education/log/22/koctpp/index.html
 

¤¹¤ß¤Þ¤»¤óÊÔ½¸¤µ¤»¤Æ¤¤¤¿¤À¤­¤Þ¤·¤¿¡Ê¬Î̺Ǿ®Æó¾èË¡¤Ë¤Ä¤¤¤Æ¡Ë

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ 1·î29Æü(ÌÚ)18»þ12ʬ33ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ¬ÎÌÌÖÊ¿¶Ñ¡¡ºÇ¾®Æó¾èË¡¤Ë¤Ä¤¤¤Æ¡¢
¾ðÊóÂԤġ¢
 

Re: ¬Î̺Ǿ®Æó¾èË¡¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 1·î30Æü(¶â)15»þ06ʬ48ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.254[¸µµ­»ö¤Ø]

kikiriri¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

»²¹Í¥µ¥¤¥È¡¡http://hw001.gate01.com/kazuok/geodetic/leveling.html

Full BASIC¤Î¾ì¹ç¡¢¹ÔÎ󤬷׻»¤Ç¤­¤ë¤Î¤Ç¡¢Â¾¤Î¸À¸ì¤è¤ê¤Ï´Êñ¤Ë·×»»¤Ç¤­¤ë¤È»×¤¤¤Þ¤¹¡£
¤¿¤À¡¢£²¹à±é»»¤Þ¤Ç¤Ç¤¹¤«¤é¡¢Å¸³«¤·¤Ê¤¬¤é¤³¤Ä¤³¤Ä·×»»¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£

¤Þ¤¿¡¢É½·×»»¤ÎÊý¤¬GUI¤ò´Þ¤á¤Æ¼ÂÍѲ½¤·°×¤¤¤«¤â¤·¤ì¤Þ¤»¤ó¡£


¾åµ­¥µ¥¤¥È¤ÎÎãÂê¡ÊPDF¥Õ¥¡¥¤¥ëÆâ¡Ë¤Î¥µ¥ó¥×¥ë¥³¡¼¥Ç¥£¥ó¥°
!ºÇ¾®£²¾èË¡¤Ë¤è¤ë¬ÎÌÌÖÊ¿¶Ñ¡Ê¾ò·ïÊýÄø¼°Ë¡¡Ë

!£È·¿
!¡¡ £Á¡¡¡¡£Ã
!¡¡1¢­ 5¡¡¢­3
! ¡¡£Ð ¢ª £Ñ
!¡¡2¢¬¡¡¡¡¢¬4
! ¡¡£Â¡¡¡¡£Ä

!´ûÃÎÅÀ
LET C=4 !¿ô

DATA 25.645 !£ÁÅÀ¤Îɸ¹â¡Êm¡Ë
DATA 24.666 !£ÂÅÀ
DATA 25.024 !£ÃÅÀ
DATA 25.699 !£ÄÅÀ
DIM Z(C)
MAT READ Z

!´Ñ¬ÃÍ
LET P=5 !¿ô

DATA -6.225, 0.44 !Ï©Àþ£±¡¡¹âÄ㺹¡Êm¡Ë¡¢Ï©ÀþĹ¡Êkm¡Ë
DATA -5.245, 0.25 !Ï©Àþ£²
DATA  0.278, 0.33 !Ï©Àþ£³
DATA -0.399, 0.26 !Ï©Àþ£´
DATA  5.879, 0.44 !Ï©Àþ£µ

DIM X(P),G(P,P) !´Ñ¬ÃÍ¡¢¥³¥¢¥Õ¥¡¥¯¥¿
MAT G=ZER
FOR i=1 TO P
   READ X(i),G(i,i)
NEXT i
MAT PRINT X;
MAT PRINT G;


!̤Ãοô
LET Px=2 !µáÅÀ£Ð¤È£Ñ


!------------------------------

!¼«Í³ÅÙR¡¡¢¨¾ò·ïÊýÄø¼°¤Î¿ô
LET R=P-Px


!¾ò·ïÊýÄø¼° UV=t
DIM U(R,P)
DATA 1,-1,0,0,0 !ÅÀ£Ð¤Ë¤Ä¤¤¤Æ HA+h1~=HB+h2~ ¤è¤ê¡¢(h1+v1)-(h2+v2)=HB-HA¡¡¡èv1-v2=-(h1+HA)+(h2+HB)
DATA 0,0,1,-1,0 !ÅÀ£Ñ¤Ë¤Ä¤¤¤Æ HC+h3~=HD+h4~
DATA 1,0,0,-1,1 !ÅÀ£Ð¤ÈÅÀ£Ñ¤Ë¤Ä¤¤¤Æ HA+h1~+h5~=HD+h4~
MAT READ U

DIM t(R,1)
FOR i=1 TO R
   LET s=0
   FOR j=1 TO P
      IF j>C THEN LET Zj=0 ELSE LET Zj=Z(j)
      LET s=s-(X(j)+Zj)*U(i,j)
   NEXT j
   LET t(i,1)=s
NEXT i
!!!LET t(1,1)=-X(1)+X(2)-Z(1)+Z(2) !0.001
!!!LET t(2,1)=-X(3)+X(4)-Z(3)+Z(4) !-0.002
!!!LET t(3,1)=-X(1)+X(4)-X(5)-Z(1)+Z(4) !0.001
MAT PRINT t;


!------------------------------

!Áê´Ø¼° NK=t¡¢N=UG(Ut)¤è¤ê¡¢K=(Ni)t¤òµá¤á¤ë
DIM Ut(P,R)
MAT Ut=TRN(U)
DIM TMP(P,R) !G(Ut)¡¡¢¨¼¡¤Ç¤â»È¤¦
MAT TMP=G*Ut
DIM N(R,R)
MAT N=U*TMP
MAT PRINT N;

DIM invN(R,R)
MAT invN=INV(N)
DIM K(R,1)
MAT K=invN*t

MAT PRINT K;


!ÊäÀµÃͤη׻»¡Êmm¡Ë V=G(Ut)K
DIM V(P,1)
MAT V=TMP*K

MAT PRINT V;


!ºÇ³ÎÃÍ X~=X+V
FOR i=1 TO P
   PRINT "Ï©Àþ";STR$(i);"=";X(i)+V(i,1)
NEXT i
PRINT "ÅÀ£Ð";Z(1)+(X(1)+V(1,1)); Z(2)+(X(2)+V(2,1)) !Í­¸ú·å¿ô ##.###
PRINT "ÅÀ£Ñ";Z(3)+(X(3)+V(3,1)); Z(4)+(X(4)+V(4,1))




!ÀºÅ٤η׻»¡Êmm^2¡Ë ¦Ò^2=(Kt)NK/r
DIM s2(1,1),Kt(1,R)
MAT Kt=TRN(K)
MAT s2=Kt*t !NK=t
LET sigma2=s2(1,1)/R

PRINT "¦Ò^2=";sigma2


!ʬ»¶¹ÔÎó¡Êmm^2¡Ë ¦Ò^2*Gx¡¢Gx=G-G(Ut)(Ni)UG
DIM Gx(P,P)
MAT Gx=TMP*invN !G(Ut)(Ni)
MAT Gx=Gx*U
MAT Gx=Gx*G
MAT Gx=G-Gx
MAT Gx=sigma2*Gx

MAT PRINT Gx;


END
 

¤¹¤ß¤Þ¤»¤óÊÔ½¸¤µ¤»¤Æ¤¤¤¿¤À¤­¤Þ¤·¤¿

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ 1·î30Æü(¶â)19»þ56ʬ54ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ¬Î̺Ǿ®Æó¾èË¡¤Ë¤Ä¤¤¤Æ¡¢
ÁᮤΤ´ÊÖÅú
¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
 

Re: ¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 1·î30Æü(¶â)20»þ27ʬ56ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.256[¸µµ­»ö¤Ø]

kikiriri¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ÍѸì¤Ë¤Ä¤¤¤Æ¡¢ÀâÌÀ¤ª´ê¤¤¤Ç¤­¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£

¬ÎÌÍѸì¤Î´ðÁÃÃμ±¡¡http://www.1roba.com/


¤Þ¤¿¡¢»²¹Íʸ¸¥
¡¡ºÇ¾®Æó¾èË¡¤È¬ÎÌÌÖÊ¿¶Ñ¤Î´ðÁá¡ÅÄÅçÌ­(Ãø)¡¢¾®ËÒÏÂͺ(Ãø)¡¡¡¡ÅìÍνñŹ (2001/03)
¤Ê¤É¤¬¤¢¤ê¤Þ¤¹¡£
 

¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ 1·î31Æü(ÅÚ)11»þ09ʬ30ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ÁᮤΤ´ÊÖÅú¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
»²¹Í¤Ë¤·¤¿¤¤¤È»×¤¤¤Þ¤¹¡£
ºÇ¾®Æó¾èË¡¤È¬ÎÌÌÖÊ¿¶Ñ¤Î´ðÁá¡ÅÄÅçÌ­(Ãø)¡¢¾®ËÒÏÂͺ(Ãø)¡¡¡¡ÅìÍνñŹ (2001/03)
»ý¤Ã¤Æ¤¤¤ë¤ó¤Ç¤¹¤¬¡¢ÀµÄ¾Æɤá¤Ê¤¤¤Ç¤¹¡£
¬Î̤δðÁ䫤éʬ¤«¤Ã¤Æ¤Ê¤¤¤È»×¤¤¤Þ¤¹¡£
ÀµÄ¾¤É¤³¤«¤é¡¢¤É¤ÎÄøÅÙ¡©ÊÙ¶¯¤¹¤ì¤Ð¤¤¤¤¤Î¤«¤¬Ê¬¤«¤ê¤Þ¤»¤ó¡£
¥³¥í¥Ê¼Ò¡¡Â¬ÎÌ¡Ê£±¡Ë¡¡Â¬ÎÌ¡Ê£²¡Ë
¼Â¶µ½ÐÈÇ¡¡Â¬Î̱齬¥Î¡¼¥È
¤Ê¤É¡¢
»ý¤Ã¤Æ¤¤¤Þ¤¹¡£
¡É»²¹Í¤Ë¤Ê¤ë¤â¤Î¤¬¤¢¤ì¤Ð¾Ò²ð¤·¤Æ¤¯¤À¤µ¤¤¡£¡É
¡É¤Ò¤È¤Ä¤ÎÌÜɸ¤È¤¤¤¦¤«¡¢¤½¤ì¤¬Ê¿¶ÑÌÖ¤Î¥×¥í¥°¥é¥ß¥ó¥°²½¤Ç¡£¡É
Ëͤˤϻ²¹Í¤Ë¤µ¤ì¤Æ¤¤¤¿¥Ú¡¼¥¸¤ò¸«¤Ä¤±¤ë¤³¤È¤µ¤¨¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¤Î¤Ç¡£
¤³¤¦¤·¤Æ¤´½õ¸Àµá¤á¤Æ¤¤¤ë¼¡Âè¤Ç¤¹¡£
¤è¤í¤·¤¯¤ª´ê¤¤¤·¤Þ¤¹¡£
 

ÊÔ½¸¤µ¤»¤Æ¤¤¤¿¤À¤­¤Þ¤·¤¿

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ 2·î 1Æü(Æü)13»þ30ʬ16ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  Ĺ¤é¤¯¾ðÊó¤Ê¤É¤ÎÊÖÅúÆÀ¤é¤ì¤º¤³¤Î¤è¤¦¤Ê·Á¤ÇÊÔ½¸¤µ¤»¤Æ¤¤¤¿¤À¤­¤Þ¤·¤¿¡£

µ¤¤Ë¤·¤Æ¤¯¤À¤µ¤Ã¤¿Êý¡¹¡¢À¿¤Ë¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿

¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
 

ÀáÅÀ²òÀÏË¡¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§Âç·§¡¡Àµ  Åê¹ÆÆü¡§2009ǯ 2·î 1Æü(Æü)14»þ39ʬ35ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ÁýÉý´ï¤ò´Þ¤à¡¢¸òή²óÏ©¤Î²òÀÏ

1.¡¡£Ã£Ò²óÏ©2ÃʤÎÄã°è¥Õ¥£¥ë¥¿¡¼¤Çñ½ã¤ÊÁýÉý´ï¤ò´Þ¤Þ¤Ê¤¤¤â¤Î¤Ï¡¢
¡¡¡¡ÀáÅÀÊýÄø¼°¤òΩ¤Æ¤Æ²ò¤±¤ë¤³¤È¤¬Ê¬¤ê¤Þ¤·¤¿¡£
¡¡¡¡ÆþÎÏ¡¡E1 ¤«¤éºÇ½é¤ÎÄñ¹³¡¡R1,¼¡¤¬R2,¤½¤Î¼¡¤¬ºÇ½ªÃ¼»Ò¤Ë¥¢¡¼¥¹
¡¡¡¡¤ËÂФ·C2¥¬ºß¤ê¡¢ ¤³¤ÎC2¤Î½ÐÎϤ¬ÁýÉý´ï¤Ç£ËÇܤµ¤ì¤ë¡£
    ¤³¤ÎÁýÉý´ï¤Î½ÐÎϤϡ¢C1¤ò²ð¤·¤Æ¡¡R1¤ÈR2¤ÎÀáÅÀ¤Ë·ë¤Ð¤ì¤ë¡£
¡¡¡¡C1=2*C2¡¡¤Î»þ¡¢K=1Á°¸å¤ÇºÇŬ¤Ç¤¢¤ë¡£
¡¡¡¡Â¨¤Á¡¢Åµ·¿Åª¤Ê¥¢¥¯¥Æ¥Ö¡¡2ÃÊ¥Õ¥£¥ë¥¿¡¼¤ÎÌäÂê¤Ç¼ÁÌ䤤¤¿¤·¤Þ¤¹¡£

¡¡¡¡C1 ¤ÎÅÅ°µ¤òE2 C2¤ÎÅÅ°µ¤òE3¤È¤·¡¢¤½¤ÎKÇܤÎÅÅ°µ¤¬C1¤ÇR1¤ÈR2¤Î
¡¡¡¡ÀáÅÀ¤ËÀµµ¢´Ô¡£¤È¤¹¤ë¤È¡¢E1¤ÈE3¤Î´Ø·¸¼°¤¬¤Ç¤Æ¡¢²óÏ©¤Ï²ò¤±¤Þ¤¹¡£

2. ¤³¤Î¤è¤¦¤Ë¤Þ¤º²ò¤¤¤Æ¡¢¼þÇÈ¿ôÆÃÀ­¤Ê¤É¤òɽ¼¨¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢ÀáÅÀ
¡¡ÊýÄø¼°¤Î¤è¤¦¤Ë¡¢¡¦¡¦¡¦¡¦µ¡³£Åª¤ËÀáÅÀ¤Ë¥¢¥É¥ß¥¿¥ó¥¹Åù¤òÁÞÆþ¡©¡©
   ¤·¤ÆÌäÂê¤ò²ò¤­¤¿¤¤¤Î¤Ç¤¹¤¬¡¢E2¤äE3,¤½¤·¤ÆKÅù¤ò¥Þ¥È¥ê¥¯¥¹¾å¤Ç¤É¤¦
¡¡ ɽ¸½¤·¤ÆÎɤ¤¤«Ê¬¤ê¤Þ¤»¤ó¡£
¡¡ ¼°¤òͽ¤á²ò¤«¤º¤È¤â¡¢µ¡³£Åª¤Ëɽ¼¨¤¹¤ì¤Ð¡¢¥Þ¥È¥ê¥¯¥¹¤¬¼«Æ°Åª¤Ë
¡¡ ²ò¤¤¤Æ¤¯¤ì¤ë¤Î¤Ç¤Ï¤Ê¤¤¤«¤È´üÂÔ¤·¤Æ¤¤¤Þ¤¹¡£
   ²¿Êý¤«¸æ¶µ¤¨¤Æ²¼¤µ¤ë¤ÈÍ­¤êÆñ¤¤¤Î¤Ç¤¹¤¬¡£

3, ¥Þ¥È¥ê¥¯¥¹¤ÇÊ£ÁÇ¿ô¤ò¡¡MAT¡¡PRINT  A ¤È¤ä¤ë¤È¡¢Ê£ÁÇ¿ô¤¬¤ä¤¿¤é
¡¡¡¡Ä¹¤¤É½¼¨¤Ë¤Ê¤ê¤Þ¤¹¡£
¡¡¡¡²¿¤È¤«PRINT USING¡¡¡ô¡ô¡ô¡ô¡¡Åª¤Ë´Ê·ë¤Êɽ¼¨¤Ï½ÐÍè¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£
¡¡¡¡ÌµÍý¤Ë¤ä¤ë¤È¥Þ¥È¥ê¥¯¥¹¤Ç¤ÏÊ£ÁÇ¿ô¤òPRINT USING¡¡É½¼¨¤Ï½ÐÍè¤Ê¤¤¤È
¡¡¡¡É½¼¨¤µ¤ì¤Þ¤¹¡£
 

Re: ÀáÅÀ²òÀÏË¡¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 2·î 1Æü(Æü)16»þ10ʬ14ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.260[¸µµ­»ö¤Ø]

> 3, ¥Þ¥È¥ê¥¯¥¹¤ÇÊ£ÁÇ¿ô¤ò¡¡MAT¡¡PRINT  A ¤È¤ä¤ë¤È¡¢Ê£ÁÇ¿ô¤¬¤ä¤¿¤é
> ¡¡¡¡Ä¹¤¤É½¼¨¤Ë¤Ê¤ê¤Þ¤¹¡£
> ¡¡¡¡²¿¤È¤«PRINT USING¡¡¡ô¡ô¡ô¡ô¡¡Åª¤Ë´Ê·ë¤Êɽ¼¨¤Ï½ÐÍè¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£
> ¡¡¡¡ÌµÍý¤Ë¤ä¤ë¤È¥Þ¥È¥ê¥¯¥¹¤Ç¤ÏÊ£ÁÇ¿ô¤òPRINT USING¡¡É½¼¨¤Ï½ÐÍè¤Ê¤¤¤È
> ¡¡¡¡É½¼¨¤µ¤ì¤Þ¤¹¡£

¼ÂÉô¤ÈµõÉô¡¤¤¢¤ë¤¤¤Ï¡¤ÀäÂÐÃͤÈÊгѤʤɡ¤µõ¿ôÉôʬ¤ò´Þ¤Þ¤Ê¤¤¿ôÃͤΥڥ¢¤Ëʬ¤±¤Æ¤«¤é½ñ¼°¤ò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡£
¤Þ¤¿¡¤MAT PRINT USING¤ß¤¿¤¤¤Î¤¬É¬ÍפǤ¢¤ì¤Ð¡¤ÇÛÎó¤È½ñ¼°¤ò°ú¿ô¤È¤·¤Æ¤È¤ëÉû¥×¥í¥°¥é¥à¤òºîÀ®¤·¤Æ»È¤Ã¤Æ¤¯¤À¤µ¤¤¡£
 

Re: ÀáÅÀ²òÀÏË¡¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 2·î 2Æü(·î)10»þ38ʬ2ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.260[¸µµ­»ö¤Ø]

Âç·§¡¡Àµ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

ÍýÁÛŪ¤Ê¥ª¥Ú¥¢¥ó¥×¤Î·×»»
¡¡²¾ÁÛ¤ÎÁǻҤò¹Í¤¨¤ë¡Ê¿Þ£²¡Ë
¡¡¡¦¥Ê¥ì¡¼¥¿
¡¡¡¡­¡V+¤ÈV-¤È¤ÎÅṲ̋ÏƱ¤¸¡Ê¥¤¥Þ¡¼¥¸¥Ê¥ê¡¼¥·¥ç¡¼¥È¡Ë
¡¡¡¡­¢V+¤ÈV-¤È¤Ë¤ÏÅÅή¤¬Î®¤ì¤Ê¤¤¡ÊÆþÎÏÄñ¹³¤¬Ìµ¸ÂÂç¡Ë
¡¡¡¦¥Î¥ì¡¼¥¿
¡¡¡¡­£Vo¤«¤é¤ÏɬÍפÊÅÅή¤¬¶¡µë¤µ¤ì¤ë¡ÊξÊý¸þ¡Ë

¤³¤ì¤òŬÍѤ¹¤ë¤È¡¢¿Þ£³¤Ï¡¢¿Þ£±¤ÎÅù²Á²óÏ©¤Ë¤Ê¤ë¤È»×¤¤¤Þ¤¹¡£

¤³¤Î¿Þ£³¤Î²óÏ©¿Þ¤ÇÀáÅÀÊýÄø¼°¤ò¹Í¤¨¤Þ¤¹¡£
Ä̾Vo¤Ï¸ÇÄêÃͤȤ¹¤ë¤¬¡¢¥¢¥ó¥×¤Ë¤è¤ê³ÎÄê¤Ç¤­¤Þ¤»¤ó¡£¡ÊVo=K*e2¡¢e2¤ÏÀáÅÀ­¢¤ÎÅÅ°Ì¡Ë
¤½¤³¤Ç¡¢¥¢¥ó¥×¤ÎÆþÎϤò½ÐÎϤËÈ¿±Ç¤µ¤»¤Æ¡ÊÈ¿Éü·×»»¤Ç¡Ë¼ý«¤µ¤»¤Þ¤¹¡£


¥×¥í¥°¥é¥à¤Ï¿Þ£±¤Î¤è¤¦¤Ê¥¢¥ó¥×¤ò´Þ¤ó¤À²óÏ©¿Þ¤Ç·×»»¤Ç¤­¤ë¤è¤¦¤Ë
°ÊÁ°¾Ò²ð¤·¤¿ÀáÅÀÅÅ°ÌË¡¤Î¤â¤Î¤ò²þÎɤ·¤Æ¤¢¤ê¤Þ¤¹¡£

1000 !ÀáÅÀÅÅ°ÌË¡¤Ë¤è¤ë¥Õ¥£¥ë¥¿²óÏ©¤Î¼þÇÈ¿ô²òÀÏ¡ÊÍøÆÀ¡¢°ÌÁê¡Ë
1010
1020 OPTION ARITHMETIC COMPLEX
1030
1040 LET j=SQR(-1) !µõ¿ôñ°Ì¡¡¢¨Åŵ¤·Ï¤Ï£ê¤ò»È¤¦
1050
1060 LET f=60 !¼þÇÈ¿ô[Hz]
1070 DEF w=2*PI*f !³Ñ¼þÇÈ¿ô¦Ø
1080
1090 DEF H2Ohm(L)=j*w*L ![H]¤ò[¦¸]¤Ø
1100 DEF F2Ohm(C)=1/(j*w*C) ![F]¤ò[¦¸]¤Ø
1110 DEF xL(L)=w*L !ͶƳ¥ê¥¢¥¯¥¿¥ó¥¹
1120 DEF xC(C)=1/(w*C) !ÍÆÎ̥ꥢ¥¯¥¿¥ó¥¹
1130
1140 SUB DispS(z) !Ê£ÁÇ¿ô¤òSɽ¼¨¤¹¤ë¡¡¢¨¥¹¥¿¥¤¥ó¥á¥Ã¥Ä¡ÊSteinmetz¡Ë
1150    PRINT ABS(z);
1160    IF ABS(z)<>0 THEN
1170       IF arg(z)<>0 THEN PRINT "¢Ü";DEG(arg(z));"¡ë";
1180    END IF
1190    !PRINT
1200 END SUB
1210
1220 FUNCTION S2COMPLEX(l,th) !Sɽ¼¨¡Ê¶ËºÂɸ·Á¼°¡Ë¤òÊ£ÁÇ¿ô¤Ø
1230    LET S2COMPLEX=COMPLEX(l*COS(RAD(th)),l*SIN(RAD(th)))
1240 END FUNCTION
1250 FUNCTION i2COMPLEX(im,th) !½Ö»þÃͼ°¤òÊ£ÁÇ¿ô¤Ø¡¡¢¨ºÇÂçÃÍ¡¢½é´ü°ÌÁê
1260    LET i2COMPLEX=S2COMPLEX(im/SQR(2),th) !¼Â¸úÃÍ¡¢½é´ü°ÌÁê
1270 END FUNCTION
1280 !-------------------- ¤³¤³¤Þ¤Ç¤¬¥µ¥Ö¥ë¡¼¥Á¥ó
1290
1300
1310 SUB set_curcit !ÁǻҤä·ëÀþ¤òÄêµÁ¤¹¤ë
1320    !---------- ¢­¢­¢­¢­¢­ ----------
1330
1340    !¡ü²óÏ©¿Þ¡¡Sallen-Key £³¼¡¥í¡¼¥Ñ¥¹¡¦¥Õ¥£¥ë¥¿
1350
1360    !»²¹Í¥µ¥¤¥È¡¡http://sim.okawa-denshi.jp/OPseikiLowkeisan.htm
1370
1380    !¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¨£¨¡C2¨¡¨¨¨¡¨¡¨¡¨¡¨¡¨¡¨¤
1390    !¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¨¢¡¡¡¡¡¡¨¢¡¡¨£¨¡¨¡¨¤¡¡¨¢
1400    !¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¨¢¡¡¡¡¡¡¨¦¨¡¨©- ¡¡¨¢¡¡¨¢
1410    !¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¨¢¡¡¡¡¡¡¡¡¡¡¨¢¡¡£Ë¨§¨¡£¶¨¡
1420    !¡¡¨¡£²¨¡R1¨¡£³¨¡R2¨¡£´¨¡R3¨¡£µ¨¡¨©+ ¡¡¨¢¡¡¢¬
1430    !¡¡¡¡¢¬¡¡¡¡¡¡¨¢¡¡¡¡¡¡¡¡¡¡¡¡¡¡¨¢¡¡¨¦¨¡¨¡¨¥¡¡¨¢
1440    !¡¡¡¡Vi¡¡¡¡¡¡C1¡¡¡¡¡¡¡¡¡¡¡¡¡¡C3¡¡¡¡¡¡¡¡¡¡¡¡Vo
1450    !¡¡¡¡¢­¡¡¡¡¡¡¨¢¡¡¡¡¡¡¡¡¡¡¡¡¡¡¨¢¡¡¡¡¡¡¡¡¡¡¡¡¢­
1460    !¡¡¨¡£±¨¡¨¡¨¡¨ª¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨ª¨¡¨¡¨¡¨¡¨¡¨¡¨ª¨¡
1470    !¡¡¡¡¨¢
1480    !¡¡¡¡¢á¥¢¡¼¥¹
1490
1500    LET GND=1 !¥¢¡¼¥¹
1510    LET Vi=2 !ÆþÎÏü»Ò
1520    LET Vo=6 !½ÐÎÏü»Ò
1530
1540    !ÁÇ»Ò: Rn,Vn,In¡¢n:ÈÖ¹æ¡ÊÏ¢ÈÖ¡Ë¡¡¢¨£²Ê¸»úÌܰʹߤÏÈÖ¹æ
1550    !ÃÍ:
1560    !ü»ÒÈÖ¹æ¡Êµ¯ÅÀ¡Ë: £±°Ê¾å¤ÎÃÍ¡¡¢¨ÀáÅÀ
1570    !ü»ÒÈÖ¹æ: £±°Ê¾å¤ÎÃÍ¡¡¢¨ÀáÅÀ
1580
1590    CALL AddElements("R1",51e3,2,3) !51k[¦¸]¡¢»ÞÏ©ÅÅή¤Ï2¢ª3¤È²¾Äꤹ¤ë
1600    CALL AddElements("C1",F2Ohm(0.0068e-6),3,1) !0.0068[¦ÌF]
1610    CALL AddElements("R2",82e3,3,4) !82k[¦¸]
1620    CALL AddElements("C2",F2Ohm(0.022e-6),4,6) !0.022[¦ÌF]
1630    CALL AddElements("R3",39e3,4,5) !39k[¦¸]
1640    CALL AddElements("C3",F2Ohm(330e-12),5,1) !330[pF]
1650
1660    !¢¨ÅÅ°µ¸»¤ÎÈÖ¹æ¤Ï£±¤«¤é¤ÎÏ¢ÈÖ¡¡Îã. CALL AddElements("V1",?,?,?) !?[V]
1670    !¤Ê¤·
1680
1690    CALL AddElements("A1",1.0,5,6) !¥¢¥ó¥×¡¡ÁýÉýΨ1.0,¡Üü»Ò5,½ÐÎÏü»Ò6
1700
1710    !---------- ¢¬¢¬¢¬¢¬¢¬ ----------
1720
1730    CALL AddElements("Vi",10,GND,Vi) !10[V]¡¡¢¨Â¬ÄêÍѤÎÅÅ°µ
1740 END SUB
1750
1760 !---------- ¢­¢­¢­¢­¢­ ----------
1770 LET Ns=0 !ÅÅ°µ¸»¤Î¿ô
1780 LET Nd=6 !ÀáÅÀ¤Î¿ô
1790 LET Na=1 !¥¢¥ó¥×¤Î¿ô
1800 !---------- ¢¬¢¬¢¬¢¬¢¬ ----------
1810
1820 LET N=Nd+Ns+Na+1
1830
1840 !¡ü¥­¥ë¥Ò¥Û¥Ã¥Õ¤ÎÅÅή§¤è¤ê¡¢ÀáÅÀÊýÄø¼°¤òÁȤßΩ¤Æ¤ë
1850 DIM A(N,N),x(N),b(N) !ϢΩÊýÄø¼° Ax=b
1860
1870 DIM AmpK(Na),AmpPlus(Na),AmpOut(Na)
1880
1890 SUB AddElements(el$,ev,nd1,nd2) !·ëÀþ¾ðÊ󤫤é²óÏ©ÊýÄø¼°¤òÁȤßΩ¤Æ¤ë
1900    IF (nd1<1 OR nd1>Nd) OR (nd2<1 OR nd2>Nd) THEN
1910       PRINT "ÁÇ»Ò";el$;"¤ÎÀáÅÀÈֹ椬°ã¤¤¤Þ¤¹¡£";nd1;nd2
1920       STOP
1930    END IF
1940
1950    !ϢΩÊýÄø¼°¤òÁȤßΩ¤Æ¤ë¡¡Ax=b
1960    ! ¨£¡¡ ¨¢¡¡ ¨¤¨£¡¡¨¤ ¨£¡¡¨¤
1970    ! ¨¢£Ç ¨¢¡Þ1¨¢¨¢V ¨¢=¨¢I ¨¢¡¡R,C,L,ÅÅή¸»(Nd¸Ä)
1980    !¨¡¨¡¨¡¨«¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡
1990    ! ¨¢¡Þ1¨¢-Zp¨¢¨¢Ip¨¢ ¨¢Ep¨¢¡¡ÅÅ°µ¸»(Ns¸Ä)¡¢¥¢¥ó¥×(Na¸Ä)¡¢ÆþÎÏÅÅ°µ¸»(1¸Ä)
2000    ! ¨¦¡¡ ¨¢¡¡ ¨¥¨¦¡¡¨¥ ¨¦¡¡¨¥
2010
2020    SELECT CASE UCASE$(el$(1:1)) !ÁǻҤ˱þ¤¸¤Æ
2030    CASE "V" !ÅÅ°µ¸»¤Ê¤é
2040       LET t$=UCASE$(el$(2:LEN(el$)))
2050       IF t$="I" THEN !·×¬ÍѤÎÆþÎÏÅÅ°µ¸»¤Ê¤é
2060          LET p=Nd+Ns+Na+1
2070       ELSE
2080          LET p=VAL(t$) !ÈÖ¹æ¤òÆÀ¤ë
2090          IF p<1 OR p>Ns THEN
2100             PRINT "ÅÅ°µ¸»¤ÎÈֹ椬°ã¤¤¤Þ¤¹¡£";el$
2110             STOP
2120          END IF
2130          LET p=p+Nd
2140       END IF
2150       LET A(nd1,p)=A(nd1,p)-1 !ÅÅήIp¤¬ÀáÅÀi¤«¤éÀáÅÀj¤Øή¤ì¤¿¤È¤·¤Æ¡¢(Vi-Vj)-Ip*Zp=Ep
2160       LET A(p,nd1)=A(p,nd1)-1
2170       LET A(nd2,p)=A(nd2,p)+1
2180       LET A(p,nd2)=A(p,nd2)+1
2190       LET A(p,p)=A(p,p)+0 !ÆâÉôÄñ¹³Zp¤Ï£°¤È¤¹¤ë
2200       LET b(p)=b(p)+ev !µ¯ÅÅÎÏ
2210
2220    CASE "A" !¥¢¥ó¥×¤Ê¤é
2230       LET t=VAL(el$(2:LEN(el$))) !ÈÖ¹æ¤òÆÀ¤ë
2240       IF t<1 OR t>Na THEN
2250          PRINT "¥¢¥ó¥×¤ÎÈֹ椬°ã¤¤¤Þ¤¹¡£";el$
2260          STOP
2270       END IF
2280       LET p=t+Nd+Ns !½ÐÎϦ¤ò¥Î¥ì¡¼¥¿¡Ê½é´üÃÍ£°£Ö¤ÎÅÅ°µ¸»¡Ë¤È¤·¤Æ°·¤¦
2290       LET A(GND,p)=A(GND,p)-1
2300       LET A(p,GND)=A(p,GND)-1
2310       LET A(nd2,p)=A(nd2,p)+1
2320       LET A(p,nd2)=A(p,nd2)+1
2330
2340       LET AmpK(t)=ev !ÁýÉýΨ
2350       LET AmpPlus(t)=nd1 !¡Üü»Ò
2360       LET AmpOut(t)=p !ÊýÄø¼°Æâ¤Ç¤Î½ÐÎÏü»Ò
2370
2380    CASE "I" !ÅÅή¸»¤Ê¤é
2390       LET b(nd1)=b(nd1)-ev
2400       LET b(nd2)=b(nd2)+ev
2410
2420    CASE ELSE !ÁǻҤʤé
2430       LET Gij=1/ev
2440       !ÂгÑÀ®Ê¬¡¡¢¨ÀáÅÀ¤ËÀܳ¤µ¤ì¤¿Áǻҡʥ¢¥É¥ß¥¿¥ó¥¹¡Ë¤ÎÏÂ
2450       LET A(nd1,nd1)=A(nd1,nd1)+Gij
2460       LET A(nd2,nd2)=A(nd2,nd2)+Gij
2470       !¤½¤Î¾¤ÎÀ®Ê¬¡¡¢¨ÀáÅÀ¤ËÀܳ¤µ¤ì¤¿Áǻҡʥ¢¥É¥ß¥¿¥ó¥¹¡Ë¤Ë-1¤ò¤«¤±¤¿¤â¤Î¤ÎÏÂ
2480       LET A(nd1,nd2)=A(nd1,nd2)-Gij
2490       LET A(nd2,nd1)=A(nd2,nd1)-Gij
2500
2510    END SELECT
2520 END SUB
2530
2540 DIM Ai(N,N) !ϢΩÊýÄø¼°¤ò²ò¤¯
2550 SUB routine
2560    MAT A=ZER
2570    MAT b=ZER
2580    CALL set_curcit !·ëÀþ¤«¤éÊýÄø¼°¤òÁȤßΩ¤Æ¤ë
2590
2600    FOR i=1 TO Nd !·ëÀþ¤µ¤ì¤Æ¤¤¤Ê¤¤ÀáÅÀ¡¡1*Vi=0
2610       IF A(i,i)=0 THEN LET A(i,i)=1
2620    NEXT i
2630    LET A(GND,GND)=0 !ÅṲ̋ò£°¤È¤¹¤ë
2640
2650    !!!MAT PRINT A; !dump it
2660    !!!MAT PRINT b;
2670
2680
2690    MAT Ai=INV(A)
2700    MAT x=Ai*b
2710    IF Na>0 THEN !¥¢¥ó¥×¤¬¤¢¤ì¤Ð
2720       FOR iter=1 TO 100 !°ÂÄꤵ¤»¤ë¡¡¢¨Í×Ä´À°
2730          FOR i=1 TO Na
2740             LET b(AmpOut(i))=AmpK(i)*x(AmpPlus(i)) !Vo=K*V+¡¡¢¨ÆþÎϤò½ÐÎϤËÈ¿±Ç¤µ¤»¤ë
2750          NEXT i
2760          MAT x=Ai*b
2770       NEXT iter
2780    END IF
2790 END SUB
2800
2810
2820
2830 !SET bitmap SIZE 600,600 !²èÌ̤òÂ礭¤¯¤¹¤ë
2840 LET ymin=-150
2850 SET WINDOW -0.5,6.5, ymin,5 !ɽ¼¨Îΰè
2860 DRAW grid(1,5) !º¸Ã¼¤ÎÌÜÀ¹¤ê
2870
2880 FOR f=1 TO 6 !£ø¼´¤¬Âпô
2890    PLOT TEXT ,AT f-0.3,-0.15: mid$("10  100 1k  10k 100k1M  ",4*(f-1)+1,4)
2900 NEXT f
2910
2920 FOR f=10 TO 100000 STEP 100 !¼þÇÈ¿ô[Hz]
2930    CALL routine
2940    PLOT LINES: LOG10(f),20*LOG10(ABS(x(Vo)/x(Vi))); !ÍøÆÀ[dB]
2950 NEXT f
2960 PLOT LINES
2970
2980
2990 SET TEXT COLOR 2
3000 FOR i=5 TO ymin STEP -5 !±¦Ã¼¤Î½Ä¼´ÌÜÀ¹¤ê
3010    PLOT TEXT ,AT 6,i: STR$(i*2)&"¡ë" !¢¨ÍøÆÀ¤Î¥°¥é¥Õ¤Ë¹ç¤ï¤»¤ë¤¿¤á¤Ë2Çܤ¹¤ë
3020 NEXT i
3030
3040 SET LINE COLOR 2
3050 FOR f=10 TO 100000 STEP 100 !¼þÇÈ¿ô[Hz]
3060    CALL routine
3070    LET t=arg(x(Vo)/x(Vi))
3080    IF t>0 THEN LET t=t-2*PI !0¡Á-2¦Ð¤ØÊäÀµ¤¹¤ë
3090    PLOT LINES: LOG10(f),DEG(t)/2; !°ÌÁê¦È¡¡¢¨ÍøÆÀ¤Î¥°¥é¥Õ¤Ë¹ç¤ï¤»¤ë¤¿¤á¤Ë1/2Çܤ¹¤ë
3100 NEXT f
3110 PLOT LINES
3120
3130
3140 END
 

¥Þ¥¯¥í¡¼¥ê¥óŸ³«¤Î¹â®¶á»÷ÃÍ·×»»¤Ø¤Î±þÍÑ

 Åê¹Æ¼Ô¡§¤¤¤¬¤é¤·¤Þ¤Ê¤È  Åê¹ÆÆü¡§2009ǯ 2·î 4Æü(¿å)18»þ40ʬ56ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¥Þ¥¯¥í¡¼¥ê¥óŸ³«¤Î¹â®¶á»÷ÃÍ·×»»¤Ø¤Î±þÍÑ

£±¡¢½½¿ÊË¡£Â£Á£Ó£É£Ã¤Ë¤è¤ë¥×¥í¥°¥é¥à

REM ***¡¡µÕ¹ÔÎó¤Ç¹â®¥Þ¥¯¥í¡¼¥ê¥óŸ³«
DIM a(3,3),b(3,1),c(3,1),d(3,3)
DEF f(x)=EXP(x)
LET x=0.0001
LET a(1,1)=x
LET a(1,2)=x^2
LET a(1,3)=x^3
LET a(2,1)=2*x
LET a(2,2)=4*x^2
LET a(2,3)=8*x^3
LET a(3,1)=3*x
LET a(3,2)=9*x^2
LET a(3,3)=27*x^3
MAT d=INV(a)
LET e=f(0)
LET c(1,1)=f(x)-e
LET c(2,1)=f(2*x)-e
LET c(3,1)=f(3*x)-e
MAT b=d*c
PRINT b(1,1)
PRINT b(2,1)
PRINT b(3,1)
END

£²¡¢ÍýÏÀ

¥Þ¥¯¥í¡¼¥ê¥óŸ³«¤Î¸ø¼°¤è¤ê

£æ¡Ê£ø¡Ë¡áa(0)+a(1)x+a(2)x^2+a(3)x^3+¡¦¡¦¡¦¡¦¤Ç¤¢¤ë¤«¤é¡£

£ø¢â£°¤ËÂФ·¤Æ¡¢²òa(m)»ý¤ÄϢΩÊýÄø¼°
£æ¡Ên£ø¡Ë¡áa(0)+a(1)(nx)+a(2)(nx)^2+a(3)(nx)^3
¤ò²ò¤¯¤È¥Þ¥¯¥í¥ê¥óŸ³«¤Î¶á»÷Ãͤ¬µá¤Þ¤ë¡£

£³¡¢·ë²Ì

f(x)=e^x¤Î¥Þ¥¯¥í¥ê¥óŸ³«¤ò¹ÔÎó¤ÎµÕ¹ÔÎó¤òÍѤ¤¤Æ·×»»¤·¤¿¡£

a(1)=0.999999999998332
a(2)=0.50000001
a(3)=0.166666766681668¡¡¤òÆÀ¤ë¤³¤ì¤Ï¿¿ÃÍ

a(1)=£±
a(2)=1/2=0.5
a(3)=1/6=0.1666¡¦¡¦¡¦

¤Ë¶á¤¤ÃͤȤʤäƤ¤¤ë¡£

£´¡¢È¯Å¸²ÝÂê¡Ê¼«Ê¬¤ËÂФ·¤Æ¡£¡£¡£¡£¡Ë

¤³¤ì¤ò¥¬¥¦¥¹¡¦¥¸¥ç¥ë¥À¥óË¡¤Ë¤è¤ê·×»»¤»¤è¡ª
 

(̵Âê)

 Åê¹Æ¼Ô¡§Âç·§¡¡Àµ  Åê¹ÆÆü¡§2009ǯ 2·î 5Æü(ÌÚ)10»þ42ʬ50ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ÇòÀС¡ÍÍ¡¡»³Ãæ¡¡ÍÍ¡¡¡¡Âç·§¤Ç¤¹¡£

¸æ¿˻Ãæ¤Î½ê¡¢¿§¡¹¤È¸æ»ØƳ¤ò夭¤Þ¤³¤È¤ËÍ­Æñ¤¦¤´¤¶¤¤¤Þ¤¹¡£

ÇòÀÐÍÍ
ÊÌÅÓ¥×¥í¥°¥é¥à¤òºî¤ê¡¢ÉôʬŪ¤Ë»î¤·¤¿½ê¡¢¾å¼ê¤¯Æ°¤­¤Þ¤·¤¿¡£

»³ÃæÍÍ
¥×¥í¥°¥é¥à¤ò¥³¥Ô¡¼¤·¡¢Æ°¤«¤·¤¿½ê¡¢åºÎï¤Ë¼þÇÈ¿ôÆÃÀ­¤¬½Ð¤Þ¤·¤¿¡£
¡Ö¥¢¥ó¥×¤ÎÆþÎϤò½ÐÎϤËÈ¿±Ç¤µ¤»¤Æ¡ÊÈ¿Éü·×»»¤Ç¡Ë¼ý«¤µ¤»¤Þ¤¹¡£¡×
¤È¤¤¤¦¤Î¤Ï¡¢¡ÖÌܤ«¤é¤¦¤í¤³¡×¤Ç¶Ã¤­¤Þ¤·¤¿¡£
Áí¤Æ¤òº¡¤ì¤«¤éÊÙ¶¯¤µ¤»¤Æ¤¤¤¿¤À¤­¤Þ¤¹¡£

¤½¤ì¤«¤é¡¢°ìÈֺǸå¤Î¡¡²óÏ©¿Þ¤Ï¡¢¤É¤³¤«¤é¡¡¤É¤Î¤è¤¦¤Ë¥³¥Ô¡¼¤·¡¢
¤³¤ÎÅê¹ÆÍó¤ËŽ¤ê¤Ä¤±¤ë¤Î¤Ç¤·¤ç¤¦¤«¡£¤³¤ÎÅê¹ÆÍó¤ËŽ¤ê¤Ä¤±¤è¤¦
¤È¤·¤Þ¤·¤¿¤¬¡¢½ÐÍè¤Þ¤»¤ó¤Ç¤·¤¿¡£
¤Þ¤¿¡¢¥Ñ¥½¥³¥ó¤Î¡Ö¥á¥âÄ¡¡×¤ä¡¢10¿ÊBASIC¡¡¤Ë¤âŽ¤êÉÕ¤­¤Þ¤»¤ó¡£

½ÐÍè¤Þ¤·¤¿¤é¡¢¸æ¶µ¤¨¤¯¤À¤µ¤¤¡£

·É¶ñ
 

Re: (̵Âê)

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 2·î 5Æü(ÌÚ)11»þ32ʬ41ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.264[¸µµ­»ö¤Ø]

Âç·§¡¡Àµ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¤½¤ì¤«¤é¡¢°ìÈֺǸå¤Î¡¡²óÏ©¿Þ¤Ï¡¢¤É¤³¤«¤é¡¡¤É¤Î¤è¤¦¤Ë¥³¥Ô¡¼¤·¡¢
> ¤³¤ÎÅê¹ÆÍó¤ËŽ¤ê¤Ä¤±¤ë¤Î¤Ç¤·¤ç¤¦¤«¡£¤³¤ÎÅê¹ÆÍó¤ËŽ¤ê¤Ä¤±¤è¤¦
> ¤È¤·¤Þ¤·¤¿¤¬¡¢½ÐÍè¤Þ¤»¤ó¤Ç¤·¤¿¡£

¤³¤Î·Ç¼¨ÈĤÎÅê¹ÆÍó¤Ï¡Ê¤³¤Î²èÌ̤ΰìÈÖ¾å¡Ë
¡¡Åê¹Æ¼Ô
¡¡¥á¡¼¥ë
¡¡Âê̾
¡¡ÆâÍÆ
¡¡²èÁü¡¡¢«¢«¢«¤³¤³
¡¡£Õ£Ò£Ì
¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¤¬¡¢¤³¤Î²èÁü¤ÎÍó¤Ë
¼«Ê¬¤Î¥Ñ¥½¥³¥óÆâ¤Î²èÁü¥Ç¡¼¥¿¡Êgif¡¢jpg¡¢png·Á¼°¡Ë¤ò»ØÄꤹ¤ë¤È¥¢¥Ã¥×¥í¡¼¥É¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

²èÁü¥Ç¡¼¥¿¤ÎºîÀ®¤Ï¡¢WindoesÉÕ°¤Î¡Ö¥Ú¥¤¥ó¥È¡×¤Ç²Äǽ¤Ç¤¹¡£Êݸ¤Î¤È¤­¡¢gif¡¢jpg·Á¼°¤Ë¤·¤Þ¤¹¡£



> ¤Þ¤¿¡¢¥Ñ¥½¥³¥ó¤Î¡Ö¥á¥âÄ¡¡×¤ä¡¢10¿ÊBASIC¡¡¤Ë¤âŽ¤êÉÕ¤­¤Þ¤»¤ó¡£

¥á¥âÄ¢¤äBASIC¤ÎÊÔ½¸²èÌ̤ϡ֥ƥ­¥¹¥È¡Êʸ»ú¡Ë¡×¤Î¤ß¤ò°·¤¤¤Þ¤¹¤Î¤Ç¡¢¡Ö²èÁü¡×¤òŽ¤êÉÕ¤±¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£
¤Þ¤¿´Ê°×¥ï¡¼¥×¥í¤Î¡Ö¥ï¡¼¥É¥Ñ¥Ã¥É¡×¤Ç¤Ï¡¢¡Ö¥Ç¥­¥¹¥È¡×¤È¡Ö²èÁü¡×¤¬°·¤¨¤Þ¤¹¡£
¤·¤¿¤¬¤Ã¤Æ¡¢²èÁü¥Ç¡¼¥¿¤Ï¥×¥í¥°¥é¥à¤È¤ÏÊ̤˴ÉÍý¡ÊÊݸ¤Ê¤É¡Ë¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£




¡üÊä­
¡¡²óÏ©¿Þ¤òÊѹ¹¤¹¤ë¤È¤­¤Î½¤Àµ²Õ½ê

¡Ýü»Ò¤Ø¤ÎÆþÎϤξì¹ç
1310 SUB set_circuit !ÁǻҤä·ëÀþ¤òÄêµÁ¤¹¤ë
1320    !---------- ¢­¢­¢­¢­¢­ ----------
1330
1340    !¡ü²óÏ©¿Þ¡¡¥ª¥Ú¥¢¥ó¥×¿½Åµ¢´Ô·¿¥Ð¥ó¥É¥Ñ¥¹¡¦¥Õ¥£¥ë¥¿
1350
1360    !»²¹Í¥µ¥¤¥È¡¡http://sim.okawa-denshi.jp/OPseikiLowkeisan.htm
1370
1380    !¡¡¡¡¡¡¡¡¡¡¡¡¨£¨¡C1¨¡¨¨¨¡¨¡¨¡¨¡¨¡¨¡¨¤
1390    !¡¡¡¡¡¡¡¡¡¡¡¡¨¢¡¡¡¡¡¡¨¢¡¡¡¡¡¡¡¡¡¡¡¡¨¢
1400    !¡¡¡¡¡¡¡¡¡¡¡¡¨¢¡¡¡¡¡¡R3¡¡¡¡¡¡¡¡¡¡¡¡¨¢
1410    !¡¡¡¡¡¡¡¡¡¡¡¡¨¢¡¡¡¡¡¡¨¢¡¡¨£¨¡¨¡¨¤¡¡¨¢
1420    !¡¡¨¡£²¨¡R1¨¡£³¨¡C2¨¡£´¨¡¨©- ¡¡¨§¨¡£µ¨¡
1430    !¡¡¡¡¢¬¡¡¡¡¡¡¨¢¡¡¡¡¡¡¡¡¡¡¨¢¡¡£Ë¨¢¡¡¢¬
1440    !¡¡¡¡Vi¡¡¡¡¡¡R2¡¡¡¡¡¡¨£¨¡¨©+ ¡¡¨¢¡¡Vo
1450    !¡¡¡¡¢­¡¡¡¡¡¡¨¢¡¡¡¡¡¡¨¢¡¡¨¦¨¡¨¡¨¥¡¡¢­
1460    !¡¡¨¡£±¨¡¨¡¨¡¨ª¨¡¨¡¨¡¨ª¨¡¨¡¨¡¨¡¨¡¨¡¨ª¨¡
1470    !¡¡¡¡¨¢
1480    !¡¡¡¡¢á¥¢¡¼¥¹
1490
1500    LET GND=1 !¥¢¡¼¥¹
1510    LET Vi=2 !ÆþÎÏü»Ò
1520    LET Vo=5 !½ÐÎÏü»Ò
1530
1540    !ÁÇ»Ò: Rn,Cn,Ln,Vn,In¡¢n:ÈÖ¹æ¡ÊÏ¢ÈÖ¡Ë¡¡¢¨£²Ê¸»úÌܰʹߤÏÈÖ¹æ
1550    !ÃÍ:
1560    !ü»ÒÈÖ¹æ¡Êµ¯ÅÀ¡Ë: £±°Ê¾å¤ÎÃÍ¡¡¢¨ÀáÅÀ
1570    !ü»ÒÈÖ¹æ: £±°Ê¾å¤ÎÃÍ¡¡¢¨ÀáÅÀ
1580
1590    CALL AddElements("R1",5.1e3,2,3) !5.1k[¦¸]¡¢»ÞÏ©ÅÅή¤Ï2¢ª3¤È²¾Äꤹ¤ë
1600    CALL AddElements("C1",F2Ohm(0.022e-6),3,5) !0.022[¦ÌF]
1610    CALL AddElements("R2",20e3,3,1) !20k[¦¸]
1620    CALL AddElements("C2",F2Ohm(0.033e-6),3,4) !0.033[¦ÌF]
1630    CALL AddElements("R3",8.2e3,4,5) !8.2k[¦¸]
1640    !
1650
1660    !¢¨ÅÅ°µ¸»¤ÎÈÖ¹æ¤Ï£±¤«¤é¤ÎÏ¢ÈÖ¡¡Îã. CALL AddElements("V1",?,?,?) !?[V]
1670    !¤Ê¤·
1680
1690    CALL AddElements("A1",-1.0,4,5) !¥¢¥ó¥×¡¡ÁýÉýΨ-1.0,¡Ýü»Ò4,½ÐÎÏü»Ò5
1700
1710    !---------- ¢¬¢¬¢¬¢¬¢¬ ----------
1720
1730    CALL AddElements("Vi",10,GND,Vi) !10[V]¡¡¢¨Â¬ÄêÍѤÎÅÅ°µ
1740 END SUB
1750
1760 !---------- ¢­¢­¢­¢­¢­ ----------
1770 LET Ns=0 !ÅÅ°µ¸»¤Î¿ô
1780 LET Nd=5 !ÀáÅÀ¤Î¿ô
1790 LET Na=1 !¥¢¥ó¥×¤Î¿ô
1800 !---------- ¢¬¢¬¢¬¢¬¢¬ ----------
1810

Ä̾¤³¤Î²Õ½ê¤òÊѹ¹¤·¤Þ¤¹¡£

ÆäËÉéµ¢´Ô¤Î¾ì¹ç¤Ï·«¤êÊÖ¤·¤Ï£±²ó¤Î¤ß¤Ç¤è¤¤¤ß¤¿¤¤¤Ç¤¹¡£
2710    IF Na>0 THEN !¥¢¥ó¥×¤¬¤¢¤ì¤Ð
2720       FOR iter=1 TO 1 !°ÂÄꤵ¤»¤ë¡¡¢¨Í×Ä´À°¡¡¡¡<---------- ¤³¤³
2730          FOR i=1 TO Na
2740             LET b(AmpOut(i))=AmpK(i)*x(AmpPlus(i)) !Vo=K*V+¡¡¢¨ÆþÎϤò½ÐÎϤËÈ¿±Ç¤µ¤»¤ë
2750          NEXT i
2760          MAT x=Ai*b
2770       NEXT iter
2780    END IF


¤Ê¤ª¡¢¥µ¥Ö¥ë¡¼¥Á¥óset_circuit¤Î¥¹¥Ú¥ë¤¬°ã¤Ã¤Æ¤¤¤Þ¤·¤¿¡£ÄûÀµ¤·¤Þ¤¹¡£
 

ÀáÅÀ²òÀÏË¡¤Ë¤Ä¤¤¤Æ¡¡¡Ê£²¡Ë

 Åê¹Æ¼Ô¡§Âç·§¡¡Àµ  Åê¹ÆÆü¡§2009ǯ 2·î 7Æü(ÅÚ)11»þ32ʬ28ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ÇòÀÐÍÍ¡¡»³ÃæÍÍ¡¡¤¤¤Ä¤â¸æ»ØƳ¤ò夭ͭÆñ¤¦¤´¤¶¤¤¤Þ¤¹¡£Âç·§¤Ç¤¹¡£

²¼µ­¤Î¤´¤È¤­¥×¥í¥°¥é¥à¤òºî¤ê¡¢»³ÃæÍͤβóÅú¤òÊ̲ò¤Ç¤Ê¤¾¤Ã¤Æ¤ß¤Þ¤·¤¿¡£
Åú¤¨¤Ï°ìÃפ·¤Æ¤¤¤ë¤È»×¤Ã¤Æ¤Þ¤¹¡£
10¿ÊBASIC¤Ï¡¢¥Þ¥È¥ê¥¯¥¹¤ÈÊ£ÁÇ¿ô¤Î·×»»¤¬´Êñ¤Ë½ÐÍè¡¢½é³Ø½¤¼Ô¤Ë¤Ï¤È¤Æ¤â
ÊØÍø¤À¤È¸À¤¦¤³¤È¤ò¼Â´¶¤·¤Æ¤¤¤Þ¤¹¡£

·É¶ñ


10 OPTION ARITHMETIC COMPLEX
   LET j=SQR(-1)
   OPTION BASE 1
   OPTION ANGLE DEGREES

   DIM FREQ(100,5)
   LET FREQ(1,1)=10
   LET FREQ(2,1)=12.25
   LET FREQ(3,1)=15
   LET FREQ(4,1)=17.32
   LET FREQ(5,1)=20
   LET FREQ(6,1)=24.5
   LET FREQ(7,1)=30
   LET FREQ(8,1)=34.6
   LET FREQ(9,1)=40
   LET FREQ(10,1)=50
   LET FREQ(11,1)=60
   LET FREQ(12,1)=70
   LET FREQ(13,1)=80
   LET FREQ(14,1)=90

   FOR I=1 TO 14
      LET P=I
      LET FREQ(I,1)=FREQ(P,1)
   NEXT I
   FOR I=15 TO 28
      LET P=I-14
      LET FREQ(I,1)=FREQ(P,1)*10
   NEXT I
   FOR I=29 TO 42
      LET P=I-28
      LET FREQ(I,1)=FREQ(P,1)*100
   NEXT I
   FOR I=43 TO 56
      LET P=I-42
      LET FREQ(I,1)=FREQ(P,1)*1000
   NEXT I
   LET FREQ(57,1)=100000

   ! FOR I=1 TO 57
   !    PRINT "FREQ(";I;",1)=";FREQ(I,1)
   ! NEXT I


   !                             ¨£¨¡C2¨¡¨¨¨¡¨¡¨¡¨¡¨¡¨¡¨¤ ¡ÖÃí°Õ¡×
   !                             ¨¢      ¨¢  ¨£¨¡¨¡¨¤  ¨¢   »³Ã椵¤ó¤Î²óÏ©¤È1ÈÖ
   !                             ¨¢      ¨¦¨¡¨©-   ¨¢  ¨¢  Ã¼»ÒÈֹ椬
   !                             ¨¢          ¨¢  £Ë¨§¨¡­¥¨¡ ¾®¤µ¤¯¤Ê¤Ã¤Æ¤Þ¤¹¡£
   !         ¨£¨¡­¡¨¡R1¨¡­¢¨¡R2¨¡­£¨¡R3¨¡­¤¨¡¨©+   ¨¢  ¢¬ V5
   !         ¢¬  ¢¬V1    ¢¬V2    ¢¬V3    ¢¬V4¨¦¨¡¨¡¨¥  ¨¢
   !         Is  Rs      C1              C3            ¨¢
   !         ¢¬  ¨¢      ¨¢              ¨¢            ¨¢
   !         ¨ª¨¡£°¨¡¨¡¨¡¨ª¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨ª¨¡¨¡¨¡¨¡¨¡¨¡¨ª¨¡
   !             ¨¢
   !             ¢á¥¢¡¼¥¹
   !    GND=0 !¥¢¡¼¥¹
   !    V1=1V !ÆþÎÏü»Ò­¡ Rs=0.1¥ª¡¼¥à¤ËÄêÅÅή¸»Is ¤«¤é10Aή¤·¤Æ1V¤È¤¹¤ë¡£
   !    V5=­¥ !½ÐÎÏü»Ò­¥ V5=K*V4

20 ! CR 3ÃʲóÏ©
   LET FF=1000             !F¤Îñ°Ì¤Ï¥Ø¥ë¥Ä
   LET R1=51000            !R¤Îñ°Ì¤Ï¥ª¡¼¥à
   LET R2=82000
   LET R3=39000
   LET C1=0.00685/(10^6)   !C¤Îñ°Ì¤ÏuF,
   LET C2=0.022/(10^6)     !C¤Îñ°Ì¤ÏuF,
   LET C3=330/(10^12)      !C¤Îñ°Ì¤ÏPF,

   LET Y1=(2*PI*FF*C1)     !Y¤Îñ°Ì¤Ï¥â¡¼
   LET Y2=(2*PI*FF*C2)
   LET Y3=(2*PI*FF*C3)

   LET ¦Ø=(2*PI*FF)
   LET Rs=0.1    !Rs¤Îñ°Ì¤Ï¥ª¡¼¥à      ­¡¤È¥¢¡¼¥¹¤ËÆþ¤ì¤ë¡£
   LET IS=10     !Is¤Îñ°Ì¤Ï¥¢¥à¥Ú¥¢  Rs¤Ë²Ã¤ï¤ëÅÅή¸»¤Ç­¡¤È¥¢¡¼¥¹¤ò1V¤Ë¤¹¤ë¡£

   LET NP=4
   DIM A(NP,NP)
   DIM T(NP,NP)

   DIM EOUT(NP,1)
   DIM B(NP,1)
   LET K=1

   !*********** ¥Ç¡¼¥¿¡¼¤È·×»»ÊýË¡*****************
   !ÊýË¡-1
   !  ¥ß¥ë¥Þ¥ó¤ÎÄêÍý¤ä¥­¥ë¥Ò¥Û¥Ã¥Õ¤Îˡ§¤Ê¤¾¤ò¿ÍÑ¡¢Ä¾Àܲò¤¯¡£

   !ÊýË¡-2
   !  ²óÏ©¤Î­¡Ã¼»Ò¤È¥¢¡¼¥¹´Ö¤Ë0.1¥ª¡¼¥à¤ÎÄñ¹³¡¢¥¢¥É¥ß¥Ã¥¿¥ó¥¹Gs¤ò¤ï¤¶¤È¤Ä¤±¤ë¡£
   !  ÅÅή¸» 10A ¤òÆþÎϤˤ·¤Æ­¡Ã¼»Ò¤È¥¢¡¼¥¹´Ö¤Î¡ÊGs¡Ë¤Ë²Ã¤¨¤Æ V1¤òÌó  1V¤È¤¹¤ë¡£
   !  °Ê²¼¤Ï¡¢ÁÛÄê¤Î²óÏ©¤Ë¤Ä¤Ê¤²¡¢Ã¼»Ò´Ö¤Î¥¢¥É¥ß¥Ã¥¿¥ó¥¹¤ò¹Í¤¨ÀáÅÀÊýÄø¼°¤òºî¤ë¡£
   !  ­¡¡¼­¢¤ËR1,­¢¡¼­£¤ËR2,­¢¡¼¥¢¡¼¥¹¤ËÍÆÎÌC1,­£¡¼­¤¤ËR3,­¤¡¼¥¢¡¼¥¹¤ËÍÆÎÌC3
   !  C3¤ÎÅÅ°µV4¤òÁýÉý´ï¤ËÆþÎÏ¡£­¥¤Ë¤ÏV5=K*V4¤ÎÅÅ°µ¤¬¤Ç¤ë¡£
   !  ­£¤ËÁýÉý´ï¤Î½ÐÎÏV5¤ò¡¢­¥¤«¤éÍÆÎÌC2¤Ç ­£¤ËÀµµ¢´Ô,¡¦¡¦¡¦ V5=K*V4
   !  ­¢Ã¼»Ò¤ÎÅÅ°µ¤òV2,­£Ã¼»Ò¤ÎÅÅ°µ¤òV3,­¤Ã¼»Ò¤ÎÅÅ°µ¤òV4,­¥Ã¼»Ò¤ÎÅÅ°µ¤òV5
   !  Áí¤Æ¥¢¥É¥ß¥Ã¥¿¥ó¥¹¤Ç·×»»¡£
   !  ­¡­¡,­¢­¢,­£­£,­¤­¤Åù Gij(i=j)¤Ï¤½¤ÎÀáÅÀ¤ËÀܳ¤µ¤ì¤ë¥¢¥É¥ß¥Ã¥¿¥ó¥¹¤ÎÏÂ
   !  ­¡-­¢, ­¢-­£ Åù Gij(i?j)¤ÏÀܳ¤µ¤ì¤Æ¤ë¥¢¥É¥ß¥Ã¥¿¥ó¥¹¤Ë-1¤ò³Ý¤±¤ÆÂåÆþ¡£
   !  Amp¤ò½ü¤­¡¢Í×ÁǤΤߤò¹Í¤¨¤ë¤ÈÂоιÔÎó¤Ë¤Ê¤ê,¥Î¡¼¥É¤Î¿ô¤¬¹ÔÎó¤ÎÂ礭¤µ¡£
   !  ¹ÔÎó¤Ï 5x5 ¤À¤¬ V5=K*V4 ¤ò¹Í¤¨A(3,4)=-(1/R3)¤Ë A(3,5)=-¦Ø*C2*j¤ò²Ã¤¨¤ë
   !  K¤Ï A(3,4)=-(1/R3)-K*¦Ø*C2*jÁýÉý´ï¤Î½ÐÎÏ E5=K*E4¤Î´Ø·¸¤òÆþ¤ìA(3,5)¤ò¾Ã¤¹
   !  °ìÊý  A(4,3)=-(1/R3) ¤È¤·ÈóÂоΤȤ·¤¿¡£A(4,3)¡áA(3,4)¤Ç¤ÏÉÔ¶ñ¹ç¤Ç¤¢¤Ã¤¿
   !  ºÇ½ª¤Î¹ÔÎó¤Ï  4x4 ¤ÎÈóÂоΤËÀ®¤ë¤¬¡¢K¤¬Ä¾ÀÜ»ØÄê¤Ç¤­¤ëÍøÅÀ¤¬¤¢¤ë¤è¤¦¤À¡£
   !  ·ë²Ì¤ÏK¤ÎÃͤËÉÒ´¶¤Ç K=0.9875¡Á1.0125¤Þ¤Ç¤Ç¡¢K=1 ¤¬ºÇŬ¡£K= 1.0125¤Ç¥Ô¡¼¥¯


   !ÊýË¡-3
   !ʸ¸¥¤äÅê¹Æ¤ò»²¾È

   !***********************ÊýË¡-2¤Î·×»»  º£²ó¤Ï¤³¤ì¤ÇÄ©Àï*****************

   FOR K=0.9875 TO 1.0125 STEP 0.0125       !K¤ÏAMP¤Î¥²¥¤¥ó¡£
      FOR P=1 TO 57
         LET FF=FREQ(P,1)
         LET ¦Ø=(2*PI*FF)

         LET A(1,1)=(1/Rs)+(1/R1)           !­¡­¡Ã¼»Ò¤Î¥¢¥É¥ß¥¿¥ó¥¹¤Î¹ç·×
         LET A(1,2)=-(1/R1)                 !­¡­¢Ã¼»Ò¤Î¥¢¥É¥ß¥¿¥ó¥¹¤Î -1

         LET A(1,3)=0
         LET A(1,4)=0

         LET A(2,1)=-(1/R1)
         LET A(2,2)=(1/R1)+(1/R2)+¦Ø*C1*j  !­¢­¢Ã¼»Ò¤Î¥¢¥É¥ß¥¿¥ó¥¹¤Î¹ç·×
         LET A(2,3)=-(1/R2)
         LET A(2,4)=0

         LET A(3,1)=0
         LET A(3,2)=-(1/R2)
         LET A(3,3)=(1/R2)+(1/R3)+¦Ø*C2*j  !­£­£Ã¼»Ò¤Î¥¢¥É¥ß¥¿¥ó¥¹¤Î¹ç·×
         LET A(3,4)=-(1/R3)-K*¦Ø*C2*j   !¤³¤³¤ËK¤ÎÃͤòÆþ¤ì V5=K*V4 ¤òÈ¿±Ç¡£
         !¥ß¥ë¥Þ¥ó¤ÎÄêÍý¤òŬÍÑ¡£
         LET A(4,1)=0
         LET A(4,2)=0
         LET A(4,3)=-(1/R3)                !A(3,4)¤È¤ÏÃͤ¬°Û¤Ê¤ë¡£
         LET A(4,4)=(1/R3)+¦Ø*C3*j         !­¤­¤Ã¼»Ò¤Î¥¢¥É¥ß¥¿¥ó¥¹¤Î¹ç·×

         LET B(1,1)=10   ! ÅÅή¸»¤«¤é10A¤òή¤·¤Æ¤¤¤ë¡£­¡Ã¼»Ò¤Ï1V¤Ë¤Ê¤ë¡£
         LET B(2,1)=0    ! ¥­¥ë¥Ò¥Û¥Ã¥Õ¤Îˡ§¤«¤é  ¥¼¥í¤Ç¤¢¤ë¡£
         LET B(3,1)=0    ! ¥­¥ë¥Ò¥Û¥Ã¥Õ¤Îˡ§¤«¤é  ¥¼¥í¤Ç¤¢¤ë¡£
         LET B(4,1)=0    ! ¥­¥ë¥Ò¥Û¥Ã¥Õ¤Îˡ§¤«¤é  ¥¼¥í¤Ç¤¢¤ë¡£
         MAT T=INV(A)
         MAT EOUT=T*B
         ! PRINT "FF=";FF
         ! MAT PRINT EOUT
         LET EE1=EOUT(1,1)
         LET EE2=EOUT(2,1)
         LET EE3=EOUT(3,1)
         LET EE4=EOUT(4,1)
         LET EE5=K*EOUT(4,1)
         PRINT
         LET FREQ(P,2)=20*LOG10(ABS(EE5))
         ! LET FREQ(P,3)=20*LOG10(ABS(EE3))
         LET  G5=(ATN(IM(EE5)/RE(EE5)))
         IF FF>750 THEN LET G5=G5-180
         IF G5>0 THEN LET G5=G5-180
         LET  FREQ(P,4)=G5
         ! LET  G3=(ATN(IM(EE3)/RE(EE3)))
         ! IF FF>750 THEN LET G3=G3-180
         ! LET  FREQ(P,5)=G3
      NEXT P
      PRINT "K=";K
      PRINT "Èֹ栠 ¼þÇÈ ¿ô      E5         E3         ¦È5         ¦È3"
      FOR I=1 TO 57
         PRINT USING "###": I;
         PRINT USING " ###,###.#"  : FREQ(I,1);
         PRINT USING " ####.### dB": FREQ(I,2);
         PRINT USING " ####.### dB": FREQ(I,3);
         PRINT USING " ####.### ÅÙ": FREQ(I,4);
         PRINT USING " ####.### ÅÙ": FREQ(I,5)
      NEXT I

      !¤³¤³¤«¤é¤Ï¡¢»³ÃæÍͤΥ°¥é¥Õ¥×¥í¥°¥é¥à¤ò»²¾È¡£
      SET WINDOW 0.5,5.5, -55,5      !ɽ¼¨Îΰè
      DRAW grid(1,5)                  ! º¸Ã¼¤ÎÌÜÀ¹¤ê
      FOR f=1 TO 6   !£ø¼´¤¬ÂпôÌÜÀ¹ f=1 TO 5 ¤Ç100k ¤Þ¤ÇÌÜÀ¹¤ë¡£
         SET COLOR 1 !£±¤Ï¹õ¿§
  PLOT TEXT ,AT f-0.1,+0.15: mid$("10  100 1k  10k 100k ",4*(f-1)+1,4)
      NEXT f

      FOR f=1 TO 6   !y¼´¤¬Ä¾ÀþÌÜÀ¹¤ê
         SET COLOR 1 !£±¤Ï¹õ¿§
  PLOT TEXT ,AT 0.8,-10*(f-1)-2: mid$("  0 -25 -50 -75 -100-125 ",4*(f-1)+1,4)
      NEXT f

      FOR I=1 TO 57 STEP 1 !¼þÇÈ¿ô[Hz]
         SET COLOR 1
     PLOT LINES:LOG10(FREQ(I,1)) ,FREQ(I,2)/2.5; !ÍøÆÀ[dB]
      NEXT I
      PLOT LINES

      !  FOR I=1 TO 57 STEP 1 !¼þÇÈ¿ô[Hz]
      !     SET COLOR 5    !5¤Ï¿å¿§
      !     PLOT LINES: LOG10(FREQ(I,1)) ,FREQ(I,3)/2; !ÍøÆÀ[dB]
      !  NEXT I
      !  PLOT LINES

      FOR I=1 TO 57 STEP 1 !°ÌÁê³ÑÅÙ[ÅÙ]
         SET COLOR 4  !4¤ÏÀÖ¿§
         PLOT LINES:LOG10(FREQ(I,1)) ,0.125*FREQ(I,4); !³ÑÅÙ[ÅÙ]
      NEXT I
      PLOT LINES

      !  FOR I=1 TO 57 STEP 1 !°ÌÁê³ÑÅÙ[ÅÙ]
      !     SET COLOR 3   !3¤ÏÎп§
      !     PLOT LINES:LOG10(FREQ(I,1)) ,0.25*FREQ(I,5); !³ÑÅÙ[ÅÙ]
      !  NEXT I
      !  PLOT LINES
      FOR f=1 TO 6     !y¼´¤¬Ä¾ÀþÌÜÀ¹¤ê
         SET COLOR 4
   PLOT TEXT ,AT 5.1,-10*(f-1)-2: mid$(" 0  -80 -160-240-320-400 ",4*(f-1)+1,4)
      NEXT f
      PRINT

   NEXT K   ! ¤³¤³¤Ç,ÍøÆÀ K¤òÊѲ½¤µ¤»¤ë¡£

   !*******************************************************************
   !100 LET FF=1000
   !    PRINT 1/R1
   !    PRINT 1/R2
   !    PRINT 1/R3
   !    PRINT  Y1
   !    PRINT  Y2
   !    PRINT  Y3
   !   FOR I=1 TO NP      ! ÇòÀÐÍͤθæ½õ¸À¤ò»²¾È¡£¥Þ¥È¥ê¥¯¥¹¤Î¥Á¥§¥Ã¥¯¤ò¤·¤¿¡£
   !      FOR J=1 TO NP
   !         LET Z=A(I,J)
   !         PRINT USING "(##.######### ":RE(Z);
   !         PRINT USING "##.#########)  ":IM(Z);
   !      NEXT J
   !      PRINT
   !   NEXT I
   !**********************************************************************

END
 

ÀáÅÀ²òÀÏË¡¤Ë¤Ä¤¤¤Æ¡¡¡Ê£³¡Ë

 Åê¹Æ¼Ô¡§Âç·§¡¡Àµ  Åê¹ÆÆü¡§2009ǯ 2·î 9Æü(·î)12»þ12ʬ3ÉÃ
ÊÖ¿®¡¦°úÍÑ
  Âç·§¤Ç¤¹¡£
Á°²óÅê¹Æ¤·¤¿¤Î¤Ç¤¹¤¬¡¢£´£Ø£´¹ÔÎó¤¬ÂоΤǤʤ¤¤Î¤¬µ¤¤Ë¿©¤ï¤º¡¢
£µx£µ¤Ë¤·¡¢¤½¤Î¤¦¤Á£´£Ø£´¤ÏÂоΤǡ¢£µ¹ÔÌܤ˰ì³ç¤·¤ÆÁýÉý´ï
¤ÎÁýÉýÅ٣ˤδط¸¤òÆþ¤ì¤ë¤è¤¦¤Ë²þÎɤ·¤Þ¤·¤¿¡£
¤³¤Î¤è¤¦¤Ë¤¹¤ì¤Ð¡¢ÆþÎϥߥ¹¤¬¾¯¤Ê¤¯¡¢¸å¤Ï¥Þ¥È¥ê¥¯¥¹¤¬¼«Æ°¤Ç
Åú¤¨¤ò½Ð¤·¤Æ¤¯¤ì¤ë¡¦¡¦¡¦¡©¡©¡£

·É¶ñ¡£

10 OPTION ARITHMETIC COMPLEX
   LET j=SQR(-1)
   OPTION BASE 1
   OPTION ANGLE DEGREES

   DIM FREQ(100,5)
   LET FREQ(1,1)=10
   LET FREQ(2,1)=12.25
   LET FREQ(3,1)=15
   LET FREQ(4,1)=17.32
   LET FREQ(5,1)=20
   LET FREQ(6,1)=24.5
   LET FREQ(7,1)=30
   LET FREQ(8,1)=34.6
   LET FREQ(9,1)=40
   LET FREQ(10,1)=50
   LET FREQ(11,1)=60
   LET FREQ(12,1)=70
   LET FREQ(13,1)=80
   LET FREQ(14,1)=90

   FOR I=1 TO 14
      LET P=I
      LET FREQ(I,1)=FREQ(P,1)
   NEXT I
   FOR I=15 TO 28
      LET P=I-14
      LET FREQ(I,1)=FREQ(P,1)*10
   NEXT I
   FOR I=29 TO 42
      LET P=I-28
      LET FREQ(I,1)=FREQ(P,1)*100
   NEXT I
   FOR I=43 TO 56
      LET P=I-42
      LET FREQ(I,1)=FREQ(P,1)*1000
   NEXT I
   LET FREQ(57,1)=100000

   ! FOR I=1 TO 57
   !    PRINT "FREQ(";I;",1)=";FREQ(I,1)
   ! NEXT I


   !                             ¨£¨¡C2¨¡¨¨¨¡¨¡¨¡¨¡¨¡¨¡¨¤ ¡ÖÃí°Õ¡×
   !                             ¨¢      ¨¢  ¨£¨¡¨¡¨¤  ¨¢   »³Ã椵¤ó¤Î²óÏ©¤È
   !                             ¨¢      ¨¦¨¡¨©-   ¨¢  ¨¢  1ÈÖü»ÒÈֹ椬
   !                             ¨¢          ¨¢  £Ë¨§¨¡­¥¨¡ ¾®¤µ¤¤¡£
   !         ¨£¨¡­¡¨¡R1¨¡­¢¨¡R2¨¡­£¨¡R3¨¡­¤¨¡¨©+   ¨¢  ¢¬ V5
   !         ¢¬  ¢¬V1    ¢¬V2    ¢¬V3    ¢¬V4¨¦¨¡¨¡¨¥  ¨¢
   !         Is  Rs      C1              C3            ¨¢
   !         ¢¬  ¨¢      ¨¢              ¨¢            ¨¢
   !         ¨ª¨¡£°¨¡¨¡¨¡¨ª¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨ª¨¡¨¡¨¡¨¡¨¡¨¡¨ª¨¡
   !             ¨¢
   !             ¢á¥¢¡¼¥¹
   !    GND=0 !¥¢¡¼¥¹
   !    V1=1V !ÆþÎÏü»Ò­¡ Rs=0.1¥ª¡¼¥à¤ËÄêÅÅή¸»Is ¤«¤é10Aή¤·¤Æ1V¡£
   !    V5=­¥ !½ÐÎÏü»Ò­¥ V5=K*V4

20 ! CR 3ÃʲóÏ©
   LET FF=1000             !F¤Îñ°Ì¤Ï¥Ø¥ë¥Ä
   LET R1=51000            !R¤Îñ°Ì¤Ï¥ª¡¼¥à
   LET R2=82000
   LET R3=39000
   LET C1=0.00685/(10^6)   !C¤Îñ°Ì¤ÏuF,
   LET C2=0.022/(10^6)     !C¤Îñ°Ì¤ÏuF,
   LET C3=330/(10^12)      !C¤Îñ°Ì¤ÏPF,

   LET Y1=(2*PI*FF*C1)     !Y¤Îñ°Ì¤Ï¥â¡¼
   LET Y2=(2*PI*FF*C2)
   LET Y3=(2*PI*FF*C3)

   LET ¦Ø=(2*PI*FF)
   LET Rs=0.1    !Rs¤Îñ°Ì¤Ï¥ª¡¼¥à      ­¡¤È¥¢¡¼¥¹¤ËÆþ¤ì¤ë¡£
   LET IS=10     !Is¤Îñ°Ì¤Ï¥¢¥à¥Ú¥¢  Rs¤ò1V¤Ë¤¹¤ë¡£

   LET NP=5
   DIM A(NP,NP)
   DIM T(NP,NP)

   DIM EOUT(NP,1)
   DIM B(NP,1)
   LET K=1

   !*********** ¥Ç¡¼¥¿¡¼¤È·×»»ÊýË¡*****************
   !ÊýË¡-1
   !  ¥ß¥ë¥Þ¥ó¤ÎÄêÍý¤ä¥­¥ë¥Ò¥Û¥Ã¥Õ¤Îˡ§¤Ê¤¾¤ò¿ÍÑ¡¢Ä¾Àܲò¤¯¡£

   !ÊýË¡-2£Â
   !  ²óÏ©¤Î­¡Ã¼»Ò¤È¥¢¡¼¥¹´Ö¤Ë0.1¥ª¡¼¥à¤ÎÄñ¹³¡¢¥¢¥É¥ß¥Ã¥¿¥ó¥¹Gs¤ò¤È¤Ä¤±¤ë¡£
   !  ÅÅή¸» 10A ¤òÆþÎϤˤ·¤Æ­¡Ã¼»Ò¤È¥¢¡¼¥¹´Ö¤Î¡ÊGs¡Ë¤Ë²Ã¤¨¤Æ V1¤òÌó  1V¡£
   !  °Ê²¼¤Ï¡¢ÁÛÄê¤Î²óÏ©¤Ë¤Ä¤Ê¤²¡¢Ã¼»Ò´Ö¤Î¥¢¥É¥ß¥Ã¥¿¥ó¥¹¤ò¹Í¤¨ÀáÅÀÊýÄø¼°¡£
   !  ­¡¡¼­¢¤ËR1,­¢¡¼­£¤ËR2,­¢¡¼¥¢¡¼¥¹¤ËÍÆÎÌC1,­£¡¼­¤¤ËR3,­¤¡¼¥¢¡¼¥¹¤ËÍÆÎÌ
   !  C3¡¢C3¤ÎÅÅ°µV4¤òÁýÉý´ï¤ËÆþÎÏ¡£­¥¤Ë¤ÏV5=K*V4¤ÎÅÅ°µ¤¬¤Ç¤ë¡£
   !  ­£¤ËÁýÉý´ï¤Î½ÐÎÏV5¤ò¡¢­¥¤«¤éÍÆÎÌC2¤Ç ­£¤ËÀµµ¢´Ô,¡¦¡¦¡¦ V5=K*V4
   !  ­¢Ã¼»Ò¤ÎÅÅ°µ¤òV2,­£Ã¼»Ò¤ÎÅÅ°µ¤òV3,­¤Ã¼»Ò¤ÎÅÅ°µ¤òV4,­¥Ã¼»Ò¤ÎÅÅ°µ¤òV5
   !  Áí¤Æ¥¢¥É¥ß¥Ã¥¿¥ó¥¹¤Ç·×»»¡£
   !  ­¡­¡,­¢­¢,­£­£,­¤­¤Åù Gij(i=j)¤Ï¤½¤ÎÀáÅÀ¤ËÀܳ¤µ¤ì¤ë¥¢¥É¥ß¥Ã¥¿¥ó¥¹ÏÂ
   !  ­¡-­¢, ­¢-­£ Åù Gij(i?j)¤ÏÀܳ¤µ¤ì¤Æ¤ë¥¢¥É¥ß¥Ã¥¿¥ó¥¹¤Ë-1¤ò³Ý¤±¤ÆÂåÆþ
   !  Amp¤ò½ü¤­¡¢Í×ÁǤΤߤò¹Í¤¨¤ë¤ÈÂоιÔÎó¤Ë¤Ê¤ê,¥Î¡¼¥É¤Î¿ô¤¬¹ÔÎó¤ÎÂ礭¤µ
   !  ¹ÔÎó¤Ï 5x5 ¤Ç4x4 ¤ÎÉôʬ¤ÏÂоΤËÀ®¤ë¡£ ¤³¤ì¤¬ÍøÅÀ¡£
   !  ¹ÔÎó¤Î 5¹ÔÌÜ¤Ë E5=K*E4¤Î´Ø·¸¤ò¤¤¤ì¤ë¡£¤³¤ì¤¬ÍøÅÀ¡£
   !  K¤Ï A(5,4)=-K   A(5,5)=1   B(5,1)=0  ¤ÇÁýÉý´ï¤Î½ÐÎϤò´Ø·¸ÉÕ¤±¤ë¡£
   !  ºÇ½ª¤Î¹ÔÎó¤Ï  5x5 ¤ÎÈóÂоΤËÀ®¤ë¤¬¡¢K¤¬Ä¾ÀÜ»ØÄê¤Ç¤­¤ëÍøÅÀ¤¬¤¢¤ë¤è¤¦¤À
   !  ·ë²Ì¤ÏK¤ÎÃͤËÉÒ´¶¤Ç K=0.9875¡Á1.0125¤Þ¤Ç¤Ç¡¢K=1 ¤¬ºÇŬ¡£


   !ÊýË¡-3
   !ʸ¸¥¤äÅê¹Æ¤ò»²¾È

   !***********************ÊýË¡-2£Â¤Î·×»»  º£²ó¤Ï¤³¤ì¤ÇÄ©Àï*****************

   FOR K=0.9875 TO 1.0125 STEP 0.0125       !K¤ÏAMP¤Î¥²¥¤¥ó¡£
      FOR P=1 TO 57
         LET FF=FREQ(P,1)
         LET ¦Ø=(2*PI*FF)

         LET A(1,1)=(1/Rs)+(1/R1)       !­¡­¡Ã¼»Ò¤Î¥¢¥É¥ß¥¿¥ó¥¹¤Î¹ç·×
         LET A(1,2)=-(1/R1)             !­¡­¢Ã¼»Ò¤Î¥¢¥É¥ß¥¿¥ó¥¹¤Î -1
         LET A(1,3)=0
         LET A(1,4)=0
         LET A(1,5)=0

         LET A(2,1)=-(1/R1)
         LET A(2,2)=(1/R1)+(1/R2)+¦Ø*C1*j  !­¢­¢Ã¼»Ò¤Î¥¢¥É¥ß¥¿¥ó¥¹¤Î¹ç·×
         LET A(2,3)=-(1/R2)
         LET A(2,4)=0
         LET A(2,5)=0

         LET A(3,1)=0
         LET A(3,2)=-(1/R2)
         LET A(3,3)=(1/R2)+(1/R3)+¦Ø*C2*j!­£­£Ã¼»Ò¤Î¥¢¥É¥ß¥¿¥ó¥¹¤Î¹ç·×
         LET A(3,4)=-(1/R3)   !A(4,3)¤ÈÃͤ¬Æ±¤¸¤¯¤·ÂоιÔÎó¤Ë¤¹¤ë¡£
         LET A(3,5)=-¦Ø*C2*j

         LET A(4,1)=0
         LET A(4,2)=0
         LET A(4,3)=-(1/R3)  !A(3,4)¤ÈÃͤ¬Æ±¤¸¤¯¤·ÂоιÔÎó¤Ë¤¹¤ë¡£
         LET A(4,4)=(1/R3)+¦Ø*C3*j !­¤­¤Ã¼»Ò¤Î¥¢¥É¥ß¥¿¥ó¥¹¤Î¹ç·×
         LET A(4,5)=0

         LET A(5,1)=0
         LET A(5,2)=0
         LET A(5,3)=0
         LET A(5,4)=-K   ! ¤³¤³¤ËK¤ÎÃͤòÆþ¤ì V5=K*V4 ¤òÈ¿±Ç¡£
         LET A(5,5)=1    ! ¤³¤³¤Ë1¤ÎÃͤòÆþ¤ì V5=K*V4 ¤òÈ¿±Ç¡£

         LET B(1,1)=10   ! ÅÅή¸»¤«¤é10A¤òή¤¹¡£­¡Ã¼»Ò¤Ï1V¡£
         LET B(2,1)=0    ! ¥­¥ë¥Ò¥Û¥Ã¥Õ¤Îˡ§¤«¤é  ¥¼¥í¤Ç¤¢¤ë¡£
         LET B(3,1)=0    ! ¥­¥ë¥Ò¥Û¥Ã¥Õ¤Îˡ§¤«¤é  ¥¼¥í¤Ç¤¢¤ë¡£
         LET B(4,1)=0    ! ¥­¥ë¥Ò¥Û¥Ã¥Õ¤Îˡ§¤«¤é  ¥¼¥í¤Ç¤¢¤ë¡£
         LET B(5,1)=0    ! ¤³¤³¤Ë0¤ÎÃͤòÆþ¤ì V5=K*V4 ¤òÈ¿±Ç¡£
         MAT T=INV(A)
         MAT EOUT=T*B
         ! PRINT "FF=";FF
         ! MAT PRINT EOUT
         LET EE1=EOUT(1,1)
         LET EE2=EOUT(2,1)
         LET EE3=EOUT(3,1)
         LET EE4=EOUT(4,1)
         LET EE5=EOUT(5,1)
         PRINT
         LET FREQ(P,2)=20*LOG10(ABS(EE5))
         ! LET FREQ(P,3)=20*LOG10(ABS(EE3))
         LET  G5=(ATN(IM(EE5)/RE(EE5)))
         IF FF>750 THEN LET G5=G5-180
         IF G5>0 THEN LET G5=G5-180
         LET  FREQ(P,4)=G5
         ! LET  G3=(ATN(IM(EE3)/RE(EE3)))
         ! IF FF>750 THEN LET G3=G3-180
         ! LET  FREQ(P,5)=G3
      NEXT P
      PRINT "K=";K
      PRINT "Èֹ栠 ¼þÇÈ ¿ô      E5         E3         ¦È5         ¦È3"
      FOR I=1 TO 57
         PRINT USING "###": I;
         PRINT USING " ###,###.#"  : FREQ(I,1);
         PRINT USING " ####.### dB": FREQ(I,2);
         PRINT USING " ####.### dB": FREQ(I,3);
         PRINT USING " ####.### ÅÙ": FREQ(I,4);
         PRINT USING " ####.### ÅÙ": FREQ(I,5)
      NEXT I

      !¤³¤³¤«¤é¤Ï¡¢»³ÃæÍͤΥ°¥é¥Õ¥×¥í¥°¥é¥à¤ò»²¾È¡£
      SET WINDOW 0.5,5.5, -55,5      !ɽ¼¨Îΰè
      DRAW grid(1,5)                  ! º¸Ã¼¤ÎÌÜÀ¹¤ê
      FOR f=1 TO 6   !£ø¼´¤¬ÂпôÌÜÀ¹ f=1 TO 5 ¤Ç100k ¤Þ¤ÇÌÜÀ¹¤ë¡£
         SET COLOR 1 !£±¤Ï¹õ¿§
   PLOT TEXT ,AT f-0.1,+0.15: mid$("10  100 1k  10k 100k ",4*(f-1)+1,4)
      NEXT f

      FOR f=1 TO 6   !y¼´¤¬Ä¾ÀþÌÜÀ¹¤ê
         SET COLOR 1 !£±¤Ï¹õ¿§
PLOT TEXT ,AT 0.8,-10*(f-1)-2: mid$("  0 -25 -50 -75 -100-125 ",4*(f-1)+1,4)
      NEXT f

      FOR I=1 TO 57 STEP 1 !¼þÇÈ¿ô[Hz]
         SET COLOR 1
         PLOT LINES:LOG10(FREQ(I,1)) ,FREQ(I,2)/2.5; !ÍøÆÀ[dB]
      NEXT I
      PLOT LINES

      !  FOR I=1 TO 57 STEP 1 !¼þÇÈ¿ô[Hz]
      !     SET COLOR 5    !5¤Ï¿å¿§
      !     PLOT LINES: LOG10(FREQ(I,1)) ,FREQ(I,3)/2; !ÍøÆÀ[dB]
      !  NEXT I
      !  PLOT LINES

      FOR I=1 TO 57 STEP 1 !°ÌÁê³ÑÅÙ[ÅÙ]
         SET COLOR 4  !4¤ÏÀÖ¿§
         PLOT LINES:LOG10(FREQ(I,1)) ,0.125*FREQ(I,4); !³ÑÅÙ[ÅÙ]
      NEXT I
      PLOT LINES

      !  FOR I=1 TO 57 STEP 1 !°ÌÁê³ÑÅÙ[ÅÙ]
      !     SET COLOR 3   !3¤ÏÎп§
      !     PLOT LINES:LOG10(FREQ(I,1)) ,0.25*FREQ(I,5); !³ÑÅÙ[ÅÙ]
      !  NEXT I
      !  PLOT LINES
      FOR f=1 TO 6     !y¼´¤¬Ä¾ÀþÌÜÀ¹¤ê
         SET COLOR 4
PLOT TEXT ,AT 5.1,-10*(f-1)-2: mid$(" 0  -80 -160-240-320-400 ",4*(f-1)+1,4)
      NEXT f
      PRINT
    NEXT K   ! ¤³¤³¤Ç,ÍøÆÀ K¤òÊѲ½¤µ¤»¤ë¡£

END
 

¥³¥ó¥Ç¥ó¥µ¤È¡¢Äñ¹³¤À¤±¡©

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 2·î 9Æü(·î)12»þ48ʬ25ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ¤³¤Î²óÏ©¤Ç¡¢700Hz ÉÕ¶á¤Î¡¢Æþ½ÐÎÏÅÅ°µÈæ¤ò¡¢·×»»¤·¤Æ²¼¤µ¤¤¡£
¤­¤Ã¤È¡¢¿®¤¸¤é¤ì¤Ê¤¤¤³¤È¤¬¡¢¸«¤Ä¤«¤ê¤Þ¤¹¡£
 

Re: ¥³¥ó¥Ç¥ó¥µ¤È¡¢Äñ¹³¤À¤±¡©

 Åê¹Æ¼Ô¡§Âç·§¡¡Àµ  Åê¹ÆÆü¡§2009ǯ 2·î10Æü(²Ð)10»þ18ʬ37ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.268[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¤³¤Î²óÏ©¤Ç¡¢700Hz ÉÕ¶á¤Î¡¢Æþ½ÐÎÏÅÅ°µÈæ¤ò¡¢·×»»¤·¤Æ²¼¤µ¤¤¡£
> ¤­¤Ã¤È¡¢¿®¤¸¤é¤ì¤Ê¤¤¤³¤È¤¬¡¢¸«¤Ä¤«¤ê¤Þ¤¹¡£

Âç·§¤Ç¤¹¡£
ºÇ¶á¡¢½¬¤¤³Ð¤¨¤¿ÀáÅÀÊýÄø¼°¤Ç²ò¤¤¤¿¤È¤³¤í¡¢³Î¤«¤Ë
700HzÉÕ¶á¤Ç0.7dB ÄøÅÙ¤ÎÀ¹¤ê¾å¤¬¤ê¤¬¡¢¤æ¤ë¤ä¤«¤Ë
¤¢¤ê¤Þ¤·¤¿¡£
¥Ñ¥Ã¥·¥ÖÁǻҤΤߤǡ¢¥È¥é¥ó¥¹¤ß¤¿¤¤¤ÊÆ°ºî¤ò¤¹¤ë¤Î¤Ï
³Î¤«¤ËÉԻ׵ĤǤ¹¡£

¤½¤³¤Ç¸æ¼ÁÌ䤤¤¿¤·¤Þ¤¹¡£

¡Ê£±¡Ë¤³¤Î²óÏ©¤Ï¡Ö¡©¡©¡©²óÏ©¡×¤È¤·¤Æͭ̾¤Ê²óÏ©¤Ê¤Î¤Ç¤¹¤«¡£
¡Ê£²¡Ë´û¤Ë¡¢¤Ê¤Ë¤«¤ÎÀ½Éʤ˻Ȥï¤ì¤Æ¤ë¤Î¤Ç¤·¤ç¤¦¤«¡£

¤½¤Î¾
¡Ê£±¡Ë10¿ÊBASIC ¤Ç´û¤Ëºî¤é¤ì¤¿²Ê³Øµ»½Ñ¤Î¥½¥Õ¥È¤ò¡¡Åŵ¤¡¢
¡¡¡¡¡¡ÅÚÌÚ¡¢°åÎÅ¡¦¡¦¡¦¡¦¤Ê¤É¤ÈʬÎष¤ÆÅÐÏ¿¤·¤Æ¤¢¤ë
¡¡¡¡¡¡¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤Î¾ì½ê¤Ï¤¢¤ê¤Þ¤»¤ó¤«¡£
¡¡¡¡¡¡LINUX ¤Ç¤½¤¦¤¤¤¦¤Î¤¬¡¢¤¢¤ë»ö¤òºÇ¶áÃΤê¤Þ¤·¤¿¡£
¡¡¡¡¡¡10¿ÊBASIC ¤Ç¤â¤¢¤ì¤Ð¡¢³§¤¬ÂçÁØÊØÍø¤Ë»È¤¤È¯Å¸¤Ë
¡¡¡¡¡¡·Ò¤¬¤ë¤È»×¤¤¤Þ¤¹¡£

·É¶ñ
 

Àë¸À²Äǽ¤ÊÇÛÎó¤ÎÂ礭¤µ¤Î¾å¸Â

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 2·î10Æü(²Ð)11»þ28ʬ54ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.252[¸µµ­»ö¤Ø]

½½¿ÊBASIC¤¬µ­²±Îΰè¤È¤·¤ÆÍѤ¤¤ë¥á¥â¥ê¤ÏÂçÊ̤·¤Æ¥Ò¡¼¥×¤È¥¹¥¿¥Ã¥¯¤Î2¼ïÎब¤¢¤ê¤Þ¤¹¡£
¥¹¥¿¥Ã¥¯¤Ï¡¤¼ê³¤­¤Î¼Â¹Ô¡¦½ªÎ»¤Ë¤·¤¿¤¬¤Ã¤Æ¼«Æ°Åª¤ËÁý¸º¤·¤Þ¤¹¡£
¥Ò¡¼¥×¤Ï¼ê³¤­¤Î¿Ê¹Ô¤ÈÈóƱ´ü¤Ë³ÎÊÝ¡¦²òÊü¤µ¤ì¤Þ¤¹¡£
¥Ø¥ë¥×¤Î¡Ö¸À¸ì»ÈÍѤξܺ١ס½¡ÖÀ©¸Â¡×¤ÎÊǤ˵­ºÜ¤µ¤ì¤Æ¤¤¤ë¡ÖÊÑ¿ô´ÉÍýÍÑ¥á¥â¥ê¡×¤Ï¥¹¥¿¥Ã¥¯¥á¥â¥ê¤Ë³ä¤êÅö¤Æ¤ëÎΰè¤Ç¤¹¡£

½½¿ÊBASIC¤Ï¡¤
LET N=1000
DIM A(N)
¤Î¤è¤¦¤Ê³ÈÄ¥¹½Ê¸¤òµöÍƤ¹¤ë¤¿¤á¡¤ÇÛÎóÍ×ÁǤμÂÎΰè¤ò¥Ò¡¼¥×¾å¤Ë³ÎÊݤ·¤Þ¤¹¡£
DIM B(1000)
¤Î¤è¤¦¤ËFull BASICµ¬³Ê¤ÎÈϰϤÇÀë¸À¤µ¤ì¤¿ÇÛÎó¤Ï¥¹¥¿¥Ã¥¯¥á¥â¥ê¾å¤Ë³ÎÊݤǤ­¤Þ¤¹¤¬¡¤
ÆâÉô¹½Â¤¤ÎÊ£»¨¤µ¤òÈò¤±¤ë¤¿¤á¤Ë¤É¤Á¤é¤Î·Á¼°¤ÎÇÛÎó¤âÇÛÎóÍ×ÁǤϥҡ¼¥×¾å¤ËÃÖ¤¤¤Æ¤¤¤Þ¤¹¡£

ÇÛÎó¤ò¿ÍѤ¹¤ë¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¾ì¹ç¤Ë¤Ï¡¤ÊÑ¿ô´ÉÍýÍÑ¥á¥â¥ê¤ò¾®¤µ¤¯¤È¤Ã¤¿¤Û¤¦¤¬Í­Íø¤Ç¤¹¡£
¤·¤«¤·¡¤¥Ò¡¼¥×¤«¤é1²ó¤Ë¼èÆÀ¤Ç¤­¤ë¥á¥â¥ê¤ÎÂ礭¤µ¤Ë¤ÏOS¡¤³«È¯¸À¸ì¤ª¤è¤Ó¼Â¹Ô´Ä¶­¤ËͳÍ褹¤ëÀ©¸Â¤¬¤¢¤ê¤Þ¤¹¡£
¼ÂÁõ¥á¥â¥ê1GB(¥Ó¥Ç¥ª¥á¥â¥ê¤ò´Þ¤à)¤ÎWindows XPµ¡¤Ç¡¤
BASIC.INI¤Î[FRAME]¥»¥¯¥·¥ç¥ó¤Ë
Virtualmemory=16
¤Îµ­½Ò¤òÄɲ䷤Ƽ¸³¤¹¤ë¤È¡¤
10 OPTION ARITHMETIC NATIVE
20 DIM A(88000000)
30 END
ÄøÅÙ¤¬¸Â³¦¤Ç¡¤¤³¤Î¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¤ÈHDD¤Ø¤Î¥¹¥ï¥Ã¥×¤¬È¯À¸¤·¤Þ¤¹¡£
20¹Ô¤ò A(90000000)¤ËÊѤ¨¤ë¤È¥á¥â¥êÉÔ­¤Î¥¨¥é¡¼¤Ë¤Ê¤ê¤Þ¤¹¡£
2¿Ê¥â¡¼¥É¤Ç¤Ï¿ôÃÍÊÑ¿ô1¸Ä¤Ç8¥Ð¥¤¥ÈÀêÍ­¤¹¤ë¤Î¤Ç¡¤88000000¸Ä¤ÎÊÑ¿ô¤Ï704MB¤ËÁêÅö¤·¤Þ¤¹¡£
¤Ê¤ª¡¤¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¤È¡¤¥Ò¡¼¥×Îΰè¤Î¥á¥â¥ê¤ÎÃÇÊÒ²½¤¬µ¯¤³¤ë¤Î¤Ç¡¤¥×¥í¥°¥é¥à¤Î¼Â¹Ô¤ËÀ®¸ù¤·¤¿¤È¤­Â³¤±¤ÆÍ×ÁÇ¿ô¤òÁý¤ä¤·¤¿¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¤È¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¹â¤¯¤Ê¤ê¤Þ¤¹¡£À®¸ù¤·¤¿¸å¤Î»î¹Ô¤Ï¡¤°ìö¡¤BASIC.EXE¤ò½ªÎ»¡¦ºÆµ¯Æ°¸å¤Ë¹Ô¤¦É¬Íפ¬¤¢¤ê¤Þ¤¹¡£
¤Þ¤¿¡¤¤³¤Î¤³¤È¤Ï¡¤¥×¥í¥°¥é¥à¤Î³«È¯¤Î¤¿¤á¤Ë²¿ÅÙ¤â¥×¥í¥°¥é¥à¤Î¼Â¹Ô¤ò¤¯¤êÊÖ¤¹¤è¤¦¤Ê¾ìÌ̤ˤ⤢¤Æ¤Ï¤Þ¤ê¤Þ¤¹¡£
 

Re: ¥³¥ó¥Ç¥ó¥µ¤È¡¢Äñ¹³¤À¤±¡©

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 2·î10Æü(²Ð)20»þ01ʬ34ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.269[¸µµ­»ö¤Ø]

¡ä¡Ê£±¡Ë¤³¤Î²óÏ©¤Ï¡Ö¡©¡©¡©²óÏ©¡×¤È¤·¤Æͭ̾¤Ê²óÏ©¤Ê¤Î¤Ç¤¹¤«¡£

¡¡¡¡¼Â¤Ï¡¢¤³¤Î¤Þ¤Þ¤Ç¤Ï¡¢¼ÂÍѤˤʤé¤Ê¤¤¤Î¤Ç¤¹¤¬¡¢¤â¤¦£±ÃʤΣãҤòÄɲä·¡¢
¡¡¡¡£Ã£Ò£³ÃÊ·¿¤Î¾º°µ²óÏ©¤Ë¤·¤¿¤â¤Î¤¬¡¢£µ£°Ç¯¤âÂçÀΡÊ1962ǯ°ÊÁ°¡Ë¤Ë¡¢
¡¡¡¡£Ò¡Ý£Ã ¥«¥½¡¼¥É¡¦¥Û¥í¥ïȯ¿¶´ï¡¡ÊƹñÆõö2769088
¡¡¡¡------------------------------------------------------------
¡¡¡¡»²¹Íʸ¸¥¡§¡¡¥¨¥ì¥¯¥È¥í¥Ë¥¯¥¹ ¥¨¥ó¥¸¥Ë¥¢¤Î¤¿¤á¤Î ¥é¥×¥é¥¹ÊÑ´¹
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¥Û¥ë¥Ö¥ë¡¼¥¯Ãø¡¡µÜÏÆ°ìÃË Ìõ¡ÊÄ«ÁÒ½ñŹ¡Ë
¡¡¡¡------------------------------------------------------------
¡¡¡¡£³Ãʰʾå¤Ë¤¹¤ë¤È¡¢£°°ÜÁê¤Ç¤Î¾º°µ¸ú²Ì¤¬ÆÀ¤é¤ì¡¢¥Ü¥ë¥Æ¡¼¥¸¡¦¥Õ¥©¥í¥¢¡¼
¡¡¡¡¤Î¤è¤¦¤Ê¡¢ÅÅ°µÍøÆÀ¡ã£±¡¡¤Î¥Ð¥Ã¥Õ¥¡¡¼¤À¤±¤Ç¡¢½ÐÎÏ¥¤¥ó¥Ô¡¼¥À¥ó¥¹¤ÎÄ㤤
¡¡¡¡È¯¿¶´ï¤¬¡¢ºî¤ì¤Þ¤¹¡£
¡¡¡¡¡¡¡Ê²¼µ­¥Ù¥¯¥È¥ë¿Þ»²¾È¡£Ä¾´¶ÅªÇÄ°®¤Ë¤Ï¡¢¤³¤ÎÊý¤¬²ò¤ê°×¤¤¡£¡Ë

¡ä¡Ê£²¡Ë´û¤Ë¡¢¤Ê¤Ë¤«¤ÎÀ½Éʤ˻Ȥï¤ì¤Æ¤ë¤Î¤Ç¤·¤ç¤¦¤«¡£

¡¡¡¡Ëؤó¤ÉÃΤé¤ì¤Æ¤¤¤Þ¤»¤ó¡£Ä´¤Ù¤Æ¤Ï¤¤¤Þ¤»¤ó¤¬¡¢¤â¤¦»þ¸ú¤À¤È¤â¡¢»×¤¤¤Þ¤¹¡£

¡ä¤½¤Î¾
¡ä¡Ê£±¡Ë10¿ÊBASIC ¤Ç´û¤Ëºî¤é¤ì¤¿²Ê³Øµ»½Ñ¤Î¥½¥Õ¥È¤ò¡¡Åŵ¤¡¢
¡¡¡¡¡¡ÅÚÌÚ¡¢°åÎÅ¡¦¡¦¡¦¡¦¤Ê¤É¤ÈʬÎष¤ÆÅÐÏ¿¤·¤Æ¤¢¤ë
¡¡¡¡¡¡¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤Î¾ì½ê¤Ï¤¢¤ê¤Þ¤»¤ó¤«¡¦¡¦¡¦

¡¡¡¡¤½¤ì¤¬¡¢¤Ç¤­¤ë¤È¤¤¤¤¤Ç¤¹¤Í¡£Ê£ÁÇ¿ô¤â»È¤¨¤Ê¤¤¸æËܲȤè¤ê¤Ï¡¢
¡¡¡¡¡Ö½½¿Ê£Â£Á£Ó£É£Ã¡×¤ÎÊý¤¬¤¤¤¤¤Ç¤¹¡£
 

Re: ¥³¥ó¥Ç¥ó¥µ¤È¡¢Äñ¹³¤À¤±¡©¡Ê£²¡Ë

 Åê¹Æ¼Ô¡§Âç·§¡¡Àµ  Åê¹ÆÆü¡§2009ǯ 2·î12Æü(ÌÚ)14»þ21ʬ48ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.271[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¡ä¡Ê£±¡Ë¤³¤Î²óÏ©¤Ï¡Ö¡©¡©¡©²óÏ©¡×¤È¤·¤Æͭ̾¤Ê²óÏ©¤Ê¤Î¤Ç¤¹¤«¡£
>
> ¡¡¡¡¼Â¤Ï¡¢¤³¤Î¤Þ¤Þ¤Ç¤Ï¡¢¼ÂÍѤˤʤé¤Ê¤¤¤Î¤Ç¤¹¤¬¡¢¤â¤¦£±ÃʤΣãҤòÄɲä·¡¢
> ¡¡¡¡£Ã£Ò£³ÃÊ·¿¤Î¾º°µ²óÏ©¤Ë¤·¤¿¤â¤Î¤¬¡¢£µ£°Ç¯¤âÂçÀΡÊ1962ǯ°ÊÁ°¡Ë¤Ë¡¢
> ¡¡¡¡£Ò¡Ý£Ã ¥«¥½¡¼¥É¡¦¥Û¥í¥ïȯ¿¶´ï¡¡ÊƹñÆõö2769088
> ¡¡¡¡------------------------------------------------------------
> ¡¡¡¡£³Ãʰʾå¤Ë¤¹¤ë¤È¡¢£°°ÜÁê¤Ç¤Î¾º°µ¸ú²Ì¤¬ÆÀ¤é¤ì¡¢¥Ü¥ë¥Æ¡¼¥¸¡¦¥Õ¥©¥í¥¢¡¼
> ¡¡¡¡¤Î¤è¤¦¤Ê¡¢ÅÅ°µÍøÆÀ¡ã£±¡¡¤Î¥Ð¥Ã¥Õ¥¡¡¼¤À¤±¤Ç¡¢½ÐÎÏ¥¤¥ó¥Ô¡¼¥À¥ó¥¹¤ÎÄ㤤
> ¡¡¡¡È¯¿¶´ï¤¬¡¢ºî¤ì¤Þ¤¹¡£
>

Âç·§¡¡¤Ç¤¹¡£
ͦ¤ò¸Ý¤·¤Æ¡¢£³ÃʤËÄ©À路¤Þ¤·¤¿¡£1.225khzÉÕ¶á¤Ç0.9db¤ÎÀ¹¤ê¾å¤¬¤ê¤Ç¤·¤¿¡£
²¿¤«¡¢Éé²Ù¤¬½Å¤¤¤Î¤À¤í¤¦¤È¡¢Äñ¹³¤ò¿Þ¤Î²¼¤«¤é1.5k,15k,150k¤ÈÁý¤ä¤·¡¢
ÍÆÎ̤òµÕ¤Ë²¼¤«¤é0.1uF,0.01uF,0.001uF¤È¸º¤é¤¹¤È¡¢¼Â¤Ë1.225khzÉÕ¶á¤Ç1.99db
¤ÎÀ¹¤ê¾å¤¬¤ê¤Ë¤Ê¤ê¤Þ¤·¤¿¡£¤³¤ì¤Ê¤éȯ¿¶¤·¤½¤¦¤Ç¤¹¡£
¡¦¡¦¡¦¾°¡¢£²ÃʤǤ⤳¤Î¤è¤¦¤Ë¤¹¤ë¤È¡¢700HZÉÕ¶á¤Ç1.153db¤ÈÁý¤¨¤Þ¤·¤¿¡£


¼ÁÌä¤Ç¤¹¤¬
¡Ê£±¡Ëȯ¿¶´ï¤È¤Ï¡¢²¿½è¤È¡¼²¿½è¤ò¡¡¤Ä¤Ê¤°¤Î¤Ç¤·¤ç¤¦¤«¡£
¡Ê£²¡Ë¶¤Î»þ¡¢¥Þ¥È¥ê¥¯¥¹¤âÅú¤¨¤¬¥°¥¸¥ã¥°¥¸¥ã¤È»ß¤Þ¤é¤Ê¤¯
¡¡¡¡¡¡À®¤ë¤Î¤Ç¤·¤ç¤¦¤«¡£¡¦¡¦¡¦¤½¤ì¤Çȯ¿¶¤È¤¹¤ë¡©¡©¡©¡£
¡Ê£³¡Ë¡¦¡¦¡¦Ê̤ËÊýÄø¼°¤òºî¤ê»þ´Ö¤Ç²ò¤¯¤Î¤Ç¤·¤ç¤¦¤«¡£
¡¡¡¡¡¡¤³¤Î¤è¤¦¤Ê»þ¤ÎÊýÄø¼°¤Î¥µ¥ó¥×¥ë¤ò¶µ¤¨¤Æ¤¤¤¿¤À¤±¤ë¤È
¡¡¡¡¡¡¤¢¤ê¤¬¤¿¤¤¤Î¤Ç¤¹¤¬¡£

·É¶ñ
 

Re: ¥³¥ó¥Ç¥ó¥µ¤È¡¢Äñ¹³¤À¤±¡©¡Ê£²¡Ë

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 2·î13Æü(¶â)00»þ43ʬ30ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.272[¸µµ­»ö¤Ø]

Âç·§¡¡Àµ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¥×¥í¥°¥é¥à¤Ç¤Ï¤Ê¤¤°Ù¡¢¤³¤³¤ËŬÅö¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¤¬¡¢¤´»²¹Í¤Ë¡£

¥ª¥Ú¥¢¥ó¥×¼«ÂΤμþÇÈ¿ô¡¢°ÌÁêÆÃÀ­¤¬ÌäÂê¤Ë¤Ê¤ë¤è¤¦¤Ê¹â¼þÇÈȯ¿¶´ï¤Ç¤Ê¤¤¾ì¹ç¡¢
µ¢´Ô²óÏ©¤Î·×»»¤À¤±¤Ç¡¢½½Ê¬¤À¤È»×¤¤¤Þ¤¹¡£

ȯ¿¶¾ò·ï¤Ï¡¢¥ë¡¼¥×¥²¥¤¥ó£±¡Ê0dB)¡¢°ÜÁêÎ̤ϡ¢£°¤ò´Þ¤à£²¦Ð¤ÎÀ°¿ôÇܤǤ¹¤¬¡¢
0dB ¤Ç¤Ï¡¢³«»Ïµ¯Æ°¤¬¡¢¤Ç¤­¤Ê¤¤¾ì¹ç¤ò´Þ¤à¤¿¤á¡¢¥²¥¤¥ó¤ò¿¤á¤Ë¤·¤Þ¤¹¡£
¤·¤«¤·¡¢
Àµ¸¹ÇȤ¬Íߤ·¤¤¾ì¹ç¡¢µ¯Æ°¤Î¿®ÍêÀ­¤ò³ÎÊݤ¹¤ëÄøÅ٤ξ¯¤Ê¤á¤Ë¤·¤Ê¤¤¤È¡¢
¸µ¡¹¤¬¡¢¹âÄ´ÇȤò´Þ¤ó¤ÀÏÄÇȤʤΤˡ¢±×¡¹Àµ¸¹ÇÈ·Á¤«¤é¡¢±ó¤¯¤Ê¤ê¤Þ¤¹¡£

¤É¤ì¤¯¤é¤¤Â¿ÌܤΥ²¥¤¥ó¤¬Å¬Åö¤«¤Ë¤Ä¤¤¤Æ¡¢¿ô³ØŪ¤Ë¤Ï£±¤ò±Û¤¨¤Æ¤µ¤¨¤ª¤ì¤Ð¡¢
¤¤¤¤¤Î¤Ç¤¹¤¬¡¢¼ÂºÝ¤Î¥¢¥ó¥×¤Î¾ì¹ç¡¢ÌµÏĤÎÀµ¸¹ÇȤò¡¢°Ý»ý¤¹¤ë¥²¥¤¥ó¤ËÌ¿Ãæ
¤µ¤»¤Æ¤â¡¢ÉÔ°ÂÄê¤Ç¸ÇÄê¤Ç¤­¤Þ¤»¤ó¡£½ÐÎÏ¿¶Éý¤Ç¡¢Äñ¹³ÃͤÎÊѲ½¤¹¤ëÁǻҤòÍѤ¤¡¢
¥²¥¤¥ó¤Î¼«Æ°À©¸æ¤ò¤·¤Ê¤¤¸Â¤ê¡¢Àµ¸¹ÇȤÏ̵Íý¤Ç¤¹¡£°ìÈ̤Îȯ¿¶´ï¤Ï¡¢ÇÈ·Á¤ÎÀíƬ
¤ò¡¢½ÐÎÏ˰Ϥˡ¢¤Ö¤Ä¤±¤ë»ö¤Ç¡¢°ÂÄê¤òÊݤäƤ¤¤ë¤¿¤á¡¢É¬¤ºÏĤó¤Ç¤¤¤Þ¤¹¡£

ȯ¿¶²óÏ©¤Ï¡¢Àþ·¿¤Ç¤¢¤ë¸Â¤ê¡¢Ìµ¸ÂÂ礫¡¢¸º¿êÄä»ß¤«¡¢¤É¤Á¤é¤«¤Ëή¤ì¤Þ¤¹¤¬¡¢
·×»»¾å¤Ï¡¢£±¼þ¥ë¡¼¥×¤ÎÅÁã´Ø¿ô¡Ê½ÐÎÏ¡¿ÆþÎϡˤòÊ£ÁÇ¿ô¤Çµá¤á¡¢
¡Ê¼Â¿ôÉô¡á£±¡¢µõ¿ôÉô¡á£°¡Ë¤Ë¤Ê¤ë¾ò·ï¤Ç¡¢²ò¤È¤·¤Æ¤¤¤ë¤è¤¦¤Ç¤¹¡£

²¼¿Þ¤Ï¡¢£Ã£Á£Ä¤Ç¡¢È¯¿¶¤µ¤»¤¿Îã¤Ç¡¢¼Âʪ¤Ë¤Ï¡¢¤µ¤é¤Ë¡¢¥À¥¤¥Ê¥ß¥Ã¥¯¡¦¥ì¥ó¥¸¤ä¡¢
ľή¥Ð¥¤¥¢¥¹¤ò¡¢¸¡Æ¤¤·¤Þ¤¹¡£¡ÊŬÅö¤Ê»²¹Í½ñ¤ò¤µ¤¬¤·¤Æ²¼¤µ¤¤¡£¡Ë
 

Re: ¥³¥ó¥Ç¥ó¥µ¤È¡¢Äñ¹³¤À¤±¡©¡Ê£²¡Ë

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 2·î13Æü(¶â)06»þ08ʬ54ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.273[¸µµ­»ö¤Ø]

Âç·§¡¡Àµ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£
¡ã¡ãÄɵ­¡ä¡ä
1KHz ¤Ç¡¢È¯¿¶¤·¤Æ¤¤¤ëµ¢´Ô²óÏ©¤ÎÆÃÀ­¤¬¡¢²¼¤ÎÍͤˤʤäƤ¤¤ë¤Î¤Ï¡¢´ñ̯¤Ë
»×¤¨¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£È¯¿¶¤·¤Æ¤¤¤ë 1KHz ÉÕ¶á¤Ï¡¢Ìó +0.1dB  +0.3deg.¤Ç¤¹¡£
¾º°µ¤ÎÂ礭¤¤Éôʬ¤Ï¡¢°ÌÁê³Ñ¤¬£²£î¦Ð¤Ç¤Ê¤¯¡¢È¯¿¶¾ò·ï¤ò¡¢Ëþ¤¿¤·¤Æ¤¤¤Ê¤¤¡£

0deg.¤Ç¤Ê¤¯¡¢¤ä¤ä¿ÊÁ꤮¤ß¤Ê¤Î¤Ï¡¢£Ï£Ð¥¢¥ó¥×ÆâÉô¤ÎÆþ½ÐÎÏ¥¤¥ó¥Ô¡¼¥À¥ó¥¹¤¬¡¢
1M¦¸,¡¡100¦¸¤Ë¤Ê¤Ã¤Æ¤¤¤Æ¡¢½ã¿è¤ÊÍýÁÛ¥¢¥ó¥×¤Ç¤Ï¤Ê¤¤»ö¤È¡¢Àܳ¤·¤¿»ö¤Ë¤è¤Ã¤Æ¡¢
µ¢´Ô²óÏ©¤ÎÄê¿ô¤¬¡¢¶Ï¤«¤Ë°ÜÆ°¤·¤¿°Ù¤«¤È»×¤¤¤Þ¤¹¡£
 

Re: ¥³¥ó¥Ç¥ó¥µ¤È¡¢Äñ¹³¤À¤±¡©¡Ê£²¡Ë

 Åê¹Æ¼Ô¡§Âç·§¡¡Àµ  Åê¹ÆÆü¡§2009ǯ 2·î13Æü(¶â)19»þ07ʬ50ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.274[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> Âç·§¡¡Àµ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£
> ¡ã¡ãÄɵ­¡ä¡ä
> 1KHz ¤Ç¡¢È¯¿¶¤·¤Æ¤¤¤ëµ¢´Ô²óÏ©¤ÎÆÃÀ­¤¬¡¢²¼¤ÎÍͤˤʤäƤ¤¤ë¤Î¤Ï¡¢´ñ̯¤Ë
> »×¤¨¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£È¯¿¶¤·¤Æ¤¤¤ë 1KHz ÉÕ¶á¤Ï¡¢Ìó +0.1dB  +0.3deg.¤Ç¤¹¡£
> ¾º°µ¤ÎÂ礭¤¤Éôʬ¤Ï¡¢°ÌÁê³Ñ¤¬£²£î¦Ð¤Ç¤Ê¤¯¡¢È¯¿¶¾ò·ï¤ò¡¢Ëþ¤¿¤·¤Æ¤¤¤Ê¤¤¡£
>
> 0deg.¤Ç¤Ê¤¯¡¢¤ä¤ä¿ÊÁ꤮¤ß¤Ê¤Î¤Ï¡¢£Ï£Ð¥¢¥ó¥×ÆâÉô¤ÎÆþ½ÐÎÏ¥¤¥ó¥Ô¡¼¥À¥ó¥¹¤¬¡¢
> 1M¦¸,¡¡100¦¸¤Ë¤Ê¤Ã¤Æ¤¤¤Æ¡¢½ã¿è¤ÊÍýÁÛ¥¢¥ó¥×¤Ç¤Ï¤Ê¤¤»ö¤È¡¢Àܳ¤·¤¿»ö¤Ë¤è¤Ã¤Æ¡¢
> µ¢´Ô²óÏ©¤ÎÄê¿ô¤¬¡¢¶Ï¤«¤Ë°ÜÆ°¤·¤¿°Ù¤«¤È»×¤¤¤Þ¤¹¡£


Âç·§¤Ç¤¹¡£
¿§¡¹¤Ê¿ÞÌ̤òÄ󼨤·¤Æ¤¤¤¿¤À¤­Í­Æñ¤¦¤´¤¶¤¤¤Þ¤¹¡£
ÊÙ¶¯¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ì¤³¤È¤¬¼Â¤Ë¿¤¤¤³¤È¤â
ʬ¤ê¤Þ¤·¤¿¡£
º£¸å¤È¤â¸æ»ØƳ¤è¤í¤·¤¯¸æ´ê¤¤¤¤¤¿¤·¤Þ¤¹¡£

·É¶ñ
 

¿ôÃͼ°Ê¸»úÎó¼°É¾²Á

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ 2·î14Æü(ÅÚ)00»þ14ʬ36ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
 
½½¿ÊBASIC¤ËźÉÕ¤µ¤ì¤¿¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à"\BASICw32\SAMPLE\INTERPRE.bas"¤Ï¿ôÃͼ°¤Îɾ²Á¤ò¹Ô¤¤¤Þ¤¹¡£
¿ôÃͼ°¤òÆþÎϤ¹¤ë¤È¡¢¤½¤Î¼°¤ÎÃͤò½ÐÎϤ·¤Þ¤¹¡£
¤½¤ì¤ò¼¡¤Î¤è¤¦¤Ë³ÈÄ¥¤·¤Þ¤·¤¿¡£

(1) ¿ôÃÍÄê¿ô
   ¾®¿ôÅÀ¤Ç»Ï¤Þ¤ë¾®¿ô¤ä¡¢»Ø¿ôÉô¤Î¤¢¤ë¿ôÃͤⰷ¤¨¤ë¡£

(2) Áȹþ¤ß´Ø¿ô
   ½½¿ÊBASIC¤ÎÁȹþ¤ß´Ø¿ô¤Ï¡¢ÇÛÎó¤äÆüì¤ÊÎã¤ò½ü¤­¤Û¤È¤ó¤ÉÍøÍѤǤ­¤ë¡£

(3) ÊÑ¿ô
   ¿ôÃͼ°¤ËÊÑ¿ô¤ò»È¤¨¤ë¡£
   ¿ôÃͼ°Æâ¤ËÊÑ¿ô¤òǧ¼±¤¹¤ë¤È,ÊÑ¿ô̾¤òɽ¼¨¤·ÆþÎϤòµá¤á¤Æ¤¯¤ë(Ãæ»ß¤Ï[Ãæ»ß]¥Ü¥¿¥ó¤Ç)¡£
   ÊÑ¿ô¤Ø¤ÎÆþÎϤϿôÃͼ°¤â²Ä¡£¤¿¤À¤·,¤³¤Î¿ôÃͼ°¤ËÊÑ¿ô¤ò´Þ¤à¤³¤È¤ÏÉԲġ£
    Îã) a^2+1 ¤ÎÊÑ¿ôa ¤Ë[4],[-3/2],[8-3*5],[sqr(5)-1],[SIN(pi/6)]¤Ê¤ÉÆþÎϲġ£[4*n+9]¤ÏÉԲġ£
   ÊÑ¿ô̾¤Î̿̾µ¬Â§¤Ï½½¿ÊBASIC¤Ë½à¤º¤ë(´Á»ú²Ä¡¢PI,RND,MAXNUM,DATE,TIME,DATE$,TIME$°Ê³°¤Îµ¡Ç½¸ì¤â²Ä)¡£
   ÇÛÎó¤Ë¤ÏÂбþ¤·¤Æ¤¤¤Ê¤¤¡£

(4) ʸ»úÎó¼°
   ʸ»úÎó¼°¤Îɾ²Á¤â¹Ô¤¨¤ë¡£¤½¤Î¾ì¹ç¤ÏÆþÎϤ¹¤ëʸ»úÎó¼°¤ÎÀèƬ¤Ë¡Ö$=¡×¤òÉÕ¤±¤ë¡£
    Îã) $=REPEAT$("aBc D",3) ; $="alphabet "&CHR$(64+Number) ; $="2*3+7="&STR$(2*3+7)
   ʸ»úÎó¤Ç¤ÏÂçʸ»ú¤È¾®Ê¸»ú¤ò¶èÊ̤¹¤ë¡£¶õÇò¤âǧ¼±¤¹¤ë¡£´Á»ú¤â²Ä¡£

(5) ʸ»úÎóÊÑ¿ô
   ¿ôÃͼ°¤äʸ»úÎ󼰤ˡ¢Ê¸»úÎóÊÑ¿ô¤ò»ÈÍѤǤ­¤ë¡£
   ʸ»úÎóÊÑ¿ô¤Ø¤ÎÆþÎϤϡ¢Ê¸»úÎóÄê¿ô(Á°¸å¤Î(")¤ÏÉÔÍ×)¤Þ¤¿¤Ïʸ»úÎó¼°¤¬²Ä¡£
   ʸ»úÎóÊÑ¿ô¤Ëʸ»úÎó¼°¤òÆþÎϤ¹¤ë¾ì¹ç¤ÏÀèƬ¤Ë¡Ö$=¡×¤òÉÕ¤±¤ë¡£¤³¤Îʸ»úÎó¼°¤ËÊÑ¿ô¤ò´Þ¤à¤³¤È¤ÏÉԲġ£
    Îã) $=USING$(a$,800.52) ¤Îa$¤Ë[###],[$=REPEAT$("#",3)]¤Ê¤ÉÆþÎϲġ£
    Îã) LEN(mj$&"yz") ¤Îmj$¤Ë[ab´Á],[$=LTRIM$("  ab")&UCASE$"cd"]¤Ê¤ÉÆþÎϲġ£[$="mn"&A$]¤ÏÉԲġ£
    Îã) VAL(c$)+7 ¤Îc$¤Ë[-2.5],[$=str$(1/2-3)]¤Ê¤ÉÆþÎϲÄ(-2.5¤Ï"-2.5"¤È¤¤¤¦Ê¸»úÎóÄê¿ô)¡£

(6) Éôʬʸ»úÎó»ØÄê
   ʸ»úÎóÊÑ¿ô¤ËÉôʬʸ»úÎó»ØÄ꤬¤Ç¤­¤ë¡£
   ¤¿¤À¤·Éôʬʸ»úÎó»ØÄê¤è¤êÁ°¤Ë,Ʊ̾¤Îʸ»úÎóÊÑ¿ô¤¬½ñ¤«¤ì¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£
    Îã) $=a$&","&a$(3:5) ; $=UCASE$(cap$&"aBc")¢Á$(2:2-1+m) ; POS(r$,r$(k:k))
    ¸íÆþÎÏÎã) $=box$(2:4)&","&box$
    ½¤ÀµÎã) $=REPEAT$(box$,0)&box$(2:4)&","&box$ ; $=SUBSTR$(box$,2,4)&","&box$

(7) ¥æ¡¼¥¶¡¼ÄêµÁ´Ø¿ô
   ¿ôÃͼ°¤ËÆȼ«¤ËÄêµÁ¤·¤¿´Ø¿ô¤ò»È¤¨¤ë¤è¤¦¤Ë¤·¤¿¡£
   ´Ø¿ô̾¤Ï F1(a)¡¢F2(a,b)¡¢F3(a,b,c)¡¢FS$(a$,b,c)¡£
   ÊÑ¿ô¤Ø¤ÎÆþÎϤˤâ»È¤¨¤ë¡£ Îã) SQR(r-4)+1 ¤Îr¤Ë[2*F2(3,7-5)]¤Ê¤ÉÆþÎϲġ£
   ¤³¤Î´Ø¿ô¤ÎÄêµÁÉô¤Ï1260¹Ô¤Î¸å¤í¤Ë¤¢¤ë¤Î¤ÇɬÍפ˱þ¤¸¤ÆÊѹ¹¤·¤Æ²¼¤µ¤¤¡£ºÆµ¢¸Æ¤Ó½Ð¤·¤â²Äǽ¤Ç¤¹¡£

ÆþÎÏÎã(´Ø¿ô̾,ÊÑ¿ô̾¤ÏÂçʸ»ú¤È¾®Ê¸»ú¤Î¶èÊ̤Ϥ·¤Ê¤¤)
  2*.43+7E2  ;  MOD(10^2,int(MAX(7.4,sqr(10)+3)))-1  ;  sin(a)^2+cos(b)^2
  2*x^2-7*x+6  ;  1+INT(RND*n)  ;  INT(¼ÚÆþ¶â*(1+ǯÍø/100)^ǯ¿ô)  ;  LEN("ab""cd ef gh")
  $=mj$&"xYz"&STR$(n)  ;  $=UCASE$(p$)&","&LCASE$(p$)  ;  $="0x"&BSTR$(Decimal,16)
  $=STR$(1/(2*a)*(-b+sqr(b^2-4*a*c)))&","&STR$((-b-sqr(b^2-4*a*c))/(2*a)) !2¼¡ÊýÄø¼°¤Î2º¬
  $="a="&STR$(abs(m^2-n^2))&",b="&STR$(2*m*n)&",c="&STR$(m^2+n^2) !¥Ô¥¿¥´¥é¥¹¿ô
  $=enter$&TIME$&USING$(".#",FP(TIME))  ;  m*f3(N-5,4,sqr(M))  ;  $=FS$("abc",x,6)&"."

ÌÜɸ¤È¤·¤¿¤Î¤Ï¡ÖPRINT *******¡×¤Ç½ÐÎϤǤ­¤ë¿ôÃͼ°¡¢Ê¸»úÎó¼°¤òÌÖÍ夹¤ë¤³¤È¤Ç¤·¤¿¡£
ÇÛÎó°Ê³°¤ÏãÀ®¤Ç¤­¤¿¤È»×¤¦¤Î¤Ç¤¹¤¬¤É¤¦¤Ç¤·¤ç¤¦¡£
¤¹¤Ù¤Æ¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤¤¤ë¤ï¤±¤Ç¤Ê¤¯´Ö°ã¤Ã¤¿¿ôÃͼ°¤òÆþÎϤ·¤Æ¤â¥¨¥é¡¼É½¼¨¤µ¤ì¤Ê¤¤¤«¤â¤·¤ì¤Þ¤»¤ó¡£
ÉÔ¶ñ¹ç¤¬¤¢¤ì¤ÐÊó¹ð¤ª´ê¤¤¤·¤Þ¤¹¡£
REM ½½¿ÊBASICźÉÕ"\BASICw32\SAMPLE\INTERPRE.bas"¤Ë²ÃÉ®
REM ¹ÔÈÖ¹æ¤Î¤Ê¤¤¹Ô¤¬²ÃÉ®Éôʬ¡£¹ÔÈÖ¹æ¤Ïºï½ü²Ä¡£
1000 REM Full BASIC¤Î¥â¥¸¥å¡¼¥ë¤Î»È¤¤Êý¤ò¼¨¤¹¥µ¥ó¥×¥ë
1010 REM
1020 REM ¿ôÃͼ°¤Îɾ²Á¤ò¹Ô¤¦
1030 REM Áȹþ¤ß´Ø¿ô¤Ï¡¤SIN¡¤COS¡¤TAN, LOG, EXP, SQR, INT¡¤ABS¤ÈPI¤Î¤ß
1040 REM Âçʸ»ú¤È¾®Ê¸»ú¤Î¶èÊ̤Ϥ·¤Ê¤¤
1050 REM ¿ôÃͼ°¤Îʸˡ¤Ï¤Û¤ÜFull BASIC¤Ë½à¤º¤ë¤¬¡¤´Ø¿ô̾¤Ë³¤¯³ç¸Ì¤Ï¶õÇò¤òÆþ¤ì¤º¤Ë½ñ¤¯¡£
1060 REM ¿ôÃͤϡ¤¿ô»ú¤Ç»Ï¤Þ¤ê¡¤¥³¥ó¥Þ¤ò1¸Ä°Ê²¼´Þ¤à¿ô»ú¤ÎÎó¤È¤·¤Æ¤Î¤ß½ñ¤±¤ë¡£
1070 REM Îí½ü»»¥¨¥é¡¼¤Ê¤É¤Ï¹Íθ¤·¤Æ¤¤¤Ê¤¤¡£
1080 DECLARE EXTERNAL FUNCTION interpreter.expression  ! ¿ôÃͼ°¤òɾ²Á¤¹¤ë´Ø¿ô
1090 DECLARE EXTERNAL STRING interpreter.s$            ! ÆþÎϹÔ
1100 DECLARE EXTERNAL NUMERIC interpreter.i            ! ÆþÎϹԤÎʸ»ú°ÌÃÖ
1110 DECLARE EXTERNAL SUB interpreter.skip             ! ¶õÇòʸ»ú¤òÆɤßÈô¤Ð¤¹Éû¥×¥í¥°¥é¥à
     DECLARE EXTERNAL FUNCTION interpreter.str_expression$  !ʸ»úÎó¼°¤òɾ²Á¤¹¤ë´Ø¿ô
     DECLARE EXTERNAL NUMERIC interpreter.vc,interpreter.sc !ÊÑ¿ô¤Î¸Ä¿ô(vc=¿ôÃÍ,sc=ʸ»úÎó)
     DECLARE EXTERNAL SUB interpreter.error                 !¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸
1120 LINE INPUT s$
1130 ! LET s$=UCASE$(s$) !ʸ»úÎó¤Î¾®Ê¸»úÊÝ»ý¤Î¤¿¤á̵¸ú¤Ë¤·¤¿
     DO
        LET vc,sc=0
1140    LET i=1
1150    CALL skip
        IF s$(i:i)="$" THEN
           LET i=i+1
           CALL skip
           IF s$(i:i)="=" THEN
              LET i=i+1
              CALL skip
              PRINT str_expression$   ! ʸ»úÎó¼°É¾²Á
           ELSE
              CALL error("$=")
           END IF
        ELSE
1160       PRINT expression   ! ¿ôÃͼ°É¾²Á
        END IF
1170    IF i<>LEN(s$)+1 THEN PRINT "Syntax error" ! Èæ³Ó¼°¤òi<LEN(s$)¤«¤éÊѹ¹
     LOOP UNTIL vc+sc=0 OR i<>LEN(s$)+1 ! Ãæ»ß¤Ï[Ãæ»ß]¥Ü¥¿¥ó¤Ç
1180 END
1190 !
1200 MODULE interpreter
  ! MODULE OPTION ARITHMETIC NATIVE ! DECIMAL_HIGH,COMPLEX,RATIONAL ¿ôÃÍ¥ª¥×¥·¥ç¥ó
1210 PUBLIC STRING s$
1220 PUBLIC NUMERIC i
1230 PUBLIC FUNCTION expression
1240 PUBLIC SUB skip
1250 SHARE FUNCTION term,factor,primary,numeric
     PUBLIC FUNCTION str_expression$
     PUBLIC NUMERIC vc,sc
     PUBLIC SUB error
     SHARE FUNCTION check,argument,rounding,position,bitval,v_chr,variable
     SHARE FUNCTION str_primary$,str_constant$,str_naming$,sub_string$,str_input$,bitstr$
     SHARE NUMERIC vari_val(20),inputv   ! 20=ÊÑ¿ô¤Î¸Ä¿ô
     SHARE STRING sn$,vari_name$(20),string$(20),str_name$(20)
     SHARE FUNCTION F1,F2,F3,FS$  !!! ¥æ¡¼¥¶¡¼ÄêµÁ´Ø¿ô
     ! MODULE OPTION ANGLE DEGREES  ! ³Ñ¤ÎÂ礭¤µ¤Îñ°Ì
     ! MODULE OPTION CHARACTER BYTE ! ʸ»úÎó½èÍý¤Îñ°Ì
     LET inputv=0
1260 !
     EXTERNAL FUNCTION F1(a)      !!! ¥æ¡¼¥¶¡¼ÄêµÁ´Ø¿ô
        let F1=a
     END FUNCTION
     EXTERNAL FUNCTION F2(a,b)    !!! ¥æ¡¼¥¶¡¼ÄêµÁ´Ø¿ô
        let F2=a+b
     END FUNCTION
     EXTERNAL FUNCTION F3(a,b,c)  !!! ¥æ¡¼¥¶¡¼ÄêµÁ´Ø¿ô
        let F3=a+b+c
     END FUNCTION
     EXTERNAL FUNCTION FS$(a$,b,c)  !!! ¥æ¡¼¥¶¡¼ÄêµÁ´Ø¿ô
        let FS$=a$&str$(b)&str$(c)
     END FUNCTION
     !
1270 EXTERNAL SUB skip
1280    DO WHILE s$(i:i)=" "
1290       LET i=i+1
1300    LOOP
1310 END SUB
1320 !
1330 EXTERNAL FUNCTION expression
1340    DECLARE NUMERIC n
1350    DECLARE STRING op$
1360    SELECT CASE s$(i:i)
1370    CASE "-"
1380       LET i=i+1
1390       CALL skip
1400       LET n=-term
1410    CASE "+"
1420       LET i=i+1
1430       CALL skip
1440       LET n=term
1450    CASE ELSE
1460       LET n=term
1470    END SELECT
1480    DO WHILE s$(i:i)="+" OR s$(i:i)="-"
1490       LET op$=s$(i:i)
1500       LET i=i+1
1510       CALL skip
1520       IF op$="+" THEN LET n=n+term ELSE LET n=n-term
1530    LOOP
1540    LET expression =n
1550    CALL skip
1560 END FUNCTION
1570 !
1580 EXTERNAL FUNCTION term
1590    DECLARE NUMERIC n
1600    DECLARE STRING op$
1610    LET n=factor
1620    DO WHILE s$(i:i)="*" OR s$(i:i)="/"
1630       LET op$=s$(i:i)
1640       LET i=i+1
1650       CALL skip
1660       IF op$="*" THEN LET n=n*factor ELSE LET n=n/factor
1670    LOOP
1680    LET term=n
1690 END FUNCTION
1700 !
1710 EXTERNAL FUNCTION factor
1720    DECLARE NUMERIC n
1730    LET n=primary
1740    DO WHILE s$(i:i)="^"
1750       LET i=i+1
1760       CALL skip
1770       LET n=n^primary
1780    LOOP
1790    LET factor=n
1800 END FUNCTION
1810 !
1820 EXTERNAL FUNCTION primary
1830    IF s$(i:i)>="0" AND s$(i:i)<="9" THEN
1840       LET  primary=numeric
        ELSEIF s$(i:i)="." THEN
           LET  primary=numeric
1850    ELSEIF UCASE$(s$(i:i+1))="PI" AND check(s$(i+2:i+2))=1 THEN ! ´Ø¿ôcheck²ÃÉ®
1860       LET i=i+2
1870       CALL skip
1880       LET primary=PI  ! Í­Íý¿ô¥â¡¼¥ÉÃí°Õ
        ELSEIF UCASE$(s$(i:i+2))="RND" AND check(s$(i+3:i+3))=1 THEN
           LET i=i+3
           CALL skip
           LET primary=RND ! ÊÑ¿ôÆþÎϤ¬¤¢¤ë¿ôÃͼ°¤Ç¤ÏÅÔÅÙ¹¹¿·
        ELSEIF UCASE$(s$(i:i+3))="TIME" AND check(s$(i+4:i+4))=1 THEN
           LET i=i+4
           CALL skip
           LET primary=TIME ! ÊÑ¿ôÆþÎϤ¬¤¢¤ë¿ôÃͼ°¤Ç¤ÏÅÔÅÙ¹¹¿·
        ELSEIF UCASE$(s$(i:i+3))="DATE" AND check(s$(i+4:i+4))=1 THEN
           LET i=i+4
           CALL skip
           LET primary=DATE ! ÊÑ¿ôÆþÎϤ¬¤¢¤ë¿ôÃͼ°¤Ç¤ÏÅÔÅÙ¹¹¿·
           !ELSEIF UCASE$(s$(i:i+5))="MAXNUM" AND check(s$(i+6:i+6))=1 THEN
           !   LET i=i+6
           !   CALL skip
           !   LET primary=MAXNUM  ! Í­Íý¿ô¥â¡¼¥ÉÉÔ²Ä
1890    ELSE
1900       IF s$(i:i)="(" THEN
1910          LET i=i+1
1920          CALL skip
1930          LET  primary=expression
           ELSEIF UCASE$(s$(i:i+2))="F1(" THEN   !!! ¥æ¡¼¥¶¡¼ÄêµÁ´Ø¿ô
              LET i=i+3
              CALL skip
              LET Primary=F1(expression)
           ELSEIF UCASE$(s$(i:i+2))="F2(" THEN   !!! ¥æ¡¼¥¶¡¼ÄêµÁ´Ø¿ô
              LET i=i+3
              CALL skip
              LET primary=F2(expression,argument)
           ELSEIF UCASE$(s$(i:i+2))="F3(" THEN   !!! ¥æ¡¼¥¶¡¼ÄêµÁ´Ø¿ô
              LET i=i+3
              CALL skip
              LET primary=F3(expression,argument,argument)
1940       ELSEIF UCASE$(s$(i:i+3))="SIN(" THEN ! Ķ±Û´Ø¿ô
1950          LET i=i+4
1960          CALL skip
1970          LET Primary=SIN(expression)
1980       ELSEIF UCASE$(s$(i:i+3))="COS(" THEN ! Ķ±Û´Ø¿ô
1990          LET i=i+4
2000          CALL skip
2010          LET Primary=COS(expression)
2020       ELSEIF UCASE$(s$(i:i+3))="TAN(" THEN ! Ķ±Û´Ø¿ô
2030          LET i=i+4
2040          CALL skip
2050          LET Primary=TAN(expression)
2060       ELSEIF UCASE$(s$(i:i+3))="LOG(" THEN ! Ķ±Û´Ø¿ô
2070          LET i=i+4
2080          CALL skip
2090          LET Primary=LOG(expression)
2100       ELSEIF UCASE$(s$(i:i+3))="EXP(" THEN ! Ķ±Û´Ø¿ô
2110          LET i=i+4
2120          CALL skip
2130          LET Primary=EXP(expression)
2140       ELSEIF UCASE$(s$(i:i+3))="SQR(" THEN ! Í­Íý¿ô¥â¡¼¥ÉÃí°Õ
2150          LET i=i+4
2160          CALL skip
2170          LET Primary=SQR(expression)
2180       ELSEIF UCASE$(s$(i:i+3))="INT(" THEN
2190          LET i=i+4
2200          CALL skip
2210          LET Primary=INT(expression)
2220       ELSEIF UCASE$(s$(i:i+3))="ABS(" THEN
2230          LET i=i+4
2240          CALL skip
2250          LET Primary=ABS(expression)
           ELSEIF UCASE$(s$(i:i+3))="MOD(" THEN
              LET i=i+4
              CALL skip
              LET primary=MOD(expression,argument)
           ELSEIF UCASE$(s$(i:i+5))="ROUND(" THEN
              LET i=i+6
              CALL skip
              LET primary=rounding
           ELSEIF UCASE$(s$(i:i+4))="CEIL(" THEN
              LET i=i+5
              CALL skip
              LET Primary=CEIL(expression)
           ELSEIF UCASE$(s$(i:i+3))="SGN(" THEN
              LET i=i+4
              CALL skip
              LET Primary=SGN(expression)
           ELSEIF UCASE$(s$(i:i+2))="IP(" THEN
              LET i=i+3
              CALL skip
              LET Primary=IP(expression)
           ELSEIF UCASE$(s$(i:i+2))="FP(" THEN
              LET i=i+3
              CALL skip
              LET Primary=FP(expression)
           ELSEIF UCASE$(s$(i:i+9))="REMAINDER(" THEN
              LET i=i+10
              CALL skip
              LET primary=REMAINDER(expression,argument)
           ELSEIF UCASE$(s$(i:i+8))="TRUNCATE(" THEN
              LET i=i+9
              CALL skip
              LET primary=TRUNCATE(expression,argument)
           ELSEIF UCASE$(s$(i:i+4))="LOG2(" THEN ! Ķ±Û´Ø¿ô
              LET i=i+5
              CALL skip
              LET Primary=LOG2(expression)
           ELSEIF UCASE$(s$(i:i+5))="LOG10(" THEN ! Ķ±Û´Ø¿ô
              LET i=i+6
              CALL skip
              LET Primary=LOG10(expression)
           ELSEIF UCASE$(s$(i:i+3))="CSC(" THEN ! Ķ±Û´Ø¿ô
              LET i=i+4
              CALL skip
              LET Primary=CSC(expression)
           ELSEIF UCASE$(s$(i:i+3))="SEC(" THEN ! Ķ±Û´Ø¿ô
              LET i=i+4
              CALL skip
              LET Primary=SEC(expression)
           ELSEIF UCASE$(s$(i:i+3))="COT(" THEN ! Ķ±Û´Ø¿ô
              LET i=i+4
              CALL skip
              LET Primary=COT(expression)
           ELSEIF UCASE$(s$(i:i+4))="ASIN(" THEN ! Ķ±Û´Ø¿ô
              LET i=i+5
              CALL skip
              LET Primary=ASIN(expression)
           ELSEIF UCASE$(s$(i:i+4))="ACOS(" THEN ! Ķ±Û´Ø¿ô
              LET i=i+5
              CALL skip
              LET Primary=ACOS(expression)
           ELSEIF UCASE$(s$(i:i+3))="ATN(" THEN ! Ķ±Û´Ø¿ô
              LET i=i+4
              CALL skip
              LET Primary=ATN(expression)
           ELSEIF UCASE$(s$(i:i+5))="ANGLE(" THEN ! Ķ±Û´Ø¿ô
              LET i=i+6
              CALL skip
              LET primary=ANGLE(expression,argument)
           ELSEIF UCASE$(s$(i:i+4))="SINH(" THEN ! Ķ±Û´Ø¿ô
              LET i=i+5
              CALL skip
              LET Primary=SINH(expression)
           ELSEIF UCASE$(s$(i:i+4))="COSH(" THEN ! Ķ±Û´Ø¿ô
              LET i=i+5
              CALL skip
              LET Primary=COSH(expression)
           ELSEIF UCASE$(s$(i:i+4))="TANH(" THEN ! Ķ±Û´Ø¿ô
              LET i=i+5
              CALL skip
              LET Primary=TANH(expression)
              !ELSEIF UCASE$(s$(i:i+3))="EPS(" THEN ! Í­Íý¿ô¥â¡¼¥ÉÉÔ²Ä
              !   LET i=i+4
              !   CALL skip
              !   LET Primary=EPS(expression)
           ELSEIF UCASE$(s$(i:i+3))="DEG(" THEN
              LET i=i+4
              CALL skip
              LET Primary=DEG(expression)
           ELSEIF UCASE$(s$(i:i+3))="RAD(" THEN
              LET i=i+4
              CALL skip
              LET Primary=RAD(expression)
           ELSEIF UCASE$(s$(i:i+3))="MAX(" THEN
              LET i=i+4
              CALL skip
              LET primary=MAX(expression,argument)
           ELSEIF UCASE$(s$(i:i+3))="MIN(" THEN
              LET i=i+4
              CALL skip
              LET primary=MIN(expression,argument)
           ELSEIF UCASE$(s$(i:i+4))="FACT(" THEN !½½¿ÊBASICÆȼ«³ÈÄ¥
              LET i=i+5
              CALL skip
              LET Primary=FACT(expression)
           ELSEIF UCASE$(s$(i:i+4))="PERM(" THEN !½½¿ÊBASICÆȼ«³ÈÄ¥
              LET i=i+5
              CALL skip
              LET primary=PERM(expression,argument)
           ELSEIF UCASE$(s$(i:i+4))="COMB(" THEN !½½¿ÊBASICÆȼ«³ÈÄ¥
              LET i=i+5
              CALL skip
              LET primary=COMB(expression,argument)
           ELSEIF UCASE$(s$(i:i+10))="COLORINDEX(" THEN !½½¿ÊBASICÆȼ«³ÈÄ¥
              LET i=i+11
              CALL skip
              LET primary=COLORINDEX(expression,argument,argument)
              !ELSEIF UCASE$(s$(i:i+7))="COMPLEX(" THEN !Ê£ÁÇ´Ø¿ô
              !   LET i=i+8
              !   CALL skip
              !   LET primary=COMPLEX(expression,argument)
              !ELSEIF UCASE$(s$(i:i+2))="RE(" THEN      !Ê£ÁÇ´Ø¿ô
              !   LET i=i+3
              !   CALL skip
              !   LET Primary=RE(expression)
              !ELSEIF UCASE$(s$(i:i+2))="IM(" THEN      !Ê£ÁÇ´Ø¿ô
              !   LET i=i+3
              !   CALL skip
              !   LET Primary=IM(expression)
              !ELSEIF UCASE$(s$(i:i+4))="CONJ(" THEN    !Ê£ÁÇ´Ø¿ô
              !   LET i=i+5
              !   CALL skip
              !   LET Primary=CONJ(expression)
              !ELSEIF UCASE$(s$(i:i+3))="ARG(" THEN     !Ê£ÁÇ´Ø¿ô
              !   LET i=i+4
              !   CALL skip
              !   LET Primary=ARG(expression)
              !ELSEIF UCASE$(s$(i:i+5))="NUMER(" THEN   !Í­Íý¿ô¥â¡¼¥ÉÀìÍÑ
              !   LET i=i+6
              !   CALL skip
              !   LET Primary=NUMER(expression)
              !ELSEIF UCASE$(s$(i:i+5))="DENOM(" THEN   !Í­Íý¿ô¥â¡¼¥ÉÀìÍÑ
              !   LET i=i+6
              !   CALL skip
              !   LET Primary=DENOM(expression)
              !ELSEIF UCASE$(s$(i:i+3))="GCD(" THEN     !Í­Íý¿ô¥â¡¼¥ÉÀìÍÑ
              !   LET i=i+4
              !   CALL skip
              !   LET primary=GCD(expression,argument)
              !ELSEIF UCASE$(s$(i:i+6))="INTSQR(" THEN  !Í­Íý¿ô¥â¡¼¥ÉÀìÍÑ
              !   LET i=i+7
              !   CALL skip
              !   LET Primary=INTSQR(expression)
              !ELSEIF UCASE$(s$(i:i+7))="INTLOG2(" THEN !Í­Íý¿ô¥â¡¼¥ÉÀìÍÑ
              !   LET i=i+8
              !   CALL skip
              !   LET Primary=INTLOG2(expression)
           ELSEIF UCASE$(s$(i:i+3))="LEN(" THEN
              LET i=i+4
              CALL skip
              LET primary=LEN(str_expression$)
           ELSEIF UCASE$(s$(i:i+3))="POS(" THEN
              LET i=i+4
              CALL skip
              LET primary=position
           ELSEIF UCASE$(s$(i:i+3))="VAL(" THEN
              LET i=i+4
              CALL skip
              LET primary=VAL(str_expression$)
           ELSEIF UCASE$(s$(i:i+3))="ORD(" THEN
              LET i=i+4
              CALL skip
              LET primary=ORD(str_expression$)
           ELSEIF UCASE$(s$(i:i+4))="BVAL(" THEN
              LET i=i+5
              CALL skip
              LET primary=bitval
           ELSEIF UCASE$(s$(i:i+4))="BLEN(" THEN !½½¿ÊBASICÆȼ«³ÈÄ¥
              LET i=i+5
              CALL skip
              LET primary=BLEN(str_expression$)
           ELSEIF v_chr(s$(i:i))=1 THEN
              LET primary=variable    !  ÊÑ¿ô
              CALL skip
              EXIT FUNCTION
2260       ELSE
              CALL error("FUNCTION primary")
2270          PRINT "Syntax error"
2280          STOP
2290       END IF
2300       IF s$(i:i)=")" THEN
2310          LET i=i+1
2320          CALL skip
2330       ELSE
              CALL error("FUNCTION primary")
2340          PRINT "Syntax error"
2350          STOP
2360       END IF
2370    END IF
2380 END FUNCTION
2390 !
2400 EXTERNAL FUNCTION numeric
2410    DECLARE NUMERIC i0
2420    CALL skip
2430    LET i0=i
        IF s$(i:i)="." THEN ! ¾®¿ôÅÀ¤Ç»Ï¤Þ¤ë
           LET i=i+1
        ELSE
2440       DO WHILE s$(i:i)>="0" AND s$(i:i)<="9"
2450          LET i=i+1
2460       LOOP
2470       IF s$(i:i)="." THEN LET i=i+1
        END IF
2480    DO WHILE s$(i:i)>="0" AND s$(i:i)<="9"
2490       LET i=i+1
2500    LOOP
        IF LEN(s$)>=i AND UCASE$(s$(i:i))="E" THEN ! »Ø¿ôÉô
           LET i=i+1
           IF s$(i:i)="+" OR s$(i:i)="-" THEN LET i=i+1
           DO WHILE s$(i:i)>="0" AND s$(i:i)<="9"
              LET i=i+1
           LOOP
        END IF
2510    LET numeric=VAL(s$(i0:i-1))
2520    CALL skip
2530 END FUNCTION
2540 !
![¤½¤Î£²]¤Ø³¤¯
 

Re: ¿ôÃͼ°Ê¸»úÎó¼°É¾²Á[¤½¤Î£²]

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ 2·î14Æü(ÅÚ)00»þ18ʬ47ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.276[¸µµ­»ö¤Ø]

! [¤½¤Î£²]
  !  *°Ê²¼¤¹¤Ù¤Æ²ÃÉ®Éôʬ*
     EXTERNAL FUNCTION check(c$) !! ͽÌó¸ì¤Î¸å³»ú
        DECLARE STRING p$
        LET check=-1
        DO
           READ IF MISSING THEN EXIT DO : p$
           IF c$=p$ THEN LET check=1
        LOOP
        DATA " " , "+" , "-" , "*" , "/" , "^" , "," , ")" , ""
     END FUNCTION
     !
     EXTERNAL FUNCTION argument !! °ú¿ô
        CALL skip
        IF s$(i:i)="," THEN
           LET i=i+1
           CALL skip
        ELSE
           CALL error("FUNCTION argument,°ú¿ô")
        END IF
        LET argument=expression
     END FUNCTION
     !
     EXTERNAL FUNCTION rounding  !! ´Ø¿ôROUND¤Î¼±ÊÌ
        DECLARE NUMERIC a
        LET a=expression
        IF s$(i:i)="," THEN
           LET i=i+1
           CALL skip
           LET rounding=ROUND(a,expression)
        ELSEIF s$(i:i)=")" THEN
           LET rounding=ROUND(a) ! ½½¿ÊBASICÆȼ«³ÈÄ¥
        ELSE
           CALL error("FUNCTION rounding,´Ø¿ôROUND")
        END IF
     END FUNCTION
     !
     EXTERNAL FUNCTION position  !! ´Ø¿ôPOS¤Î¼±ÊÌ
        DECLARE STRING aa$,bb$
        LET aa$=str_expression$
        IF s$(i:i)="," THEN
           LET i=i+1
           CALL skip
           LET bb$=str_expression$
           IF s$(i:i)=")" THEN
              LET position=POS(aa$,bb$)
           ELSEIF s$(i:i)="," THEN
              LET i=i+1
              CALL skip
              LET position=POS(aa$,bb$,expression)
           ELSE
              CALL error("FUNCTION position,´Ø¿ôPOS")
           END IF
        ELSE
           CALL error("FUNCTION position,´Ø¿ôPOS")
        END IF
     END FUNCTION
     !
     EXTERNAL FUNCTION bitval   !! ´Ø¿ôBVAL¤Î¼±ÊÌ
        DECLARE STRING aa$
        LET aa$=str_primary$
        IF s$(i:i)="," THEN
           LET i=i+1
           CALL skip
           IF s$(i:i)="2" THEN
              LET i=i+1
              CALL skip
              LET bitval=BVAL(aa$,2)
           ELSEIF s$(i:i+1)="16" THEN
              LET i=i+2
              CALL skip
              LET bitval=BVAL(aa$,16)
           ELSE
              CALL error("FUNCTION bitval,´Ø¿ôBVAL")
           END IF
        ELSE
           CALL error("FUNCTION bitval,´Ø¿ôBVAL")
        END IF
     END FUNCTION
     !
     EXTERNAL FUNCTION v_chr(c$)   !! ÊÑ¿ô̾ʸ»ú
        IF c$>="A" AND c$<="Z" OR c$>="a" AND c$<="z" OR c$>="¤¡" THEN !ÀèƬʸ»úµÚ¤Ó¤½¤ì°Ê¹ß
           LET v_chr=1
        ELSEIF c$>="0" AND c$<="9" OR c$="_" OR c$>="£°" THEN ! 2ʸ»úÌܰʹß
           LET v_chr=2
        ELSE
           LET v_chr=-1
        END IF
     END FUNCTION
     !
     EXTERNAL FUNCTION variable   !! ÊÑ¿ô
        DECLARE NUMERIC j,vi
        DECLARE STRING vn$,aa$,vs$
        LET vn$=""
        DO WHILE v_chr(s$(i:i))>=1
           LET vn$=vn$&s$(i:i)
           LET i=i+1
        LOOP
        FOR j=1 TO vc
           IF UCASE$(vn$)=UCASE$(vari_name$(j)) THEN
              LET variable=vari_val(j)  ! ´û½Ð¤ÎÊÑ¿ô
              EXIT FUNCTION
           END IF
        NEXT j
        LET vc=vc+1
        LET vari_name$(vc)=vn$
        IF inputv=0 THEN
           DO
              LINE INPUT PROMPT vn$&"=" : aa$ ! ÊÑ¿ô¤Ø¤ÎÆþÎÏ
           LOOP UNTIL aa$<>""
        ELSE
           CALL error("FUNCTION variable,ÊÑ¿ôÆþÎÏ")
        END IF
        LET vs$=s$
        LET vi=i
        LET s$=LTRIM$(aa$)
        LET i=1
        LET inputv=1
        LET vari_val(vc)=expression ! ÊÑ¿ô¤ËÆþÎϤ·¤¿¿ôÃͼ°¤Î½èÍý
        LET inputv=0
        LET s$=vs$
        LET i=vi
        LET variable=vari_val(vc)
     END FUNCTION
     !
     !
     EXTERNAL FUNCTION str_expression$ !! ʸ»úÎó¼°
        DECLARE STRING str_n$
        LET str_n$=str_primary$
        DO WHILE s$(i:i)="&"
           LET i=i+1
           CALL skip
           LET str_n$=str_n$&str_primary$
        LOOP
        LET str_expression$ =str_n$
        CALL skip
     END FUNCTION
     !
     EXTERNAL FUNCTION str_primary$ !! ʸ»úÎó°ì¼¡»Ò
        DECLARE NUMERIC j
        IF s$(i:i)="""" THEN
           LET i=i+1
           LET str_primary$=str_constant$
        ELSEIF UCASE$(s$(i:i+4))="DATE$" THEN
           LET i=i+5
           CALL skip
           LET str_primary$=DATE$  !ÊÑ¿ôÆþÎϤ¬¤¢¤ë¿ôÃͼ°¤Ç¤ÏÅÔÅÙ¹¹¿·
        ELSEIF UCASE$(s$(i:i+4))="TIME$" THEN
           LET i=i+5
           CALL skip
           LET str_primary$=TIME$  !ÊÑ¿ôÆþÎϤ¬¤¢¤ë¿ôÃͼ°¤Ç¤ÏÅÔÅÙ¹¹¿·
        ELSE
           IF v_chr(s$(i:i))=1 THEN
              LET sn$=str_naming$ ! ʸ»úÎó´Ø¿ô/ÊÑ¿ô̾
              FOR j=1 TO sc
                 IF UCASE$(sn$)=UCASE$(str_name$(j)) THEN
                    CALL skip
                    IF s$(i:i)="(" THEN
                       LET i=i+1
                       CALL skip
                       LET str_primary$=sub_string$(string$(j)) !Éôʬʸ»úÎó
                    ELSE
                       LET str_primary$=string$(j)  ! ´û½Ð¤Îʸ»úÎóÊÑ¿ô
                    END IF
                    EXIT FUNCTION
                 END IF
              NEXT j
           ELSE
              CALL error("FUNCTION str_primary$,ʸ»úÎó°ì¼¡»Ò")
           END IF
           SELECT CASE UCASE$(sn$)&s$(i:i)
           CASE "FS$("    !!! ¥æ¡¼¥¶¡¼ÄêµÁ´Ø¿ô
              LET i=i+1
              CALL skip
              LET str_primary$=FS$(str_expression$,argument,argument)
           CASE "REPEAT$("
              LET i=i+1
              CALL skip
              LET str_primary$=REPEAT$(str_expression$,argument)
           CASE "STR$("
              LET i=i+1
              CALL skip
              LET str_primary$=STR$(expression)
           CASE "USING$("
              LET i=i+1
              CALL skip
              LET str_primary$=USING$(str_expression$,argument)
           CASE "CHR$("
              LET i=i+1
              CALL skip
              LET str_primary$=CHR$(expression)
           CASE "LCASE$("
              LET i=i+1
              CALL skip
              LET str_primary$=LCASE$(str_expression$)
           CASE "UCASE$("
              LET i=i+1
              CALL skip
              LET str_primary$=UCASE$(str_expression$)
           CASE "LTRIM$("
              LET i=i+1
              CALL skip
              LET str_primary$=LTRIM$(str_expression$)
           CASE "RTRIM$("
              LET i=i+1
              CALL skip
              LET str_primary$=RTRIM$(str_expression$)
           CASE "BSTR$("
              LET i=i+1
              CALL skip
              LET str_primary$=bitstr$
           CASE "SUBSTR$(" ! ½½¿ÊBASICÆȼ«³ÈÄ¥
              LET i=i+1
              CALL skip
              LET str_primary$=SUBSTR$(str_expression$,argument,argument)
           CASE "MID$("    ! ½½¿ÊBASICÆȼ«³ÈÄ¥
              LET i=i+1
              CALL skip
              LET str_primary$=MID$(str_expression$,argument,argument)
           CASE "LEFT$("   ! ½½¿ÊBASICÆȼ«³ÈÄ¥
              LET i=i+1
              CALL skip
              LET str_primary$=LEFT$(str_expression$,argument)
           CASE "RIGHT$("  ! ½½¿ÊBASICÆȼ«³ÈÄ¥
              LET i=i+1
              CALL skip
              LET str_primary$=RIGHT$(str_expression$,argument)
           CASE ELSE
              LET str_primary$=str_input$ ! ʸ»úÎóÆþÎÏ
              CALL skip
              EXIT FUNCTION
           END SELECT
           IF s$(i:i)=")" THEN
              LET i=i+1
              CALL skip
           ELSE
              CALL error("FUNCTION str_primary$")
           END IF
        END IF
     END FUNCTION
     !
     EXTERNAL FUNCTION str_constant$  !! ʸ»úÎóÄê¿ô
        DECLARE STRING cc$
        LET cc$=""
        DO
           IF s$(i:i)="""" THEN
              IF s$(i+1:i+1)="""" THEN ! [""]¤Î¼±ÊÌ
                 LET cc$=cc$&s$(i:i)
                 LET i=i+2
              ELSE
                 LET i=i+1
                 EXIT DO
              END IF
           ELSE
              LET cc$=cc$&s$(i:i)
              LET i=i+1
              IF i>LEN(s$)+1 THEN
                 CALL error("FUNCTION str_constant$,ʸ»úÎóÄê¿ô")
                 EXIT DO
              END IF
           END IF
        LOOP
        CALL skip
        LET str_constant$=cc$
     END FUNCTION
     !
     EXTERNAL FUNCTION str_naming$ !! ʸ»úÎó´Ø¿ô/ÊÑ¿ô̾
        LET sn$=""
        DO WHILE v_chr(s$(i:i))>=1
           LET sn$=sn$&s$(i:i)
           LET i=i+1
        LOOP
        IF s$(i:i)="$" THEN
           LET str_naming$=sn$&s$(i:i)
           LET i=i+1
        ELSE
           CALL error("FUNCTION str_naming$,ʸ»úÎó´Ø¿ô/ÊÑ¿ô̾")
        END IF
     END FUNCTION
     !
     EXTERNAL FUNCTION sub_string$(ss$)  !! Éôʬʸ»úÎó
        DECLARE NUMERIC a
        LET a=expression
        IF s$(i:i)=":" THEN
           LET i=i+1
           CALL skip
           LET sub_string$=ss$(a:expression)
           IF s$(i:i)=")" THEN
              LET i=i+1
              CALL skip
           ELSE
              CALL error("FUNCTION sub_string$,Éôʬʸ»úÎó")
           END IF
        ELSE
           CALL error("FUNCTION sub_string$,Éôʬʸ»úÎó")
        END IF
     END FUNCTION
     !
     EXTERNAL FUNCTION str_input$  !! ʸ»úÎóÆþÎÏ
        DECLARE NUMERIC j,vi
        DECLARE STRING vs$
        LET sc=sc+1
        LET str_name$(sc)=sn$
        IF inputv=0 THEN
           LINE INPUT PROMPT sn$&"=" : string$(sc)
        ELSE
           CALL error("FUNCTION str_input$,ʸ»úÎóÆþÎÏ")
        END IF
        LET j=1
        DO WHILE string$(sc)(j:j)=" "
           LET j=j+1
        LOOP
        IF string$(sc)(j:j)="$" THEN
           LET j=j+1
           DO WHILE string$(sc)(j:j)=" "
              LET j=j+1
           LOOP
           IF string$(sc)(j:j)="=" THEN
              LET vs$=s$
              LET vi=i
              LET s$=string$(sc)(j+1:LEN(string$(sc)))
              LET s$=LTRIM$(s$)
              LET i=1
              LET inputv=1
              LET string$(sc)=str_expression$ ! ʸ»úÎóÊÑ¿ô¤ËÆþÎϤ·¤¿Ê¸»úÎ󼰤νèÍý
              LET inputv=0
              LET s$=vs$
              LET i=vi
           END IF
        END IF
        LET str_input$=string$(sc)
     END FUNCTION
     !
     EXTERNAL FUNCTION bitstr$   !! ´Ø¿ôBSTR$¤Î¼±ÊÌ
        DECLARE NUMERIC a
        LET a=expression
        IF s$(i:i)="," THEN
           LET i=i+1
           CALL skip
           IF s$(i:i)="2" THEN
              LET i=i+1
              CALL skip
              LET bitstr$=BSTR$(a,2)
           ELSEIF s$(i:i+1)="16" THEN
              LET i=i+2
              CALL skip
              LET bitstr$=BSTR$(a,16)
           ELSE
              CALL error("FUNCTION bitstr$,´Ø¿ôBSTR$")
           END IF
        ELSE
           CALL error("FUNCTION bitstr$,´Ø¿ôBSTR$")
        END IF
     END FUNCTION
     !
     EXTERNAL SUB error(e$)  !! ¥¨¥é¡¼É½¼¨
        PRINT "Error (";e$;")"
        !STOP
     END SUB
     !
2550 END MODULE
 
 

ÅÁã´Ø¿ô¤Ë¤è¤ë¥Õ¥£¥ë¥¿²óÏ©¤Î¼þÇÈ¿ô²òÀÏ¡¢²áÅϲòÀÏ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 2·î16Æü(·î)11»þ47ʬ59ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¡üÅÁã´Ø¿ô¤Ë¤è¤ë¼þÇÈ¿ô²òÀÏ
OPTION ARITHMETIC COMPLEX

LET j=SQR(-1) !µõ¿ôñ°Ì

LET f=60 !¼þÇÈ¿ô[Hz]
DEF w=2*PI*f !³Ñ¼þÇÈ¿ô¦Ø

SUB DispS(z) !Ê£ÁÇ¿ô¤òSɽ¼¨¤¹¤ë¡¡¢¨¥¹¥¿¥¤¥ó¥á¥Ã¥Ä¡ÊSteinmetz¡Ë
   PRINT ABS(z);
   IF ABS(z)<>0 THEN
      IF arg(z)<>0 THEN PRINT "¢Ü";DEG(arg(z));"¡ë";
   END IF
   PRINT
END SUB
!-------------------- ¤³¤³¤Þ¤Ç¤¬¥µ¥Ö¥ë¡¼¥Á¥ó


!---------- ¢­¢­¢­¢­¢­ ----------
LET xmax=6 !<----- ¢¨Í×Ä´À°
LET ymin=-50
LET ymax=5


!¡ü²óÏ©¿Þ¡¡CR¥í¡¼¥Ñ¥¹¡¦¥Õ¥£¥ë¥¿
!vi¡¦¨¡R1¨¨¨¡¡¦vo
!¡¡¡¡¡¡¡¡C1
!¡¡¡¡¡¡  ¨¢
!¡¡¡¡¡¡¡¡¢á
!¡¡»²¹Í¥µ¥¤¥È¡¡http://sim.okawa-denshi.jp/CRlowkeisan.htm

LET R1=1.6e3 !1.6k[¦¸]
LET C1=0.1e-6 !0.1¦Ì[F]

DEF G(s)=1/(s*C1*R1+1) !Æþ½ÐÎÏ¥·¥¹¥Æ¥à¤ÎÅÁã´Ø¿ô¡¡G(s)=Vo/Vi=(1/(C1*R1))/(s+1/(C1*R1))
!---------- ¢¬¢¬¢¬¢¬¢¬ ----------


!!!SET bitmap SIZE 600,600 !²èÌ̤òÂ礭¤¯¤¹¤ë
SET WINDOW -0.5,xmax+0.5, ymin,ymax !ɽ¼¨Îΰè
DRAW grid(1,5) !º¸Ã¼¤ÎÌÜÀ¹¤ê

FOR f=1 TO xmax !£ø¼´¤¬Âпô
   PLOT TEXT ,AT f-0.3,-0.15: mid$("10  100 1k  10k 100k1M  10M 100M",4*(f-1)+1,4)
NEXT f

FOR xx=0 TO xmax STEP 0.025 !¼þÇÈ¿ô[Hz]
   LET f=10^xx !xx=LOG10(f)
   LET t=ABS(G(j*w))
   PLOT LINES: xx,20*LOG10(t); !ÍøÆÀ[dB]
NEXT xx
PLOT LINES


SET TEXT COLOR 2
FOR k=ymax TO ymin STEP -5 !±¦Ã¼¤Î½Ä¼´ÌÜÀ¹¤ê
   PLOT TEXT ,AT xmax,k: STR$(k*2)&"¡ë" !¢¨ÍøÆÀ¤Î¥°¥é¥Õ¤Ë¹ç¤ï¤»¤ë¤¿¤á¤Ë2Çܤ¹¤ë
NEXT k

SET LINE COLOR 2
FOR xx=0 TO xmax STEP 0.05 !¼þÇÈ¿ô[Hz]
   LET f=10^xx
   LET th=arg(G(j*w))
   IF th>0 THEN LET th=th-2*PI !0¡Á-2¦Ð¤ØÊäÀµ¤¹¤ë¡¡<----- ¢¨Í×Ä´À°
   PLOT LINES: xx,DEG(th)/2; !°ÌÁê¦È[deg]¡¡¢¨ÍøÆÀ¤Î¥°¥é¥Õ¤Ë¹ç¤ï¤»¤ë¤¿¤á¤Ë1/2Çܤ¹¤ë
NEXT xx
PLOT LINES


END


¡üÅÁã´Ø¿ô¤Ë¤è¤ë²áÅϲòÀÏ
OPTION ARITHMETIC COMPLEX

DECLARE EXTERNAL SUB IFFT !µÕ¥Õ¡¼¥ê¥¨ÊÑ´¹

DEF C(s)=G(s)*R(s) !±þÅú´Ø¿ô
DEF R(s)=1/s !»ØÎá´Ø¿ô¡¡¢¨¥¹¥Æ¥Ã¥×´Ø¿ô

LET Vi=1 !1¢Ü0¡ë[V]¡¡¢¨²¾¤ÎÅÅ°µ¸»


!----- ¢­¢­¢­¢­¢­ -----
LET T=2e-3 !»þ´Ö¶è´Ö [0,T]


!¡ü²óÏ©¿Þ¡¡CR¥í¡¼¥Ñ¥¹¡¦¥Õ¥£¥ë¥¿
!vi¡¦¨¡R1¨¨¨¡¡¦vo
!¡¡¡¡¡¡¡¡C1
!¡¡¡¡¡¡  ¨¢
!¡¡¡¡¡¡¡¡¢á
!¡¡»²¹Í¥µ¥¤¥È¡¡http://sim.okawa-denshi.jp/CRlowkeisan.htm

LET R1=1.6e3 !1.6k[¦¸]
LET C1=0.1e-6 !0.1¦Ì[F]

DEF G(s)=1/(s*C1*R1+1) !Æþ½ÐÎÏ¥·¥¹¥Æ¥à¤ÎÅÁã´Ø¿ô¡¡G(s)=Vo/Vi=(1/(C1*R1))/(s+1/(C1*R1))
!----- ¢¬¢¬¢¬¢¬¢¬ -----


!µÕ¥é¥×¥é¥¹ÊÑ´¹
! f(t)=lim [¦Ø¢ª¡ç] { 1/(2¦Ð*j)¢éF(s)*Exp(s*t)ds [¦Ã-j*¦Ø,¦Ã+j*¦Ø] }¡¢j¤Ïµõ¿ôñ°Ì¡¢¦Ã>0¤È¦Ø¤Ï¼Â¿ô¡£
!s=¦Ã+j*2¦Ð¦Ø¤È¤¹¤ë¤È¡¢ds=j*2¦Ðd¦Ø¡£
!¤³¤ì¤ò¾å¼°¤ËÂåÆþ¤·¤Æ¡¢ÊÑ·Á¤¹¤ë¤È¡¢
! f(t)=Exp(¦Ãt)¢éF(¦Ã,¦Ø)*Exp(j*2¦Ð¦Ø)d¦Ø [-¡ç,¡ç]
!±¦ÊÕ¤ÎÀÑʬÉôʬ¤ÏµÕ¥Õ¡¼¥ê¥¨ÊÑ´¹¡£

LET N=1024*8 !¥Ç¡¼¥¿Áí¿ô¡¡¢¨£²¤Î¤Ù¤­¾è¡¢Â礭¤¤¤Û¤ÉÀºÅÙ¤¬¤è¤¤
DIM d(0 TO N-1) !Æþ½ÐÎÏÍÑÇÛÎó

LET Gamma=5 !¢¨3¡Á7
!¦Ã¤òÂ礭¤¯¤¹¤ì¤ÐÀºÅ٤Ͼ夬¤ê¤½¤¦¤À¤¬¡¢
!¤¢¤È¤ÇExp(¦Ãt)¤ò¤«¤±¤ë¤Î¤Ç¡¢t¤¬Â礭¤¤¤È¤³¤í¤Çȯ»¶¤¹¤ë¡£

LET rr=Gamma/T !¦Ã¤ò·è¤á¤ë

FOR k=0 TO N/2 !ÊÑ´¹¥Ç¡¼¥¿¤ÎºîÀ®
   LET Cs=C( COMPLEX(rr, 2*PI*k/T) ) !sk=¦Ã+j*2¦Ð*k/T¡¢k=0¡Án-1
   LET Hw=(COS(2*PI*k/N)+1)/2 !¥Ç¡¼¥¿¤ÏÎ¥»¶¤Ê¤¿¤á¡¢¥Ï¥Ë¥ó¥°´Ø¿ô¤ò¤«¤±¤ÆÊ¿³ê²½¤¹¤ë¡¡¢¨ÀºÅ٤θþ¾å
   LET d(k)=N/T*Cs*Hw !n/T*Y(k) * Hw¡¡0¡ÁN/2

   IF NOT(k=0 OR k=N/2) THEN LET d(N-k)=COMPLEX(Re(d(k)),-Im(d(k))) !N-1¡ÁN/2+1¤Ï¡¢¶¦ÌòÊ£ÁÇ¿ô
NEXT k


CALL IFFT(d) !¹â®µÕ¥Õ¡¼¥ê¥¨ÊÑ´¹


SET WINDOW -T/8,T,-Vi*1.2,Vi*1.2 !ɽ¼¨Îΰè
DRAW grid(T/4,Vi/5)

PLOT TEXT ,AT T*7/8,0: "[ÉÃ]"

LET dt=T/N !»þ´Ö¹ï¤ßÉý ­ùt

FOR k=0 TO N-1 STEP 8 !·ë²Ì¤Îɽ¼¨ [0,T]
   LET tt=k*dt !·Ð²á»þ´Ö
   PLOT LINES: tt, Re(d(k))*EXP(rr*tt); !Exp(¦Ãt)¤ò¤«¤±¤ë¡¡¢¨Exp(¦Ã*k*T/n)¡¢k=0¡Án-1
   PRINT Re(d(k))*EXP(rr*tt) !debug
NEXT k


END



EXTERNAL SUB IFFT(x()) !¹â®µÕ¥Õ¡¼¥ê¥¨ÊÑ´¹¡¡x() : ÆþÎÏ/½ÐÎϥǡ¼¥¿
OPTION ARITHMETIC COMPLEX
DECLARE EXTERNAL SUB FFTMAIN
LET nx=SIZE(x)
LET theta=2*PI/nx ! W = Exp(-j * 2¦Ð/N * -1) = Exp(j * theta)¤È¤¹¤ë
CALL FFTMAIN(x, theta)
MAT x=(1/nx)*x
END SUB

EXTERNAL SUB FFTMAIN(x(), theta)
OPTION ARITHMETIC COMPLEX
LET nx=SIZE(x)
IF MOD(nx, 2)<>0 THEN !DFT¤Î·×»»
   DIM w(0 TO nx-1), xtmp(0 TO nx-1)
   MAT xtmp=x
   FOR k=0 TO nx-1
      LET tmp=theta*k
      FOR n=0 TO nx-1
         LET w(n)=EXP( COMPLEX(0, tmp*n) )
      NEXT n
      LET x(k)=DOT(w, xtmp)
   NEXT k
ELSE !£²Ê¬¤·¤ÆºÆµ¢¸Æ½Ð¤·
   LET hnx=nx/2
   DIM x0(0 TO hnx-1), x1(0 TO hnx-1)
   FOR k=0 TO hnx-1
      LET x0(k)=x(k)+x(k+hnx)
      LET wk=EXP( COMPLEX(0, theta*k) )
      LET x1(k)=wk*(x(k)-x(k+hnx))
   NEXT k
   CALL FFTMAIN(x0, 2*theta)
   CALL FFTMAIN(x1, 2*theta)
   FOR k=0 TO hnx-1
      LET x(2*k)=x0(k)
      LET x(2*k+1)=x1(k)
   NEXT k
END IF
END SUB
 

Re: ÅÁã´Ø¿ô¤Ë¤è¤ë¥Õ¥£¥ë¥¿²óÏ©¤Î¼þÇÈ¿ô²òÀÏ¡¢²áÅϲòÀÏ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 2·î16Æü(·î)14»þ51ʬ17ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.278[¸µµ­»ö¤Ø]

ÅÁã´Ø¿ô¤Ï¡¢ÊÄÏ©ÊýÄø¼°¤äÀáÅÀÊýÄø¼°¤Ê¤É¤Çµ­½Ò¤µ¤ì¤¿Ï¢Î©ÊýÄø¼°¤«¤éƳ¤«¤ì¤ë¡£

º¹¤·Âؤ¨
!¡ü²óÏ©¿Þ¡¡CR¥í¡¼¥Ñ¥¹¡¦¥Õ¥£¥ë¥¿
!vi¡¦¨¡R1¨¨¨¡¡¦vo
!¡¡¡¡¡¡¡¡C1
!¡¡¡¡¡¡  ¨¢
!¡¡¡¡¡¡¡¡¢á
!¡¡»²¹Í¥µ¥¤¥È¡¡http://sim.okawa-denshi.jp/CRlowkeisan.htm

LET R1=1.6e3 !1.6k[¦¸]
LET C1=0.1e-6 !0.1¦Ì[F]

DEF G(s)=1/(s*C1*R1+1) !Æþ½ÐÎÏ¥·¥¹¥Æ¥à¤ÎÅÁã´Ø¿ô¡¡G(s)=Vo/Vi=(1/(C1*R1))/(s+1/(C1*R1))
!---------- ¢¬¢¬¢¬¢¬¢¬ ----------


¤³¤Î²Õ½ê¤ò²¼µ­¤Î¥×¥í¥°¥é¥à¤ËÃÖ¤­´¹¤¨¤ë¡£

LET Vi=1 !1¢Ü0¡ë[V]¡¡¢¨²¾¤ÎÅÅ°µ¸»

FUNCTION Laplace(e$,Z,s) !¥é¥×¥é¥¹ÊÑ´¹
   SELECT CASE UCASE$(e$)
   CASE "R"
      LET Laplace=Z !R*i(t)
   CASE "L"
      LET Laplace=s*Z !L*d{i(t)}/dt
   CASE "C"
      LET Laplace=1/(s*Z) !1/C*¢é{i(t)}dt
   CASE ELSE
      PRINT "̤¥µ¥Ý¡¼¥È¤ÎÁǻҤǤ¹¡£"
      STOP
   END SELECT
END FUNCTION


!¡ü²óÏ©¿Þ¡¡CR¥í¡¼¥Ñ¥¹¡¦¥Õ¥£¥ë¥¿
!¡¡¡¡¡¡¡¡a
!vi¡¦¨¡R1¨¨¨¡¡¦vo
!¡¡¡¡¡¡¡¡C2
!¡¡¡¡¡¡  ¨¢
!¡¡¡¡¡¡¡¡¢á
!¡¡»²¹Í¥µ¥¤¥È¡¡http://sim.okawa-denshi.jp/CRlowkeisan.htm

!----- ¢­¢­¢­¢­¢­ -----
LET M=2 !ÁǻҤοô
!----- ¢¬¢¬¢¬¢¬¢¬ -----

DIM A(M,M),x(M),b(M) !A*x=b¡¡¢¨Z(s)*I(s)=E(s)
DIM iA(M,M)

FUNCTION G(s) !ÅÁã´Ø¿ô
   MAT A=ZER !A(¼°¤ÎÈÖ¹æ,ÁǻҤÎÈÖ¹æ)¡¡¢¨²¼µ­¤ÎÀßÄê¤Ç£°¤Ï¾Êά¤¹¤ë¤¿¤á¡¢¤¢¤é¤«¤¸¤á£°¤òÆþ¤ì¤Æ¤ª¤¯
   MAT b=ZER !b(¼°¤ÎÈÖ¹æ)¡¡¢¨ÅÅή¤Þ¤¿¤ÏÅÅ°µ¤ÎÏÂ

   !---------- ¢­¢­¢­¢­¢­ ----------
   LET R1=Laplace("R",1.6e3,s) !1.6k[¦¸]
   LET C2=Laplace("C",0.1e-6,s) !0.1¦Ì[F]


   !¥­¥ë¥Ò¥Û¥Ã¥Õ¤ÎÅÅή§
   LET A(1,1)=1 !ÀáÅÀa¡¡i1(t)-i2(t)=0¡¡¢Í¡¡I1(s)-I2(s)=0
   LET A(1,2)=-1

   !¥­¥ë¥Ò¥Û¥Ã¥Õ¤ÎÅÅ°µÂ§
   LET A(2,1)=R1 !ÌÖÌÜ¡¡R1*i1(t) +1/C2*¢éi2(t)dt =Vi(t)¡¡¢Í¡¡R1*I1(s)+1/(s*C2)*I2(s)=Vi(s)
   LET A(2,2)=C2
   LET b(2)=Vi
   !---------- ¢¬¢¬¢¬¢¬¢¬ ----------

   MAT iA=INV(A)
   MAT x=iA*b !³ÆÁǻҤÎÅÅήI(s)¤òµá¤á¤ë
   !!!mat print x


   !---------- ¢­¢­¢­¢­¢­ ----------
   LET Vo=C2*x(2) ! Vo(t)=1/C2*¢éi2(t)dt¡¡¢Í¡¡Vo(s)=1/(s*C2)*I2(s)
   !---------- ¢¬¢¬¢¬¢¬¢¬ ----------

   LET G=Vo/Vi
END FUNCTION
!---------- ¢¬¢¬¢¬¢¬¢¬ ----------
 

Re: ¥³¥ó¥Ç¥ó¥µ¤È¡¢Äñ¹³¤À¤±¡©¡Ê£²¡Ë

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 2·î17Æü(²Ð)03»þ16ʬ38ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.273[¸µµ­»ö¤Ø]

¡ã¡ãÊä­»ö¹à¡ä¡ä
¡É·×»»¾å¤Ï¡¢£±¼þ¥ë¡¼¥×¤ÎÅÁã´Ø¿ô¡Ê½ÐÎÏ¡¿ÆþÎϡˤòÊ£ÁÇ¿ô¤Çµá¤á¡¢
¡Ê¼Â¿ôÉô¡á£±¡¢µõ¿ôÉô¡á£°¡Ë¤Ë¤Ê¤ë¾ò·ï¤Ç¡¢²ò¤È¤·¤Æ¤¤¤ë¡¦¡¦¡¦¡¡¡É¤Ë¤Ä¤¤¤Æ¡¢

¼«Ê¬¤Ç·×»»¤·¤¿¤â¤Î¤Ç¤Ï¡¢¤¢¤ê¤Þ¤»¤ó¤¬¡¢
³ºÅö¤Î£³ÃÊ·¿£Ã£Ò¾º°µ²óÏ©¤ÎÅÁã´Ø¿ô¤Ç¤¹¡£( R =R1=R2=R3, C =C1=C2=C3 )

ZT(s)=(1+5*R*C*s+6*R^2*C^2*s^2)/(1+5*R*C*s+6*R^2*C^2*s^2 + R^3*C^3*c^3)¢«¸í¤ê
ZT(s)=(1+5*R*C*s+6*R^2*C^2*s^2)/(1+5*R*C*s+6*R^2*C^2*s^2 + R^3*C^3*s^3)¢«Àµ(09/2/25)

-----------------------------------
°Ê²¼¤Ï¡¢²æή¤ÎÍý²ò¤Ê¤¿¤á¡¢´Ö°ã¤¤¤¬¤¢¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£»²¹ÍÄøÅ٤˸æÍƼϡ£

ÅÅ°µ¤Ç¹Í¤¨¤ë¾ì¹ç¤Î¡¢
ÅÁã´Ø¿ô( ½ÐÎÏÅÅ°µ¡¿ÆþÎÏÅÅ°µ ) ¤òµá¤á¤ë»þ¡¢£Ì£Ã£ÒÁǻҤΥ¤¥ó¥Ô¡¼¥À¥ó¥¹¤ò¡¢
sL, 1¡¿sC , R
j¦ØL, 1¡¿j¦ØC, R¡¡¡¡¤Î¤É¤Á¤é¤òÍѤ¤¤Æɽ¸½¤¹¤ë¤È¡¢²¿¤¬²ò¤ë¤«¤ò¡¢¹Í¤¨¤Þ¤¹¡£

sL¡¡1¡¿sC¡¡ R¡¡¤È¤¹¤ë°ÕÌ£¡£¡Ês=¦Ò+j¦Ø ¤ÎÊ£ÁÇ¿ô¡Ë

¡¡¡¦¡¦¡¦²óÏ©ÅÅή¤ò¡¢I'(t)=(½é´ü°ÌÁêÅÅή)*exp(st) ¤ËÁ°Äó¤·¤¿¤È¤­¤Î¡¢ÅÅ°µ¹ß²¼¤Î·¸¿ô¡£

L ¤ÎÅÅ°µ¹ß²¼¡á¡¡ L * dI'(t)/dt¡¡=L*s*I'(t)¡¡¡¡¡¡¡¡¡¡=¡¡sL * I'(t)
C ¤ÎÅÅ°µ¹ß²¼¡á(1/C)* ¢é I'(t)dt¡¡=(1/C)*(1/s )*I'(t) =(1/sC) * I'(t)
R ¤ÎÅÅ°µ¹ß²¼¡á¡¡ R * I'(t)

j¦ØL¡¡1¡¿j¦ØC¡¡R¡¡¤È¤¹¤ë°ÕÌ£¡£

¡¡¡¦¡¦¡¦²óÏ©ÅÅή¤ò¡¢I(t)=(½é´ü°ÌÁêÅÅή)*exp(j¦Øt) ¤ËÁ°Äó¤·¤¿¤È¤­¤Î¡¢ÅÅ°µ¹ß²¼¤Î·¸¿ô¡£

L ¤ÎÅÅ°µ¹ß²¼¡á¡¡ L * dI(t)/dt¡¡=L*j¦Ø*I(t)¡¡¡¡¡¡¡¡ =¡¡j¦ØL * I(t)
C ¤ÎÅÅ°µ¹ß²¼¡á(1/C)* ¢é I(t)dt¡¡=(1/C)*(1/j¦Ø)*I(t) =(1/j¦ØC) * I(t)
R ¤ÎÅÅ°µ¹ß²¼¡á¡¡ R * I(t)


-------- ȯ¿¶²óÏ©¤Î¾ì¹ç -----------
¤³¤ì¤é¤Î¥¤¥ó¥Ô¡¼¥À¥ó¥¹¤òÍѤ¤¤Æ¡¢ÅÅ°µÆþ½ÐÎϤÎÈæ¡ÊÅÁã´Ø¿ô¡Ë¤òºî¤ê¡¢

ÅÁã´Ø¿ôZT() ¤ÎÆþ½ÐÎϤòÀܳ¤·¡¢¥ë¡¼¥×¤òºî¤Ã¤¿¤È¤­¤Î¾õÂÖ¤ò¡¢¼¡¤Î¼°¤Çɽ¸½¤·¤Þ¤¹¡£
¡Ê£Ï£Ð¥¢¥ó¥×¤âÃæ¤Ë´Þ¤á¤Æ¤ª¤¯¡Ë
ÅÁã´Ø¿ôZT(s)=1
ÅÁã´Ø¿ôZT(j¦Ø)=1

¤³¤ÎÊýÄø¼°¤«¤é½Ð¤Æ¤¯¤ëº¬£ó¤ä¡¢²ò¤Îj¦Ø¤Ï¡¢¤É¤ó¤Ê°ÕÌ£¤ò»ý¤Ä¤«¡£

³°ÉôÆþÎϤÎ̵¤¤¾õÂ֤ǡ¢ÆâÉô¤Ë²óÏ©ÅÅή
I'(t)=(½é´ü°ÌÁêÅÅή)*exp(st)¡¡Ëô¤Ï¡¢I(t)=(½é´ü°ÌÁêÅÅή)*exp(j¦Øt)

¤Ê¤ëÅÅή¤¬¡¢¼«Î©¤Ç¤­¤ë»ö¤ò¡¢°ÕÌ£¤·¤Þ¤¹¡££ó¤Î¼Â¿ôÉô¤¬Àµ¤Ê¤é¡¢³Ñ®Å٦ؤÇȯ¿¶¤Ç¤¹
ÅÁã´Ø¿ôZT()=1 ¤Î²ò £ó¡¢j¦Ø¤Ï¡¢(½é´ü°ÌÁêÅÅή)¤Ë¤Ä¤¤¤Æ¤Ï¡¢²¿¤é¤ÎÀ©¸Â¤â¤·¤Æ¤¤¤Þ¤»¤ó¡£

¤³¤³¤Ç¡¢ÅÁã´Ø¿ôZT(j¦Ø)=1 ¤ÎÊý¤Ï¡¢²ò¤¬Ìµ¤¤²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£

I(t)=(½é´ü°ÌÁêÅÅή)*exp(j¦Øt) ¤Ê¤ë
Äê¾ïŪ¤Ê²óÏ©ÆâÅÅή¤òÁ°Ä󤷤Ƥ¤¤ë¤¿¤á¡¢ÅÁã´Ø¿ôZT(j¦Ø)=1 ¤Ï¡¢½é´üÃͤμ«Í³ÅÙ¤ò½ü¤¯¤È¡¢
¤½¤Î²ò¤ÎÅÅή¤Ï¡¢£±¤Ä¤ÎÄê¾ïŪ¤Ê¡¢ÇÈ·ÁÅÅή¤À¤±¤Ç¤¹¡£

ȯ¿¶´ï¤Î¤è¤¦¤Ë¡¢¥ë¡¼¥×Æâ¤Ë¡¢À®Ä¹¤¹¤ë¿¶Æ°ÅÅή¤¬¡¢»þ´Ö¤Èȼ¤Ëȯ㤷¤Æ¤¤¤ë¤Ê¤é¡¢
¥ë¡¼¥×ÆâÅÅή¤ò¡¢(½é´ü°ÌÁêÅÅή)*exp(j¦Øt) ·Á¼°¤Ç¡¢É½¸½½ÐÍè¤Ê¤¤¤¿¤á¤Ç¤·¤ç¤¦¡£

-------------------------------------
£±¤Ä¤ÎÇÈ·Á¤Ï¡¢Äê¾ïŪ¤ÊÊ£¿ô¤Îñ¿¶Æ°¡¢(½é´ü°ÌÁêÅÅή)*exp(j¦Øt) ¤¬½¸¤Þ¤ë¹çÀ®ÇÈ
¤Ç¤¹¤«¤é¡¢
j¦Ø¤ò¡¢¦Ò¡Üj¦Ø¤ÎÍͤʡ¢¼Â¿ôÉô¦Ò¤ò»ý¤ÄÊ£ÁÇ¿ô£ó¤òÍѤ¤¤Æ¡¢
²óÏ©ÆâÅÅή¤ò¡¢I'(t)=(½é´ü°ÌÁêÅÅή)*exp(st) ¤Ë¡¢Á°Ä󤹤ë¤È¡¢

³Æ¥¹¥Ú¥¯¥È¥ë¤Ï¡¢ÆÈΩ¤Ë¤½¤Î¿¶Éý¤âÊѲ½¤µ¤»¤ë»ö¤¬½ÐÍè¡¢¥¹¥Ú¥¯¥È¥é¥à¤Î»þ´ÖÊѲ½¤òɽ¸½
¤¹¤ë»ö¤¬²Äǽ¤È¤Ê¤ê¡¢£²¤Ä¤Î°Û¤Ê¤ëÇÈ·Á¤Ø¤ÎÊÑÁ«¤¬¡¢µ­½Ò½ÐÍè¤ë¤Ç¤·¤ç¤¦¡£
¨¤Á¡¢²áÅÏŪ¤ÊÅÅήÇÈ·Á¤ò¤â¡¢ÅÁã´Ø¿ôZT(s)=1 ¤Ï¡¢²ò¤È¤·¤Æ»ý¤Æ¤ë»ö¤ò¡¢°ÕÌ£¤·¤Þ¤¹¡£

¤³¤ì¤¬¡¢£ó¤ò»ÈÍѤ¹¤ë¥¤¥ó¥Ô¡¼¥À¥ó¥¹³µÇ°¤¬¡¢£ê¦Ø¤è¤ê¹¥¤Þ¤ì¡¢Í¥¤ì¤Æ¤¤¤ëÅÀ¤Ç¤¹¡£
-------------------------------------

¢¨¸½ºß¡¢»þ´Ö¤¬¥­¥Ä¥¤¤¿¤á¤Ë¡¢°Ê¾å¤Ë¤Ä¤¤¤Æ¤Î¼ÁÌä¤Ï¡¢¤·¤Ê¤¤¤Ç²¼¤µ¤¤¡£¤¹¤ß¤Þ¤»¤ó¡£
 

Re: ÅÁã´Ø¿ô¤Ë¤è¤ë¥Õ¥£¥ë¥¿²óÏ©¤Î¼þÇÈ¿ô²òÀÏ¡¢²áÅϲòÀÏ

 Åê¹Æ¼Ô¡§Âç·§¡¡Àµ  Åê¹ÆÆü¡§2009ǯ 2·î17Æü(²Ð)12»þ23ʬ48ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.279[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ÅÁã´Ø¿ô¤Ï¡¢ÊÄÏ©ÊýÄø¼°¤äÀáÅÀÊýÄø¼°¤Ê¤É¤Çµ­½Ò¤µ¤ì¤¿Ï¢Î©ÊýÄø¼°¤«¤éƳ¤«¤ì¤ë¡£
>
> º¹¤·Âؤ¨
>
> <PRE>
>
> !¡ü²óÏ©¿Þ¡¡CR¥í¡¼¥Ñ¥¹¡¦¥Õ¥£¥ë¥¿
> !vi¡¦¨¡R1¨¨¨¡¡¦vo
> !¡¡¡¡¡¡¡¡C1
> !¡¡¡¡¡¡  ¨¢
> !¡¡¡¡¡¡¡¡¢á
> !¡¡»²¹Í¥µ¥¤¥È¡¡http://sim.okawa-denshi.jp/CRlowkeisan.htm
>
> LET R1=1.6e3 !1.6k[¦¸]
> LET C1=0.1e-6 !0.1¦Ì[F]
>
> DEF G(s)=1/(s*C1*R1+1) !Æþ½ÐÎÏ¥·¥¹¥Æ¥à¤ÎÅÁã´Ø¿ô¡¡G(s)=Vo/Vi=(1/(C1*R1))/(s+1/(C1*R1))
> !---------- ¢¬¢¬¢¬¢¬¢¬ ----------
> </PRE>
>
>
> ¤³¤Î²Õ½ê¤ò²¼µ­¤Î¥×¥í¥°¥é¥à¤ËÃÖ¤­´¹¤¨¤ë¡£
>
>
> <PRE>
>
> LET Vi=1 !1¢Ü0¡ë[V]¡¡¢¨²¾¤ÎÅÅ°µ¸»
>
> FUNCTION Laplace(e$,Z,s) !¥é¥×¥é¥¹ÊÑ´¹
>    SELECT CASE UCASE$(e$)
>    CASE "R"
>       LET Laplace=Z !R*i(t)
>    CASE "L"
>
> !¡ü²óÏ©¿Þ¡¡CR¥í¡¼¥Ñ¥¹¡¦¥Õ¥£¥ë¥¿
> !¡¡¡¡¡¡¡¡a
> !vi¡¦¨¡R1¨¨¨¡¡¦vo
> !¡¡¡¡¡¡¡¡C2
> !¡¡¡¡¡¡  ¨¢
> !¡¡¡¡¡¡¡¡¢á
> !¡¡»²¹Í¥µ¥¤¥È¡¡http://sim.okawa-denshi.jp/CRlowkeisan.htm
>
> !----- ¢­¢­¢­¢­¢­ -----
> LET M=2 !ÁǻҤοô
> !----- ¢¬¢¬¢¬¢¬¢¬ -----
>
> DIM A(M,M),x(M),b(M) !A*x=b¡¡¢¨Z(s)*I(s)=E(s)
> DIM iA(M,M)
>
>    !---------- ¢­¢­¢­¢­¢­ ----------
>    LET Vo=C2*x(2) ! Vo(t)=1/C2*¢éi2(t)dt¡¡¢Í¡¡Vo(s)=1/(s*C2)*I2(s)
>    !---------- ¢¬¢¬¢¬¢¬¢¬ ----------
>
>    LET G=Vo/Vi
> END FUNCTION
> !---------- ¢¬¢¬¢¬¢¬¢¬ ----------

¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö

Âç·§¤Ç¤¹¡£
¥³¥Ô¡¼¤·¤Æº¹¤·Âؤ¨¤Þ¤·¤¿¤¬ºÇ¸å¤Î²¼µ­¤ÎÉôʬ
    LET G=Vo/Vi
END FUNCTION
!---------- ¢¬¢¬¢¬¢¬¢¬ ----------


LET G=Vo/Vi¡¡¤Ç¡Ö£Ç¤Ï´Ø¿ô̾¡¡Ê¸Ë¡¾å¤Î¸í¤ê¡×¤È½Ð¤ÆÆ°¤­¤Þ¤»¤ó¡£

·É¶ñ
 

Re: ÅÁã´Ø¿ô¤Ë¤è¤ë¥Õ¥£¥ë¥¿²óÏ©¤Î¼þÇÈ¿ô²òÀÏ¡¢²áÅϲòÀÏ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 2·î17Æü(²Ð)13»þ09ʬ15ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.281[¸µµ­»ö¤Ø]

Âç·§¡¡Àµ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> LET G=Vo/Vi¡¡¤Ç¡Ö£Ç¤Ï´Ø¿ô̾¡¡Ê¸Ë¡¾å¤Î¸í¤ê¡×¤È½Ð¤ÆÆ°¤­¤Þ¤»¤ó¡£

¤¦¤Þ¤¯Àڤꎤ꤬¤Ç¤­¤Æ¤¤¤Ê¤¤¤è¤¦¤Ê¤Î¤Ç¡¢ºÇ½é¤Î¥×¥í¥°¥é¥à¤Ëº¹¤·Âؤ¨¤¿¤â¤Î¤ò·ÇºÜ¤·¤Þ¤¹¡£
OPTION ARITHMETIC COMPLEX

LET j=SQR(-1) !µõ¿ôñ°Ì

LET f=60 !¼þÇÈ¿ô[Hz]
DEF w=2*PI*f !³Ñ¼þÇÈ¿ô¦Ø

SUB DispS(z) !Ê£ÁÇ¿ô¤òSɽ¼¨¤¹¤ë¡¡¢¨¥¹¥¿¥¤¥ó¥á¥Ã¥Ä¡ÊSteinmetz¡Ë
   PRINT ABS(z);
   IF ABS(z)<>0 THEN
      IF arg(z)<>0 THEN PRINT "¢Ü";DEG(arg(z));"¡ë";
   END IF
   PRINT
END SUB
!-------------------- ¤³¤³¤Þ¤Ç¤¬¥µ¥Ö¥ë¡¼¥Á¥ó


!---------- ¢­¢­¢­¢­¢­ ----------
LET xmax=6 !<----- ¢¨Í×Ä´À°
LET ymin=-50
LET ymax=5


LET Vi=1 !1¢Ü0¡ë[V]¡¡¢¨²¾¤ÎÅÅ°µ¸»

FUNCTION Laplace(e$,Z,s) !¥é¥×¥é¥¹ÊÑ´¹
   SELECT CASE UCASE$(e$)
   CASE "R"
      LET Laplace=Z !R*i(t)
   CASE "L"
      LET Laplace=s*Z !L*d{i(t)}/dt
   CASE "C"
      LET Laplace=1/(s*Z) !1/C*¢é{i(t)}dt
   CASE ELSE
      PRINT "̤¥µ¥Ý¡¼¥È¤ÎÁǻҤǤ¹¡£"
      STOP
   END SELECT
END FUNCTION


!¡ü²óÏ©¿Þ¡¡CR¥í¡¼¥Ñ¥¹¡¦¥Õ¥£¥ë¥¿
!¡¡¡¡¡¡¡¡a
!vi¡¦¨¡R1¨¨¨¡¡¦vo
!¡¡¡¡¡¡¡¡C2
!¡¡¡¡¡¡  ¨¢
!¡¡¡¡¡¡¡¡¢á
!¡¡»²¹Í¥µ¥¤¥È¡¡http://sim.okawa-denshi.jp/CRlowkeisan.htm

!----- ¢­¢­¢­¢­¢­ -----
LET M=2 !ÁǻҤοô
!----- ¢¬¢¬¢¬¢¬¢¬ -----

DIM A(M,M),x(M),b(M) !A*x=b¡¡¢¨Z(s)*I(s)=E(s)
DIM iA(M,M)

FUNCTION G(s) !ÅÁã´Ø¿ô
   MAT A=ZER !A(¼°¤ÎÈÖ¹æ,ÁǻҤÎÈÖ¹æ)¡¡¢¨²¼µ­¤ÎÀßÄê¤Ç£°¤Ï¾Êά¤¹¤ë¤¿¤á¡¢¤¢¤é¤«¤¸¤á£°¤òÆþ¤ì¤Æ¤ª¤¯
   MAT b=ZER !b(¼°¤ÎÈÖ¹æ)¡¡¢¨ÅÅή¤Þ¤¿¤ÏÅÅ°µ¤ÎÏÂ

   !---------- ¢­¢­¢­¢­¢­ ----------
   LET R1=Laplace("R",1.6e3,s) !1.6k[¦¸]
   LET C2=Laplace("C",0.1e-6,s) !0.1¦Ì[F]


   !¥­¥ë¥Ò¥Û¥Ã¥Õ¤ÎÅÅή§
   LET A(1,1)=1 !ÀáÅÀa¡¡i1(t)-i2(t)=0¡¡¢Í¡¡I1(s)-I2(s)=0
   LET A(1,2)=-1

   !¥­¥ë¥Ò¥Û¥Ã¥Õ¤ÎÅÅ°µÂ§
   LET A(2,1)=R1 !ÌÖÌÜ¡¡R1*i1(t) +1/C2*¢éi2(t)dt =Vi(t)¡¡¢Í¡¡R1*I1(s)+1/(s*C2)*I2(s)=Vi(s)
   LET A(2,2)=C2
   LET b(2)=Vi
   !---------- ¢¬¢¬¢¬¢¬¢¬ ----------

   MAT iA=INV(A)
   MAT x=iA*b !³ÆÁǻҤÎÅÅήI(s)¤òµá¤á¤ë
   !!!mat print x


   !---------- ¢­¢­¢­¢­¢­ ----------
   LET Vo=C2*x(2) ! Vo(t)=1/C2*¢éi2(t)dt¡¡¢Í¡¡Vo(s)=1/(s*C2)*I2(s)
   !---------- ¢¬¢¬¢¬¢¬¢¬ ----------

   LET G=Vo/Vi
END FUNCTION
!---------- ¢¬¢¬¢¬¢¬¢¬ ----------


!!!SET bitmap SIZE 600,600 !²èÌ̤òÂ礭¤¯¤¹¤ë
SET WINDOW -0.5,xmax+0.5, ymin,ymax !ɽ¼¨Îΰè
DRAW grid(1,5) !º¸Ã¼¤ÎÌÜÀ¹¤ê

FOR f=1 TO xmax !£ø¼´¤¬Âпô
   PLOT TEXT ,AT f-0.3,-0.15: mid$("10  100 1k  10k 100k1M  10M 100M",4*(f-1)+1,4)
NEXT f

FOR xx=0 TO xmax STEP 0.025 !¼þÇÈ¿ô[Hz]
   LET f=10^xx !xx=LOG10(f)
   LET t=ABS(G(j*w))
   PLOT LINES: xx,20*LOG10(t); !ÍøÆÀ[dB]
NEXT xx
PLOT LINES


SET TEXT COLOR 2
FOR k=ymax TO ymin STEP -5 !±¦Ã¼¤Î½Ä¼´ÌÜÀ¹¤ê
   PLOT TEXT ,AT xmax,k: STR$(k*2)&"¡ë" !¢¨ÍøÆÀ¤Î¥°¥é¥Õ¤Ë¹ç¤ï¤»¤ë¤¿¤á¤Ë2Çܤ¹¤ë
NEXT k

SET LINE COLOR 2
FOR xx=0 TO xmax STEP 0.05 !¼þÇÈ¿ô[Hz]
   LET f=10^xx
   LET th=arg(G(j*w))
   IF th>0 THEN LET th=th-2*PI !0¡Á-2¦Ð¤ØÊäÀµ¤¹¤ë¡¡<----- ¢¨Í×Ä´À°
   PLOT LINES: xx,DEG(th)/2; !°ÌÁê¦È[deg]¡¡¢¨ÍøÆÀ¤Î¥°¥é¥Õ¤Ë¹ç¤ï¤»¤ë¤¿¤á¤Ë1/2Çܤ¹¤ë
NEXT xx
PLOT LINES


END
 

Re: ÅÁã´Ø¿ô¤Ë¤è¤ë¥Õ¥£¥ë¥¿²óÏ©¤Î¼þÇÈ¿ô²òÀÏ¡¢²áÅϲòÀÏ

 Åê¹Æ¼Ô¡§Âç·§¡¡Àµ  Åê¹ÆÆü¡§2009ǯ 2·î18Æü(¿å)10»þ54ʬ41ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.282[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> Âç·§¡¡Àµ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£
>
> > LET G=Vo/Vi¡¡¤Ç¡Ö£Ç¤Ï´Ø¿ô̾¡¡Ê¸Ë¡¾å¤Î¸í¤ê¡×¤È½Ð¤ÆÆ°¤­¤Þ¤»¤ó¡£
>
> ¤¦¤Þ¤¯Àڤꎤ꤬¤Ç¤­¤Æ¤¤¤Ê¤¤¤è¤¦¤Ê¤Î¤Ç¡¢ºÇ½é¤Î¥×¥í¥°¥é¥à¤Ëº¹¤·Âؤ¨¤¿¤â¤Î¤ò·ÇºÜ¤·¤Þ¤¹¡£
>
>

Âç·§¤Ç¤¹¡£
º£Å٤Ϥ¹¤°¾å¼ê¤¯Æ°¤­¤Þ¤·¤¿¡£¤ªË»¤·¤¤Ã桢ͭÆñ¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£

²áÅÏÆÃÀ­¤Î¥×¥í¥°¥é¥à¤â¡¢¤³¤¦¤¤¤¦¤Î¤¬ºß¤Ã¤¿¤é¤¤¤¤¤Ê¡¦¡¦¡¦
¤È»×¤Ã¤Æ¤¤¤¿ÌðÀè¤Ç¤·¤¿¡£º£¸å¤âÂç»ö¤Ë»È¤ï¤»¤Æ¤¤¤¿¤À¤­¤Þ¤¹¡£

·É¶ñ
 

Re: ÀáÅÀ²òÀÏË¡¤Ë¤Ä¤¤¤Æ¡¡¡Ê£³¡Ë

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 2·î19Æü(ÌÚ)11»þ24ʬ57ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.267[¸µµ­»ö¤Ø]

Âç·§¡¡Àµ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

! Rs¤òÉղ乤ë¤Î¤Ï¡¢Îɤ¯¤¢¤ê¤Þ¤»¤ó¡£
! ²¼¤Î£²¤Ä¤Î²óÏ©¤Ï¡¢Æ±¤¸¤â¤Î¤Ç¤¹¡£¥Æ¥Ö¥Ê¥ó¤ÎÄêÍý¤ò¡£
!                             ¨£¨¡C2¨¡¨¨¨¡¨¡¨¡¨¡¨¡¨¡¨¤
!                             ¨¢      ¨¢  ¨£¨¡¨¡¨¤  ¨¢
!                             ¨¢      ¨¦¨¡¨©-   ¨¢  ¨¢
!                             ¨¢          ¨¢    ¨§¨¡­¥¨¡
!             ¨£¨¡R1¨¡­¡¨¡R2¨¡­¢¨¡R3¨¡­£¨¡¨©+   ¨¢  ¢¬ V5
!             ¢¬      ¢¬V1    ¢¬V2    ¢¬V3¨¦¨¡¨¡¨¥  ¨¢
!             Vin     C1              C3     K=1    ¨¢
!             ¨¢      ¨¢              ¨¢            ¨¢
!             £°¨¡¨¡¨¡¨ª¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨ª¨¡¨¡¨¡¨¡¨¡¨¡¨ª¨¡
!
! |(1/R1)+(1/R2)+¦Ø*C1*j -(1/R2)               0                | |V1| |Vin/R1|
! |-(1/R2)               (1/R2)+(1/R3)+¦Ø*C2*j -(1/R3)-K*¦Ø*C2*j| |V2|=| 0    |
! |0                     -(1/R3)               (1/R3)+¦Ø*C3*j   | |V3| | 0    |
!

!                             ¨£¨¡C2¨¡¨¨¨¡¨¡¨¡¨¡¨¡¨¡¨¤
!                             ¨¢      ¨¢  ¨£¨¡¨¡¨¤  ¨¢
!                             ¨¢      ¨¦¨¡¨©-   ¨¢  ¨¢
!         ¨£¨¡¨¡¨¡¨¡¨¡¨¤      ¨¢          ¨¢    ¨§¨¡­¥¨¡
!         ¨¢¡¡¨£¨¡R1¨¡­¡¨¡R2¨¡­¢¨¡R3¨¡­£¨¡¨©+   ¨¢  ¢¬ V5
!         ¢¬  ¨¢¡¡     ¢¬V1    ¢¬V2    ¢¬V3¨¦¨¡¨¡¨¥  ¨¢
!   Is=Vin/R1 ¨¢      C1              C3     K=1    ¨¢
!         ¢¬  ¨¢      ¨¢              ¨¢            ¨¢
!         ¨ª¨¡£°¨¡¨¡¨¡¨ª¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨ª¨¡¨¡¨¡¨¡¨¡¨¡¨ª¨¡
!
! £Ë¢â£±¤Ï¡¢¥Ü¥ë¥Æ¡¼¥¸¥Õ¥©¥í¥¢¤È¤·¤Æ¤ÎÍøÆÀ¤Ç¡¢AMP¼«ÂΤÎÅÅ°µÍøÆÀ¤Ï¡¢10E6 ÄøÅ٤˶ˤá¤ÆÂ礭¤¤¡£
! ²óÏ©¾å¤Ç¡¢£Ë¡ã¡ä£±¤Ë¤¹¤ë¤Ë¤Ï¡¢
!¡¡V5¡ÁAmp(-in)´Ö¤Ë¡¢¸º¿ê´ï¤òÁÞÆþ¢ª £Ë¡ä£±¡¢¸º¿ê´ï½ÐÎÏÆâÉôÄñ¹³¤Ï¡¢Â礭¤¯¤Æ¤â²Ä¡£
!¡¡V5¡ÁC2 ´Ö¤Ë¡¢¸º¿ê´ï¤òÁÞÆþ¢ª £Ë¡ã£±¡¢¸º¿ê´ï½ÐÎÏÆâÉôÄñ¹³¤Ï¡¢½½Ê¬¤Ë¾®¤µ¤¤»ö¡£
!
OPTION ANGLE DEGREES
OPTION ARITHMETIC COMPLEX
LET j=COMPLEX(0,1)
LET NP=3
DIM FREQ(57,5), A(NP,NP), T(NP,NP), EOUT(NP,1), B(NP,1)
!----
! ¼þÇÈ¿ô10Hz~100KHz¡¢ÅùÈ楹¥Æ¥Ã¥×
FOR i=1 TO 57
   LET FREQ(i,1)=10^(1+4*(i-1)/56)
NEXT i
!----
! CR 3ÃʲóÏ©
LET R1=51000            !¦¸
LET R2=82000            !¦¸
LET R3=39000            !¦¸
LET C1=0.00685/(10^6)   !F
LET C2=0.022/(10^6)     !F
LET C3=330/(10^12)      !F
!----
SET WINDOW 0.5,5.5, -55,5
DRAW grid(1,5)
FOR K=1-0.0125 TO 1.0125 STEP 0.0125
   FOR P=1 TO 57
      LET ¦Ø=(2*PI*FREQ(P,1))
      !
      LET A(1,1)=(1/R1)+(1/R2)+j*¦Ø*C1
      LET A(1,2)=-(1/R2)
      LET A(1,3)=0
      !
      LET A(2,1)=-(1/R2)
      LET A(2,2)=(1/R2)+(1/R3)+j*¦Ø*C2
      LET A(2,3)=-(1/R3)-K*j*¦Ø*C2
      !
      LET A(3,1)=0
      LET A(3,2)=-(1/R3)
      LET A(3,3)=(1/R3)+j*¦Ø*C3
      !
      LET Vin=1           !1V
      LET B(1,1)=(Vin/R1) !ÅÅ°µ¸»Vin ľÎóÄñ¹³R1¤ò¡¢ÅÅή¸»Vin/R1 ÊÂÎóÄñ¹³R1 ¤ËÊÑ·Á¡£
      LET B(2,1)=0
      LET B(3,1)=0
      MAT T=INV(A)
      MAT EOUT=T*B
      LET EE1=EOUT(1,1)
      LET EE2=EOUT(2,1)
      LET EE3=EOUT(3,1)
      !
      LET Gv=K*EOUT(3,1)/Vin
      LET FREQ(P,2)=20*LOG10(ABS(Gv))
      LET Pv=arg(Gv)
      IF Pv>0 THEN LET Pv=Pv-360
      LET  FREQ(P,4)=Pv
   NEXT P
   !------
   !¥ê¥¹¥È
   PRINT "K=";K
   PRINT "Èֹ栠 ¼þÇÈ¿ô      E5         ¦È5"
   FOR i=1 TO 57
      PRINT USING "###": i;
      PRINT USING " ###,###.#"  : FREQ(i,1);
      PRINT USING " ####.### dB": FREQ(i,2);
      PRINT USING " ####.### ÅÙ": FREQ(i,4)
   NEXT i
   !------
   !¥°¥é¥Õ
   FOR f=1 TO 6
      SET TEXT COLOR "black"
      PLOT TEXT ,AT f-0.1, 1: mid$("10  100 1k  10k 100k ",4*(f-1)+1,4) !£ø¼´ 10Hz^100kHz
      PLOT TEXT ,AT 0.8,-10*(f-1)-2: mid$("  0 -25 -50 -75 -100-125 ",4*(f-1)+1,4) !º¸y¼´ 0~-125dB
      SET TEXT COLOR "red"
      PLOT TEXT ,AT 5.1,-10*(f-1)-2: mid$(" 0  -80 -160-240-320-400 ",4*(f-1)+1,4) !±¦y¼´ 0~-400¡ë
   NEXT f
   SET LINE COLOR "black"
   FOR i=1 TO 57
      PLOT LINES:LOG10(FREQ(i,1)) ,FREQ(i,2)/2.5; !ÍøÆÀ[dB]
   NEXT i
   PLOT LINES
   SET LINE COLOR "red"
   FOR i=1 TO 57
      PLOT LINES:LOG10(FREQ(i,1)) ,0.125*FREQ(i,4); !°ÌÁê³ÑÅÙ[ÅÙ]
   NEXT i
   PLOT LINES
NEXT K

END
 

Re: ÀáÅÀ²òÀÏË¡¤Ë¤Ä¤¤¤Æ¡¡¡Ê£³¡Ë

 Åê¹Æ¼Ô¡§Âç·§¡¡Àµ  Åê¹ÆÆü¡§2009ǯ 2·î20Æü(¶â)14»þ06ʬ15ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.284[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ! Rs¤òÉղ乤ë¤Î¤Ï¡¢Îɤ¯¤¢¤ê¤Þ¤»¤ó¡£
> ! ²¼¤Î£²¤Ä¤Î²óÏ©¤Ï¡¢Æ±¤¸¤â¤Î¤Ç¤¹¡£¥Æ¥Ö¥Ê¥ó¤ÎÄêÍý¤ò¡£

> !
> ! |(1/R1)+(1/R2)+¦Ø*C1*j -(1/R2)               0                | |V1| |Vin/R1|
> ! |-(1/R2)               (1/R2)+(1/R3)+¦Ø*C2*j -(1/R3)-K*¦Ø*C2*j| |V2|=| 0    |
> ! |0                     -(1/R3)               (1/R3)+¦Ø*C3*j   | |V3| | 0    |
> !

> !                             ¨£¨¡C2¨¡¨¨¨¡¨¡¨¡¨¡¨¡¨¡¨¤
> !                             ¨¢      ¨¢  ¨£¨¡¨¡¨¤  ¨¢
> !                             ¨¢      ¨¦¨¡¨©-   ¨¢  ¨¢
> !         ¨£¨¡¨¡¨¡¨¡¨¡¨¤      ¨¢          ¨¢    ¨§¨¡­¥¨¡
> !         ¨¢¡¡¨£¨¡R1¨¡­¡¨¡R2¨¡­¢¨¡R3¨¡­£¨¡¨©+   ¨¢  ¢¬ V5
> !         ¢¬  ¨¢¡¡     ¢¬V1    ¢¬V2    ¢¬V3¨¦¨¡¨¡¨¥  ¨¢
> !   Is=Vin/R1 ¨¢      C1              C3     K=1    ¨¢
> !         ¢¬  ¨¢      ¨¢              ¨¢            ¨¢
> !         ¨ª¨¡£°¨¡¨¡¨¡¨ª¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨ª¨¡¨¡¨¡¨¡¨¡¨¡¨ª¨¡
> !
> LET NP=3
> DIM FREQ(57,5), A(NP,NP), T(NP,NP), EOUT(NP,1), B(NP,1)
> !----
> ! ¼þÇÈ¿ô10Hz~100KHz¡¢ÅùÈ楹¥Æ¥Ã¥×
> FOR i=1 TO 57
>    LET FREQ(i,1)=10^(1+4*(i-1)/56)
> NEXT i
> !----
>

Âç·§¡¡¤Ç¤¹¡£

¤ªË»¤·¤¤¤È¤³¤í¡¢¿§¡¹¸æ¸¡Æ¤Äº¤­¤Þ¤·¤ÆÍ­Æñ¤¦¤´¤¶¤¤¤Þ¤¹¡£
¡Ê£±¡ËÆþÎϤËRs¤¬Ìµ¤¯¤Æ¤â¤è¤¤¤³¤È¤ä¡¢
¡Ê£²¡Ë¼þÇÈ¿ô10Hz~100KHz¡¢ÅùÈ楹¥Æ¥Ã¥×¤Ç¥×¥í¥°¥é¥à¤¬
¡¡¡¡¡¡´ÊÁǤËåºÎï¤Ë¤Ê¤ë¤³¤È¤Ê¤ÉÊÙ¶¯¤µ¤»¤Æ¤¤¤¿¤À¤­¤Þ¤·¤¿¡£

¤³¤Î¥×¥é¥°¥é¥à¤ò¥³¥Ô¡¼¤·¤Æ¡¢Ä¾¤°¤ËÆ°¤«¤·¤Þ¤·¤¿¡£
åºÎï¤Ë¥°¥é¥Õ¤òÉÁ¤¤¤Æ¤¯¤ì¤Þ¤·¤¿¡£
ËÜÅö¤ËÍ­Æñ¤¦¤´¤¶¤¤¤Þ¤¹¡£
º£¸å¤È¤â¸æ»ØƳ¤Î¤Û¤É¤è¤í¤·¤¯¤ª´ê¤¤¤¤¤¿¤·¤Þ¤¹¡£


·É¶ñ
 

¼°¤Îɾ²Á¡¢¤â¤¦£±¤Ä¤Î³ÈÄ¥

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 2·î20Æü(¶â)15»þ39ʬ28ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ¡Ö¿ô¤ÎÁȡפËÂФ¹¤ë¡Ö¼°¤Îɾ²Á¡Ê·×»»¡Ë¡×¤¬¤Ç¤­¤ë¤è¤¦¤Ë¼¡¤Î³ÈÄ¥¤ò¹Ô¤Ã¤¿¡£
¡¦¹½Ê¸²òÀϤȱ黻¤È¤ÎÉôʬ¤òʬΥ
¡¦FUNCTIONʸ¤Ç¤ÏÊÖ¤êÃͤò£±¤Ä¤Î¤ß¤Î¤¿¤á¡¢SUBʸ¤Çµ­½Ò

¡Ö¿ô¤ÎÁȡפȤÏ
¡¡¡¡´Ø¿ô¡¢ÊÑ¿ô¡¢Äê¿ô¤ÎÄ̾ï¤Î¿ô¼°¤Î¾ì¹ç¡¢¡ÖÃ͡סʣ±¤Ä¡Ë
¡¡¡¡Í­Íý¿ô¤Î¾ì¹ç¡¢¡Öʬ»Ò¤ÈʬÊì¡×¡Ê£²¤Ä¡Ë
¡¡¡¡Ê£ÁÇ¿ô¤Î¾ì¹ç¡¢¡Ö¼Â¿ôÉô¤Èµõ¿ôÉô¡×¡Ê£²¤Ä¡Ë
¡¡¡¡¥Ù¥¯¥È¥ë¡¢¹ÔÎó¤Î¾ì¹ç¡¢¡ÖÍ×ÁÇÎó¡×¡Ê£î¸Ä¡Ë
¡¡¡¡£±ÊÑ¿ô¿¹à¼°¤Î·¸¿ô¤¬À°¿ô¤Î¾ì¹ç¡¢¡Ö·¸¿ôÎó¡×¡Ê£î¸Ä¡Ë
¡¡¤È¤¹¤ë¡£


µ­½ÒÎã¡¡£±ÊÑ¿ô¿¹à¼°¤Î·¸¿ô¤¬À°¿ô¤Î¾ì¹ç

!¼°¡ÊÃæÃÖµ­Ë¡¡Ë¤Îɾ²Á - £±ÊÑ¿ô¿¹à¼°¤Î·¸¿ô¤¬À°¿ô¤Î¾ì¹ç¡¡¢¨UBASICÁêÅö

DECLARE EXTERNAL SUB expr.eval

!LET s$="(x-2)*(x-3)*(x-4)*(x-5)"
LET s$="(x^2-2*x+3)^2"
!LET s$="(x^5-5*x^3+5*x^2-1)/(x^2+3*x+1)" !¾¦ x^3-3*x^2+3*x-1¡¢Í¾¤ê 0
!LET s$="mod(2*x^3-13*x^2-26*x-15,x^2-2*x+3)" !¾¦ 2*x-9¡¢Í¾¤ê -50*x+12
!LET s$="gcd(3*x^2+5*x-2,3*x^2-7*x+2)" !12*x-4 { 3*x-1 }
!LET s$="lcm(3*x^2+5*x-2,3*x^2-7*x+2)" !3/4*x^3-1/4*x^2-3*x+1 { (x+2)*(x-2)*(3*x-1) }
!LET s$="lcm(x^3-16*x,x^3-8*x^2+16*x)"


DIM a(0 TO 8) !·¸¿ô a(n)*x^n+a(n-1)*x^(n-1)+ ¡Ä +a(1)*x+a(0)
CALL eval(s$, a,rc) !¼°

MAT PRINT a; !x^0,x^1,x^2, ¡Ä ¤Î½ç¡¡debug

IF rc=0 THEN CALL poly_disp(a) !·ë²Ì¤òɽ¼¨¤¹¤ë

END



MODULE expr

PUBLIC NUMERIC p,ErrNo !¶¦ÄÌÊÑ¿ô

!¡ü²òÀÏÉôʬ

!²¼°Ì¤Î¶¦Ḁ̈롼¥Á¥ó
EXTERNAL FUNCTION token$(s$) !£±Ê¸»úÆɤ߹þ¤à
   CALL EatSpace(s$)
   IF p<=LEN(s$) THEN LET token$=s$(p:p) ELSE LET token$=""
END FUNCTION

EXTERNAL SUB EatSpace(s$) !¶õÇò¤òÆɤßÈô¤Ð¤¹
   DO WHILE s$(p:p)=" " AND p<=LEN(s$)
      LET p=p+1
   LOOP
END SUB

EXTERNAL SUB CheckToken(s$,L$) !ʸ»ú¤ò³Îǧ¤¹¤ë
   CALL EatSpace(s$)
   IF UCASE$(s$(p:p+LEN(L$)-1))<>L$ THEN CALL Error(L$&"¤¬¤¢¤ê¤Þ¤»¤ó¡£")
   LET p=p+LEN(L$) !eat it
END SUB

EXTERNAL SUB Error(x$) !¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤¹¤ë
   PRINT
   PRINT x$; p

   LET errNo=1
END SUB


!¾å°Ì¥ë¡¼¥Á¥ó
PUBLIC SUB eval
EXTERNAL SUB eval(s$, v(),rc) !¼°¤Îɾ²Á
   LET errNo=0 !¥¨¥é¡¼¥³¡¼¥É
   LET p=1 !ʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿
   CALL expression(s$, v) !·×»»¤¹¤ë
   LET rc=errNo
END SUB

EXTERNAL SUB expression(s$, v()) !¼°
   DIM w(0 TO UBOUND(v))

   LET t$=token$(s$)
   IF t$="-" THEN !Éä¹æ¤Ê¤é
      LET p=p+1 !eat it

      CALL term(s$, v)
      IF errNo<>0 THEN EXIT SUB

      CALL op_neg(v, v) !v=-v
   ELSE
      IF t$="+" THEN LET p=p+1 !eat it
      CALL term(s$, v)
   END IF
   IF errNo<>0 THEN EXIT SUB


   LET t$=token$(s$)
   DO WHILE t$="+" OR t$="-" !²Ã»»¡¢¸º»»¤Ê¤é
      LET p=p+1 !eat it

      CALL term(s$, w)
      IF errNo<>0 THEN EXIT SUB

      IF t$="+" THEN !·×»»¤¹¤ë
         CALL op_add(v,w, v) !v=v+w
      ELSE
         CALL op_sub(v,w, v) !v=v-w
      END IF
      IF errNo<>0 THEN EXIT SUB

      LET t$=token$(s$) !¼¡¤Ø
   LOOP
END SUB

EXTERNAL SUB term(s$, v()) !¹à
   DIM w(0 TO UBOUND(v))

   CALL factor(s$,v)
   IF errNo<>0 THEN EXIT SUB

   LET t$=token$(s$)
   DO WHILE t$="*" OR t$="/" !¾è»»¡¢½ü»»¤Ê¤é
      LET p=p+1 !eat it

      CALL factor(s$,w)
      IF errNo<>0 THEN EXIT SUB

      IF t$="*" THEN !·×»»¤¹¤ë
         CALL op_mul(v,w, v) !v=v*w
      ELSE
         CALL op_div(v,w, v) !v=v/w
      END IF
      IF errNo<>0 THEN EXIT SUB

      LET t$=token$(s$) !¼¡¤Ø
   LOOP
END SUB

EXTERNAL SUB factor(s$, v()) !°ø»Ò
   DIM w(0 TO UBOUND(v))

   LET t$=token$(s$)
   IF t$="(" THEN !³ç¸Ì¤Ê¤é
      LET p=p+1 !eat it

      CALL expression(s$,w) !¼°
      IF errNo<>0 THEN EXIT SUB

      MAT v=w

      CALL CheckToken(s$,")") !ÊĤ¸³ç¸Ì¤«³Îǧ¤¹¤ë
   ELSE
      CALL num(s$,v)
   END IF
   IF errNo<>0 THEN EXIT SUB


   LET t$=token$(s$)
   DO WHILE t$="^" !¤Ù¤­¾è¤Ê¤é
      LET p=p+1 !eat it

      LET t$=token$(s$)
      IF t$="(" THEN !³ç¸Ì¤Ê¤é
         LET p=p+1 !eat it

         CALL expression(s$,w) !¼°
         IF errNo<>0 THEN EXIT SUB

         CALL CheckToken(s$,")") !ÊĤ¸³ç¸Ì¤«³Îǧ¤¹¤ë
      ELSE
         CALL num(s$,w)
      END IF
      IF errNo<>0 THEN EXIT SUB


      CALL op_pow(v,w, v) !·×»»¤¹¤ë¡¡v=v^w
      IF errNo<>0 THEN EXIT SUB


      LET t$=token$(s$) !¼¡¤Ø
   LOOP
END SUB

EXTERNAL SUB num(s$,v()) !¿ô
   DIM w(0 TO UBOUND(v)),x(0 TO UBOUND(v))

   LET c=fnc(s$)
   IF c>0 THEN !´Ø¿ô¤Ê¤é
      LET t$=token$(s$)
      IF t$="(" THEN !³ç¸Ì¤Ê¤é
         LET p=p+1 !eat it

         CALL expression(s$,w) !°ú¿ô£±
         IF errNo<>0 THEN EXIT SUB

         MAT v=w

         CALL CheckToken(s$,",") !¥«¥ó¥Þ¤«³Îǧ¤¹¤ë

         CALL expression(s$,w) !°ú¿ô£²
         IF errNo<>0 THEN EXIT SUB

         IF c=1 THEN !modpow(a,n,b)·Á¼°
            CALL CheckToken(s$,",") !¥«¥ó¥Þ¤«³Îǧ¤¹¤ë

            CALL expression(s$,w) !°ú¿ô£³
            IF errNo<>0 THEN EXIT SUB

            MAT x=w

            CALL set_fnc3(c,v,w,x, v) !v=fnc(v,w,x)
         ELSE
            CALL set_fnc2(c,v,w, v) !v=fnc(v,w)
         END IF
         IF errNo<>0 THEN EXIT SUB

         CALL CheckToken(s$,")") !ÊĤ¸³ç¸Ì¤«³Îǧ¤¹¤ë
      ELSE
         CALL Error("ÉÔÀµ¤Êʸ»ú¤Ç¤¹¡£")
      END IF

   ELSE
      LET c=var(s$)
      IF c>0 THEN !ÊÑ¿ô¤Ê¤é
         CALL set_var(c, v)
      ELSE
         LET c=number(s$)
         IF c>=0 THEN !Äê¿ô¡Ê¿ôÃ͡ˤʤé
            CALL set_number(c, v)
         ELSE
            CALL Error("ÉÔÀµ¤Êʸ»ú¤Ç¤¹¡£")
         END IF
      END IF

   END IF
END SUB

EXTERNAL FUNCTION fnc(s$) !´Ø¿ô
   DATA "MODPOW","MODINV","MOD","GCD","LCM" !¢¨Ê¸»úŤ¬Â礭¤¤½ç
   LET k=0
   DO
      LET k=k+1
      READ IF MISSING THEN EXIT DO: d$
      IF UCASE$(s$(p:p+LEN(d$)-1))=UCASE$(d$) THEN !°ìÃפ·¤¿¤é
         LET p=p+LEN(d$)
         LET fnc=k
         EXIT FUNCTION
      END IF
   LOOP
   LET fnc=-1
END FUNCTION

EXTERNAL FUNCTION var(s$) !ÊÑ¿ô
   LET t$=UCASE$(token$(s$)) !Âçʸ»ú¤Ø
   IF "A"<=t$ AND t$<="Z" THEN
   !!!IF t$="X" THEN
      LET p=p+1 !eat it
      LET var=ORD(t$)-ORD("@") !¥ª¥Õ¥»¥Ã¥È¡¡@=0,A=1,B=2,¡Ä,Z=26
   ELSE
      LET var=-1
   END IF
END FUNCTION

EXTERNAL FUNCTION number(s$) !¿ôÃÍ¡Ê£°¡¢Àµ¤ÎÀ°¿ô¡Ë
   LET i0=p !ÀèƬ°ÌÃÖ¤òµ­Ï¿¤¹¤ë

   LET t$=token$(s$)
   DO WHILE t$>="0" AND t$<="9"
      LET p=p+1
      LET t$=token$(s$)
   LOOP

   LET number=-1
   IF p>i0 THEN LET number=VAL(s$(i0:p-1)) !¿ô»úÎó¤ÎÈϰϤòÀÚ¤ê¼è¤ë
END FUNCTION


¤Ä¤Å¤¯
 

Re: ¼°¤Îɾ²Á¡¢¤â¤¦£±¤Ä¤Î³ÈÄ¥

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 2·î20Æü(¶â)15»þ42ʬ40ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.286[¸µµ­»ö¤Ø]

¤Ä¤Å¤­

!¡ü±é»»Éôʬ¡¡¢¨¡Ö¿ô¤ÎÁȡפ˱þ¤¸¤Æ±é»»¤òÄêµÁ¤¹¤ë

EXTERNAL SUB op_neg(v1(), v()) !Éä¹æ¡ÊÉé¡Ë
   MAT v=(-1)*v1
END SUB

EXTERNAL SUB op_add(v1(),v2(), v()) !²Ã»»
   MAT v=v1+v2
END SUB

EXTERNAL SUB op_sub(v1(),v2(), v()) !¸º»»
   MAT v=v1-v2
END SUB

EXTERNAL SUB op_mul(v1(),v2(), v()) !¾è»»
   LET N=UBOUND(v)
   DIM w(0 TO N*2) !·å¿ô¤Ï£²Çܤˤʤë

   MAT w=ZER
   FOR i=0 TO N !·¸¿ô
      FOR j=0 TO N
         LET w(i+j)=w(i+j)+v1(i)*v2(j) !¾ö¤ß¹þ¤ß
      NEXT j
   NEXT i
   IF poly_degree(w)>N THEN CALL Error("¥ª¡¼¥Ð¡¼¥Õ¥í¡¼")

   FOR i=0 TO N !²¼n·å¤ò¥³¥Ô¡¼¤¹¤ë
      LET v(i)=w(i)
   NEXT i
END SUB

EXTERNAL SUB op_div(v1(),v2(), v()) !½ü»»
   DIM Q(0 TO UBOUND(v)),R(0 TO UBOUND(v))

   IF poly_degree(v2)=0 AND v2(0)=0 THEN !Äê¿ô¤Î£°¤Ê¤é
      CALL Error("£°¤Ç¤Ï³ä¤ì¤Þ¤»¤ó¡£")
      EXIT SUB
   END IF
   CALL poly_div(v1,v2, Q,R)
   MAT v=Q !¾¦¡¡¢¨v=INT(v1/v2)¤ËÁêÅö
END SUB

EXTERNAL SUB op_pow(v1(),v2(), v()) !¤Ù¤­»»
   DIM x(0 TO UBOUND(v)),T(0 TO UBOUND(v))

   MAT x=v1 !x=v1

   MAT T=ZER !Äê¿ô£±
   LET T(0)=1

   IF poly_degree(v1)=0 THEN !Äê¿ô¹à¤Î¤ß¡ÊÄê¿ô¡Ë
      IF poly_degree(v2)>0 THEN CALL Error("¤Ù¤­¿ô¤ÏÀ°¿ô¤Î¤ß")
      IF errNo<>0 THEN EXIT SUB
      IF v1(0)=0 AND v2(0)<0 THEN CALL Error("£°¤ÎÉé¤Ù¤­¾è")
      IF errNo<>0 THEN EXIT SUB

      LET v(0)=v1(0)^v2(0)
   ELSE
      IF poly_degree(v2)>0 OR v2(0)<0 THEN CALL Error("¤Ù¤­¿ô¤ÏÈóÉéÀ°¿ô¤Î¤ß")
      IF errNo<>0 THEN EXIT SUB

      LET m=v2(0)
      DO UNTIL m=0
         IF MOD(m,2)=1 THEN CALL op_mul(T,x, T) !¥Ó¥Ã¥È¤¬£±¤Ê¤é¡¢T=T*x
         IF errNo<>0 THEN EXIT SUB
         CALL op_mul(x,x, x) !x=x^2
         IF errNo<>0 THEN EXIT SUB

         LET m=INT(m/2) !£²¿Ê¿ô¤Ë¤¹¤ë
      LOOP
      MAT v=T
   END IF
END SUB


EXTERNAL SUB set_fnc(c,v1(), v()) !´Ø¿ô¡ÊÃ͡ˤòÀßÄꤹ¤ë¡¡¢¨°ú¿ô£±¸Ä
!³ºÅö´Ø¿ô¤Ê¤·
END SUB

EXTERNAL SUB set_fnc2(c,v1(),v2(), v()) !´Ø¿ô¡ÊÃ͡ˤòÀßÄꤹ¤ë¡¡¢¨°ú¿ô£²¸Ä
   LET N=UBOUND(v)
   DIM Q(0 TO N),R(0 TO N),A(0 TO N),B(0 TO N)

   SELECT CASE c !³Æ´Ø¿ô¤Ë±þ¤¸¤Æ
   CASE 2 !modinv
      PRINT "modinv´Ø¿ô¤Ï̤¥µ¥Ý¡¼¥È¡ª"
   CASE 3 !¾ê;
      CALL poly_div(v1,v2, Q,R)
      MAT v=R !;¤ê
   CASE 4,5 !ºÇÂç¸øÌó¿ô¡¢ºÇ¾®¸øÇÜ¿ô
      MAT A=v1
      MAT B=v2
      DO UNTIL poly_degree(B)=0 AND B(0)=0 !b=0
         CALL poly_div(A,B, Q,R) !R=MOD(a,b)
         MAT A=B !a=b
         MAT B=R !b=R
      LOOP

      IF c=5 THEN !LCM=v1*v2/GCD(v1,v2)
         CALL op_div(v1,A, Q)
         IF errNo<>0 THEN EXIT SUB
         CALL op_mul(Q,v2, v)
      ELSE !GCD
         MAT v=A
      END IF
   CASE ELSE
   END SELECT
END SUB

EXTERNAL SUB set_fnc3(c,v1(),v2(),v3(), v()) !´Ø¿ô¡ÊÃ͡ˤòÀßÄꤹ¤ë¡¡¢¨°ú¿ô£³¸Ä
   PRINT "modpow´Ø¿ô¤Ï̤¥µ¥Ý¡¼¥È¡ª"
END SUB

EXTERNAL SUB set_var(c, v()) !ÊÑ¿ô¡ÊÃÍ¡Ë
   MAT v=ZER
   LET v(1)=1 !x^1¤Î·¸¿ô
END SUB

EXTERNAL SUB set_number(c, v()) !Äê¿ô¡Ê¿ôÃÍ¡Ë
   MAT v=ZER
   LET v(0)=c !x^0¤Î·¸¿ô
END SUB

END MODULE



!Êä½õ¥ë¡¼¥Á¥ó

!±é»»´ØÏ¢

EXTERNAL SUB poly_div(A(),B(), Q(),R()) !½ü»»¡¡¢¨Èï½ü¿ô=¾¦*½ü¿ô+;¤ê
DIM w(0 TO UBOUND(A))

LET aa=poly_degree(A)
LET bb=poly_degree(B)

MAT Q=ZER !¾¦¡¢¤½¤Î¼¡¿ô
LET qq=MAX(aa-bb,0)

MAT R=A !;¤ê¡¢¤½¤Î¼¡¿ô
LET rr=aa

DO WHILE rr>=bb !Èï½ü¿ô¤Î¼¡¿ô¤¬½ü¿ô¤Î¤è¤êÂ礭¤¤¤Ê¤é
   IF R(rr)<>0 THEN !·¸¿ô¤¬£°°Ê³°¤Ê¤é
      LET k=R(rr)/B(bb) !¾¦¤Î·¸¿ô
      LET Q(rr-bb)=k !¾¦

      MAT w=ZER !;¤ê
      FOR i=bb TO 0 STEP -1 !R=A-k*B¡¡¢¨É®»»»²¾È
         LET w(rr-bb+i)=k*B(i)
      NEXT i
      MAT R=R-w
   END IF
   LET rr=rr-1 !¼¡¤Î¼¡¿ô¤Ø
LOOP
END SUB

EXTERNAL FUNCTION poly_degree(v()) !¼¡¿ô¤òÆÀ¤ë
FOR i=UBOUND(v) TO 1 STEP -1
   IF v(i)<>0 THEN EXIT FOR !·¸¿ô¤¬£°¤Ç¤Ê¤¤ºÇ½é¤Î°ÌÃÖ
NEXT i
LET poly_degree=i
END FUNCTION


!ɽ¼¨´ØÏ¢

EXTERNAL SUB poly_disp(A()) !¿¹à¼°¤òɽ¼¨¤¹¤ë¡¡a(X)=¦²AkX^k=AnX^n+An-1X^n-1+¡Ä+A1X+A0
LET aa=poly_degree(A) !ºÇ½é¤Î¹à
CALL mono_disp(A(aa),aa)
FOR i=aa-1 TO 0 STEP -1 !¼¡¹à
   LET w=A(i)
   IF w>0 THEN PRINT "+";
   IF w<>0 OR (w=0 AND aa=0) THEN CALL mono_disp(w,i)
NEXT i
END SUB

EXTERNAL SUB mono_disp(ak,k) !ñ¹à¼°¤òɽ¼¨¤¹¤ë¡¡Ak*X^k
IF k<>0 THEN !x^n¤Ç
   IF ak=1 THEN !·¸¿ô¤¬£±¤Ê¤é
   ELSEIF ak=-1 THEN !·¸¿ô¤¬¡Ý£±¤Ê¤é
      PRINT "-";
   ELSE
      PRINT STR$(ak);"*";
   END IF
END IF
IF k=0 THEN !¼¡¿ô¤¬£°¤Ê¤é
   PRINT STR$(ak);
ELSEIF k=1 THEN !¼¡¿ô¤¬£±¤Ê¤é
   PRINT "X";
ELSE
   PRINT "X^";STR$(k);
END IF
END SUB


°Ê¾å
 

Re: ÀáÅÀ²òÀÏË¡¤Ë¤Ä¤¤¤Æ¡¡¡Ê£³¡Ë

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 2·î22Æü(Æü)01»þ18ʬ14ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.284[¸µµ­»ö¤Ø]

!<<ÉÕÏ¿>>
! ¥È¥é¥ó¥¸¥¹¥¿£±¤Ä¤Î¥¨¥ß¥Ã¥¿¡¦¥Õ¥©¥í¥¢¤Ê¤É¤ò»ÈÍѤ¹¤ë¾ì¹ç¡¢ÍøÆÀGv ¤¬
! ½½Ê¬¤Ç¤Ê¤¯¡¢ÆþÎϤΥ¤¥Þ¥¸¥Ê¥ëŽ¥¥·¥ç¡¼¥È°·¤¤¤¬½ÐÍè¤Ê¤¤¾ì¹ç¤â¡¢¤¢¤ê¤Þ¤¹¡£
! £Ç£ö¡á£±£°¡Á£±£°£°°Ì¤Î¾®¤µ¤¤»þ¡¢²¼¿Þ¤Î£Ë¤Ç·×»»¤·¤Þ¤¹¡£

!                         ľÎóµ¢´Ô·¿ Negative.Feed.Back amp
!                         Gv ¢ª¡ç¡¢K ¢ª1 ¤Î´Ê°×¥Ù¥¯¥È¥ë¿Þ
!             ¨£¨¡R1¨¡­¡               ¨¡¨¡¨¡¨¡¨¡¨¡¢ªV3
!             ¢¬                       ¢ª  ¨¡¨¡¨¡¨¡¢ª(Ei)+(Ei)*Gv =V3
!             Vin                     (Ei) (Ei)*Gv =V5
!             ¨¢                                         K=V5/V3
!             £°              ¨£¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¤
!                             ¨¢      ¨£¨¡¨¡¨¡¨¡¨¡¨¡¨¤¨¢ ¢¨(Ei)¤Ï¡¢
!             Ʊ ¾å            C2      ¨¢  ¨£¨¡¨¡¨¡¨¤¨¢¨¢   +~-¤Îº¹Ê¬
!                             ¨¢      ¨¦¨¡¨©-     ¨¢¨¢¨¢
!         ¨£¨¡¨¡¨¡¨¡¨¡¨¤      ¨¢       (Ei)¨¢ÍøÆÀGv¨§¨ª­¥¨¡
!         ¨¢¡¡¨£¨¡R1¨¡­¡¨¡R2¨¡­¢¨¡R3¨¡­£¨¡¨©+     ¨¢  ¢¬ V5
!         ¢¬  ¨¢¡¡     ¢¬V1    ¢¬V2    ¢¬V3¨¦¨¡¨¡¨¡¨¥  ¨¢
!   Is=Vin/R1 ¨¢      C1              C3   K=Gv/(1+Gv)¨¢
!         ¢¬  ¨¢      ¨¢              ¨¢              ¨¢
!         ¨ª¨¡£°¨¡¨¡¨¡¨ª¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨ª¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨ª¨¡
!
! | 1/R1+1/R2+j*¦Ø*C1  -1/R2                0             | |V1| |Vin/R1|
! |-1/R2                1/R2+1/R3+j*¦Ø*C2  -1/R3-K*j*¦Ø*C2| |V2|=| 0    |
! | 0                  -1/R3                1/R3+j*¦Ø*C3  | |V3| | 0    |
!

OPTION ANGLE DEGREES
OPTION ARITHMETIC COMPLEX
LET NP=3
LET rss=10 !14¡¡¼þÇÈ¿ô¡¢10ÇÜËè¤Î¥¹¥Æ¥Ã¥×¿ô
!
DIM FREQ(0 TO rss*4, 4), A(NP,NP), T(NP,NP), EOUT(NP,1), B(NP,1)
!----
! ¼þÇÈ¿ô10Hz~100KHz¡¢ÅùÈ楹¥Æ¥Ã¥×
FOR p=0 TO rss*4
   LET FREQ(p,1)=10^(1+p/rss)
NEXT p
!----
! CR 3ÃʲóÏ©
LET R1=51E3       !¦¸
LET R2=82E3       !¦¸   51E3 ! °Ê²¼¡¢±¦Â¦¤Î¿ôÃͤÇGv=100¤Ç¤â¡¢¤Û¤Üʿó¤ËÌá¤ë¡£
LET R3=39E3       !¦¸
LET C1=0.00685E-6 !F    0.0047E-6
LET C2=0.022E-6   !F    0.033E-6
LET C3=330E-12    !F    270E-12
!----
SET WINDOW 0.5,5.5, -55,5
DRAW grid(1,5)
!----
! ÌÜÀ¹¤ê
FOR p=0 TO 5
   SET TEXT COLOR "black"
   PLOT TEXT ,AT p+0.9, 1    :mid$("10  100 1k  10k 100k", 4*p+1, 4)    !£ø¼´ 10Hz~100kHz
   PLOT TEXT ,AT 0.7,-10*p-2 :mid$("  0 -25 -50 -75 -100-125", 4*p+1, 4)!£ù¼´ 0~-125dB º¸
   SET TEXT COLOR "red"
   PLOT TEXT ,AT 5.1,-10*p-2 :mid$(" 0  -80 -160-240-320-400", 4*p+1, 4)!£ù¼´ 0~-400¡ë±¦
NEXT p
!----
FOR Gv=10 TO 100 STEP 10
   LET K=Gv/(1+Gv)
   PRINT USING "Gv=### K=.####" :Gv, K
   PRINT "Èֹ栠 ¼þÇÈ¿ô      E5         ¦È5"
   !----
   FOR p=0 TO rss*4
      LET ¦Ø=2*PI*FREQ(p,1)
      !
      LET A(1,1)= 1/R1+1/R2+COMPLEX(0,¦Ø*C1)
      LET A(1,2)=-1/R2
      LET A(1,3)=0
      LET A(2,1)=-1/R2
      LET A(2,2)= 1/R2+1/R3+COMPLEX(0,¦Ø*C2)
      LET A(2,3)=-1/R3-K*COMPLEX(0,¦Ø*C2)
      LET A(3,1)=0
      LET A(3,2)=-1/R3
      LET A(3,3)= 1/R3+COMPLEX(0,¦Ø*C3)
      !
      LET Vin=1
      LET B(1,1)=Vin/R1
      LET B(2,1)=0
      LET B(3,1)=0
      !
      MAT T=INV(A)
      MAT EOUT=T*B
      !
      LET Af=K*EOUT(3,1)/Vin
      LET Pf=arg(Af)
      IF Pf>0 THEN LET Pf=Pf-360
      LET FREQ(p,2)=20*LOG10(ABS(Af))
      LET FREQ(p,4)=Pf
      !------
      !¥ê¥¹¥È
      PRINT USING "### ###,###.# ####.### dB ####.### ÅÙ": p, FREQ(p,1), FREQ(p,2), FREQ(p,4)
      !------
      !¥°¥é¥Õ
      IF 0<p THEN
         SET LINE COLOR "black"
         PLOT LINES:LOG10(FREQ(p-1,1)),0.4*FREQ(p-1,2); LOG10(FREQ(p,1)),0.4*FREQ(p,2) !ÍøÆÀ[dB]
         SET LINE COLOR "red"
         PLOT LINES:LOG10(FREQ(p-1,1)),0.125*FREQ(p-1,4); LOG10(FREQ(p,1)),0.125*FREQ(p,4) !°ÌÁê[ÅÙ]
      END IF
   NEXT p
NEXT Gv

END
 

Re: ÀáÅÀ²òÀÏË¡¤Ë¤Ä¤¤¤Æ¡¡¡Ê£³¡Ë

 Åê¹Æ¼Ô¡§Âç·§¡¡Àµ  Åê¹ÆÆü¡§2009ǯ 2·î22Æü(Æü)14»þ41ʬ46ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.288[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> !<<ÉÕÏ¿>>
> ! ¥È¥é¥ó¥¸¥¹¥¿£±¤Ä¤Î¥¨¥ß¥Ã¥¿¡¦¥Õ¥©¥í¥¢¤Ê¤É¤ò»ÈÍѤ¹¤ë¾ì¹ç¡¢ÍøÆÀGv ¤¬
> ! ½½Ê¬¤Ç¤Ê¤¯¡¢ÆþÎϤΥ¤¥Þ¥¸¥Ê¥ëŽ¥¥·¥ç¡¼¥È°·¤¤¤¬½ÐÍè¤Ê¤¤¾ì¹ç¤â¡¢¤¢¤ê¤Þ¤¹¡£
> ! £Ç£ö¡á£±£°¡Á£±£°£°°Ì¤Î¾®¤µ¤¤»þ¡¢²¼¿Þ¤Î£Ë¤Ç·×»»¤·¤Þ¤¹¡£
>
> !                         ľÎóµ¢´Ô·¿ Negative.Feed.Back amp
> !                         Gv ¢ª¡ç¡¢K ¢ª1 ¤Î´Ê°×¥Ù¥¯¥È¥ë¿Þ
> !             ¨£¨¡R1¨¡­¡               ¨¡¨¡¨¡¨¡¨¡¨¡¢ªV3
> !             ¢¬                       ¢ª  ¨¡¨¡¨¡¨¡¢ª(Ei)+(Ei)*Gv =V3
> !             Vin                     (Ei) (Ei)*Gv =V5
> !             ¨¢                                         K=V5/V3
> !             £°              ¨£¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¤
> !                             ¨¢      ¨£¨¡¨¡¨¡¨¡¨¡¨¡¨¤¨¢ ¢¨(Ei)¤Ï¡¢
> !             Ʊ ¾å            C2      ¨¢  ¨£¨¡¨¡¨¡¨¤¨¢¨¢   +~-¤Îº¹Ê¬
> !                             ¨¢      ¨¦¨¡¨©-     ¨¢¨¢¨¢
> !         ¨£¨¡¨¡¨¡¨¡¨¡¨¤      ¨¢       (Ei)¨¢ÍøÆÀGv¨§¨ª­¥¨¡
> !         ¨¢¡¡¨£¨¡R1¨¡­¡¨¡R2¨¡­¢¨¡R3¨¡­£¨¡¨©+     ¨¢  ¢¬ V5
> !         ¢¬  ¨¢¡¡     ¢¬V1    ¢¬V2    ¢¬V3¨¦¨¡¨¡¨¡¨¥  ¨¢
> !   Is=Vin/R1 ¨¢      C1              C3   K=Gv/(1+Gv)¨¢
> !         ¢¬  ¨¢      ¨¢              ¨¢              ¨¢
> !         ¨ª¨¡£°¨¡¨¡¨¡¨ª¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨ª¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨ª¨¡
> !
> ! | 1/R1+1/R2+j*¦Ø*C1  -1/R2                0             | |V1| |Vin/R1|
> ! |-1/R2                1/R2+1/R3+j*¦Ø*C2  -1/R3-K*j*¦Ø*C2| |V2|=| 0    |
> ! | 0                  -1/R3                1/R3+j*¦Ø*C3  | |V3| | 0    |
> !
>

Âç·§¤Ç¤¹¡£
¤ªË»¤·¤¤½ê¡¢¿§¿§¤È¸æ»ØƳ夭ͭÆñ¤¦¤´¤¶¤¤¤Þ¤¹¡£

¥¹¥Þ¡¼¥È¤Ê¥×¥í¥°¥é¥à¤äÊýÄø¼°¤Î¹Í¤¨Êý¤Ë¤Ä¤¤¤Æ
ÊÙ¶¯¤µ¤»¤Æ¤¤¤¿¤À¤¤¤Æ¤ª¤ê¤Þ¤¹¡£
º£¸å¤È¤â¤è¤í¤·¤¯¸æ´ê¤¤¤¤¤¿¤·¤Þ¤¹¡£

·É¶ñ


 

Re: ÀáÅÀ²òÀÏË¡¤Ë¤Ä¤¤¤Æ¡¡¡Ê£³¡Ë

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 2·î23Æü(·î)16»þ03ʬ38ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.288[¸µµ­»ö¤Ø]

!<<ÉÕÏ¿£²>>
!¡¡ÀáÅÀÊýÄø¼°¡§¥­¥ë¥Ò¥Û¥Ã¥ÕÂ裱ˡ§ ¡Ä£±ÅÀ¤Ø¤ÎÅÅή¡¡ÁíÏ¡ᣰ
!¡¡ÌÖÏ©ÊýÄø¼°¡§¥­¥ë¥Ò¥Û¥Ã¥ÕÂ裲ˡ§ ¡ÄÊIJóÏ©¤ÎÅŰ̺¹ÁíÏ¡ᣰ

!¡¡Í¾·×¤Ç¤¹¤¬¡¢ÌÖÏ©ÊýÄø¼°¡ÊÂ裲ˡ§¡Ë¤ÎÊý¤ò¡¢»È¤Ã¤¿Îã¡£
!
!                   ¨£¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¤
!                   ¨¢      ¨£¨¡¨¡¨¡¨¡¨¡¨¡¨¤¨¢
!                   C2      ¨¢  ¨£¨¡¨¡¨¡¨¤¨¢¨¢
!                   ¨¢¨¢i3  ¨¦¨¡¨©-     ¨¢¨¢¨¢
!                   ¨¢¨¦¨¡¨¡¨¡¨¤¨¢ÍøÆÀGv¨§¨ª¨«¨¡
! ¡¡¨£¨¡R1¨¡¨¨¨¡R2¨¡¨ª¨¡R3¨¡¨¨¨«¨©+     ¨¢  ¢¬ Vout=K*(i2+i3)/(j*¦Ø*C3)
!   ¢¬ ¨£¢ª ¨¢    ¨£¢ª      ¨¢¢­¨¦¨¡¨¡¨¡¨¥  ¨¢
!   Vin¨¢i1 C1    ¨¢i2      C3   K=Gv/(1+Gv)¨¢
!   ¨¢ ¨¦   ¨¢    ¨¦        ¨¢              ¨¢
!   £°¨¡¨¡¨¡¨ª¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨ª¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨ª¨¡
!
! | R1+1/(j*¦Ø*C1) -1/(j*¦Ø*C1)                   0                         | |i1| |Vin |
! |-1/(j*¦Ø*C1)     1/(j*¦Ø*C1)+R2+R3+1/(j*¦Ø*C3) R3+1/(j*¦Ø*C3)            | |i2|=| 0  |
! | 0               R3+1/(j*¦Ø*C3)                1/(j*¦Ø*C2)+R3+1/(j*¦Ø*C3)| |i3| |Vout|

! | R1+1/(j*¦Ø*C1) -1/(j*¦Ø*C1)                   0                                     | |i1| |Vin|
! |-1/(j*¦Ø*C1)     1/(j*¦Ø*C1)+R2+R3+1/(j*¦Ø*C3) R3+1/(j*¦Ø*C3)                        | |i2|=| 0 |
! | 0               R3+1/(j*¦Ø*C3)-K/(j*¦Ø*C3)    1/(j*¦Ø*C2)+R3+1/(j*¦Ø*C3)-K/(j*¦Ø*C3)| |i3| | 0 |
!

OPTION ANGLE DEGREES
OPTION ARITHMETIC COMPLEX
LET NP=3
LET rss=10 !14¡¡¼þÇÈ¿ô¡¢10ÇÜËè¤Î¥¹¥Æ¥Ã¥×¿ô
!
DIM FREQ(0 TO rss*4, 4), A(NP,NP), T(NP,NP), IOUT(NP,1), B(NP,1)
!----
! ¼þÇÈ¿ô10Hz~100KHz¡¢ÅùÈ楹¥Æ¥Ã¥×
FOR p=0 TO rss*4
   LET FREQ(p,1)=10^(1+p/rss)
NEXT p
!----
! CR 3ÃʲóÏ©      ! (Gv=1000000) ! (Gv=100)
LET R1=51E3       !¦¸
LET R2=51E3       !¦¸ 82E3       ! 51E3
LET R3=39E3       !¦¸
LET C1=0.0047E-6  !F  0.00685E-6 ! 0.0047E-6
LET C2=0.033E-6   !F  0.022E-6   ! 0.033E-6
LET C3=270E-12    !F  330E-12    ! 270E-12
!----
SET WINDOW 0.5,5.5, -55,5
DRAW grid(1,5)
!----
! ÌÜÀ¹¤ê
FOR p=0 TO 5
   SET TEXT COLOR "black"
   PLOT TEXT ,AT p+0.9, 1    :mid$("10  100 1k  10k 100k", 4*p+1, 4)    !£ø¼´ 10Hz~100kHz
   PLOT TEXT ,AT 0.7,-10*p-2 :mid$("  0 -25 -50 -75 -100-125", 4*p+1, 4)!£ù¼´ 0~-125dB º¸
   SET TEXT COLOR "red"
   PLOT TEXT ,AT 5.1,-10*p-2 :mid$(" 0  -80 -160-240-320-400", 4*p+1, 4)!£ù¼´ 0~-400¡ë±¦
NEXT p
!----
FOR Gv=10 TO 100 STEP 10
   LET K=Gv/(1+Gv)
   PRINT USING "Gv=### K=.####" :Gv, K
   PRINT "Èֹ栠 ¼þÇÈ¿ô    Vout/Vin    ¦È"
   !----
   FOR p=0 TO rss*4
      LET ¦Ø=2*PI*FREQ(p,1)
      !
      LET A(1,1)= R1+1/COMPLEX(0,¦Ø*C1)
      LET A(1,2)=-1/COMPLEX(0,¦Ø*C1)
      LET A(1,3)=0
      LET A(2,1)=-1/COMPLEX(0,¦Ø*C1)
      LET A(2,2)= 1/COMPLEX(0,¦Ø*C1)+R2+R3+1/COMPLEX(0,¦Ø*C3)
      LET A(2,3)= R3+1/COMPLEX(0,¦Ø*C3)
      LET A(3,1)=0
      LET A(3,2)= R3+1/COMPLEX(0,¦Ø*C3)-K/COMPLEX(0,¦Ø*C3)
      LET A(3,3)=1/COMPLEX(0,¦Ø*C2)+R3+1/COMPLEX(0,¦Ø*C3)-K/COMPLEX(0,¦Ø*C3)
      !
      LET Vin=1
      LET B(1,1)=Vin
      LET B(2,1)=0
      LET B(3,1)=0
      !
      MAT T=INV(A)
      MAT IOUT=T*B
      !
      LET Af=K*((IOUT(2,1)+IOUT(3,1))/COMPLEX(0,¦Ø*C3))/Vin
      LET Pf=arg(Af)
      IF Pf>0 THEN LET Pf=Pf-360
      LET FREQ(p,2)=20*LOG10(ABS(Af))
      LET FREQ(p,4)=Pf
      !------
      !¥ê¥¹¥È
      PRINT USING "### ###,###.# ####.### dB ####.### ÅÙ": p, FREQ(p,1), FREQ(p,2), FREQ(p,4)
      !------
      !¥°¥é¥Õ
      IF 0< p THEN
         SET LINE COLOR "black"
         PLOT LINES:LOG10(FREQ(p-1,1)),0.4*FREQ(p-1,2); LOG10(FREQ(p,1)),0.4*FREQ(p,2) !ÍøÆÀ[dB]
         SET LINE COLOR "red"
         PLOT LINES:LOG10(FREQ(p-1,1)),0.125*FREQ(p-1,4); LOG10(FREQ(p,1)),0.125*FREQ(p,4) !°ÌÁê[ÅÙ]
      END IF
   NEXT p
NEXT Gv

END

!
²¼¿Þ¤Ï¡¢i3 ¤òµÕÊý¸þ¤Ë¤·¤¿¤â¤Î¤Ç¡¢Á´¤¯Æ±¤¸¤â¤Î¤Ç¤¹¡£³Æ¼°¤ÎÉé¹æ¤ËÃí°Õ¡ª
!
!                   ¨£¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¤
!                   ¨¢      ¨£¨¡¨¡¨¡¨¡¨¡¨¡¨¤¨¢
!                   C2¢¬    ¨¢  ¨£¨¡¨¡¨¡¨¤¨¢¨¢
!                   ¨¢¨¢i3  ¨¦¨¡¨©-     ¨¢¨¢¨¢
!                   ¨¢¨¦¨¡¨¡¨¡¨¤¨¢ÍøÆÀGv¨§¨ª¨«¨¡
! ¡¡¨£¨¡R1¨¡¨¨¨¡R2¨¡¨ª¨¡R3¨¡¨¨¨«¨©+     ¨¢  ¢¬ Vout=K*(i2-i3)/(j*¦Ø*C3)
!   ¢¬ ¨£¢ª ¨¢    ¨£¢ª      ¨¢  ¨¦¨¡¨¡¨¡¨¥  ¨¢
!   Vin¨¢i1 C1    ¨¢i2      C3   K=Gv/(1+Gv)¨¢
!   ¨¢ ¨¦   ¨¢    ¨¦        ¨¢              ¨¢
!   £°¨¡¨¡¨¡¨ª¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨ª¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨ª¨¡
!
! | R1+1/(j*¦Ø*C1) -1/(j*¦Ø*C1)                    0                         | |i1| | Vin |
! |-1/(j*¦Ø*C1)     1/(j*¦Ø*C1)+R2+R3+1/(j*¦Ø*C3) -R3-1/(j*¦Ø*C3)            | |i2|=|  0  |
! | 0              -R3-1/(j*¦Ø*C3)                 1/(j*¦Ø*C2)+R3+1/(j*¦Ø*C3)| |i3| |-Vout|

! | R1+1/(j*¦Ø*C1) -1/(j*¦Ø*C1)                    0                                     | |i1| |Vin|
! |-1/(j*¦Ø*C1)     1/(j*¦Ø*C1)+R2+R3+1/(j*¦Ø*C3) -R3-1/(j*¦Ø*C3)                        | |i2|=| 0 |
! | 0              -R3-1/(j*¦Ø*C3)+K/(j*¦Ø*C3)     1/(j*¦Ø*C2)+R3+1/(j*¦Ø*C3)-K/(j*¦Ø*C3)| |i3| | 0 |
!

!¡¡i3 µÕÊý¸þ¤Î¡¢º¹¤·Âؤ¨Éôʬ(¡¡º¸Ã¼!¤ò³°¤·¤Æ»ÈÍÑ¡£¡Ë
!      LET A(1,1)= R1+1/COMPLEX(0,¦Ø*C1)
!      LET A(1,2)=-1/COMPLEX(0,¦Ø*C1)
!      LET A(1,3)= 0
!      LET A(2,1)=-1/COMPLEX(0,¦Ø*C1)
!      LET A(2,2)= 1/COMPLEX(0,¦Ø*C1)+R2+R3+1/COMPLEX(0,¦Ø*C3)
!      LET A(2,3)=-R3-1/COMPLEX(0,¦Ø*C3)
!      LET A(3,1)= 0
!      LET A(3,2)=-R3-1/COMPLEX(0,¦Ø*C3)+K/COMPLEX(0,¦Ø*C3)
!      LET A(3,3)= 1/COMPLEX(0,¦Ø*C2)+R3+1/COMPLEX(0,¦Ø*C3)-K/COMPLEX(0,¦Ø*C3)
!      !
!      LET Vin=1
!      LET B(1,1)=Vin
!      LET B(2,1)=0
!      LET B(3,1)=0
!      !
!      MAT T=INV(A)
!      MAT IOUT=T*B
!      !
!      LET Af=K*((IOUT(2,1)-IOUT(3,1))/COMPLEX(0,¦Ø*C3))/Vin
!¤³¤³¤Þ¤Ç
!
 

ÊÔ½¸¤µ¤»¤Æ¤¤¤¿¤À¤­¤Þ¤·¤¿

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ 2·î23Æü(·î)18»þ50ʬ14ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.255[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> kikiriri¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

Ĺ¤é¤¯¤´ÊÖÅú¤¤¤¿¤À¤±¤Ê¤«¤Ã¤¿¤¿¤á¡¢

¤³¤Î¤è¤¦¤Ê·Á¤ÇÊÔ½¸¤µ¤»¤Æ¤¤¤¿¤À¤­¤Þ¤·¤¿¡£

»³ÃæϵÁ¤µ¤ó¤Ø

¡¡¡¡kikiriri¤è¤ê

¡¡¤´²óÅú(¥×¥í¥°¥é¥à¡Ë¡¢À¿¤Ë¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
 

!£³ÃÊ·¿£Ã£Ò¾º°µ²óÏ©¤ò»È¤Ã¤¿È¯¿¶´ï¤Î¡¢Ê£ÁÇÊ¿Ì̵°À×

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 2·î26Æü(ÌÚ)09»þ48ʬ16ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.280[¸µµ­»ö¤Ø]

!¾å¤Î¥ê¥ó¥¯¥Ú¡¼¥¸¤ÎÅÁã´Ø¿ôZT(s)¤Ë¸í»ú¤¬Í­¤Ã¤¿»ö¤ò¸æÏͤӤ·¤Þ¤¹¡£

!£³ÃÊ·¿£Ã£Ò¾º°µ²óÏ©¤ò»È¤Ã¤¿È¯¿¶´ï¤Î¡¢Ê£ÁÇÊ¿Ì̵°À×

!ΩÂÎÉÁ²è¤Ï¡¢»³Ãæ»á¤Î£³£Ä¥°¥é¥Õ¤Ë¤è¤ë¡£

!£³ÃÊ·¿£Ã£Ò¾º°µ²óÏ©¤ÎÅÁã´Ø¿ôZT(s)¡¡( R =R1=R2=R3, C =C1=C2=C3 )
! ZT(s)=(1+5*R*C*s+6*R^2*C^2*s^2)/(1+5*R*C*s+6*R^2*C^2*s^2 + R^3*C^3*s^3)

!ZT(s)*K=1 !¡¡ÁýÉýΨ K ¤ò½ÄÎ󤷤ơ¢Æþ½ÐÎÏûÍí¥ë¡¼¥×¤Ë¤·¤¿¼°¡£¤³¤Îº¬ s ¤òµá¤á¤ë¡£

!(1+5*R*C*s+6*R^2*C^2*s^2)*K=(1+5*R*C*s+6*R^2*C^2*s^2 + R^3*C^3*s^3)
! R^3*C^3*s^3 +(1-K)(1+5*R*C*s+6*R^2*C^2*s^2)=0
! s^3 +6*(1-K)/(R*C)*s^2 +5*(1-K)/(R^2*C^2)*s +(1-K)/(R^3*C^3) =0
! ¤³¤Î£³º¬£ó¤ò¡¢ÁýÉýΨ K=Gv/(1+Gv) ¤Î´Ø¿ô¤È¤·¤Æ¡¢ÉÁ¤¯¡£(Gv ¤Ï¡¢Í祢¥ó¥×¤ÎÍøÆÀ)

! £ó¤Î¼Â¿ôÉô¤¬Àµ¤ÎÎΰ褬¡¢È¯¿¶²Äǽ¤ÊÎΰè¤Ç¤¹¡£¥°¥é¥Õ¤ò¸«¤ë¤È¡¢ÁýÉýΨ¤ÎÊѲ½¤Ç¡¢
! ¼Â¤Ë¹­ÈϰϤˡ¢È¯¿¶¼þÇÈ¿ô¤Î°ÜÆ°¤¬¸«¤é¤ì¡¢¼þÇÈ¿ô¤Î°ÂÄê¤Ï¡¢Îɤ¯¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤¡£

SET TEXT BACKGROUND "OPAQUE"
OPTION ARITHMETIC COMPLEX
LET N=3
DIM A(N),Xr(N)
!
LET R=12E3      !¦¸
LET C=0.0033E-6 !£Æ
LET RC=R*C

!------------------
!¡¡£ú¡¡£ù¡¡¤Çɽ¼¨¤¹¤ë¡Ê »³Ãæ»á¤Î£³£Ä¥×¥í¥Ã¥È£Ó£Õ£Â¡Ë
!¡¡¨¢¡¿
!¡¡¡¦¨¡£ø
!------------------
SUB rotx(x,y,z,a)
   LET w=y*COS(a)-z*SIN(a)
   LET z=y*SIN(a)+z*COS(a)
   LET y=w
END SUB

SUB rotz(x,y,z,a)
   LET w=x*COS(a)-y*SIN(a)
   LET y=x*SIN(a)+y*COS(a)
   LET x=w
END SUB

SUB plots(x,y,z)
   CALL rotz(x,y,z,-PI/2.5)
   CALL rotx(x,y,z,-PI/10)
   PLOT LINES:x,y;
END SUB

SUB plott(x,y,z,w$)
   CALL rotz(x,y,z,-PI/2.5)
   CALL rotx(x,y,z,-PI/10)
   PLOT TEXT,AT x,y:w$
END SUB
!------------------

SET WINDOW -4.2,3.7, -3.6,4.3
!-----
! ÌÜÀ¹¤ê
FOR x=-2 TO 1
   IF x=0 THEN SET LINE STYLE 1 ELSE SET LINE STYLE 3
   CALL plots((x),-3, 0)
   CALL plots((x),+3, 0) !¡¡(x) ¤Ï¡¢SUB ¤«¤é£ø¤Î½ñ¤­Ìᤷ¤ÎËɻߡ£
   PLOT LINES
   CALL plott(x-.1, -3.7, 0, USING$("######",x*5000) )
NEXT x
FOR y=-3 TO 3
   IF y=0 THEN SET LINE STYLE 1 ELSE SET LINE STYLE 3
   CALL plots(-2,(y), 0)
   CALL plots( 1,(y), 0)
   PLOT LINES
   CALL plott(1.3, y-.3, 0, STR$(y*5000)&"j" )
   CALL plott(1.6, y-.4, 0, USING$("#####",y*5000/(2*PI))&"Hz" )
NEXT y
SET LINE STYLE 1
!----
SET LINE COLOR 1
CALL plots(-2,0,0)
CALL plots(-2,0,4)
PLOT LINES
CALL plott(-2, 0.1, 1.5, "K=0.90" )
CALL plott(-2, 0.1, 2.5, "K=0.95" )
CALL plott(-2, 0.1, 3.5, "K=1.0" )
!
!-----
! K ¤Èº¬¤Î¥°¥é¥Õ
LET rss=15 ! Gv=10~100000 10ÇÜËè¤Î¥¹¥Æ¥Ã¥×¿ô
FOR p=0 TO 4*rss
   LET Gv=10^(1+p/rss)
   LET K=Gv/(1+Gv)
   !
   LET A(1)=6*(1-K)/RC
   LET A(2)=5*(1-K)/RC^2
   LET A(3)=(1-K)/RC^3
   CALL DKA_00
   !
   PRINT USING "Gv=###### K=.#####": Gv,K;
   FOR s=1 TO 3
      PRINT USING"¨­#####.# #####.#Hz" :re(Xr(s)),im(Xr(s))/(2*PI);
      SET LINE COLOR s+1
      CALL plots(re(Xr(s))/5000,im(Xr(s))/5000, 0)
      CALL plots(re(Xr(s))/5000,im(Xr(s))/5000,(K-0.8)*20)
      PLOT LINES
   NEXT s
   PRINT
NEXT p


!DKA (Durand Kerner Aberth) Ë¡¤Ë¤è¤ë¹â¼¡ÊýÄø¼°¤Îº¬
!--------------------------------------------
! X^n + A(1)*X^(n-1) + ... + A(n) = 0

! Xr( 1 ~ n ) <== root
!--------------------------------------------
SUB DKA_00
   LET r=1
   FOR j=2 TO N
      LET rn=ABS(A(j))^(1/j)
      if r<rn then LET r=rn
   NEXT j
   FOR j=1 TO N
      LET Xr(j)=-A(1)/N+r*EXP( complex(0,1)*2*PI/N *(j-3/4) )
   NEXT j
   FOR m=0 TO 100
      LET mfx=0
      LET maj=0
      FOR j=1 TO N
         LET Xk=1
         LET fx=1
         FOR w=1 TO N
            LET fx=fx*Xr(j)+A(w)
            IF w<>j THEN LET Xk=Xk*(Xr(j)-Xr(w))
         NEXT w
         LET Xr(j)=Xr(j)-fx/Xk
         IF mfx<ABS(fx) THEN LET mfx=ABS(fx)
         IF maj<ABS(fx/Xk) THEN LET maj=ABS(fx/Xk)
      NEXT j
      IF mfx<.0000001 AND maj<.0000001 THEN EXIT FOR
   NEXT m
END SUB

END
 

ÆÃÀ­Â¿¹à¼°¤Î·¸¿ô¤«¤é°ÂÄêÀ­¤òȽÊ̤¹¤ëÊýË¡

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 3·î 3Æü(²Ð)10»þ26ʬ22ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ·Ï¤Î°ÂÄêÀ­¤ÎȽÊÌ
¡¦Â¿¹à¼°¤Îº¬¤òDKAË¡¤Ê¤É¤Çµá¤á¤ë
¡¦Â¿¹à¼°¤Î·¸¿ô¤«¤é
¡¡¡¡¡§

¡ü¥é¥¦¥¹¡Êrouth¡Ë¤Î°ÂÄêȽÊÌË¡
LET N=4 !¼¡¿ô
DIM A(0 TO N) !¿¹à¼°¤Î·¸¿ô A(n)*s^n+A(n-1)*s^(n-1)+ ¡Ä +A(1)*s+A(0)¡¢A(n)>0

DATA 1,5,10,10,4 !s^4+5*s^3+10*s^2+10*s+4


FOR i=N TO 0 STEP -1
   READ A(i) !·¸¿ô¤òÆɤ߹þ¤à

   IF A(i)<=0 THEN !¤¹¤Ù¤ÆÀµ¤«¤É¤¦¤«³Îǧ¤¹¤ë
      PRINT "°ÂÄê¤Ê¿¹à¼°¤Ç¤Ê¤¤¡£"
      STOP
   END IF
NEXT i


!¥é¥¦¥¹É½¤ò¤Ä¤¯¤ë
!£±¹Ô¡¡B1¡¡A(N)   A(N-2) A(N-4) ¡Ä
!£²¹Ô¡¡B2¡¡A(N-1) A(N-3) A(N-5) ¡Ä¡¡¡¡¢ª B1
!£³¹Ô¡¡B3¡¡¢ª B2
! ¡§ ¡¡¡¡¡¡¢ª B3
! ¡§
LET M=INT(N/2)
DIM B1(0 TO M),B2(0 TO M),B3(0 TO M)

FOR i=0 TO N !£°¹ÔÌÜ¡¢£±¹ÔÌÜ
   IF MOD(i,2)=0 THEN LET B1(INT(i/2))=A(N-i) ELSE LET B2(INT(i/2))=A(N-i)
NEXT i
MAT PRINT B1; !debug
MAT PRINT B2;

FOR l=2 TO N !£²¹ÔÌÜ¡Á£Î¹ÔÌÜ
   MAT B3=ZER
   FOR i=0 TO M-1
      LET B3(i)=-1/B2(0)*( B1(0)*B2(i+1) - B1(i+1)*B2(0) )
   NEXT i
   MAT PRINT B3; !debug
   IF B3(0)<=0 THEN !¥é¥¦¥¹¿ôÎ󤬤¹¤Ù¤ÆÀµ¤«¤É¤¦¤«³Îǧ¤¹¤ë
      PRINT "°ÂÄê¤Ê¿¹à¼°¤Ç¤Ê¤¤¡£"
      STOP
   END IF

   MAT B1=B2
   MAT B2=B3
NEXT l

PRINT "°ÂÄê¤Ê¿¹à¼°¤Ç¤¢¤ë¡£"

END



¡ü¥Õ¥ë¥Ó¥Ã¥Ä¡ÊHurwitz¡Ë¤Î°ÂÄêȽÊÌË¡
LET N=4 !¼¡¿ô
DIM A(0 TO N) !¿¹à¼°¤Î·¸¿ô A(n)*s^n+A(n-1)*s^(n-1)+ ¡Ä +A(1)*s+A(0)

DATA 1,5,10,10,4 !s^4+5*s^3+10*s^2+10*s+4


FOR i=N TO 0 STEP -1
   READ A(i) !·¸¿ô¤òÆɤ߹þ¤à

   IF A(i)<=0 THEN !¤¹¤Ù¤ÆÀµ¤«¤É¤¦¤«³Îǧ¤¹¤ë
      PRINT "°ÂÄê¤Ê¿¹à¼°¤Ç¤Ê¤¤¡£"
      STOP
   END IF
NEXT i


!¥Õ¥ë¥Ó¥Ã¥Ä¹ÔÎó¼°¤ò¤Ä¤¯¤ë
!¨¢A(n-1) A(n-3) A(n-5) ¡Ä 0 ¨¢
!¨¢A(n) ¡¡A(n-2) A(n-4) ¡Ä 0 ¨¢
!¨¢0¡¡¡¡¡¡A(n-1) A(n-3) ¡Ä 0 ¨¢
!¨¢0¡¡¡¡¡¡A(n) ¡¡A(n-2) ¡Ä 0 ¨¢
!¡¡¡¡¡§
!¡¡¡¡¡§
!¨¢0¡¡¡¡¡¡0¡¡¡¡¡¡0¡¡¡¡¡Ä A(1)¨¢

DIM B(N,N)
FOR m=1 TO N
   MAT B=ZER(m,m)
   LET k=N-1
   FOR i=1 TO m
      FOR j=1 TO m
         LET t=k-2*(j-1)
         IF t>=0 AND t<=N THEN LET B(i,j)=A(t)
      NEXT j
      LET k=k+1
   NEXT i
   MAT PRINT B; !debug
   IF DET(B)<=0 THEN
      PRINT "ÉÔ°ÂÄê¤Ê¿¹à¼°¤Ç¤¹¡£"
      !STOP
   END IF
   PRINT "¹ÔÎó¼°=";DET(B) !debug
NEXT m

PRINT "°ÂÄê¤Ê¿¹à¼°¤Ç¤¢¤ë¡£"

END
 

¾õÂÖÊýÄø¼°¤«¤éÅÁã´Ø¿ô¤òµá¤á¤ë

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 3·î 3Æü(²Ð)10»þ36ʬ9ÉÃ
ÊÖ¿®¡¦°úÍÑ
 
!£±ÆþÎÏ£±½ÐÎÏ¡¢¾õÂÖÊÑ¿ô¤¬£Î¸Ä¤Î£±³¬¤ÎϢΩÈùʬÊýÄø¼°
!¡¡¾õÂÖÊýÄø¼° x'(t)=A*x(t)+b*u(t)¡¡¢¨A:N¡ßN¡¢b:N¡ß1
!¡¡½ÐÎÏÊýÄø¼°¡¡y(t)=C*x(t)¡¡¢¨C:1¡ßN
!¤«¤é
!¡¡ÅÁã´Ø¿ô G(s)=c*INV(s*I-A)*b=c*adj(s*I-A)*b/det(s*I-A)
!¤òµá¤á¤ë


!¹ÔÎó´ØÏ¢
FUNCTION tr(A(,)) !¹ÔÎóA¤Î¥È¥ì¡¼¥¹
   LET t=0
   FOR i=1 TO N
      LET t=t+A(i,i)
   NEXT i
   LET tr=t
END FUNCTION

!¿¹à¼°´ØÏ¢
SUB mono_disp(ak,k) !ñ¹à¼°¤òɽ¼¨¤¹¤ë¡¡Ak*X^k
   IF k<>0 THEN !x^n¤Ç
      IF ak=1 THEN !·¸¿ô¤¬£±¤Ê¤é
      ELSEIF ak=-1 THEN !·¸¿ô¤¬¡Ý£±¤Ê¤é
         PRINT "-";
      ELSE
         PRINT STR$(ak);"*";
      END IF
   END IF
   IF k=0 THEN !¼¡¿ô¤¬£°¤Ê¤é
      PRINT STR$(ak);
   ELSEIF k=1 THEN !¼¡¿ô¤¬£±¤Ê¤é
      PRINT "s";
   ELSE
      PRINT "s^";STR$(k);
   END IF
END SUB
!-------------------- ¤³¤³¤Þ¤Ç¤¬¥µ¥Ö¥ë¡¼¥Á¥ó


!---------- ¢­¢­¢­¢­¢­ ----------
LET N=3 !¾õÂÖÊÑ¿ô¤Î¿ô

DATA 0,0,-6 !A
DATA 1,0,-11
DATA 0,1,-6

DATA 1 !b
DATA 0
DATA 0

DATA 0,0,1 !c
!---------- ¢¬¢¬¢¬¢¬¢¬ ----------


DIM A(N,N),b(N,1),c(1,N)

MAT READ A
MAT READ b
MAT READ c


!FrameË¡¡¢Leverrir-FaddeevË¡
!¡¡adj(s*I-A)=s^(n-1)*I+s^(n-2)*¦Â1+ ¡Ä +s*¦Ân-2+¦Ân-1
!¡¡det(s*I-A)=s^n+¦Á1*s^(n-1)+ ¡Ä + ¦Án-1*s+¦Án
!¤Î¤È¤­
!¡¡¦Â0=I¡¢k=1¡Án¤Ë¤Ä¤¤¤Æ
!¡¡¡¡Xk=A*¦Âk-1
!¡¡¡¡¦Ák=-trace(Xk)/k
!¡¡¡¡¦Âk=Xk+¦Ák*I
!¤ÎÃ༡·×»»¤Ç¦Ák¡¢¦Âk¤¬µá¤Þ¤ë¡£

DIM c1(N) !¿¹à¼° c(1)*X^(N-1)+c(2)*X^(N-2)+ ¡Ä +c(N-1)*X+c(N) ¤Î·¸¿ô
DIM c2(N) !¿¹à¼° X^N+c(1)*X^(N-1)+c(2)*X^(N-2)+ ¡Ä +c(N-1)*X+c(N) ¤Î·¸¿ô
DIM X(N,N),sE(N,N),T1(1,N),T2(1,1) !ºî¶ÈÍÑ

MAT X=IDN !adj(s*I-A)
FOR k=1 TO N
!!!MAT PRINT X; !debug
   MAT T1=c*X !c*adj(s*I-A)*b¡¡¢¨Äê¿ô*¿¹à¼°*Äê¿ô
   MAT T2=T1*b
   LET c1(k)=T2(1,1)

   MAT X=A*X
   LET c2(k)=-tr(X)/k !det(s*I-A)
   MAT sE=(c2(k))*IDN
   MAT X=X+sE
NEXT k


!!!MAT PRINT c1; !debug
PRINT "ʬ»Ò= ";
FOR i=1 TO N !ʬ»Ò¦¤Î¿¹à¼°¤òɽ¼¨¤¹¤ë
   LET w=c1(i)
   IF w>0 THEN PRINT "+";
   IF w<>0 THEN CALL mono_disp(w,N-i)
NEXT i
PRINT

!!!MAT PRINT c2; !debug
PRINT "ʬÊì= ";
CALL mono_disp(1,N) !ʬÊ즤ο¹à¼°¤òɽ¼¨¤¹¤ë
FOR i=1 TO N
   LET w=c2(i)
   IF w>0 THEN PRINT "+";
   IF w<>0 THEN CALL mono_disp(w,N-i)
NEXT i


END
 

Re: ¥»¥ó¥¿¡¼»î¸³ÄøÅÙ¤Î¥×¥í¥°¥é¥à±é½¬

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 3·î 6Æü(¶â)19»þ59ʬ4ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.246[¸µµ­»ö¤Ø]

¡ü£î¡ª¡Ê£î¤Î³¬¾è¡Ë¤ÎËöÈø¤Î£°¤Î¿ô
ËöÈø¤¬£°¤Ë¤Ê¤ë¤Î¤Ï¡¢£±£°¤Î¤Ù¤­¿ô¡Ê10,100,1000,¡Ä¡Ë¤Ê¤Î¤Ç¡¢¤³¤Î£±£°¤ò¿ô¤¨¤ì¤Ð¤è¤¤¡£
£±£°¤Ï¡¢£²¤È£µ¤ÎÁȹ礻¤Ê¤Î¤Ç¡¢¤³¤Î£²¤È£µ¤ò¿ô¤¨¤ì¤Ð¤è¤¤¡£
£î¤Î³¬¾è¤ÎÃæ¤Ë£²¤Ï½½Ê¬¤¢¤ë¤Î¤Ç¡¢£µ¤Î¿ô¤òµá¤á¤ë¡£

Îã. 10!=3628800¤Ê¤Î¤Ç¡¢2¸Ä
OPTION ARITHMETIC RATIONAL

LET N=20

PRINT fact(N) !¸¡»»


LET A=N
LET S=0 !5¤Î¿ô¤ò¿ô¤¨¤ë
DO UNTIL A=0
   LET A=INT(A/5) !5,5^2,5^3,¡Ä¤Ç³ä¤ë
   LET S=S+A
LOOP
PRINT S;"¸Ä"


!LET A=N
!LET S=0 !2¤Î¿ô¤ò¿ô¤¨¤ë
!DO UNTIL A=0
!   LET A=INT(A/2) !2,2^2,2^3,¡Ä¤Ç³ä¤ë
!   LET S=S+A
!LOOP
!PRINT S;"¸Ä"

END


¡ü£î¡ª¤ÎÁÇ°ø¿ôʬ²ò
£²¡Á£î¤Þ¤Ç¤ÎÁÇ¿ô¤Ç¡¢¤½¤ì¤¾¤ì¤Î¸Ä¿ô¤òµá¤á¤ë¡£¡Ê¾åµ­¤òÍøÍѤ¹¤ë¡Ë
LET N=20

FOR i=2 TO N
   IF isPRIME(i)=-1 THEN !ÁÇ¿ô¤ËÂФ·¤Æ

      LET a=N
      LET s=0 !ÁÇ¿ôi¤Î¸Ä¿ô
      DO UNTIL a=0
         LET a=INT(a/i)
         LET s=s+a
      LOOP
      PRINT STR$(i);"^";STR$(s) !¤Ù¤­¾è¤Çɽ¼¨

   END IF
NEXT i

END


!¡üÁÇ¿ô¤«¤É¤¦¤«È½Äꤹ¤ë¡Ê¥¨¥é¥È¥¹¥Æ¥Í¥¹¤Î¤Õ¤ë¤¤Ë¡¡Ë
!¡¡ÊÑ¿ô N¡§ ȽÄꤹ¤ë¿ôÃÍ¡£¢¨£²°Ê¾å
!¡¡´Ø¿ôÃÍ¡§k>0 ÁÇ¿ô¤Ç¤Ê¤¤¡Êk¤ÏÌó¿ô¡Ë¡¢-1 ÁÇ¿ô
EXTERNAL FUNCTION isPRIME(N)
IF MOD(N,2)=0 THEN !2¤Ç³ä¤êÀÚ¤ì¤ë¤Ê¤éÁÇ¿ô¤Ç¤Ê¤¤
   LET isPRIME=2
   IF N=2 THEN LET isPRIME=-1 !2¤ÏÁÇ¿ô
ELSE
   LET isPRIME=-1 !ÁÇ¿ô¤Ç¤¢¤ë
   FOR i=3 TO SQR(N) STEP 2 !N¤ÎÊ¿Êýº¬¤Þ¤Ç¤Î´ñ¿ô¤Ç·«¤êÊÖ¤¹
   !!!FOR i=3 TO INTSQR(N) STEP 2 !N¤ÎÊ¿Êýº¬¤Þ¤Ç¤Î´ñ¿ô¤Ç·«¤êÊÖ¤¹
      IF MOD(N,i)=0 THEN !i¤Ç³ä¤êÀÚ¤ì¤ë¤Ê¤éÁÇ¿ô¤Ç¤Ê¤¤
         LET isPRIME=i
         EXIT FOR
      END IF
   NEXT i
END IF
END FUNCTION


¡ü£î¡ª¤Î·×»»
¿ô¤ÎʤӤÎÂоÎÀ­¤òÍøÍѤ¹¤ë¡£
! 10!=1*2*3*4*5*6*7*8*9*10¤Î¾ì¹ç

! Ãæ±ûÃÍ¡¡m=6
! 5¤È7¡¡(m-1)*(m+1)=m^2-1=36-1=35¡¢d=1
! 4¤È8¡¡(m-2)*(m+2)=m^2-4=(m^2-1)-3=35-3=32¡¢d=3
! 3¤È9¡¡(m-3)*(m+3)=m^2-9=(m^2-4)-5=32-5=27¡¢d=5
! 2¤È10¡¡(m-4)*(m+4)=m^2-16=(m^2-9)-7=27-7=20¡¢d=7
! 1¡¡Ìµ»ë
! ¡è10!=6*35*32*27*20

LET N=10

LET m=INT(N/2+1) !Ãæ±ûÃÍ
LET s=m
LET mm=m*m

LET d=1
FOR i=1 TO N-m
   LET mm=mm-d
   LET s=s*mm

   LET d=d+2 !1,3,5,7,¡Ä¡¡´ñ¿ô
NEXT i

PRINT s

END
 

Parabola Mandala¡¡¡Ê´ö²¿³Ø¥¢¡¼¥È¡Ë

 Åê¹Æ¼Ô¡§yossy  Åê¹ÆÆü¡§2009ǯ 3·î 7Æü(ÅÚ)11»þ59ʬ10ÉÃ
ÊÖ¿®¡¦°úÍÑ
  !Parabola Mandala¡Ê´ö²¿³Ø¥¢¡¼¥È¡Ë
OPTION ANGLE DEGREES
SUB circle(a,b,r)
   FOR t=0 TO 360
      PLOT LINES: a+r*COS(t),b+r*SIN(t);
   NEXT t
   PLOT LINES
END SUB
DEF f(x)=x^2-x
LET c=(2*SQR(2))
LET d=(12*SQR(2))/5
LET e=(4-c)
LET g=24/5
LET h=(SQR(2)-1)
DIM M(4,4)!¿Þ·Á¤Î΢ÊÖ¤·
MAT READ M
DATA 0, 1, 0, 0
DATA 1, 0, 0, 0
DATA 0, 0, 1, 0
DATA 0, 0, 0, 1
!Lotus Mandala¡Ê±¦Â¦¤ÎÒØè¸Íå¡Ë
SET BITMAP SIZE 800,400
SET WINDOW -6.8,6.8,-6.8,6.8
SET VIEWPORT 0.5,1.0,0,0.5
CALL circle(0,0,c)
CALL circle(d,-d,e)
CALL circle(-d,d,e)
CALL circle(d,d,e)
CALL circle(-d,-d,e)
CALL circle(0,g,e)
CALL circle(0,-g,e)
CALL circle(g,0,e)
CALL circle(-g,0,e)
DRAW nike
DRAW nike WITH ROTATE(90)
DRAW nike WITH ROTATE(180)
DRAW nike WITH ROTATE(270)
DRAW nike WITH M
DRAW nike WITH M*ROTATE(90)
DRAW nike WITH M*ROTATE(180)
DRAW nike WITH M*ROTATE(270)
DRAW pothos WITH SCALE(h)*SHIFT(d,-d)
DRAW pothos WITH SCALE(h)*ROTATE(180)*SHIFT(-d,d)
DRAW pothos WITH SCALE(h)*ROTATE(90)*SHIFT(d,d)
DRAW pothos WITH SCALE(h)*ROTATE(270)*SHIFT(-d,-d)
DRAW pothos WITH M*SCALE(h)*ROTATE(180)*SHIFT(0,g)
DRAW pothos WITH M*SCALE(h)*SHIFT(0,-g)
DRAW pothos WITH M*SCALE(h)*ROTATE(90)*SHIFT(g,0)
DRAW pothos WITH M*SCALE(h)*ROTATE(270)*SHIFT(-g,0)
!Pothos Mandala¡Êº¸Â¦¤ÎÒØè¸Íå¡Ë
SET BITMAP SIZE 800,400
SET WINDOW -6.8,6.8,-6.8,6.8
SET VIEWPORT 0,0.5,0,0.5
CALL circle(0,0,c)
CALL circle(d,-d,e)
CALL circle(-d,d,e)
CALL circle(d,d,e)
CALL circle(-d,-d,e)
CALL circle(0,g,e)
CALL circle(0,-g,e)
CALL circle(g,0,e)
CALL circle(-g,0,e)
DRAW pothos
DRAW pothos WITH SCALE(h)*SHIFT(d,-d)
DRAW pothos WITH SCALE(h)*ROTATE(180)*SHIFT(-d,d)
DRAW pothos WITH SCALE(h)*ROTATE(90)*SHIFT(d,d)
DRAW pothos WITH SCALE(h)*ROTATE(270)*SHIFT(-d,-d)
DRAW pothos WITH M*SCALE(h)*ROTATE(180)*SHIFT(0,g)
DRAW pothos WITH M*SCALE(h)*SHIFT(0,-g)
DRAW pothos WITH M*SCALE(h)*ROTATE(90)*SHIFT(g,0)
DRAW pothos WITH M*SCALE(h)*ROTATE(270)*SHIFT(-g,0)
PICTURE nike
   FOR x=0 TO 2 STEP 0.01
      PLOT LINES: x,f(x);
   NEXT x
   FOR x=9/4 TO 1/4 STEP -0.01
      PLOT LINES: x-1/4,f(x)-13/16;
   NEXT x
END PICTURE
PICTURE pothos
   FOR y=-2 TO 1 STEP 0.01
      PLOT LINES: -f(ABS(y)),y;
   NEXT y
   FOR x=-1/4 TO -9/4 STEP -0.01
      PLOT LINES: x+1/4,SGN(x)*f(ABS(x))+13/16;
   NEXT x
   FOR x=-2 TO 2 STEP 0.01
      PLOT LINES: x,SGN(x)*f(ABS(x));
   NEXT x
END PICTURE
END

http://www15.plala.or.jp/pothos/

 

Heart Magic ¡Ê´ö²¿³Ø¥¢¡¼¥È¡Ë

 Åê¹Æ¼Ô¡§yossy  Åê¹ÆÆü¡§2009ǯ 3·î 7Æü(ÅÚ)12»þ36ʬ29ÉÃ
ÊÖ¿®¡¦°úÍÑ
  °ÊÁ°¡¢Â裱·Ç¼¨ÈĤǷǺܤµ¤»¤Æ¤¤¤¿¤À¤¤¤¿Æ°²è¥×¥í¥°¥é¥à¤Î¡¢´ÊάÈǤǤ¹¡£¥¢¥Ë¥á¡¼¥·¥ç¥ó¤Î·ë²Ì¤Î²èÁü¤ò¤½¤Î²¼¤ËºÜ¤»¤Æ¤¢¤ê¤Þ¤¹¡£¿·¤·¤¯³«Àߤ·¤¿»ä¤Î¥¦¥§¥Ö¥µ¥¤¥È¤Ë¡¢´ö²¿³Ø¥¢¡¼¥È¤Î¥×¥í¥°¥é¥ß¥ó¥°¡¦¥Ç¡¼¥¿¤òÃÖ¤¤¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢¤è¤í¤·¤±¤ì¤Ð¤¼¤Ò°ìÅÙÇÁ¤¤¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£

!Heart Magic¡Ê´ö²¿³Ø¥¢¡¼¥È¡Ë
OPTION ANGLE DEGREES
DEF f(x)=x^2-x
DEF g(x)=-x^2-x
DEF h(x)=-x^2+1/2*x+1
DEF i(y)=y^2-y
DEF j(y)=y^2+1/2*y-1
DEF k(y)=y^2-1/2*y-1
DEF l(y)=-y^2+1/2*y+1
DIM M(4,4)
MAT READ M !¿Þ·Á¤Î΢ÊÖ¤·
DATA 0, 1, 0, 0
DATA 1, 0, 0, 0
DATA 0, 0, 1, 0
DATA 0, 0, 0, 1
SET WINDOW -9.2,9.2,-9.2,9.2
!½¸¹ç
FOR n=6.9 TO 0 STEP -0.01
   SET DRAW mode hidden
   CLEAR
   DRAW pothos WITH M*ROTATE(180)*SHIFT(0,n)
   DRAW pothos WITH M*SHIFT(0,-n)
   DRAW pothos WITH M*ROTATE(90)*SHIFT(n,0)
   DRAW pothos WITH M*ROTATE(270)*SHIFT(-n,0)
   DRAW pothos WITH SHIFT(n,-n)
   DRAW pothos WITH ROTATE(180)*SHIFT(-n,n)
   DRAW pothos WITH ROTATE(90)*SHIFT(n,n)
   DRAW pothos WITH ROTATE(270)*SHIFT(-n,-n)
   WAIT DELAY 0.01
   SET DRAW mode explicit
NEXT n
WAIT DELAY 8
!ȯ»¶
FOR n=0 TO 6.9 STEP 0.01
   SET DRAW mode hidden
   CLEAR
   DRAW heart1 WITH SHIFT(-n,n)
   DRAW heart1 WITH ROTATE(180)*SHIFT(-n/3,n)
   DRAW heart1 WITH M*SHIFT(n/3,n)
   DRAW heart1 WITH ROTATE(90)*SHIFT(n,n)
   DRAW heart2 WITH SHIFT(-n,n/3)
   DRAW heart2 WITH ROTATE(180)*SHIFT(-n/3,n/3)
   DRAW heart2 WITH ROTATE(90)*SHIFT(n/3,n/3)
   DRAW heart2 WITH ROTATE(270)*SHIFT(n,n/3)
   DRAW heart3 WITH SHIFT(-n,-n/3)
   DRAW heart3 WITH ROTATE(180)*SHIFT(-n/3,-n/3)
   DRAW heart3 WITH ROTATE(90)*SHIFT(n/3,-n/3)
   DRAW heart3 WITH ROTATE(270)*SHIFT(n,-n/3)
   DRAW heart3 WITH M*ROTATE(180)*SHIFT(-n,-n)
   DRAW heart3 WITH M*SHIFT(-n/3,-n)
   DRAW heart3 WITH M*ROTATE(90)*SHIFT(n/3,-n)
   DRAW heart3 WITH M*ROTATE(270)*SHIFT(n,-n)
   WAIT DELAY 0.01
   SET DRAW mode explicit
NEXT n
PICTURE heart1
   FOR x=-1 TO 1 STEP 0.01
      PLOT LINES: x,f(ABS(x));
   NEXT x
   FOR y=0 TO (1+SQR(17))/4 STEP 0.01
      PLOT LINES: l(y),y;
   NEXT y
   FOR y=(1+SQR(17))/4 TO 0 STEP -0.01
      PLOT LINES: k(y),y;
   NEXT y
END PICTURE
PICTURE heart2
   FOR x=-1 TO 0 STEP 0.01
      PLOT LINES: x,g(x);
   NEXT x
   FOR y=0 TO 1 STEP 0.01
      PLOT LINES: i(y),y;
   NEXT y
   FOR x=0 TO 2 STEP 0.01
      PLOT LINES: x,h(x);
   NEXT x
   FOR y=-2 TO 0 STEP 0.01
      PLOT LINES: j(y),y;
   NEXT y
END PICTURE
PICTURE heart3
   FOR y=-2 TO 1 STEP 0.01
      PLOT LINES: -f(ABS(y)),y;
   NEXT y
   FOR x=-1/4 TO -9/4 STEP -0.01
      PLOT LINES: x+1/4,SGN(x)*f(ABS(x))+13/16;
   NEXT x
END PICTURE
PICTURE pothos
   FOR y=-2 TO 1 STEP 0.01
      PLOT LINES: -f(ABS(y)),y;
   NEXT y
   FOR x=-1/4 TO -9/4 STEP -0.01
      PLOT LINES: x+1/4,SGN(x)*f(ABS(x))+13/16;
   NEXT x
   FOR x=-2 TO 2 STEP 0.01
      PLOT LINES: x,SGN(x)*f(ABS(x));
   NEXT x
END PICTURE
END

http://www15.plala.or.jp/pothos/

 

Éôʬʬ¿ôʬ²ò

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 3·î 8Æü(Æü)14»þ52ʬ16ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ÊÑ¿ôx¤ÎÍ­Íý¼°

           B(n-1)*x^(n-1)+B(n-2)*x^(n-2)+ ¡Ä +B(1)*x+B(0)
---------------------------------------------------------
  A(n)*x^n+A(n-1)*x^(n-1)+A(n-2)*x^(n-2)+ ¡Ä +A(1)*x+A(0)

¤È¤¹¤ë¡£Ê¬Êì¤Î¿¹à¼°¤¬¡¢
¡¡(x-¦Á1)*(x-¦Á2)* ¡Ä *(x-¦Án)¡¡¢¨½Åº¬¤Ï´Þ¤Þ¤Ê¤¤
¤È°ø¿ôʬ²ò²Äǽ¤Î¤È¤­

    k1        k2             kn
------- + ------- + ¡Ä + -------
(x-¦Á1)   (x-¦Á2)        (x-¦Án)

¤ÈÉôʬʬ¿ô¤Ëʬ²ò¤Ç¤­¤ë¡£

LET N=3 !¼¡¿ô

DIM A(0 TO N),B(0 TO N-1) !·¸¿ô

DATA 6,-1,-3 !ʬ»Ò 6*x^2-x-3
DATA 1,0,-1,0 !ʬÊì x^3-x=x*(x+1)*(x-1)
DATA 0,1 !º¬,½ÅÊ£ÅÙ
DATA -1,1
DATA 1,1

!DATA 0,1,1 !ʬ»Ò s+1
!DATA 1,-5,8,-4 !ʬÊì s^3-5*s^2+8*s-4=(s-1)*(s-2)^2
!DATA 1,1 !º¬,½ÅÊ£ÅÙ
!DATA 2,2

FOR i=N-1 TO 0 STEP -1
   READ B(i)
NEXT i
FOR i=N TO 0 STEP -1
   READ A(i)
NEXT i


!¥Ø¥ô¥£¥µ¥¤¥É¡ÊHeaviside¡Ë¤ÎŸ³«ÄêÍý
!¡¡F(x)=B(x)/A(x)¤È¤¹¤ë¡£
!¡¡x-¦Á¤¬Ê¬ÊìA(x)¤Î½ÅÊ£ÅÙ£±¤Î°ø¿ô¤È¤¹¤ë¤È
!¡¡Éôʬʬ¿ô C/(x-¦Á) ¤Î·¸¿ô¤Ï¡¢C=(x-¦Á)*F(x)¨¢x=¦Á¤È¤Ê¤ë¡£
!
!¡¡x-¦Á¤¬Ê¬ÊìA(x)¤Î½ÅÊ£ÅÙm¤Î°ø¿ô¤È¤¹¤ë¤È
!¡¡Éôʬʬ¿ô C1/(x-¦Á)+C2/(x-¦Á)^2+ ¡Ä +Cm/(x-¦Á)^m ¤Î·¸¿ô¤Ï¡¢
!¡¡Cm-k=1/k!*d^k/dx^k{(x-¦Á)^m*F(x)}¨¢x=¦Á¡¢k=0,1,2,¡Ä,m-1¤È¤Ê¤ë¡£

DIM Q(0 TO N),T1(0 TO 4*N),T2(0 TO 4*N) !ºî¶ÈÍÑ
DIM AA(0 TO 2*N),BB(0 TO 2*N),dA(0 TO 2*N),dB(0 TO 2*N)

LET Lp=N
DO WHILE Lp>0 !³Æº¬¤ËÂФ·¤Æ
   READ v,m !¦Á¡¢½ÅÊ£ÅÙ

   SELECT CASE m
   CASE 1 !ñº¬¤Ê¤é
      CALL poly_divByLin(A,v, Q,R) !(x-¦Á)*F(x)=B(x)/(A(x)/(x-¦Á))
      CALL PrintOut(B,Q,0,v)

   CASE ELSE !½ÅÊ£º¬¤Ê¤é
      MAT AA=A
      MAT BB=B

      FOR j=1 TO m !(x-¦Á)^m*F(x)¤Î£°³¬Èùʬ
         CALL poly_divByLin(AA,v, Q,R) !(x-¦Á)^m*F(x)=B(x)/(A(x)/(x-¦Á)^m)
         MAT AA=Q
      NEXT j
      CALL PrintOut(BB,AA,m,v) !Cm

      FOR k=1 TO m-1 !£ë³¬Èùʬ
      !Èùʬ¤Î¸ø¼° (B/A)'=(B'*A-B*A')/A^2
         CALL poly_diff(BB, dB) !B'
         CALL poly_diff(AA, dA) !A'
         CALL poly_mul(dB,AA, T1) !ʬ»Ò
         CALL poly_mul(BB,dA, T2)
         MAT T1=T1-T2
         CALL poly_copy(T1, BB)
         CALL poly_mul(AA,AA, T1) !ʬÊì
         CALL poly_copy(T1, AA)

         CALL PrintOut(BB,AA,m-k,v/fact(k)) !Cm-k
      NEXT k

   END SELECT


   LET Lp=Lp-m !¼¡¤Ø
LOOP


SUB PrintOut(B(),A(),k,v) !ʬ¿ô¤òɽ¼¨¤¹¤ë
   PRINT poly_val(B,v)/poly_val(A,v); !ʬ»Ò¦=C

   IF v>0 THEN !ʬÊì¦=x-¦Á
      PRINT "/ ( x -";v;")";
   ELSEIF v<0 THEN
      PRINT "/ ( x +";ABS(v);")";
   ELSE
      PRINT "/ x ";
   END IF
   IF k>1 THEN PRINT " ^";k ELSE PRINT !¤Ù¤­¾è
END SUB

END


!Êä½õ¥ë¡¼¥Á¥ó

!ÊÑ¿ôx¤Î¿¹à¼° ¦²[k=0,n]a(k)*x^k=a(n)*x^n+a(n-1)*x^(n-1)+ ¡Ä +a(1)*x+a(0)

!±é»»´ØÏ¢

EXTERNAL FUNCTION poly_degree(A()) !¼¡¿ô¤òÆÀ¤ë
FOR i=UBOUND(A) TO 1 STEP -1
   IF A(i)<>0 THEN EXIT FOR !·¸¿ô¤¬£°¤Ç¤Ê¤¤ºÇ½é¤Î°ÌÃÖ
NEXT i
LET poly_degree=i
END FUNCTION

EXTERNAL SUB poly_divByLin(A(),v, Q(),R) !¿¹à¼°a(x)¤òx-¦Á¤Ç³ä¤Ã¤¿¤È¤­¤Î¾¦q(x)¤È;¤êR¤òµá¤á¤ë
MAT Q=ZER
LET aa=poly_degree(A) !¼¡¿ô
IF aa>0 THEN !£±¼¡¼°°Ê¾å¤Ê¤é
   LET qq=aa-1 !¼¡¿ô
   LET Q(qq)=A(aa) !¾¦¡¡¢¨ÁÈΩ½üË¡
   FOR i=qq TO 1 STEP -1
      LET Q(i-1)=A(i)+Q(i)*v
   NEXT i
   LET R=A(0)+Q(0)*v !;¤ê
ELSE
   LET Q(0)=0 !¾¦
   LET R=A(0) !;¤ê
END IF
END SUB

EXTERNAL FUNCTION poly_val(A(),v) !¿¹à¼°¤ò·×»»¤¹¤ë¡Ê¿ôÃÍÂåÆþ¡Ë
LET k=0
FOR i=UBOUND(A) TO 0 STEP -1 !Horner¤ÎÊýË¡
   LET k=k*v+A(i) !(¡Ä(((An*X+An-1)*X+An-2)*X+An-3)*X+¡Ä+A1)*X+A0
NEXT i
LET poly_val=k
END FUNCTION

EXTERNAL SUB poly_copy(A(), S()) !ÂåÆþ S=A
MAT S=ZER
FOR i=0 TO UBOUND(S)
   LET S(i)=A(i)
NEXT i
END SUB

EXTERNAL SUB poly_mul(A(),B(), S()) !¾è»» S=A*B¡¡¢¨S¡âA¡¢S¡âB
MAT S=ZER
FOR i=UBOUND(A) TO 0 STEP -1
   FOR j=UBOUND(B) TO 0 STEP -1
      LET S(i+j)=S(i+j)+A(i)*B(j) !¤¹¤Ù¤Æ¤Î·¸¿ô¤ò¤«¤±¤ë
   NEXT j
NEXT i
END SUB

EXTERNAL SUB poly_diff(A(), S()) !Èùʬ S=A'
FOR i=1 TO UBOUND(A)
   LET S(i-1)=i*A(i)
NEXT i
END SUB
 

Re: Éôʬʬ¿ôʬ²ò

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 3·î 8Æü(Æü)22»þ42ʬ25ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.299[¸µµ­»ö¤Ø]

Ê̲ò. ÄÌʬ¤·¤Æʬ»Ò¦¤Î¿¹à¼°¤Î·¸¿ôB()¤ÈÈæ³Ó¤·¤Æ¡¢¹±Åù¼°¡ÊϢΩÊýÄø¼°¡Ë¤ò²ò¤¯
LET N=3 !¼¡¿ô

DIM A(0 TO N),B(0 TO N-1) !·¸¿ô

!DATA 6,-1,-3 !ʬ»Ò 6*x^2-x-3
!DATA 1,0,-1,0 !ʬÊì x*(x^2-1)
!DATA 0,1 !º¬,½ÅÊ£ÅÙ
!DATA -1,1
!DATA 1,1

DATA 0,1,1 !ʬ»Ò s+1
DATA 1,-5,8,-4 !ʬÊì s^3-5*s^2+8*s-4=(s-1)*(s-2)^2
DATA 1,1 !º¬,½ÅÊ£ÅÙ
DATA 2,2

FOR i=N-1 TO 0 STEP -1
   READ B(i)
NEXT i
FOR i=N TO 0 STEP -1
   READ A(i)
NEXT i


DIM C(N,N),k(N) !ϢΩÊýÄø¼° C*k=B
DIM Q(0 TO N) !ʬÊ줬x-¦Ák¤Î¡ÊÄÌʬ¤·¤¿¤È¤­¤Î¡Ëʬ»Ò¦¤Î·¸¿ô

DIM AA(0 TO N),v(N),m(N)

LET Lp=1
DO UNTIL Lp>N !³Æº¬¤ËÂФ·¤Æ
   READ v(Lp),m(Lp) !£±¼¡°ø»Òx-¦Ák¡¢½ÅÊ£ÅÙm

   CALL poly_divByLin(A,v(Lp), Q,R) !ÄÌʬ¤·¤¿¤È¤­¤Î·¸¿ô=(ʬÊ즤ο¹à¼°)/(x-¦Ák)
   FOR j=1 TO N !LpÎóÌܤËÀßÄꤹ¤ë
      LET C(j,Lp)=Q(j-1)
   NEXT j

   FOR i=1 TO m(Lp)-1 !½ÅÊ£º¬¤Ê¤é
      MAT AA=Q

      CALL poly_divByLin(AA,v(Lp), Q,R) !ÄÌʬ¤·¤¿¤È¤­¤Î·¸¿ô=(ʬÊ즤ο¹à¼°)/(x-¦Ák)^m
      FOR j=1 TO N !Lp+iÎóÌܤËÀßÄꤹ¤ë
         LET C(j,Lp+i)=Q(j-1)
      NEXT j
   NEXT i

   LET Lp=Lp+m(Lp) !¼¡¤Ø
LOOP
!!!MAT PRINT C; !debug


DIM Ci(N,N) !¹±Åù¼°¤ò²ò¤¯
MAT Ci=INV(C)
MAT k=Ci*B


LET Lp=1 !·ë²Ì¤òɽ¼¨¤¹¤ë
DO UNTIL Lp>N
   FOR i=0 TO m(Lp)-1
      CALL PrintOut(k(Lp+i),v(Lp),i+1)
   NEXT i
   LET Lp=Lp+m(Lp) !¼¡¤Ø
LOOP

SUB PrintOut(c,v,k) !ʬ¿ô¤òɽ¼¨¤¹¤ë
   PRINT c; !ʬ»Ò¦=C

   IF v>0 THEN !ʬÊì¦=x-¦Á
      PRINT "/ ( x -";v;")";
   ELSEIF v<0 THEN
      PRINT "/ ( x +";ABS(v);")";
   ELSE
      PRINT "/ x ";
   END IF
   IF k>1 THEN PRINT " ^";k ELSE PRINT !¤Ù¤­¾è
END SUB

END


!Êä½õ¥ë¡¼¥Á¥ó

!ÊÑ¿ôx¤Î¿¹à¼° ¦²[k=0,n]a(k)*x^k=a(n)*x^n+a(n-1)*x^(n-1)+ ¡Ä +a(1)*x+a(0)

!±é»»´ØÏ¢

EXTERNAL FUNCTION poly_degree(A()) !¼¡¿ô¤òÆÀ¤ë
FOR i=UBOUND(A) TO 1 STEP -1
   IF A(i)<>0 THEN EXIT FOR !·¸¿ô¤¬£°¤Ç¤Ê¤¤ºÇ½é¤Î°ÌÃÖ
NEXT i
LET poly_degree=i
END FUNCTION

EXTERNAL SUB poly_divByLin(A(),v, Q(),R) !¿¹à¼°a(x)¤òx-¦Á¤Ç³ä¤Ã¤¿¤È¤­¤Î¾¦q(x)¤È;¤êR¤òµá¤á¤ë
MAT Q=ZER
LET aa=poly_degree(A)
IF aa>0 THEN !£±¼¡¼°°Ê¾å¤Ê¤é
   LET qq=aa-1 !¼¡¿ô
   LET Q(qq)=A(aa) !¾¦¡¡¢¨ÁÈΩ½üË¡
   FOR i=qq TO 1 STEP -1
      LET Q(i-1)=A(i)+Q(i)*v
   NEXT i
   LET R=A(0)+Q(0)*v !;¤ê
ELSE
   LET Q(0)=0 !¾¦
   LET R=A(0) !;¤ê
END IF
END SUB
 

Re: ¥»¥ó¥¿¡¼»î¸³ÄøÅÙ¤Î¥×¥í¥°¥é¥à±é½¬

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 3·î 9Æü(·î)21»þ48ʬ27ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.296[¸µµ­»ö¤Ø]

ÁÈΩ½üË¡¤Î¡Ê°Õ³°¤Ê¡Ë»È¤¤Æ»
¡¦´Ø¿ôÃÍ - µ­¿ôË¡¤Î·×»»¡¢Ê¿¶ÑÊѲ½Î¨¡¢ÄêÀÑʬ
¡¦Èùʬ·¸¿ô - ¿¹à¼°¤Î¥Æ¥¤¥é¡¼Å¸³«¡¢¥Ë¥å¡¼¥È¥óË¡¤Ë¤è¤ëÂå¿ôÊýÄø¼°¤Îµáº¬
¤³¤ì¤é¤òÍѤ¤¤ë¥·¡¼¥ó¤ÇÍøÍѤǤ­¤ë¡£

¤½¤Î°ìÎã¤ò¥³¡¼¥Ç¥£¥ó¥°¤·¤Æ¤ß¤Þ¤·¤¿¡£
!¡üµ­¿ôË¡¤Î·×»»

LET N=5 !·å¿ô
DATA 1,1,0,1,0,1 !£²¿ÊË¡ 110101

DIM A2(0 TO N),Q2(0 TO N)
FOR i=N TO 0 STEP -1
   READ A2(i)
NEXT i
CALL poly_divByLin(A2,2, Q2,R) !p(x)/(x-2)
PRINT R !10¿ÊË¡



!¡ü¿¹à¼°¤Î¥Æ¥¤¥é¡¼Å¸³«

LET N=4 !¼¡¿ô
DATA 1,-2,-20,23,13 !x^4-2*x^3-20*x^2+23*x+13
DATA 5 !x=a

DIM A(0 TO N) !·¸¿ô
FOR i=N TO 0 STEP -1
   READ A(i)
NEXT i
READ v


DIM Q(0 TO N),AA(0 TO N) !ºî¶ÈÍÑ

MAT AA=A
FOR i=0 TO N-1 !¦²f[k](a)/k!*(x-a)^k
   CALL poly_divByLin(AA,v, Q,R) !£ë³¬Èùʬ·¸¿ô¡¡¢¨<----------
   PRINT R;" * ( x -";v;") ^";i

   MAT AA=Q !¼¡¤Ø
NEXT i
PRINT Q(0);" * ( x -";v;") ^";N



!¡üÂå¿ôÊýÄø¼°¤Îº¬¤ò¥Ë¥å¡¼¥È¥óË¡¤Çµá¤á¤ë¡Ê´Ø¿ôÃÍ¡¢Èùʬ·¸¿ô¡Ë

LET cEps=1e-10 !ÀºÅÙ  ¢¨Í×Ä´À°

LET N=3 !¼¡¿ô
DATA 1,-2,0,-9 !x^3-2*x^2-9=(x-3)*(x^2+x+3)

LET Xk=2 !¶á»÷º¬

DIM A3(0 TO N),Q3(0 TO N),QQ3(0 TO N)
FOR i=N TO 0 STEP -1
   READ A3(i)
NEXT i

LET iter=200 !È¿Éü²ó¿ô
FOR k=1 TO iter
   CALL poly_divByLin(A3,Xk, Q3,f) !´Ø¿ôÃÍ¢¨<----------
   CALL poly_divByLin(Q3,Xk, QQ3,df) !Èùʬ·¸¿ô¡¡¢¨<----------
   LET WXk=Xk-f/df !Xk+1=Xk-f(Xk)/f'(Xk)
   IF ABS(WXk-Xk)<=ABS(Xk)*cEps THEN EXIT FOR !¼ý«¤¹¤ì¤Ð½ªÎ»
   LET Xk=WXk !¼¡¤Ø
NEXT k
IF k>iter THEN
   PRINT iter;"²ó¤Ç¤Ï¼ý«¤·¤Þ¤»¤ó¡£"
   STOP
END IF

PRINT USING "## ##.###############": k,Xk


END


!Êä½õ¥ë¡¼¥Á¥ó

!ÊÑ¿ôx¤Î¿¹à¼° ¦²[k=0,n]a(k)*x^k=a(n)*x^n+a(n-1)*x^(n-1)+ ¡Ä +a(1)*x+a(0)

!±é»»´ØÏ¢

EXTERNAL FUNCTION poly_degree(A()) !¼¡¿ô¤òÆÀ¤ë
FOR i=UBOUND(A) TO 1 STEP -1
   IF A(i)<>0 THEN EXIT FOR !·¸¿ô¤¬£°¤Ç¤Ê¤¤ºÇ½é¤Î°ÌÃÖ
NEXT i
LET poly_degree=i
END FUNCTION

EXTERNAL SUB poly_divByLin(A(),v, Q(),R) !¿¹à¼°a(x)¤òx-¦Á¤Ç³ä¤Ã¤¿¤È¤­¤Î¾¦q(x)¤È;¤êr¤òµá¤á¤ë
MAT Q=ZER
LET s=0
FOR i=poly_degree(A) TO 0 STEP -1 !¥Û¡¼¥Ê¡¼¤ÎÊýË¡
   LET Q(i)=s !¢¨¡Ö·¸¿ô¤Ë£ø¤ò³Ý¤±¤Æ¼¡¤Î·¸¿ô¤ò²Ã¤¨¤ë¡×¤¬ÁÈΩ½üË¡¤Ë¤Ê¤ë
   LET s=s*v+A(i) !(¡Ä(((An*X+An-1)*X+An-2)*X+An-3)*X+¡Ä+A1)*X+A0
NEXT i
LET R=s
END SUB
 

!ƱÃͥǡ¼¥¿¡¼¤ò°ÂÄê²½¤¹¤ë¡¢¥¯¥¤¥Ã¥¯¡¦¥½¡¼¥È

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 3·î10Æü(²Ð)18»þ49ʬ59ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  !ƱÃͥǡ¼¥¿¡¼¤ò°ÂÄê²½¤¹¤ë¡¢¥¯¥¤¥Ã¥¯¡¦¥½¡¼¥È

!¡¡¥¯¥¤¥Ã¥¯¡¦¥½¡¼¥È¤Ï¡¢º£¤Ç¤âºÇ®¤ÎÉôÎà¤Ë¤¢¤ê¤Ê¤¬¤é¡¢
!Ʊ¤¸É¾²ÁÃͤΡ¢Ì¾»¥¤Î½çÈÖ¤¬¡¢¥½¡¼¥È¸å¤Ë¡¢Íð¤ì¤ëÆñÅÀ¤¬¤¢¤ê¤Þ¤¹¡£
!¤½¤ì¤ò¡¢³ÈÄ¥¤µ¤ì¤¿²¼°Ì·å¤ÎÆâÉôÉղäǡ¢Êä½þ¤·¤¿¡£
!½êÍ×»þ´Ö¤¬¡¢Ìó1.25ÇÜÄøÅÙ( ¥½¡¼¥È¿ô 99999¸Ä ¤Ç¬¤Ã¤¿)¡¡¤ËÃÙ¤¯
!¤Ê¤ê¤Þ¤·¤¿¤¬¡¢¤Þ¤À¡¢Â®¤¤Êý¤Ç¤¹¡£
!
!¡¡½èÍý¸å¤Î(¥½¡¼¥ÈÃÍ)¤¬¡¢Æ±ÃͤÇʤó¤Ç¤¤¤ë¥µ¥ó¥×¥ëÈÖ¹æ( No: )¤ò¡¢
!¡¡½èÍýÁ°¤Î¥µ¥ó¥×¥ëÈÖ¹æ( No: )¤ÎʤӤȡ¢Èæ¤Ù¤Æ²¼¤µ¤¤¡£
!----------------------------------------------------------
!
!¥Æ¥­¥¹¥È¡¦¥¦¥£¥ó¥É¥¦¤Î¡¢º¸¾å°ÌÃÖ(x0,y0)¤È¡¢Éý(xw,yw)¡£
CALL SetWindowPos( WinHandle("TEXT" ),0, 100,200,800,350, 0)

SUB SetWindowPos( handle,C2, x0,y0,xw,yw, nFLG ) ! nFLG: 0=x0y0xwyw 1=x0y0 2=xwyw
   ASSIGN "user32.dll","SetWindowPos"
END SUB

!----------------------------------------------------------
LET SU=999 !¡¡¥µ¥ó¥×¥ë¤Î¥Ç¡¼¥¿¡¼¿ô
DIM NO_(SU), VA$(SU) !¡¡¥µ¥ó¥×¥ëÈֹ桢¥½¡¼¥È¤¹¤ë¥µ¥ó¥×¥ë¤ÎÃÍ
DIM stb(SU) !¡¡Æ±Ãͥǡ¼¥¿¡¼½çÈÖ¤ò¡¢°ÂÄê²½¤¹¤ë³ÈÄ¥ÇÛÎó
!
LET u_$=REPEAT$("#",LEN(STR$(SU)))
LET u0$=REPEAT$("%",LEN(STR$(SU)))

SUB PRNdata(w$)
   MAT PRINT USING "      ¡¿ No: "& REPEAT$(u_$& " ",SU): NO_
   MAT PRINT USING w$&     " ÃÍ: "& REPEAT$(u_$& " ",SU): VA$
END SUB

SUB Ready
!--- ¥µ¥ó¥×¥ë¤ÎºîÀ®
   RANDOMIZE 19650218 !¥Ç¥Õ¥©¡¼¥ë¥ÈRND ¤Î·«ÊÖ¤·ºÆÀ¸
   FOR i=1 TO SU
      LET NO_(i)=i ! ¥µ¥ó¥×¥ëÈֹ桢¸ÇÍ­¤Î£É£Ä¤À¤¬¡¢Íð¤ì¤Î¼±Ê̤Τ¿¤áÅÐÏ¿½ç¤ÈƱ¤¸¤Ë¤¹¤ë¡£
      LET VA$(i)=USING$(u0$,SU*RND) ! ¥½¡¼¥È¤¹¤ëɾ²ÁÃÍ
   NEXT i
   !---
   FOR i=1 TO SU
      LET stb(i)=i ! ƱÃÍ ¤ÎÅÐÏ¿½ç¤Î°ÂÄêÍÑÈÖ¹æ( ¥µ¥ó¥×¥ë¤ÎÅÐÏ¿½çÈÖ¹æ )
   NEXT i
   CALL PRNdata("¸µ¤Î½ç¡À")
   LET t0=TIME
END SUB

SUB Result(w$)
!--- ·ë²Ì¤Î¥×¥ê¥ó¥È
   LET t1=TIME-t0
   IF t1< 0 THEN LET t1=t1+86400
   CALL PRNdata("¥½¡¼¥È¡À")
   FOR i=2 TO SU
      IF VA$(i-1)>VA$(i) THEN EXIT FOR
   NEXT i
   IF SU< i THEN PRINT w$& ": ¥½¡¼¥È»þ´Ö¡§";t1;"sec." ELSE  PRINT w$& ": Error!"
   PRINT
END SUB

!----
CALL Ready
CALL Qsort(1,SU)
CALL Result("°ÂÄꥯ¥¤¥Ã¥¯")
!
CALL Ready
CALL Qsort00(1,SU)
CALL Result("Ä̾說¥¤¥Ã¥¯")
!
PRINT "¢¨»þ´Ö·×¬¤Ï¡¢¡Þ0.05 sec ÄøÅÙ¡¢Ìµ°ÕÌ£¤Ê¥Ð¥é¥Ä¥­Í­¤ê¡¢"&
&& "¥Ç¡¼¥¿¡¼¿ô>=9999 °Ê¾å¤Ç¬¤Ã¤Æ²¼¤µ¤¤¡£"
PRINT "¡¡¸½ºß¤Î¥Ç¡¼¥¿¡¼¿ô¡§";SU;

!------
!¡¡½ç½ø¤ò°ÂÄê²½¤·¤¿¡¢¥¯¥¤¥Ã¥¯¡¦¥½¡¼¥È
SUB Qsort(L,R)
   local i,j
   LET i=L
   LET j=R
   LET v$=VA$((L+R)/2)
   LET ss=stb((L+R)/2)
   DO
      DO WHILE VA$(i)< v$ OR (VA$(i)=v$ AND stb(i)< ss)
         LET i=i+1
      LOOP
      DO WHILE v$< VA$(j) OR (VA$(j)=v$ AND ss< stb(j))
         LET j=j-1
      LOOP
      IF j< i THEN EXIT DO
      SWAP NO_(i),NO_(j)
      SWAP VA$(i),VA$(j)
      SWAP stb(i),stb(j)
      LET i=i+1
      LET j=j-1
   LOOP UNTIL j< i
   IF L< j THEN CALL Qsort(L,j)
   IF i< R THEN CALL Qsort(i,R)
END SUB

!------
!¡¡Ä̾ï¤Î¥¯¥¤¥Ã¥¯¡¦¥½¡¼¥È(Èæ³ÓÍÑ)
SUB Qsort00(L,R)
   local i,j
   LET i=L
   LET j=R
   LET v$=VA$((L+R)/2)
   DO
      DO WHILE VA$(i)< v$
         LET i=i+1
      LOOP
      DO WHILE v$< VA$(j)
         LET j=j-1
      LOOP
      IF j< i THEN EXIT DO !¡¡Åù¹æÉÕ j<=i ¤Ï¡¢Ë½Áö¡£
      SWAP NO_(i),NO_(j)
      SWAP VA$(i),VA$(j)
      LET i=i+1
      LET j=j-1
   LOOP UNTIL j< i !¡¡Åù¹æÉÕ j<=i ¤Ï¡¢Ä㮡£
   IF L< j THEN CALL Qsort00(L,j)
   IF i< R THEN CALL Qsort00(i,R)
END SUB

END
 

Re: ¾õÂÖÊýÄø¼°¤«¤éÅÁã´Ø¿ô¤òµá¤á¤ë

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 3·î10Æü(²Ð)20»þ51ʬ18ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.302[¸µµ­»ö¤Ø]

Âç·§¡¡Àµ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£


¡¡¾õÂÖÊýÄø¼° x'(t)=A*x(t)+b*u(t)
¡¡½ÐÎÏÊýÄø¼°¡¡y(t)=C*x(t)
¤Î°ÕÌ£¤Ï¡¢

¡¡·Ï u¡ÊÆþÎÏ¡Ë¢ª [ x'=A*x+b*u¡¢y=c*x ] ¢ª y¡Ê½ÐÎÏ¡Ë
¤òɽ¤·¤Þ¤¹¡£

´Êñ¤ÊÎã¤ò¤¢¤²¤Æ»»½ÐÊýË¡¤ò¾Ò²ð¤·¤Þ¤¹¡£

¡üRC²óÏ©¤Î¾ì¹ç

¡¡¡¡Vi¨¡R1¨¡¨¨¨¡Vo
u ¢ª¡¡¡¡¡¡x C1¡¡¡¡¢ª y
¡¡¡¡¡¡¡¡¡¡¡¡¨¢
¡¡¡¡¡¡¡¡¡¡¡¡¢á

¤³¤³¤Ç¡¢C1¤Ë¤«¤«¤ëÅÅ°µ¤òx¤È¤·¤Þ¤¹¡£

¾õÂÖÊýÄø¼°¤Ï¡¢C1¤Ëή¤ì¤ëÅÅήi=C1*dx/dt=C1*x'¤è¤ê¡¢C1*x'=(Vi-Vo)/R1=(u-x)/R1
¤·¤¿¤¬¤Ã¤Æ¡¢x'=-1/(C1*R1)*x+1/(C1*R1)*u

¤Þ¤¿¡¢½ÐÎÏÊýÄø¼°¤Ï¡¢y=Vo=x


¹ÔÎó¡Ê£±¡ß£±¡Ë¤Çɽ¤¹¤È
[x']=[-1/(C1*R1)][x] + [1/(C1*R1)]*[u]
[y]=[x]

¤³¤ì¤è¤ê
¡¡A=-1/(C1*R1)
¡¡b=1/(C1*R1)
¡¡c=1
¤È¤Ê¤ê¤Þ¤¹¡£



¡ü¥ª¥Ú¥¢¥ó¥×Àµµ¢´Ô·¿¥í¡¼¥Ñ¥¹¡¦¥Õ¥£¥ë¥¿¤Î¾ì¹ç
¡¡¡¡¡¡¨£C1¨¨¨¡¨¡¨¤
¡¡¡¡¡¡¨¢¡¡¨¦ -¡¡¨¢
Vi¨¡R1¨ªR2¨¨ + K¨ª¨¡Vo
¡¡¡¡¡¡¡¡¡¡C2
¡¡¡¡¡¡¡¡¡¡¨¢
¡¡¡¡¡¡¡¡¡¡¢á

C1,C2¤Ë¤«¤«¤ëÅÅ°µ¤òx1,x2¡¢ÅÅή¤òi1,i2¤È¤·¤Þ¤¹¡£
R1,R2,C2·ÐÏ©¡¢Vi=(i1+i2)*R1+i2*R2+x2 ¡Ä (1)
R1,C1,Vo·ÐÏ©¡¢Vi=(i1+i2)*R1+x1+Vo ¡Ä (2)
ÅÅή¡¢i1=C1*x1'¡¢i2=C2*x2' ¡Ä (3),(4)
¥ª¥Ú¥¢¥ó¥×¡¢Vo=K*x2 ¡Ä (5)

u=Vi=(1)=(2)¡¢(4)¤è¤ê¡¢x2'=(x1+(K-1)*x2)/(R2*C2) ¡Ä (6)

(1)¤Ë(3),(4)¤òÂåÆþ¤·¤Æi1,i2¤ò¾Ã¤¹¡£¤µ¤é¤Ë(6)¤òÂåÆþ¤·¤Æx2¤ò¾Ã¤¹¤È
x1'=-(R1+R2)/(R1*R2*C1)*x1 -{(K-1)*(R1+R2)+R2}/(R1*R2*C1)*x2 +(1/(R1*C1))*u ¡Ä (7)

¤³¤Î(6),(7)¤¬¾õÂÖÊýÄø¼°¤òɽ¤·¤Þ¤¹¡£

¤Þ¤¿¡¢½ÐÎÏÊýÄø¼°¤Ï(5)¤è¤ê¡¢y=Vo=K*x2 ¡Ä (8)


¥µ¥ó¥×¥ë¡¡¢¨¸µ¤Î¥×¥í¥°¥é¥à¤Ç¤ÏC1,C2¤¬½ÅÊ£¤¹¤ë¤¿¤á¡¢·¸¿ô¤ÎÊÑ¿ô̾¤òÊѹ¹¤·¤Æ¤¢¤ê¤Þ¤¹¡£
!¹ÔÎó´ØÏ¢
FUNCTION tr(A(,)) !¹ÔÎóA¤Î¥È¥ì¡¼¥¹
   LET t=0
   FOR i=1 TO N
      LET t=t+A(i,i)
   NEXT i
   LET tr=t
END FUNCTION

!¿¹à¼°´ØÏ¢
SUB mono_disp(ak,k) !ñ¹à¼°¤òɽ¼¨¤¹¤ë¡¡Ak*X^k
   IF k<>0 THEN !x^n¤Ç
      IF ak=1 THEN !·¸¿ô¤¬£±¤Ê¤é
      ELSEIF ak=-1 THEN !·¸¿ô¤¬¡Ý£±¤Ê¤é
         PRINT "-";
      ELSE
         PRINT STR$(ak);"*";
      END IF
   END IF
   IF k=0 THEN !¼¡¿ô¤¬£°¤Ê¤é
      PRINT STR$(ak);
   ELSEIF k=1 THEN !¼¡¿ô¤¬£±¤Ê¤é
      PRINT "s";
   ELSE
      PRINT "s^";STR$(k);
   END IF
END SUB
!-------------------- ¤³¤³¤Þ¤Ç¤¬¥µ¥Ö¥ë¡¼¥Á¥ó


!·Ï u¡ÊÆþÎÏ¡Ë¢ª [ x'=A*x+b*u¡¢y=c*x ] ¢ªy¡Ê½ÐÎÏ¡Ë

!---------- ¢­¢­¢­¢­¢­ ----------
LET N=2 !¾õÂÖÊÑ¿ô¤Î¿ô

DIM A(N,N),b(N,1),c(1,N)

LET R1=30e3 !30k[¦¸]
LET R2=18e3 !18k[¦¸]
LET C1=0.01e-6 !0.01¦Ì[F]
LET C2=0.0047e-6 !0.0047¦Ì[F]
LET K=1 !¥Ü¥ë¥Æ¡¼¥¸¡¦¥Õ¥©¥í¥ï¤è¤ê¡¢¥¢¥ó¥×¤ÎÁýÉýΨ¤Ï£±

LET A(1,1)=-(R1+R2)/(R1*R2*C1)
LET A(1,2)=-((K-1)*(R1+R2)+R2)/(R1*R2*C1)
LET A(2,1)=1/(R2*C2)
LET A(2,2)=(K-1)/(R2*C2)

LET b(1,1)=1/(R1*C1)
LET b(2,1)=0

LET c(1,1)=0
LET c(1,2)=K
!---------- ¢¬¢¬¢¬¢¬¢¬ ----------


!FrameË¡¡¢Leverrir-FaddeevË¡
!¡¡adj(s*I-A)=s^(n-1)*I+s^(n-2)*¦Â1+ ¡Ä +s*¦Ân-2+¦Ân-1
!¡¡det(s*I-A)=s^n+¦Á1*s^(n-1)+ ¡Ä + ¦Án-1*s+¦Án
!¤Î¤È¤­
!¡¡¦Â0=I¡¢k=1¡Án¤Ë¤Ä¤¤¤Æ
!¡¡¡¡Xk=A*¦Âk-1
!¡¡¡¡¦Ák=-trace(Xk)/k
!¡¡¡¡¦Âk=Xk+¦Ák*I
!¤ÎÃ༡·×»»¤Ç¦Ák¡¢¦Âk¤¬µá¤Þ¤ë¡£

DIM p1(N) !ʬ»Ò¦¤Î¿¹à¼° c(1)*X^(N-1)+c(2)*X^(N-2)+ ¡Ä +c(N-1)*X+c(N) ¤Î·¸¿ô
DIM p2(N) !ʬÊ즤ο¹à¼° X^N+c(1)*X^(N-1)+c(2)*X^(N-2)+ ¡Ä +c(N-1)*X+c(N) ¤Î·¸¿ô
DIM X(N,N),sE(N,N),T1(1,N),T2(1,1) !ºî¶ÈÍÑ

MAT X=IDN !adj(s*I-A)
FOR k=1 TO N
   MAT PRINT X; !debug
   MAT T1=c*X !c*adj(s*I-A)*b¡¡¢¨Äê¿ô*¿¹à¼°*Äê¿ô
   MAT T2=T1*b
   LET p1(k)=T2(1,1)

   MAT X=A*X
   LET p2(k)=-tr(X)/k !det(s*I-A)
   MAT sE=(p2(k))*IDN
   MAT X=X+sE
NEXT k


!¢¨´ûÌóʬ¿ô¤Ç¤Ê¤¤

!!!MAT PRINT p1; !debug
PRINT "ʬ»Ò= ";
FOR i=1 TO N !ʬ»Ò¦¤Î¿¹à¼°¤òɽ¼¨¤¹¤ë
   LET w=p1(i)
   IF w>0 THEN PRINT "+";
   IF w<>0 THEN CALL mono_disp(w,N-i)
NEXT i
PRINT

!!!MAT PRINT p2; !debug
PRINT "ʬÊì= ";
CALL mono_disp(1,N) !ʬÊ즤ο¹à¼°¤òɽ¼¨¤¹¤ë
FOR i=1 TO N
   LET w=p2(i)
   IF w>0 THEN PRINT "+";
   IF w<>0 THEN CALL mono_disp(w,N-i)
NEXT i


END
 

Re: ¾õÂÖÊýÄø¼°¤«¤éÅÁã´Ø¿ô¤òµá¤á¤ë

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 3·î11Æü(¿å)11»þ42ʬ34ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.304[¸µµ­»ö¤Ø]

Êä­

¡üÅÁã´Ø¿ô¤òµá¤á¤ë
¾õÂÖÊýÄø¼° (6),(7)
¡¡[ x1' ] = [ -(R1+R2)/(R1*R2*C1)  -{(K-1)*(R1+R2)+R2}/(R1*R2*C1) ] [ x1 ] + [ 1/(R1*C1) ] [ u ]
¡¡[ x2' ] ¡¡[ 1/(R2*C2)            (K-1)/(R2*C2)                  ] [ x2 ]   [ 0         ]
½ÐÎÏÊýÄø¼° (8)
¡¡[ y ] = [ 0  K ] [ x1 ]
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ [ x2 ]
¤È¹ÔÎó¤Çɽ¤µ¤ì¤ë¡£

K=1¤È¤¹¤ë¤È
A=[ -(R1+R2)/(R1*R2*C1)  -1/(R1*C1) ]
  [ 1/(R2*C2)            0          ]

c=[ 0  1 ]


ÅÁã´Ø¿ô G(s)
=c*INV(s*I-A)*b
=[ 0  1 ] [ s+(R1+R2)/(R1*R2*C1)  1/(R1*C1) ]-1 [ 1/(R1*C1) ]
          [ -1/(R2*C2)            s         ]   [ 0         ]

¤Þ¤º¡¢(s*I-A)¤ÎµÕ¹ÔÎó¤Ï
¡¡[a b]-1 = 1/(a*d-b*c)[d -b] ¤è¤ê
¡¡[c d]                [-c a]

INV(s*I-A)
=[ s+(R1+R2)/(R1*R2*C1)  1/(R1*C1) ]-1
 [ -1/(R2*C2)            s         ]
=1/{(s+(R1+R2)/(R1*R2*C1))*s + 1/(R1*R2*C1*C2)} * [ s          -1/(R1*C1)           ]
                                                  [ 1/(R2*C2)  s+(R1+R2)/(R1*R2*C1) ]
¤È¤Ê¤ë¡£¤³¤Î¾ì¹ç¡¢·¸¿ôÉôʬ¤ÎʬÊ줬ÅÁã´Ø¿ô¤ÎʬÊì¤Ë¤Ê¤ë¡£

¤Þ¤¿¡¢¹ÔÎóÉôʬ¤Ï
[ 0  1 ] * ¾åµ­ * [ 1/(R1*C1) ]
                  [ 0         ]
=[ 1/(R2*C2)  s+(R1+R2)/(R1*R2*C1) ] [ 1/(R1*C1) ]
                                     [ 0         ]
=1/(R1*R2*C1*C2)
¤È¤Ê¤ë¡£¤³¤é¤¬ÅÁã´Ø¿ô¤Îʬ»Ò¤Ë¤Ê¤ë¡£

¤·¤¿¤¬¤Ã¤Æ
G(s)
=1/(R1*R2*C1*C2) * 1/{ (s+(R1+R2)/(R1*R2*C1))*s + 1/(R1*R2*C1*C2) }
={ 1/(R1*R2*C1*C2) } / { (s^2+{1/(R2*C1)+1/(R1*C1)}*s + 1/(R1*R2*C1*C2) }


¡üºÇ¶á¤ÎÅê¹Æ¤Î¥Í¥¿¤Ç¤¹¡£
²óÏ©²òÀÏ
¡¡¥­¥ë¥Ò¥Û¥Ã¥Õ¤Îˡ§
¡¡¡¡Ä¾Î®²óÏ©¡¢¸òή²óÏ©
¡¡¡¡Äê¾ï¾õÂÖ¡¢²áÅϾõÂÖ

¡¡¡¡Ï¢Î©ÊýÄø¼°¤ò²ò¤¯¡ÊÂå¿ôÊýÄø¼°¤Ë¤è¤ëɽ¸½¡Ë
¡¡¡¡¡¡»ÞÏ©ÅÅήˡ
¡¡¡¡¡¡¡¡¨£¡Þ1¨¤[i]=¨£0¨¤
¡¡¡¡¡¡¡¡¨¦ Z ¨¥¡¡¡¡¨¦E¨¥
¡¡¡¡¡¡ÌÖÌܲòÀÏ
¡¡¡¡¡¡¡¡ÌÖÌÜ¡ÊÊÄÏ©¡ËÅÅήˡ¡ÊÊÄÏ©ÊýÄø¼° Z*I=E¡Ë
¡¡¡¡¡¡ÀáÅÀ²òÀÏ
¡¡¡¡¡¡¡¡ÀáÅÀÅÅ°ÌË¡¡ÊÀáÅÀÊýÄø¼° G*E=I¡Ë

¡¡¡¡¡¡Äñ¹³¡¢ÅÅή¡¢ÅÅ°µ¤Î·×»»
¡¡¡¡¡¡ÆþÎÏÅÅ°µ¤È½ÐÎÏÅÅ°µ¤ÎÈæ
¡¡¡¡¡¡¡¡¼þÇÈ¿ô²òÀÏ
¡¡¡¡¡¡¡¡¡¡¥Ü¡¼¥ÉÀþ¿Þ¡ÊÍøÆÀ¡¢°ÌÁê¡Ë
¡¡¡¡¡¡¡¡¡¡¥Ê¥¤¥­¥¹¥ÈÀþ¿Þ


¡¡¡¡¾õÂÖÊýÄø¼°¤È½ÐÎÏÊýÄø¼°¤ò²ò¤¯¡ÊϢΩ£±¼¡¾ïÈùʬÊýÄø¼°¤Ë¤è¤ëɽ¸½¡Ë
¡¡¡¡¡¡¥é¥×¥é¥¹ÊÑ´¹
¡¡¡¡¡¡¡¡ÅÁã´Ø¿ô
¡¡¡¡¡¡¡¡¡¡Í­Íý¼°
¡¡¡¡¡¡¡¡¡¡¡¡ÎíÅÀ¡Êʬ»Ò¦¤Î¿¹à¼°¡Ë
¡¡¡¡¡¡¡¡¡¡¡¡¶Ë¡ÊʬÊ즤ο¹à¼°¡Ë
¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÆÃÀ­ÊýÄø¼°¤Îº¬¡Ê¸ÇÍ­ÃÍ¡Ë
¡¡¡¡¡¡¡¡¡¡¡¡Âå¿ôÊýÄø¼°¤Îº¬
¡¡¡¡¡¡¡¡¡¡¡¡¡¡DKAË¡

¡¡¡¡¡¡¡¡¡¡¥·¥¹¥Æ¥à¤Î±þÅú
¡¡¡¡¡¡¡¡¡¡¡¡¼þÇÈ¿ô²òÀÏ
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¥Ü¡¼¥ÉÀþ¿Þ¡ÊÍøÆÀ¡¢°ÌÁê¡Ë
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¥Ê¥¤¥­¥¹¥ÈÀþ¿Þ
¡¡¡¡¡¡¡¡¡¡¡¡²áÅϲòÀÏ
¡¡¡¡¡¡¡¡¡¡¡¡¡¡µÕ¥é¥×¥é¥¹ÊÑ´¹
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Éôʬʬ¿ôʬ²ò
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Âå¿ôÊýÄø¼°¤Îº¬¡¢ÁÈΩ½üË¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡µÕ¥Õ¡¼¥ê¥¨ÊÑ´¹

¡¡¡¡¡¡¡¡¡¡°ÂÄêȽÊÌ
¡¡¡¡¡¡¡¡¡¡¡¡ÆÃÀ­ÊýÄø¼°¤Îº¬¡¢·¸¿ô
¡¡¡¡¡¡¡¡¡¡¡¡º¬µ°À×

¡¡¡¡¡¡¥ª¥¤¥é¡¼Ë¡¡¢¥ë¥ó¥²¥¯¥Ã¥¿Ë¡


¡¡¡¡¥Õ¥£¥ë¥¿²óÏ©
¡¡¡¡ÁýÉý´ï¡Ê¥¢¥Ú¥¢¥ó¥×¡Ë
¡¡¡¡¡¡Ééµ¢´Ô¡¢Àµµ¢´Ô
¡¡¡¡¡¡¥¢¥¯¥Æ¥£¥Ö¡¦¥Õ¥£¥ë¥¿²óÏ©
 

! ´Ñ¾Þ¥°¥é¥Õ

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 3·î15Æü(Æü)03»þ57ʬ47ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ! ´Ñ¾Þ¥°¥é¥Õ
! µ±¤¯ ¥Þ¥ó¥Ç¥ë¥Ö¥í¡¼¡Ê źÉÕ¥µ¥ó¥×¥ë Complex\mandelbm.bas ¤ÎÃ忧²þÊÑ¡Ë
!
OPTION ARITHMETIC COMPLEX
SET POINT STYLE 1
!
FOR n=0 TO 50
   SET COLOR MIX(    n) 0   ,0     ,n/51   !BLACK =< < BLUE
   SET COLOR MIX( 51+n) 0   ,n/51  ,1      !BLUE =< < CYAN
   SET COLOR MIX(102+n) 0   ,1     ,1-n/51 !CYAN =< < GREEN
   SET COLOR MIX(153+n) n/51,1     ,0      !GREEN =< < YELLOW
   SET COLOR MIX(204+n) 1   ,1-n/51,0      !YELLOW =< < RED
NEXT n
!SET COLOR MIX(255) 1,0,0 !=RED
SET COLOR MIX(255) 0.549,0.549,0.561 !=GRAY =default
!
LET XL=-2
LET XR=.8
LET w1=XR-XL
LET w2=w1/2
!
SET WINDOW XL, XR,-w2,w2
ASK PIXEL SIZE(XL,-w2; XR,w2) px,py
!
! ¥Þ¥ó¥Ç¥ë¥Ö¥í¡¼¤Î¦Ì-map
! f(z)=z^2+¦Ì¤ÎÈ¿Éü¤¬Í­³¦¤È¤Ê¤ëÊ£ÁÇ¿ô¦Ì¤Î½¸¹ç
! ȯ»¶¤ÎȽÄê¤Ë»ê¤ë¤Þ¤Ç¤Î·«¤êÊÖ¤·²ó¿ô¤Ç¿§Ê¬¤±¡£
!
FOR x=XL TO XR STEP w1/(px-1)
   FOR y=0 TO w2 STEP w1/(py-1)
      LET z=0
      FOR n=1 TO 255
         LET z=z^2+COMPLEX(x,y)
         IF 2< ABS(z) THEN
            IF n< 64 THEN SET POINT COLOR n*4 ELSE SET POINT COLOR 255
            PLOT POINTS :x,y
            PLOT POINTS :x,-y
            EXIT FOR
         END IF
      NEXT n
   NEXT y
NEXT x

!--------------
pause !°ì»þÄä»ß
SET COLOR MIX(0) 1,1,1
CLEAR

! º¸¤Ø¿­¤Ó¤ëÇòÀþ¡Ê̵ȯ»¶Îΰè¡Ë¤Ï¡¢ËÜÍè¤Ï¡¢ºÙ¤¤Àþ¤Ç¸«¤¨¤Ê¤¤°Ì¤Ê¤Î¤Ç¡¢
! °Ê²¼¤ÎÍͤˤ¹¤ë¤È¡¢¾Ã¤¨¤ë¡£Â®ÅÙ¤¬Íî¤Á¤ë¤Î¤Ç¡¢Â¾¤ËÊýË¡¤â¡¦¡¦¡£
!--------------

FOR x=XL TO XR STEP w1/(px-1)
   FOR y=-w2-w1/(py-1)/2 TO w2 STEP w1/(py-1) !¸Î°Õ¤Ë(x,0)¤òÉÁÅÀ¤Î´Ö¤Ë¶´¤à¡£
      LET z=0
      FOR n=1 TO 255
         LET z=z^2+COMPLEX(x,y)
         IF 2< ABS(z) THEN
            IF n< 64 THEN SET POINT COLOR n*4 ELSE SET POINT COLOR 255
            PLOT POINTS :x,y !¾å²¼¤ÎÂоݥץí¥Ã¥È¤ò¤·¤Ê¤¤¡£
            EXIT FOR
         END IF
      NEXT n
   NEXT y
NEXT x

END
 

Re: ! ´Ñ¾Þ¥°¥é¥Õ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 3·î16Æü(·î)15»þ03ʬ27ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.307[¸µµ­»ö¤Ø]

ÉÔÅù¼°f(x,y)>0¤ÎÎΰ褬¤Ä¤¯¤ëÌÏÍÍ

Ê¿Ì̤ϡ¢³Æ´Ø¿ô¤ä¤½¤Î£î¤ÎÃͤòÊѹ¹¤¹¤ë¤³¤È¤Ç²Äǽ¤Ç¤¹¡£
ñ¿§¤Ç¤¹¤¬Ê¿Ì̤ε¯Éú¤Ë¤è¤Ã¤Æ¡¢¤ª¤â¤·¤í¤¤ÌÏÍͤ¬ÉÁ¤±¤Þ¤¹¡£

¤Þ¤¿¡¢Åù¹âÀþ¤Ç¿§Ê¬¤±¤¹¤ë¤Î¤âÎɤ¤¤«¤È»×¤¤¤Þ¤¹¡£

!ÉÔÅù¼°f(x,y)>0¤ÎÎΰ褬¤Ä¤¯¤ëÌÏÍÍ

!´Ø¿ô¤ÎÄêµÁ f(x,y)=0
LET n=0.25
DEF g(x,y)=COS(PI*y)-n/COS(PI*x) !n=[-1,1]

!LET n=0.2
!DEF g(x,y)=x*y/n-(x^2+y^2)/(COS(2*PI*x)+COS(2*PI*y)) !n=[0.1,1]

!LET n=0.5
!DEF g(x,y)=COS(2*PI*y)-COS(2*PI*(COS(2*n*PI*x)+COS(2*n*PI*y))) !n=[0.1,2]

!LET n=3
!DEF g(x,y)=COS(PI*x*y/n)-(COS(2*PI*x)+COS(2*PI*y)) !n=[0.1,5]

!LET n=0.2
!DEF g(x,y)=n*COS(PI*x*y)-(SIN(2*PI*x)+SIN(2*PI*y)) !n=[-0.5,0.5]

!LET n=25
!DEF g(x,y)=COS(PI*x*y)-COS(n*x*y/(x^2+y^2)) !n=[1,100]

!LET n=25
!DEF g(x,y)=COS(PI*x*y)-x*y*COS(n*x*y/(x^2+y^2)) !n=[1,100]


LET a=-5 !x=[a,b]¡¡¢¨xyºÂɸ¤Îɽ¼¨Îΰè
LET b=5
LET c=a !y=[c,d]
LET d=b


SET WINDOW a,b,c,d !ɽ¼¨Îΰè¤òÀßÄꤹ¤ë
DRAW grid(1,1) !ºÂɸ¤òÉÁ¤¯
ASK PIXEL SIZE (a,c; b,d) w,h !²èÁü¤Î½Ä²£¤ÎÂ礭¤µ(¥É¥Ã¥Èñ°Ì)¤òÄ´¤Ù¤ë

!¾ò·ï¤òËþ¤¿¤¹Îΰè¤òÉÁ¤¯
SET POINT STYLE 1 !¥É¥Ã¥È·Á¼°
SET POINT COLOR 2
FOR j=1 TO h !²èÌÌÁ´ÂΤòÁöºº¤¹¤ë
   LET y=WORLDY(j) !¥É¥Ã¥È¤òxyºÂɸ¤ËÊÑ´¹¤¹¤ë
   FOR i=1 TO w
      LET x=WORLDX(i)

      WHEN EXCEPTION IN
         LET z=g(x,y) !´Ø¿ôÃͤò·×»»¤¹¤ë
         IF z>0 THEN !Àµ¤ÎÉôʬ¤òÀÚ¤ê¼è¤ë
            PLOT POINTS: x,y
         END IF
      USE !£°³ä¤ê¤Ê¤É¤ÎÎã³°½èÍý
      END WHEN

   NEXT i
NEXT j

END
 

Re: ¥»¥ó¥¿¡¼»î¸³ÄøÅÙ¤Î¥×¥í¥°¥é¥à±é½¬

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 3·î20Æü(¶â)21»þ31ʬ59ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.301[¸µµ­»ö¤Ø]

> ÁÈΩ½üË¡¤Î¡Ê°Õ³°¤Ê¡Ë»È¤¤Æ»
>
> EXTERNAL SUB poly_divByLin(A(),v, Q(),R) !¿¹à¼°a(x)¤òx-¦Á¤Ç³ä¤Ã¤¿¤È¤­¤Î¾¦q(x)¤È;¤êr¤òµá¤á¤ë
> MAT Q=ZER
> LET s=0
> FOR i=poly_degree(A) TO 0 STEP -1 !¥Û¡¼¥Ê¡¼¤ÎÊýË¡
>    LET Q(i)=s !¢¨¡Ö·¸¿ô¤Ë£ø¤ò³Ý¤±¤Æ¼¡¤Î·¸¿ô¤ò²Ã¤¨¤ë¡×¤¬ÁÈΩ½üË¡¤Ë¤Ê¤ë
>    LET s=s*v+A(i) !(¡Ä(((An*X+An-1)*X+An-2)*X+An-3)*X+¡Ä+A1)*X+A0
> NEXT i
> LET R=s
> END SUB


Á°½Ð¤ÎÁÈΩ½üË¡¤Î»»½Ð¡Ê¥µ¥Ö¥ë¡¼¥Á¥ópoly_divByLin»²¾È¡Ë¤ò¤è¤¯¸«¤ë¤È¡¢
¥Û¡¼¥Ê¡¼Ë¡¤Ë¤è¤ë´Ø¿ôÃͤòµá¤á¤ë¤Î¤ÈƱ¤¸¤Ç¤¹¡£
¤·¤¿¤¬¤Ã¤Æ¡¢´Ø¿ôÃͤÈÈùʬ·¸¿ô¤Ï¤Þ¤È¤á¤Æ·×»»¤Ç¤­¤Þ¤¹¡£¡Ê¥µ¥Ö¥ë¡¼¥Á¥óFxdFx»²¾È¡Ë

´Ø¿ôÃͤÈÈùʬ·¸¿ô¤òƱ»þ¤Ë°·¤¦ÌäÂê¤ò²ò¤¤¤Æ¤ß¤Þ¤¹¡£

!¡üÀÜÀþ¤ÎÊýÄø¼°

!À°´Ø¿ôy=f(x)¤Ï¡¢ÁÈΩ½üË¡¤Ç¡¢y=Q(x)*(x-a)^2+m*(x-a)+n¤ËÊÑ·Á¤Ç¤­¤ë¡£
!y=f(x)¾å¤ÎÅÀP(a,f(a))¤Ë¤ª¤±¤ëÀÜÀþ¤Ï¡¢y=m*(x-a)+n¤Ë¤Ê¤ë¡£

LET N=3 !¼¡¿ô

DATA 1,0,0,0 !y=f(x)=x^3
LET a=1 !ÅÀP

DIM A2(0 TO N)
FOR i=N TO 0 STEP -1
   READ A2(i)
NEXT i

CALL FxdFx(N,A2,a, f,df) !´Ø¿ôÃͤÈÈùʬ·¸¿ô¡¡¢¨<----------
PRINT df;"* (x + "; -a;") +";f !y=f'(a)*(x-a)+f(a)



!¡üÂå¿ôÊýÄø¼°¤Îº¬¤ò¥Ë¥å¡¼¥È¥óË¡¤Çµá¤á¤ë¡Ê´Ø¿ôÃÍ¡¢Èùʬ·¸¿ô¡Ë

LET cEps=1e-10 !ÀºÅÙ  ¢¨Í×Ä´À°

!LET N=3 !¼¡¿ô
!DATA 1,-2,0,-9 !x^3-2*x^2-9=(x-3)*(x^2+x+3)
LET N=4
DATA 1,-4,-1,10,6 !(x+1)(x-3)(x^2-2*x-2)

LET Xk=4 !¶á»÷º¬

DIM A3(0 TO N)
FOR i=N TO 0 STEP -1
   READ A3(i)
NEXT i

LET iter=200 !È¿Éü²ó¿ô
FOR k=1 TO iter
   CALL FxdFx(N,A3,Xk, f,df) !´Ø¿ôÃͤÈÈùʬ·¸¿ô¡¡¢¨<----------
   LET WXk=Xk-f/df !Xk+1=Xk-f(Xk)/f'(Xk)
   IF ABS(WXk-Xk)<=ABS(Xk)*cEps THEN EXIT FOR !¼ý«¤¹¤ì¤Ð½ªÎ»
   LET Xk=WXk !¼¡¤Ø
NEXT k
IF k>iter THEN
   PRINT iter;"²ó¤Ç¤Ï¼ý«¤·¤Þ¤»¤ó¡£"
   STOP
END IF

PRINT USING "## ##.###############": k,Xk


END


!Êä½õ¥ë¡¼¥Á¥ó

!ÊÑ¿ôx¤Î¿¹à¼° ¦²[k=0,n]a(k)*x^k=a(n)*x^n+a(n-1)*x^(n-1)+ ¡Ä +a(1)*x+a(0)

!±é»»´ØÏ¢

EXTERNAL SUB FxdFx(n,a(),x0, f,df) !´Ø¿ôÃÍf(x0)¤ÈÈùʬ·¸¿ôf'(x0)¤òµá¤á¤ë¡¡¢¨n¡æ1
LET f=a(n)
LET df=f
FOR j=n-1 TO 1 STEP -1 !¥Û¡¼¥Ê¡¼Ë¡¡ÊÁÈΩ½üË¡¡Ë
   LET f=f*x0+a(j)
   LET df=df*x0+f
NEXT j
LET f=f*x0+a(0)
END SUB
 

¥Ó¥Ã¥ÈÎó´Ø¿ô

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ 3·î26Æü(ÌÚ)14»þ47ʬ32ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ÇòÀÐÀèÀ¸¤Ë¼ÁÌä¤Ç¤¹¡£

¥Ó¥Ã¥ÈÎóÁàºî´Ø¿ôBVAL(b$,r),BSTR$(v,r)¤ÎÂ裲°ú¿ô¤Ï½½¿ÊBASIC¤Ç¤Ï2¤È16¤Î¿ôÃÍÄê¿ô¤·¤«Ç§¤á¤Æ¤¤¤Þ¤»¤ó¤¬¡¢
JIS¤òÆɤà¤È¿ôÃͼ°¤är=8¤Ë¤Ä¤¤¤Æ¤âǧ¤á¤Æ¤â¤è¤¤¤è¤¦¤Ë»×¤¦¤Î¤Ç¤¹¤¬¤¤¤«¤¬¤Ç¤·¤ç¤¦¤«¡£

JIS¤Î¡Ö14.7 ¥Ó¥Ã¥ÈÎóÁàºî¡×¡Ö14.7.4 °ÕÌ£ (1)¡×¤Î¡Öɽ14.1 ¥Ó¥Ã¥ÈÎó´Ø¿ô¡×¤Ë
¡Øb$:ʸ»úÎó¼°;  r,v:»Øɸ;  r¤Î¤È¤ëÃÍ: 2, 8Ëô¤Ï16¤À¤±¡Ù
¤È¤¢¤ê¤Þ¤¹¤¬¡ÖÉí°½ñE À¸À®µ¬Â§°ìÍ÷¡×¤Ë¤Ï
¡Ø5.2 »Øɸ = ¿ôÃͼ°¡Ù
¤È¤¢¤ê¤Þ¤¹¡£¡Ê»Øɸ¤ÎÄêµÁ¤Ï 5.2.4 (3)¤Ë¤¢¤ê¤Þ¤¹¡Ë

¤Þ¤¿¡Ø2, 8Ëô¤Ï16¤À¤±¡Ù¤Ï¤ª¤½¤é¤¯ "only 2, 8 or 16" ¤Î¤Þ¤º¤¤Ä¾Ìõ¤Ç¡¢°ÕÌ£¤È¤·¤Æ¤Ï¡Ö2,8,16¤À¤±¡×¤À¤È»×¤¤¤Þ¤¹¡£
8¤Ë¤Ä¤¤¤Æ¤âÄêµÁ¤¹¤ë¤³¤È¤òÍ×ÀÁ¤·¤Æ¤¤¤ë¤è¤¦¤Ë¼õ¤±¼è¤ì¤Þ¤¹¡£


¤¤¤Ä¤âÁǿͤ¬¤ï¤±¤Î¤ï¤«¤é¤ó¤³¤È¤ò¼çÄ¥¤·¤Æ¿½¤·Ìõ¤´¤¶¤¤¤Þ¤»¤ó¡£²¿¤«¤·¤é¤´¶µ¼¨¤ò¤¤¤¿¤À¤±¤ì¤Ð¹¬¤¤¤Ç¤¹¡£
 

Re: ¥Ó¥Ã¥ÈÎó´Ø¿ô

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 3·î26Æü(ÌÚ)18»þ22ʬ29ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.310[¸µµ­»ö¤Ø]

BVAL¤ÈBSTR$¤ÏJIS Full BASIC¤Ç¤Ï¼Â»þ´Öµ¡Ç½Ã±°Ì¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
¼Â»þ´Öµ¡Ç½¤ò¼ÂÁõ¤·¤è¤¦¤È¤¹¤ë¤ÈÌÌÅݤ¬Â¿¡¹½Ð¤Æ¤¯¤ë¤Î¤ÇÅöÌ̤½¤ÎͽÄê¤Ï¤¢¤ê¤Þ¤»¤ó¡£
¤Ç¤¹¤¬¡¤2¿Ê¿ô¡¤16¿Ê¿ô¤Îɽ¸½¤Ï¤Ç¤­¤Ê¤¤¤ÈÉÔÊؤʤΤÇJIS¸ß´¹¤È¤Ê¤ë¤è¤¦¤Ë¤½¤Îµ¡Ç½¤òÍÑ°Õ¤·¤Æ¤¤¤Þ¤¹¡£
Full BASIC¤ÎBVAL(s$,r),BSTR$(n,r)¤Ïr¤ÎÉôʬ¤ò¿ôÃͼ°¤Ç»ØÄê¤Ç¤­¤Þ¤¹¤¬¡¤½½¿ÊBASIC¤Ç¤ÏÄê¿ô¤Î¤ß¤Ç¤¹¡£
8¿Ê¤ËÂбþ¤¹¤ë¤Î¤Ï¤µ¤Û¤ÉÆñ¤·¤¯¤Ê¤¤¤Î¤Ç¤¹¤¬¡¤¸½ºß¤ÎPC´Ä¶­¤Ç¤½¤ÎɬÍ×À­¤ò´¶¤¸¤ë¤³¤È¤¬¤Ê¤¤¤Î¤Ç¾Ê¤¤¤Æ¤¤¤Þ¤¹¡£
 

Re: ¥Ó¥Ã¥ÈÎó´Ø¿ô

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ 3·î26Æü(ÌÚ)20»þ40ʬ47ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.311[¸µµ­»ö¤Ø]

Á᡹¤Ë¤´²óÅú¤¤¤¿¤À¤­¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£

¼Â»þ´Öµ¡Ç½¤ò¾Ê¤¤¤Æ¤¤¤ë°Ê¾å¡¢ËÜÍè¥Ó¥Ã¥ÈÎó´Ø¿ô¼«ÂΤòÄêµÁ¤¹¤ëɬÍפ¬¤Ê¤¯¡¢¸À¤ï¤Ð¥µ¡¼¥Ó¥¹¤Ç¤Ä¤±¤Æ¤¤¤ë¤È¤¤¤¦¤³¤È¤Ç¤¹¤Í¡£
»ä¤Î¸í²ò¤Ï¡¢¥Ó¥Ã¥ÈÎó´Ø¿ô¤ò¾¤ÎÁȹþ¤ß´Ø¿ô¤ÈƱÍͤ˪¤¨¤Æ¤¤¤¿¤È¤³¤í¤Ë¤¢¤ë¤è¤¦¤Ç¤¹¡£
ÃúÇ«¤Ë¤´ÀâÌÀ¤¤¤¿¤À¤­Íý²ò¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤·¤¿¡£¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
 

¥¯¥¤¥Ã¥¯¡¦¥½¡¼¥È¤Î¥¢¥Ë¥á¡¼¥·¥ç¥ó

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 4·î 1Æü(¿å)23»þ48ʬ4ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.303[¸µµ­»ö¤Ø]

!¥¯¥¤¥Ã¥¯¡¦¥½¡¼¥È¤Î¥¢¥Ë¥á¡¼¥·¥ç¥ó
!
!¼ÌÁü¥½¡¼¥È¤¬»ÈÍѤǤ­¤Ê¤¤¾ì¹ç¡¢°ÍÁ³¡¢ºÇ¹â®¤Ê¥¯¥¤¥Ã¥¯¡¦¥½¡¼¥È¤Î¼ê½ç¡£

!³µÎ¬
!¡¡¥Ç¡¼¥¿¡¼¤¬¡¢º¸(£Ì)¤«¤é±¦(£Ò)¤Ëʤó¤Ç¤¤¤Æ¡¢±¦(£Ò)¤Ø¸þ¤«¤Ã¤Æ¾º½ç¤Ë¡¢
!¡¡Ê¤ÓÂؤ¨¤¿¤¤¤È¤¹¤ë¡£

!£±¡Ë¥Ç¡¼¥¿¡¼Îó ½çÈÖ¤ÎÃæ±û°ÌÃÖ¤ÎÃͤò¡Ö´ð½àÃ͡פËÁª¤Ö¡£¤³¤ÎÃͤϡ¢
!¡¡¡¡Á´¥Ç¡¼¥¿¡¼ÃͤÎÊ¿¶Ñ¤È¤â¸Â¤é¤º¡¢ÉÔ¶ø¤Ë¤â°ìÈÖÂ礭¤ÊÃͤ䡢°ìÈÖ¾®¤µ¤ÊÃͤË
!¡¡¡¡Áª¤Ð¤ì¤ë¾ì¹ç¤â´Þ¤Þ¤ì¤Æ¤¤¤ë¡£

!£²¡Ë¤³¤Î¡Ö´ð½àÃ͡װʾå¤ÎÃͤΥǡ¼¥¿¡¼¤Ï¡¢£Ò¦¤Ë¡¢
!¡¡¡¡¤³¤Î¡Ö´ð½àÃ͡װʲ¼¤ÎÃͤΥǡ¼¥¿¡¼¤Ï¡¢£Ì¦¤Ë¡¢£²¤Ä¤ÎÎΰè¤Ëʬ¤±¤ë¡£
!¡¡¡¡¡Ö´ð½àÃ͡פϡ¢£±¡Ë¤Î¾ò·ï¤Ê¤Î¤Ç¡¢Ê¬³ä¤Î¶­³¦¤¬¡¢
!¡¡¡¡¤É¤Á¤é¤«¤Îü¤Ë´ó¤Ã¤Æ¤¤¤­¡¢ÉԶѹդˤʤë»ö¤â¤¢¤ë¡£
!¡¡¡¡³Æ¡¹¤ÎÎΰè¤Ï¡¢¹ß½ç¤ä¾º½ç¤Ë¤¹¤ëɬÍפÏ̵¤¯¡¢°Ê¾å¤È°Ê²¼¤Ë¡¢Ê¬¤±¤ì¤ÐÎɤ¤¡£

!£³¡Ëʬ³ä¤µ¤ì¤¿£²Îΰ衢¤½¤ì¤¾¤ì¤Ï¡¢¿·¤¿¤Ê¥Ç¡¼¥¿¡¼Îó¤È¤·¤Æ¡¢
!¡¡¡¡¾å¤Î£±¡Ë£²¡Ë¤ÎÁàºî¤òƱÍͤ˹Ԥʤ¦¡£¤½¤ì¤âËô¡¢£²¤Ä¤º¤Ä¤Ëʬ¤«¤ì¤Æ¤¤¤¯¡£
!¡¡¡¡¡¦¡¦¡¦¤³¤Î·«¤êÊÖ¤·¤ò¡¢Ê¬³äÎΰ裱¤Ä¤ÎŤµ¤¬¡¢£±°Ê²¼¤Ë¤Ê¤Ã¤Æ¡¢
!¡¡¡¡Ê¬³ä½ÐÍè¤Ê¤¯¤Ê¤ë¤Þ¤Ç¡¢¿Ê¤á¤ë¤È¡¢Á´ÂΤΥ½¡¼¥È¤¬½ªÎ»¤·¤Æ¤¤¤ë¡£


DIM VA$(100)

SUB div1time(i,j)
!----------¡¡¡¡°Ê¾å¤Îʬ³ä¤ò£±²ó¹Ô¤Ê¤¦¥Ö¥í¥°¥é¥à¡£i=L,j=R ¤Ç³«»Ï¡£
   LET v$=VA$((i+j)/2)
   DO
      DO WHILE VA$(i)< v$
         LET i=i+1
      LOOP
      DO WHILE v$< VA$(j)
         LET j=j-1
      LOOP
      IF j< i THEN EXIT DO !¡¡Åù¹æÉÕ j<=i ¤Ï¡¢ÉÔÎÉ¡£Ï¢Â³¤ÎºÆµ¢¤Ç˽Áö¤¹¤ë¡£
      SWAP VA$(i),VA$(j)
      LET i=i+1
      LET j=j-1
   LOOP UNTIL j< i !¡¡Åù¹æÉÕ j<=i ¤Ï¡¢ÉÔŬ¡£Ï¢Â³¤ÎºÆµ¢¤ÇÄ㮡£
   !----------
END SUB

!¾å¤Î·ë²Ì¤Îi,j¡¡(L ¡Ä j)(i ¡Ä R) ¤ò¡¢
!¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¢­¡¡¢­¡¡¢­¡¡¢­
!¡¡¡¡¡¡¼¡¤ÎL,R¡¡(L ¡Ä R)(L ¡Ä R)¡¡¤È¤·¤Æ¡¢¾åµ­¤Î½èÍý¤ò¹Ô¤¤¡¢
!¡¡¡¡¡¡Î¾¶è´Ö¤Î¥Ç¡¼¥¿¡¼¿ô¤¬¡¢³Æ¡¹£±°Ê²¼( <=1 )¤Ë¤Ê¤ë¤Þ¤Ç·«ÊÖ¤¹¡£


!===================
SUB QuickSort(L,R) !¡¡¾å¤ò¡¢Ï¢Â³¤Ë¹Ô¤Ê¤¦¥Ö¥í¥°¥é¥à¡£
   local i,j
   LET i=L
   LET j=R
   !----------
   !¡¡¾å¤Î¥×¥í¥°¥é¥à("---"¤ÎÆâ¦)¤ò¡¢¥³¥³¤ËÃÖ¤¤¤Æ¡¢
   !¡¡ºÆµ¢Åª¤Ë¡¢·«ÊÖ¤·»ÈÍÑ¡£
   !----------
   CALL div1time(i,j) !¤³¤ì¤Ç¤âÎɤ¤¡£¡ÄºÆµ¢Ê¸¤ÎʬΥ¤Ï¡¢local ÊÑ¿ô¤ËÍÑ¿´!
   !----------
   IF L< j THEN CALL QuickSort(L,j) !¥Ç¡¼¥¿¡¼¿ô£±¸Ä°Ê²¼( L>=j) ¤Ë¤Ê¤ë¤Þ¤Ç¡£
   IF i< R THEN CALL QuickSort(i,R) !¥Ç¡¼¥¿¡¼¿ô£±¸Ä°Ê²¼( i>=R) ¤Ë¤Ê¤ë¤Þ¤Ç¡£
END SUB


!==========================¡¡¾åµ­¤ÎÆ°ºî¤Î¡¢¿Þ²ò¥¢¥Ë¥á¡¼¥·¥ç¥ó¡¡============
!LET samp$="079427856083621"
LET samp$="0794278069836215794278560836215806083"
LET L=1
LET R=LEN(samp$)
FOR k=L TO R
   LET VA$(k)=samp$(k:k)
NEXT k
!
SET TEXT background "Opaque"
SET TEXT font "£Í£Ó ¥´¥·¥Ã¥¯",11
SET WINDOW -1,40, 30,0
SET LINE width 2
PLOT TEXT,AT 1,1.5:"** ¥¯¥¤¥Ã¥¯¡¦¥½¡¼¥È¤Î¼ê½ç **"
LET s=26
PLOT TEXT,AT 1,s :"²¼Àþ¤ÎÉÕ¤¤¤¿Ê¸»ú¤Ï¡¢L~ R Ãæ±û°ÌÃÖ¤ÇÁª¤Ð¤ì¤¿¡Ö´ð½àÃÍ¡×"
PLOT TEXT,AT 1,s+1 :"¤½¤Î¡Ö´ð½àÃ͡פǡ¢Ê¬³ä¤µ¤ì¤¿²¼¤ÎÃʤο§Ê¬¡¢"
SET COLOR MIX(0) 0,1,1
PLOT TEXT,AT 1,s+2 :"ÀĤϡִð½àÃ͡װʲ¼"
SET COLOR MIX(0) 1,1,0
PLOT TEXT,AT 13,s+2 :"²«¤Ï¡Ö´ð½àÃ͡װʾå"
SET COLOR MIX(0) 1,1,1
PLOT TEXT,AT 25,s+2 :"(̵¿§¡§Ê¬³äÉÔÍס¢³ÎÄê)"
PLOT TEXT,AT 1,s+3 :"ÉÁ²è¤Î½ç½ø¤Ï¡¢ºÆµ¢Ê¸¤È¤·¤Æ¤Î¡¢¼Â¹Ô½ç½ø¤½¤Î¤Þ¤Þ¡£"
LET s=3
!
CALL plotVA(L,R,s,L,R)
CALL GraphQS(L,R)
CALL plotVA(L,R,m+1,L,R)

SUB GraphQS(L,R) !¡¡Ê¬³ä·«ÊÖ¤·¤Î¹½Â¤¤ò¡¢¥°¥é¥Õ¥£¥Ã¥¯¤Ëɽ¼¨¡£
   local i,j
   LET i=L
   LET j=R
   LET s=s+1
   SET COLOR MIX(0) 1,1,1
   PLOT TEXT,AT L,s :"L"
   PLOT TEXT,AT R,s :"R"
   LET s=s+1
   !----------
   CALL div1time(i,j) !¢« ËÁƬ¤Î¡Êʬ³ä¤ò£±²ó¹Ô¤Ê¤¦¡¦¡¦¡Ëʸ¤ò¡¢¼ÂºÝ¤Ë»ÈÍÑ¡£
   CALL plotVA(L,R,s,i,j)
   IF m< s THEN LET m=s
   WAIT DELAY .1 !¡¡ÉÁ²è¤Î®¤µ¤ÎÄ´À°¡£
   !----------
   IF L< j THEN CALL GraphQS(L,j)
   IF i< R THEN CALL GraphQS(i,R)
   LET s=s-2
END SUB

SUB plotVA(L,R,y,i,j)
   FOR x=L TO R
      IF L=i AND R=j THEN
         SET COLOR MIX(0) .8,.8,.8
         !SET COLOR MIX(0) 1,1,1
      ELSEIF x<=j THEN
         SET COLOR MIX(0) 0,1,1
      ELSEIF i<=x THEN
         SET COLOR MIX(0) 1,1,0
      ELSE
         SET COLOR MIX(0) 1,1,1
      END IF
      PLOT TEXT,AT x,y :VA$(x)
      IF L<>j AND ROUND((L+j)/2)=x OR i<>R AND ROUND((i+R)/2)=x THEN
         PLOT LINES:x+.2,y;x+.6,y
      END IF
   NEXT x
END SUB

END

!¡¡ÉÕÏ¿¡§¡¡¢¨ËÁƬÀâÌÀ¡ÁÉÕÏ¿´Þ¤á¤Æ¡¢Á´Ê¸¤ò¥³¥Ô¡¼Å½¤êÉÕ¤±¡¢¼Â¹Ô¤¹¤ë¡£
!-------------------------------------
!¡¡Swap¤Îľ¸å¤Ë¡¢Ê¬³ä½ªÎ»¤¹¤ë¾ì¹ç¤Ç¡¢
!¡¡»þ¡¹¡¢¤É¤Á¤é¤Ë¤â°¤µ¤Ê¤¤¥Ç¡¼¥¿¡¼¤¬¡¢¤¹¤­´Ö¤ò¡¢³«¤±¤ë»þ¤¬¤¢¤ë¡£

!¡¡¢¨²¼¤Ï i=J ¤Ç¡¢swap ÉÔÍפνªÎ»¤Ç¤¹¤¬¡¢iJ ¤Ï¡¢¿Ê¤á¤Ê¤¤¤È¡¢¼¡¤Î£Ì¡Á£Ò¤¬¡¢
!¡¡¡¡£±¤ÄŤ¯¤Ê¤Ã¤Æ¡¢Â®ÅÙ¤¬Íî¤Á¤ë¡£if~then swap ¤è¤ê¡¢Ìµ¾ò·ï swap ¤¬Â®¤¤¡£
!¡¡¡¡¤³¤Î¥±¡¼¥¹¤Ï¡¢´ð½à¤Îv$ ¤Î°ÌÃÖ¤¬¡¢¼¡¤Îʬ³ä¤«¤é½ü¤«¤ì¤Æ¤ª¤ê¡¢Ëô¡¢v$ ¼«ÂΡ¢
!¡¡¡¡¤½¤Î°ÌÃÖ¤¬¡¢°ÜÆ°¤·¤Æ¤¤¤Ê¤¤¡¢Â¨¤Á¥½¡¼¥È¸å¤Î°ÌÃ֤Ȥ·¤Æ¡¢³ÎÄꤷ¤Æ¤¤¤ë¡£

!¡¡¡¡£Ì¡¡¡¡¡¡¡¡¡¡¡¡¡¡iJ¡¡¡¡¡¡¡¡¡¡¡¡¡¡£Ò
!¡¡¡¡¢¦¢¦¢¦¢¦¢¦¢¦¢¦¢¦¡ü¢¤¢¤¢¤¢¤¢¤¢¤¢¤¢¤
!¡¡¡¡¡¡¡¡¡¡¡¡ VA$()= v$ =VA$()
!¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡swap
!¡¡¡¡£Ì¡¡¡¡¡¡¡¡¡¡¡¡£Ê¡¡£é¡¡¡¡¡¡¡¡¡¡¡¡£Ò
!¡¡¡¡¢¦¢¦¢¦¢¦¢¦¢¦¢¦¢¦¡ü¢¤¢¤¢¤¢¤¢¤¢¤¢¤¢¤
!¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡v$
!¼¡¤Î£Ì¡Ý¡Ý¡Ý¡Ý¡Ý¡Ý£Ò¡¡£Ì¡Ý¡Ý¡Ý¡Ý¡Ý¡Ý£Ò
 

ÈùʬÊýÄø¼°¤Î¿ôÃͲòË¡

 Åê¹Æ¼Ô¡§¤·¤Þ¤à¤é1243  Åê¹ÆÆü¡§2009ǯ 4·î10Æü(¶â)21»þ05ʬ30ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¼¡¤ÎÈùʬÊýÄø¼°¤ò¡¢¿ôÃÍ·×»»¤Ç²ò¤¯¾ì¹ç¤ÎÊýË¡¤ò¶µ¤¨¤Æ¤¯¤À¤µ¤¤¡£

²óÏ©¤ÎÈùʬÊýÄø¼°
¡Ê°ì¼¡Â¦¤ÎÅÅ°µÊ¿¹Õ¼°¡ËL1*¦¤i1/¦¤t+R1*(1+sin(w*t))*i1-M*¦¤i2/¦¤t=E
¡ÊÆó¼¡Â¦¤ÎÅÅ°µÊ¿¹Õ¼°¡ËM*¦¤i1/¦¤t=L2*¦¤i2/¦¤t+R2*i2

ÊÑ°µ´ï¤Ç·ë¹ç¤µ¤ì¤¿Åŵ¤²óÏ©¤Î¼°¤Çµ­¹æ¤Î°ÕÌ£¤Ï¼¡¤Î¤È¤ª¤ê¤Ç¤¹¡£
¡¡t :»þ´Ö[s]
¡¡E :°ì¼¡Â¦Ä¾Î®ÄêÅÅ°µÅŸ»[V] Î㤨¤Ð10[V]
¡¡i1:°ì¼¡Â¦ÅÅή[A]
¡¡L1:ÊÑ°µ´ï°ì¼¡Â¦¼«¸Ê¥¤¥ó¥À¥¯¥¿¥ó¥¹[H] Î㤨¤Ð0.1[H]
  r :°ì¼¡Â¦Ä¾ÎóÊÑÆ°Äñ¹³¤Ç¡¢r=R1*(1+sin(¦Ø*t)
      R1:°ìÄêÄñ¹³[¦¸] Î㤨¤Ð1000[¦¸]
¡¡¡¡¡¡ ¦Ø :²ÄÊÑÄñ¹³r¤ÎÊÑÆ°³Ñ¼þÇÈ¿ô[rad/s]¡¡Î㤨¤Ð2*PI*50[rad/s]
¡¡i2:Æó¼¡Â¦ÅÅή[A]
¡¡L2:ÊÑ°µ´ïÆó¼¡Â¦¼«¸Ê¥¤¥ó¥À¥¯¥¿¥ó¥¹[H] Î㤨¤Ð0.1[H]
  R2:ÊÑ°µ´ïÆó¼¡Éé²ÙÄñ¹³[¦¸]  Î㤨¤Ð10[¦¸]
¡¡M:ÊÑ°µ´ï°ì¼¡Æó¼¡Áê¸ß¥¤¥ó¥À¥¯¥¿¥ó¥¹[H]=SQR(L1*L2)

¥ë¥ó¥²¡¦¥¯¥Ã¥¿Ë¡¤¬»È¤¨¤½¤¦¤â̵¤¯¡¢Ã±½ã¤Ê¥ª¥¤¥é¡¼Ë¡¡Ê½¤ÀµÌµ¡Ë¤Ç²ò¤³¤¦¤È¤·¤¿¤¬È¯»¶¤·¤Æ¤¦¤Þ¤¯¤¤¤­¤Þ¤»¤ó¡£¤è¤í¤·¤¯¤ª´ê¤¤¤·¤Þ¤¹¡£
 

Re: ÈùʬÊýÄø¼°¤Î¿ôÃͲòË¡

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 4·î13Æü(·î)08»þ56ʬ12ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.314[¸µµ­»ö¤Ø]

!¤³¤ó¤Ë¤Á¤Ï¡¢¤ª¤Ò¤µ¤·¤Ö¤ê¤Ç¤¹¡£¤´»²¹ÍÄøÅ٤ˡ¢¼«¿®¤¬¤Ê¤¯¤Æ¡¦¡¦

!°Ê²¼¤Ï¡¢¥ë¥ó¥²¥¯¥Ã¥¿Ë¡¤Ç¡¢»þ·ÏÎó¤Î¿ôÃͲò¤È¡¢¤½¤ÎÆ°¤­¤òÉÁ¤¤¤Æ¤ß¤Þ¤·¤¿¤¬¡¢
!¥¯¥ê¥Á¥«¥ë¤ÊÅÀ¤Ê¤É¡¢¤¤¤¯¤Ä¤«ÉÔÌÀ¤ÊÌ̤⤢¤ê¤Þ¤¹¡£


!²óÏ©¤ÎÈùʬÊýÄø¼°
!¡Ê°ì¼¡Â¦¤ÎÅÅ°µÊ¿¹Õ¼°¡ËL1*¦¤i1/¦¤t+R1*(1+sin(w*t))*i1-M*¦¤i2/¦¤t=E
!¡ÊÆó¼¡Â¦¤ÎÅÅ°µÊ¿¹Õ¼°¡ËM*¦¤i1/¦¤t=L2*¦¤i2/¦¤t+R2*i2
!---------------------------
!·×»»ÍѤÎÈùʬÊýÄø¼°
! f1(t, i1)= (di1/dt)= ( E-R1*(1+sin(w*t))*i1+M*(di2/dt) )/L1
! f2(t, i2)= (di2/dt)= ( M*(di1/dt)-R2*i2 )/L2
!
!¢¨¾å¤Î¤Þ¤Þ¤Ç¤Ï¡¢Àµµ¢´Ô ˽Áö¤¹¤ë¤Î¤Ç¡¢f1(),f2() ¤Ë¡¢¥Ð¥Ã¥Õ¥¡ f1_,f2_ ¤òÉÕ¤±¤¿¡£
DEF f1(t, i1)=( E-R1*(1+SIN(w9*t))*i1+M*f2_ )/L1 ! f2_=f2(t, i2)
DEF f2(t, i2)=( M*f1_-R2*i2 )/L2                 ! f1_=f1(t, i1)

LET E=10
LET R1=1000
LET i1=E/R1/2
LET i2=0
LET L1=50 !0.1 ¾®¤µ¤¤¤È¡¢¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¡©
LET L2=2 !0.1 ¾®¤µ¤¤¤È¡¢¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¡©
LET R2=10
LET M=SQR(L1*L2)
LET w9=2*PI*1 !50 ¾®¤µ¤¤¤È¡¢ÉÁ²è¥Ô¥Ã¥Á±é»»¥Ô¥Ã¥Á¶¦¤Ë̵Íý
!
LET dt=0.05 !sec. ±é»»¥Ô¥Ã¥Á¡£ÉÁ²è¥Ô¥Ã¥Á¤¬ÃÙ¤ì¤Ê¤¤ÄøÅ٤ˡ£

SUB RungeKutta4_1(t, i1)
   LET k1=f1(t, i1)
   LET k2=f1(t+dt/2, i1+k1*dt/2)
   LET k3=f1(t+dt/2, i1+k2*dt/2)
   LET k4=f1(t+dt,   i1+k3*dt )
   LET i1=i1+(k1+2*k2+2*k3+k4)*dt/6
   LET f1_=f1(t, i1)
END SUB

SUB RungeKutta4_2(t, i2)
   LET k1=f2(t, i2)
   LET k2=f2(t+dt/2, i2+k1*dt/2)
   LET k3=f2(t+dt/2, i2+k2*dt/2)
   LET k4=f2(t+dt,   i2+k3*dt )
   LET i2=i2+(k1+2*k2+2*k3+k4)*dt/6
   LET f2_=f2(t, i2)
END SUB

!----run
LET t=0
LET w=.5 !13
SET WINDOW -w,w,-w,w
SET LINE width 3
SET COLOR MIX(15) .5,.5,.5
SET TEXT background "OPAQUE"
LET t0=TIME
DO
   LET t1=TIME
   IF dt=< ABS(t1-t0) THEN
      SET DRAW mode hidden
      CLEAR
      DRAW grid(5,5)
      PLOT TEXT,AT w*0.25,w*0.9:"¥Þ¥¦¥¹ ±¦¥Ü¥¿¥ó¤Ç¡¢½ªÎ»¡£"
      PLOT TEXT,AT w*0.4,w*0.76,USING"±é»»¥Ô¥Ã¥Á=#.### ÉÃ":dt
      PLOT TEXT,AT w*0.4,w*0.69,USING"ÉÁ²è¥Ô¥Ã¥Á=#.### ÉÃ":t1-t0
      LET t0=t1
      PRINT t;i1;i2;f1_;f2_
      !---
      PLOT TEXT,AT-w/2.5,i1:"i1"
      PLOT TEXT,AT w/2.9,i2:"i2"
      PLOT LINES :-w/3,i1;0,i1
      PLOT LINES : w/3,i2;0,i2
      !---
      SET DRAW mode explicit
      CALL RungeKutta4_1(t,i1) !¡¡¼¡¤Îi1 ¤Ø¹¹¿·
      CALL RungeKutta4_2(t,i2) !¡¡¼¡¤Îi2 ¤Ø¹¹¿·
      LET t=t+dt
   END IF
   WAIT DELAY 0 !¡¡¾ÊÅÅÎϸú²Ì
   MOUSE POLL mx,my,mlb,mrb
LOOP UNTIL mrb=1

END
 

Re: ÈùʬÊýÄø¼°¤Î¿ôÃͲòË¡

 Åê¹Æ¼Ô¡§¤·¤Þ¤à¤é1243  Åê¹ÆÆü¡§2009ǯ 4·î13Æü(·î)19»þ13ʬ9ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.315[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

SECOND¤µ¤ó¡¢¤³¤ó¤Ë¤Á¤ï¡£¤´Ìµº»ÂÁ¤·¤Æ¤ª¤ê¤Þ¤¹¡£ÊѤÊÂêºà¤Ë¤â´Ø¤ï¤é¤º¡¢ÁᮤΤ´¶µ¼¨¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£

̤¤À¿ôÃÍ·×»»¤ÎÆâÍƤòÆɤ߽ª¤¨¤Æ¤¤¤Ê¤¤¤Î¤Ç¤¹¤¬¡¢Áᮡ¢ºîÀ®¤·¤Æ¤¤¤¿¤À¤¤¤¿¥×¥í¥°¥é¥à¤òÁö¤é¤»¤Æ¸«¤Þ¤·¤¿¡£
ÅÅή¤¬¿¶Æ°¤·¤Æ¤¤¤ëÍͻҤϡ¢²£¼´¤Ë»þ´Ö¡¢½Ä¼´¤ËÂ礭¤µ¤òºÎ¤Ã¤Æɽ¤¹¤Î¤¬°ìÈÌŪ¤Ç¤¹¤¬¡¢SECOND¤µ¤ó¤ÎȯÁۤϻ¿·Åª¤À¤È»×¤¤¤Þ¤·¤¿¡£

¤µ¤Æ¼ÁÌä¤Î°Õ¿Þ¤òµ­ºÜ¤·¤Ê¤¯¤Æ¿½¤·Ìõ¤¢¤ê¤Þ¤»¤ó¤Ç¤·¤¿¤¬¡¢¥È¥é¥ó¥¸¥¹¥¿¤Î¶µ²Ê½ñ¤Ç¤Ï¡¢¡ÖÊÑ°µ´ï·ë¹ç¤Î¥¨¥ß¥Ã¥¿ÀÜÃÏAµéÁýÉý²óÏ©¤Î¥³¥ì¥¯¥¿¡Á¥¨¥ß¥Ã¥¿´ÖÅÅ°µ¤Ï¡¢ÅÅ°µE¡Ê°ìÈ̤ˤÏVcc¤È½ñ¤¯¡Ë¤òÃæ¿´¤È¤·¤Æ¡ÞE¤ÎÈϰϤǿ¶Æ°¤¹¤ë¡×¤È½ñ¤«¤ì¤Æ¤¤¤Þ¤¹¡£
¤Ä¤Þ¤ê¡¢ÊÑ°µ´ï¤Î°ì¼¡Â¦ÅÅ°µ¤Î¥Ô¡¼¥¯ÃͤÏ2E¤Ë¤Ê¤ë¤³¤È¤ò°ÕÌ£¤·¤Æ¤¤¤ë¤Î¤Ç¤¹¤¬¡¢²¿¸ÎE°Ê¾å¤Ë¤Ê¤ê¤¦¤ë¤Î¤«¡©¤ò¿ôÃÍ·×»»¤Ç³Îǧ¤·¤¿¤«¤Ã¤¿¤â¤Î¤Ç¤¹¡£

Ä󼨤·¤¿ÈùʬÊýÄø¼°¤ÎÄñ¹³r¤Ï¡¢¥È¥é¥ó¥¸¥¹¥¿¤Î¥Ù¡¼¥¹ÅÅή¤òÀµ¸¹ÇȤ˿¶Æ°¤µ¤»¤¿¤È¤­¤ÎÅÅήÁýÉýµ¡Ç½¤ò¡¢ÊÑÆ°¤¹¤ëÄñ¹³r¤ÇÃÖ¤­´¹¤¨¤ÆÌϵ¼¤·¤¿¤Ä¤â¤ê¤Ç¤¹¡£
¡Ê¶µ²Ê½ñ¤Ç¤ÏÅÅήÁýÉýµ¡Ç½¤ÇÀâÌÀ¤·¤Æ¤¤¤ë¤¬¡¢¥È¥é¥ó¥¸¥¹¥¿¤¬ÅÅή¤òÁýÉý¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢¥Ù¡¼¥¹ÅÅή¤¬ÊѲ½¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¥È¥é¥ó¥¸¥¹¥¿¤ÎC¡ÁE´ÖÄñ¹³¤¬ÊѲ½¤·¡¢¤½¤Î·ë²Ì¡¢³°ÉôÅŸ»E¤«¤éή¤ì¤ëÅÅήi1¤¬Â礭¤¯ÊÑÆ°¤·¤ÆÅÅή¤¬ÁýÉý¤µ¤ì¤¿Íͤ˸«¤¨¤ë¡¢¤È»×¤Ã¤Æ¤¤¤ë¤Î¤Ç¡£¡Ë

¤½¤·¤ÆºÇ½ªÅª¤ËÃΤꤿ¤¤¤³¤È¤Ï¡¢¥È¥é¥ó¥¹¤Î°ì¼¡Â¦ÅÅ°µ ¡ÖVt=E-r*i1 ¡×¤Ï¡¢Ä¾Î®ÅŸ»ÅÅ°µ¤¬E¤·¤«Ìµ¤¤¤Ë¤â´Ø¤ï¤é¤º¡¢E¤òÃæ¿´¤È¤·¤Æ£°¡Á2E¤ÎÈϰϤÇÀµ¸¹ÇȾõ¤Ë¿¶Æ°¤¹¤ë¡¢¤Ä¤Þ¤ê³Î¤«¤Ë¡Ö 2E>=Vt>=0 ¡×¤ÇÀµ¸¹ÇȾó¤Ë¿¶Æ°¤¹¤ë»ö¤ò¸«¤¿¤¤¤Î¤Ç¤¹¡£

¤³¤ÎÍͤʰտޤǤ¢¤ë¤¿¤á¡¢ÇÈ·Á¿Þ¤Ï²£¼´¤Ë»þ´Öt[s]¡¢½Ä¼´¤Ëi1[A]¡ÊºÇ½ªÅª¤Ë¤ÏVt[V]¡Ë¤È¤·¤Æĺ¤¯¤ÈÍ­Æñ¤¤¤Ç¤¹¡£¾¡¤Ã¤Æ¸À¤Ã¤Æ¿½¤·Ìõ¤¢¤ê¤Þ¤»¤ó¡£
 

Re: ÈùʬÊýÄø¼°¤Î¿ôÃͲòË¡

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 4·î13Æü(·î)20»þ30ʬ23ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.316[¸µµ­»ö¤Ø]

¤·¤Þ¤à¤é1243¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

ÂçÊÑ¡¢¿½¤·ÌõÍ­¤ê¤Þ¤»¤ó¤¬¡¢¤´´üÂԤˤÏÅú¤¨¤é¤ì¤Þ¤»¤ó¡£¤½¤ì¤è¤ê¤³¤Î¥Æ¡¼¥Þ¤Ë¤Æ
¥ë¥ó¥²¥¯¥Ã¥¿¤Ç¤ÎÉÁ²è¤È¤½¤ÎÆ°¤­¤Ë¡¢¤¤¤¯¤Ä¤«ÉÔÌÀ¤ÊÉôʬ¤¬¸«¤Ä¤«¤ê¤Þ¤·¤Æ¡¢¤½¤ì¤Ë
µ¤¤ò¤È¤é¤ì¤Æ¤ª¤ê¤Þ¤¹¡£¤Ç¤­¤ì¤Ð¡¢¤½¤ÎÄÉÀפˤªÎÏź¤¨¤ò¡¢Äº¤­¤¿¤«¤Ã¤¿¤Î¤Ç¤¹¤¬¡£
¥È¥é¥ó¥¹·ë¹ç£ÁµéÁýÉý´ï¤Ë¥¹¥Ô¡¼¥«¤¬¤Ä¤Ê¤¬¤Ã¤¿¾õÂ֤ˤ·¤Æ¤Ï¡¢°ÂÄêÀ­¤ò·ç¤­¡¢
Àµµ¢´Ô˽Áö¤·¤¿¤ê¡¢¥¯¥ê¥Á¥«¥ë¤Ë²á¤®¤ë¤Î¤Ç¤Ï¡¢¤Ê¤¤¤À¤í¤¦¤«¡©
 

Re: ÈùʬÊýÄø¼°¤Î¿ôÃͲòË¡

 Åê¹Æ¼Ô¡§¤·¤Þ¤à¤é1243  Åê¹ÆÆü¡§2009ǯ 4·î14Æü(²Ð)04»þ18ʬ58ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.317[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¤·¤Þ¤à¤é1243¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£
>
> ÂçÊÑ¡¢¿½¤·ÌõÍ­¤ê¤Þ¤»¤ó¤¬¡¢¤´´üÂԤˤÏÅú¤¨¤é¤ì¤Þ¤»¤ó¡£¤½¤ì¤è¤ê¤³¤Î¥Æ¡¼¥Þ¤Ë¤Æ
> ¥ë¥ó¥²¥¯¥Ã¥¿¤Ç¤ÎÉÁ²è¤È¤½¤ÎÆ°¤­¤Ë¡¢¤¤¤¯¤Ä¤«ÉÔÌÀ¤ÊÉôʬ¤¬¸«¤Ä¤«¤ê¤Þ¤·¤Æ¡¢¤½¤ì¤Ë
> µ¤¤ò¤È¤é¤ì¤Æ¤ª¤ê¤Þ¤¹¡£¤Ç¤­¤ì¤Ð¡¢¤½¤ÎÄÉÀפˤªÎÏź¤¨¤ò¡¢Äº¤­¤¿¤«¤Ã¤¿¤Î¤Ç¤¹¤¬¡£
> ¥È¥é¥ó¥¹·ë¹ç£ÁµéÁýÉý´ï¤Ë¥¹¥Ô¡¼¥«¤¬¤Ä¤Ê¤¬¤Ã¤¿¾õÂ֤ˤ·¤Æ¤Ï¡¢°ÂÄêÀ­¤ò·ç¤­¡¢
> Àµµ¢´Ô˽Áö¤·¤¿¤ê¡¢¥¯¥ê¥Á¥«¥ë¤Ë²á¤®¤ë¤Î¤Ç¤Ï¡¢¤Ê¤¤¤À¤í¤¦¤«¡©

ÇÈ·Á¤òÉÁ¤¯¤è¤¦¤Ë¼ê¤òÆþ¤ì¤µ¤»¤Æ夭¤Þ¤·¤¿¡£¤¹¤ë¤È
£±¡ËÊÑ°µ´ï°ì¼¡ÅÅ°µÇÈ·Á¤ÏÀµ¸¹ÇÈVt=£Åsin(wt)[V]¤¬½Ð¤Þ¤·¤¿¡£ ´¶·ã!!¤Ç¤¹¡£
¤Ç¤â»ä¤ÏVt=E+Esin(wt)¤òÁÛÄꤷ¤Æ¤¤¤¿¤Î¤ÇÀµ¤·¤¤·ë²Ì¤Ê¤Î¤«¤¬È½ÃǤǤ­¤º¡£

£²¡ËÅÅήÇÈ·Á¤ÏÀµ¸¹ÇÈ¿¶Æ°¤·¤Þ¤»¤ó¡££±¡Ë¤ÈÊ»¤»¤Æ²¿½è¤«¤Ë¥í¥¸¥Ã¥¯¾å¤ÎÌäÂ꤬¤¢¤ë¤è¤¦¤Ç¤¹¤¬¡¢Ì¤¤Àʬ¤«¤ê¤Þ¤»¤ó¡£

!------- °Ê²¼Êѹ¹¤·¤¿¥×¥í¥°¥é¥à------
!¢¨¾å¤Î¤Þ¤Þ¤Ç¤Ï¡¢Àµµ¢´Ô ˽Áö¤¹¤ë¤Î¤Ç¡¢f1(),f2() ¤Ë¡¢¥Ð¥Ã¥Õ¥¡ f1_,f2_ ¤òÉÕ¤±¤¿¡£
DEF f1(t, i1)=( E-R1*(1+SIN(w9*t))*i1+M*f2_ )/L1 ! f2_=f2(t, i2)
DEF f2(t, i2)=( M*f1_-R2*i2 )/L2                 ! f1_=f1(t, i1)

LET E=10
LET R1=1000
LET L1=0.5 !0.2°Ê²¼¤Ë¤¹¤ë¤È¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¡©
LET L2=0.1
LET R2=10
LET M=SQR(L1*L2)
LET frq=50 !¿®¹æ¼þÇÈ¿ô[Hz]
LET dt=0.001 !Èùʬ»þ´Ö[s]

LET drawTime=0.1 ![s] !ÉÁ²è»þ´Ö¤Ç¡¢frq¡ßdrawTime¥µ¥¤¥¯¥ëʬ¤À¤±ÉÁ²è¤¹¤ë¡£
LET iBairitu=500 !ÅÅήÇÈ·ÁÉÁ²è³ÈÂçÇÜΨ

LET i1_=0 ! i1¤Î½é´üÃÍ
LET i2_=0 ! i2¤Î½é´üÃÍ
LET Vt_=E !ÊÑ°µ´ï°ì¼¡ÅÅ°µVt¤Î½é´üÃÍ
LET t_=0  ! t¤Î½é´üÃÍ

SUB RungeKutta4_1(t_, i1_,i1)
   LET k1=f1(t_, i1_)
   LET k2=f1(t_+dt/2, i1_+k1*dt/2)
   LET k3=f1(t_+dt/2, i1_+k2*dt/2)
   LET k4=f1(t_+dt,   i1_+k3*dt )
   LET i1=i1_+(k1+2*k2+2*k3+k4)*dt/6
   LET f1_=f1(t_, i1)
END SUB

SUB RungeKutta4_2(t_, i2_,i2)
   LET k1=f2(t_, i2_)
   LET k2=f2(t_+dt/2, i2_+k1*dt/2)
   LET k3=f2(t_+dt/2, i2_+k2*dt/2)
   LET k4=f2(t_+dt,   i2_+k3*dt )
   LET i2=i2_+(k1+2*k2+2*k3+k4)*dt/6
   LET f2_=f2(t_, i2)
END SUB

!----run
LET w=2*PI*frq !¸òή¿®¹æ¤Î³Ñ¼þÇÈ¿ô[rad/s]
LET nmax=drawTime/dt !·×»»ÅÀ¿ô

SET WINDOW -0,drawTime,-15,15
DRAW grid

FOR n=1 TO nmax
   LET t=n*dt
   CALL RungeKutta4_1(t_,i1_,i1)
   CALL RungeKutta4_2(t_,i2_,i2)
   LET Vt=E-R1*(1+SIN(w*t))*i1

   SET LINE COLOR "red" !ÅÅήi1ÇÈ·ÁÉÁ²è¿§
   PLOT LINES:t_,i1_*iBairitu;t,i1*iBairitu

   SET LINE COLOR "black" !ÅÅ°µÇÈ·ÁÉÁ²è¿§
   PLOT LINES:t_,Vt_;t,Vt

   PLOT LINES: t_,0;t,0 !»þ´Ö¼´ÉÁ²è

   LET t_=t   !¡¡¼¡¤Ît ¤Ø¹¹¿·
   LET i1_=i1 !¡¡¼¡¤Îi1 ¤Ø¹¹¿·
   LET i2_=i2 !¡¡¼¡¤Îi2 ¤Ø¹¹¿·
   LET Vt_=Vt !¡¡¼¡¤Îi2 ¤Ø¹¹¿·
Next N

END
 

Re: ÈùʬÊýÄø¼°¤Î¿ôÃͲòË¡

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 4·î14Æü(²Ð)08»þ28ʬ2ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.318[¸µµ­»ö¤Ø]

¤·¤Þ¤à¤é1243¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¡ü¤³¤Î¥×¥í¥°¥é¥à¤Ë¤Ä¤¤¤Æ

¡¡DEF f1(t, i1)=( E-R1*(1+SIN(w9*t))*i1+M*f2_ )/L1 ! f2_=f2(t, i2)
¤È
¡¡LET Vt=E-R1*(1+SIN(w*t))*i1

¤Ç¡¢¦Ø¤ÎÊÑ¿ô̾¤¬°ã¤¦¡£

²þ½¤°Æ
¡¡DEFʸ¤Îw9¤òw¤È¤·¤Æ¡¢
¡¡¹ï¤ßÉý¤ò¡¢LET dt=0.000001 !Èùʬ»þ´Ö[s]¡¡¤È¤¹¤ë¡£



¡ü¥ª¥¤¥é¡¼Ë¡¡¢¥ë¥ó¥²¡¦¥¯¥Ã¥¿Ë¡¤ÎŬÍѤǤ­¤ë¼°¤Î·Á¼°
¡¡£²ÊÑ¿ô¤ÎϢΩ£±¼¡¾ïÈùʬÊýÄø¼°
¡¡¡¡¦¤i1/¦¤t=f1(t,i1,i2)
¡¡¡¡¦¤i2/¦¤t=f2(t,i1,i2)
¡¡¤¬°ìÈ̤Ǥ¹¤¬¡¢±¦ÊÕ¤ËÈùʬ¤¬´Þ¤Þ¤ì¤Æ¤¤¤Æ¤â²Äǽ¤Ê¤Î¤«¡©

²þ½¤°Æ
¡¡SECOND¤µ¤ó¤Î¹©ÉפǣϣË!?



»ä¤âÀµ¤·¤¤·ë²Ì¤«¤É¤¦¤«È½ÃǤǤ­¤Þ¤»¤ó¤¬¡¢ÇÈ·Á¤òɽ¼¨¤¹¤ë¥×¥í¥°¥é¥à¤ò·ÇºÜ¤·¤Þ¤¹¡£

¡ü¤½¤Î£±
!²óÏ©¿Þ
!¡¡¡¡¡¡¢ªi1¡¡¡¡¡¡ N:1¡¡ ¢ªi2
!¡¡¡¡¨££ò¨¡¨¡¨¡¡¦¨¤ ¨£¨¡¨¡¨¡¨¡¨¨
!¡¡¡¡E¡¡¡¡¡¡ Vt¢¬L1 L2¢¬V2¡¡¡¡R2
!¡¡¡¡¨¦¨¡¨¡¨¡¨¡¨¡¨¥ ¨¦¡¦¨¡¨¡¨¡¨ª

!Äñ¹³r¤«¤éÊÑ°µ´ï¤Þ¤Ç¤ÎF¥Ñ¥é¥á¡¼¥¿¡ÊÆóü»ÒÂвóÏ©¤È¤·¤Æ¤ß¤ë¤È¡Ë
!¡¡¨£ 1¡¡r ¨¤¨£ N¡¡0 ¡¡¨¤=¨£ N¡¡r/N ¨¤
!¡¡¨¦ 0¡¡1 ¨¥¨¦ 0¡¡1/N ¨¥ ¨¦ 0¡¡1/N ¨¥

!¤¿¤À¤·¡¢´¬¤­¿ôÈæN=SQR(L1/L2)¤È¤¹¤ë¡£

!Æóü»ÒÂФÎξü¤ÎÅÅ°µ¡¢ÅÅή¤Ï
!¡¡¨£ E¡¡¨¤=¨£ N¡¡r/N ¨¤¨£ V2 ¨¤
!¡¡¨¦ i1 ¨¥ ¨¦ 0¡¡1/N ¨¥¨¦ i2 ¨¥
!¤È¤Ê¤ê¡¢À°Íý¤¹¤ë¤È
!¡¡¨£ E¡¡¨¤=¨£ N*V2+r/N*i2 ¨¤ ¡Ä ­¡
!¡¡¨¦ i1 ¨¥ ¨¦ 1/N*i2¡¡¡¡¡¡¨¥ ¡Ä ­¢

!Æó¼¡Â¦ÅÅ°µV2=R2*i2¤è¤ê¡¢i2=V2/R2 ¡Ä ­£

!­£¤ò­¡¤ËÂåÆþ¤·¤Æ¡¢V2=(N*R2)/(r+N^2*R2)*E ¡Ä ­¤

!¤³¤ì¤ò­£¤ËÂåÆþ¤·¤Æ¡¢i2=N/(r+N^2*R2)*E ¡Ä ­¥

!­¢¤ËÂåÆþ¤·¤Æ¡¢i1=E/(r+N^2*R2) ¡Ä ­¦

!¤Þ¤¿¡¢ÊÑ°µ´ï¤Î°ì¼¡Â¦ÅÅ°µVt=E-r*i1 ¡Ä ­§ ¤Ç¤¢¤ë¡£


LET E=10
LET L1=0.5
LET R1=1000
DEF r=R1*(1+SIN(w*t))
LET w=2*PI*50
LET R2=10
LET L2=0.1

LET N=SQR(L1/L2)
SUB routine
   LET V2=N*R2*E/(r+N^2*R2)
   LET i2=N*E/(r+N^2*R2)
   LET i1=E/(r+N^2*R2)
   LET Vt=E-r*i1
END SUB


LET yy=12 !½Ä¼´¤ÎÈÏ°Ï

LET TT=50e-3 !»þ´Ö¶è´Ö [0,T]


!!!SET bitmap SIZE 600,600 !²èÌ̤òÂ礭¤¯¤¹¤ë
SET WINDOW -TT/8,TT,-yy,yy !ɽ¼¨Îΰè
DRAW grid(TT/5,yy/6)

PLOT TEXT ,AT TT*7/8,0: "[ÉÃ]"


SET LINE COLOR 1
PLOT LINES: t,Vt; t,Vt
SET LINE COLOR 4
PLOT LINES: t,i1; t,i1

FOR t=0 TO TT STEP TT/10000
   CALL routine
   !!!PRINT t;i1,V2;i2

   SET LINE COLOR 1
   PLOT LINES: t,Vt; t,Vt
   SET LINE COLOR 4
   PLOT LINES: t,i1; t,i1 !¢¨
NEXT t
PLOT LINES


END


¡ü¤½¤Î£²
!²óÏ©¿Þ
!¡¡¡¡¡¡¡¡¡¡¡¡¢ªi1¡¡¡¡ ¢ªi2
!¡¡¡¡¨££ò¨¡¨¡¨¡¡¦¨¤ ¨£¨¡¨¡¨¡¨¡¨¨
!¡¡¡¡E¡¡¡¡¡¡ V1¢¬L1 L2¢¬V2¡¡¡¡R2
!¡¡¡¡¨¦¨¡¨¡¨¡¨¡¨¡¨¥ ¨¦¡¦¨¡¨¡¨¡¨ª

!¡¡E-r*i1=V1=L1*¦¤i1/¦¤t-M*¦¤i2/¦¤t
!¡¡¡¡¡¡¡¡¡¡¡¡M*¦¤i1/¦¤t-L2*¦¤i2/¦¤t=V2=R2*i2

!£²ÊÑ¿ôi1,i2¤ÎϢΩ£±¼¡¾ïÈùʬÊýÄø¼°¤Çɽ¤µ¤ì¤ë¡£

!¹ÔÎó¤Çɽ¸½¤¹¤ë¤È
!¡¡¨£ E-r*i1 ¨¤=¨£ L1¡¡-M¡¡¨¤¨£ ¦¤i1/¦¤t ¨¤
!¡¡¨¦ R2*i2¡¡¨¥ ¨¦ M ¡¡-L2 ¨¥¨¦ ¦¤i2/¦¤t ¨¥

!¡¡¨£ ¦¤i1/¦¤t ¨¤=1/(-L1*L2+M*M)¨£ -L2¡¡M ¨¤¨£ E-r*i1 ¨¤
!¡¡¨¦ ¦¤i2/¦¤t ¨¥¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ¨¦ -M¡¡L1 ¨¥¨¦ R2*i2¡¡¨¥

!¤È¤³¤í¤Ç¡¢M=SQR(L1*L2)¤è¤ê¡¢¾åµ­¤ÎÊÑ·Á¤Ï¤Ç¤­¤Ê¤¤¡£

!¤·¤¿¤¬¤Ã¤Æ¡¢M=k*SQR(L1*L2)¤È¤·¤Æ¹Í¤¨¤ë¡£


!ÀºÅÙ¤¬°­¤¤¤¿¤á¡¢·×»»¤Î¸åȾ¤Ç¤Ï¸íº¹¤¬ÎßÀѤµ¤ì¤ä¤¹¤¯¤Ê¤ë¡£



!£²ÊÑ¿ô¤ÎϢΩ£±¼¡¾ïÈùʬÊýÄø¼°¤Î²ò

!----- ¢­¢­¢­¢­¢­ -----

LET yy=12 !½Ä¼´¤ÎÈÏ°Ï

LET TT=50e-3 !»þ´Ö¶è´Ö [0,T]

DEF r(t)=R1*(1+SIN(w*t))
!DEF f1(t,i1,i2)=1/(L1*L2-M*M)*(L2*(E-r(t)*i1) - M*R2*i2)
!DEF f2(t,i1,i2)=1/(L1*L2-M*M)*(-M*(E-r(t)*i1) +L1*R2*i2)
DEF f1(t,i1,i2)=1/(-L1*L2+M*M)*(-L2*(E-r(t)*i1) + M*R2*i2)
DEF f2(t,i1,i2)=1/(-L1*L2+M*M)*( -M*(E-r(t)*i1) +L1*R2*i2)


LET E=10 ![V]
LET L1=0.5 ![H]
LET R1=1000 ![¦¸]
LET w=2*PI*50 ![rad/s]
LET L2=0.1 ![H]
LET R2=10 ![¦¸]

LET K=0.999 !ÍýÁÛÊÑ°µ´ï K=1¡¡¢¨
LET M=K*SQR(L1*L2) ![H]

!----- ¢¬¢¬¢¬¢¬¢¬ -----


!!!SET bitmap SIZE 600,600 !²èÌ̤òÂ礭¤¯¤¹¤ë
SET WINDOW -TT/8,TT,-yy,yy !ɽ¼¨Îΰè
DRAW grid(TT/5,yy/6)

PLOT TEXT ,AT TT*7/8,0: "[ÉÃ]"


!¡ü¥ª¥¤¥é¡¼Ë¡
LET t=0 !½é´üÃÍ i1(0)=0¡¢i2(0)=0
LET i1=0
LET i2=0
SET LINE COLOR 1
PLOT LINES: t,E-r(t)*i1; t,E-r(t)*i1
SET LINE COLOR 4
PLOT LINES: t,i1; t,i1

LET h=TT/500000 !¹ï¤ßÉý¡¡¢¨
FOR i=1 TO 500000
   LET k1=h*f1(t,i1,i2)
   LET k2=h*f2(t,i1,i2)
   LET i1=i1+k1
   LET i2=i2+k2
   LET t=t+h

   !!!PRINT t,i1,i2

   SET LINE COLOR 1
   PLOT LINES: t,E-r(t)*i1; t,E-r(t)*i1

   SET LINE COLOR 4
   PLOT LINES: t,i1; t,i1
NEXT i
PLOT LINES


END
 

Re: ÈùʬÊýÄø¼°¤Î¿ôÃͲòË¡

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 4·î14Æü(²Ð)14»þ12ʬ40ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.318[¸µµ­»ö¤Ø]

¤·¤Þ¤à¤é1243¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> £²¡ËÅÅήÇÈ·Á¤ÏÀµ¸¹ÇÈ¿¶Æ°¤·¤Þ¤»¤ó¡£

i=E/R¤À¤«¤é¡¢Ê¬Êì¤ÎR¤ò0¡Á2*R¡ÊÀµ¸¹ÇȡˤȤ·¤Æ¤â¡¢i¤ÏÀµ¸¹ÇȤˤʤê¤Þ¤»¤ó¡£



SET WINDOW -1,5,-1,15
DRAW grid

LET E=1
LET R1=5
FOR t=0 TO 5 STEP 0.001
   LET r=R1*(1+SIN(5*t))
   LET i=E/r
   PLOT LINES: t,r; t,r !Àµ¸¹ÇÈ
   !PLOT LINES: t,i; t,i !Àµ¸¹ÇÈ¡©
NEXT t

END
 

Re: ÈùʬÊýÄø¼°¤Î¿ôÃͲòË¡

 Åê¹Æ¼Ô¡§¤·¤Þ¤à¤é1243  Åê¹ÆÆü¡§2009ǯ 4·î14Æü(²Ð)15»þ24ʬ22ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.320[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

»³Ã椵¤ó¡¢¤´¶µ¼¨¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
³Î¤«¤Ë£ò¤¬Àµ¸¹ÇȾõ¤ËÊѲ½¤·¤Æ¤â¡¢¤½¤ÎµÕ¿ô¤ÏÀµ¸¹ÇȾõ¤Ë¤Ï¤Ê¤é¤Ê¤¤¤Ç¤¹¤Í¡£º¬ËÜŪ¤Ê¸í¤ê¤ò¤·¤Æ¤¤¤Þ¤·¤¿¡£
¤È¸À¤¦¤³¤È¤Ï¡¢¥È¥é¥ó¥¸¥¹¥¿¤ÎÅÅήÁýÉýµ¡Ç½¡Ê¥Ù¡¼¥¹¤ËÀµ¸¹ÇÈ¿®¹æ¤òÆþÎϤ¹¤ë¤È¡¢¤Û¤ÜÀµ¸¹ÇȾõ¤ÎÅÅή½ÐÎϤ¬ÆÀ¤é¤ì¤ë¡Ë¤òÌϵ¼¤¹¤ë²ÄÊÑÄñ¹³¤Ï¡¢Àµ¸¹ÇȤεտô¤ÇÀßÄꤷ¤¿¤Û¤¦¤¬Îɤ¤¤È¤¤¤¦¤³¤È¤Ë¤Ê¤ê¤½¤¦¤Ç¤¹¤Í¡£
SECOND¤µ¤ó¡¢»³Ã椵¤ó¤«¤é¤´¶µ¼¨¤¤¤¿¤À¤¤¤¿¥³¡¼¥É¤ò¡¢¤½¤Î´ÑÅÀ¤Ç¸«¤Æ¤ß¤Þ¤¹¡£

¼è¤ê´º¤¨¤ºSECOND¤µ¤ó¤Î¸¶ÈǤκî²èÉôʬ¤òºÆ½¤Àµ¤·¤¿¤â¤Î¤ò²¼µ­¤Ë¼¨¤·¤Þ¤¹¡£
¼þÇÈ¿ô¤ò¹â¤¯¤·¡¢·ë¹ç·¸¿ô¤ò¾®¤µ¤¯¤¹¤ë¤ÈÀµ¸¹ÇȾõ¤Ë¶á¤Å¤­¤Þ¤¹¡£
ÊÑ°µ´ï°ì¼¡Â¦ÅÅ°µ¤¬¡ÞE¤Ç¿¶Æ°¤¹¤ë¤Î¤â³Îǧ½ÐÍè¤ëÍͤˤʤê¤Ä¤Ä¤¢¤ê¤Þ¤¹¡£

!¢¨¾å¤Î¤Þ¤Þ¤Ç¤Ï¡¢Àµµ¢´Ô ˽Áö¤¹¤ë¤Î¤Ç¡¢f1(),f2() ¤Ë¡¢¥Ð¥Ã¥Õ¥¡ f1_,f2_ ¤òÉÕ¤±¤¿¡£
DEF f1(t, i1)=( E-R1*(1+SIN(w*t))*i1+M*f2_ )/L1 ! f2_=f2(t, i2)
DEF f2(t, i2)=( M*f1_-R2*i2 )/L2                 ! f1_=f1(t, i1)

LET E=10
LET R1=10000
LET ketugo=0.8 !·ë¹ç·¸¿ô¤Ç¡¢1¤Ë¶á¤Å¤±¤ë¤ÈÇÈ·Á¤¬±ÔÍø¤Ë¤Ê¤êȯ¿¶¤¹¤ë
LET L1=0.2
LET L2=0.1
LET R2=2
LET frq=10000     !¿®¹æ¼þÇÈ¿ô[Hz]
LET ndiv=5000     !£±¥µ¥¤¥¯¥ë¤Î·×»»Ê¬³ä¿ô
LET drawHz=10     ! 1²èÌ̤Çɽ¼¨¤¹¤ë¥µ¥¤¥¯¥ë¿ô[Hz]
LET pass_gamen=1  !½é´ü²áÅÏ»þ¤ÎÉÁ²èÌ̤ò¥Ñ¥¹¤¹¤ë²ó¿ô
LET iBairitu=1000 !ÅÅήÇÈ·ÁÉÁ²è³ÈÂçÇÜΨ¡£1000¤Ç1ÌÜÀ¹¤ê1[mA]¤Ë¤Ê¤ë

LET nmax=drawHz*ndiv !1²èÌ̤ÎÉÁ²èÅÀ¿ô
LET dt=1/frq/ndiv    !·×»»Èùʬ»þ´Ö[s]

LET M=ketugo*SQR(L1*L2)
LET w=2*PI*frq       !¸òήÀµ¸¹ÇÈ¿®¹æ¤Î³Ñ¼þÇÈ¿ô[rad/s]
LET i1_=0            ! i1¤Î½é´üÃÍ
LET i2_=0            ! i2¤Î½é´üÃÍ
LET Vt_=0            !ÊÑ°µ´ï°ì¼¡ÅÅ°µVt¤Î½é´üÃÍ
LET t_=0             ! t¤Î½é´üÃÍ

!----run

SET WINDOW -0,nmax,-2*E,2*E
DRAW grid

FOR nn=0 TO pass_gamen
   FOR n=0 TO nmax
      IF n=0 THEN LET xn_=0
      LET t=n*dt
      LET xn=n
      CALL RungeKutta4_1(t_,i1_,i1)
      CALL RungeKutta4_2(t_,i2_,i2)
      LET Vt=E-R1*(1+SIN(w*t))*i1

      IF nn=pass_gamen THEN
         SET LINE COLOR "red" !ÅÅήi1ÇÈ·ÁÉÁ²è¿§
         PLOT LINES:xn_,i1_*iBairitu;xn,i1*iBairitu
         !SET LINE COLOR "blue" !ÅÅήi2ÇÈ·ÁÉÁ²è¿§
         !PLOT LINES:xn_,i2_*iBairitu;xn,i2*iBairitu
         SET LINE COLOR "black" !ÅÅ°µÇÈ·ÁÉÁ²è¿§
         PLOT LINES:xn_,Vt_;xn,Vt
         PLOT LINES: xn_,0;xn,0 !»þ´Ö¼´ÉÁ²è
         SET LINE COLOR "green" !ÅÅ°µ¡ÞE[V]¥é¥¤¥ó
         PLOT LINES:xn_,-E;xn,-E
         PLOT LINES:xn_,E;xn,E
      END IF

      LET t_=t   !¡¡¼¡¤Ît ¤Ø¹¹¿·
      LET i1_=i1 !¡¡¼¡¤Îi1 ¤Ø¹¹¿·
      LET i2_=i2 !¡¡¼¡¤Îi2 ¤Ø¹¹¿·
      LET Vt_=Vt !¡¡¼¡¤ÎVt ¤Ø¹¹¿·
      LET xn_=xn
   next N
NEXT nn

SUB RungeKutta4_1(t_, i1_,i1)
   LET k1=f1(t_, i1_)
   LET k2=f1(t_+dt/2, i1_+k1*dt/2)
   LET k3=f1(t_+dt/2, i1_+k2*dt/2)
   LET k4=f1(t_+dt,   i1_+k3*dt )
   LET i1=i1_+(k1+2*k2+2*k3+k4)*dt/6
   LET f1_=f1(t_, i1)
END SUB

SUB RungeKutta4_2(t_, i2_,i2)
   LET k1=f2(t_, i2_)
   LET k2=f2(t_+dt/2, i2_+k1*dt/2)
   LET k3=f2(t_+dt/2, i2_+k2*dt/2)
   LET k4=f2(t_+dt,   i2_+k3*dt )
   LET i2=i2_+(k1+2*k2+2*k3+k4)*dt/6
   LET f2_=f2(t_, i2)
END SUB

END



> ¤·¤Þ¤à¤é1243¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£
> > £²¡ËÅÅήÇÈ·Á¤ÏÀµ¸¹ÇÈ¿¶Æ°¤·¤Þ¤»¤ó¡£
> i=E/R¤À¤«¤é¡¢Ê¬Êì¤ÎR¤ò0¡Á2*R¡ÊÀµ¸¹ÇȡˤȤ·¤Æ¤â¡¢i¤ÏÀµ¸¹ÇȤˤʤê¤Þ¤»¤ó¡£
>
> SET WINDOW -1,5,-1,15
> DRAW grid
>
> LET E=1
> LET R1=5
> FOR t=0 TO 5 STEP 0.001
>    LET r=R1*(1+SIN(5*t))
>    LET i=E/r
>    PLOT LINES: t,r; t,r !Àµ¸¹ÇÈ
>    !PLOT LINES: t,i; t,i !Àµ¸¹ÇÈ¡©
> NEXT t
>
> END
 

PLOT LINESʸ¤ÎÉÔ¶ñ¹ç

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 4·î15Æü(¿å)10»þ32ʬ54ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  SET WINDOW wx1,wx2,wy1,wy2
PLOT LINES: x1,y1; x2,y2

²èÌ̤«¤éÂ礭¤¯³°¤ì¤ëÀþʬ¤òÉÁ¤¯¾ì¹ç¡Êy1¤Þ¤¿¤Ïy2¤¬wy2¤È¤Îº¹¤¬1e7°Ê¾å¡Ë¡¢
¥¯¥ê¥Ã¥Ô¥ó¥°¤µ¤ì¤ë¤Ï¤º¤ÎÀþʬ¤¬¡¢ÅÀ(x1,wy2)¤È¤·¤Æ²èÌ̾åü¤Ëɽ¼¨¤µ¤ì¤ë¡£

º¸Ã¼¤âÅÀ(wx1,y1)¤ÇƱÍÍ¡£


¥µ¥ó¥×¥ë£±
SET WINDOW -1,1,-1,1
LET y=1e8
PLOT LINES: x,y; x+0.5,y !¾åüÃæ±û¤ËÅÀ¤¬¸«¤¨¤ë
END


¥µ¥ó¥×¥ë£²
SET WINDOW -1,1,-1,1
LET y=1e8
FOR x=-1 TO 1 STEP 0.001 !¼ÂÀþ¤¬¸«¤¨¤ë¡Ê0.1¡¢0.01¤Ê¤éÅÀ¡¹¤Ë¤Ê¤ë¡Ë
   PLOT LINES: x,y; x+0.5,y
NEXT x
END
 

Re: PLOT LINESʸ¤ÎÉÔ¶ñ¹ç

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 4·î16Æü(ÌÚ)08»þ59ʬ14ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.322[¸µµ­»ö¤Ø]

line width ¤ò2°Ê¾å¤Ë¤¹¤ë¤ÈÌäÂ꤬¤Ç¤ë¤è¤¦¤Ç¤¹¡£
Ä´¤Ù¤¿´Ä¶­¤ÏWindows XP¤ÈVista¤Ç¤¹¤¬¡¤
line width¤òÊѤ¨¤Ê¤¤¤È¤­¤ÏÀþ¤¬ÉÁ¤«¤ì¤Þ¤»¤ó¤Ç¤·¤¿¡£

Windows NT·Ï¤Î¾ì¹ç¡¤GDI¡Ê¤Ç¤è¤«¤Ã¤¿¤«¡©¡Ë¤Ï32¥Ó¥Ã¥È¤ÎºÂɸ¶õ´Ö¤ò¤â¤Ä¤Î¤Ç¡¤
-2^31¡Á2^31-1¤Ç¥¯¥ê¥Ã¥×¤·¤¿¿ôÃͤòWindows¤ËÅϤ·¤Æ¤¤¤Þ¤¹¡£

line style ¤Þ¤¿¤Ï Line Width¡¡¤ò2°Ê¾å¤Ë¤¹¤ë¤È¡¤
¤ª¤«¤·¤Ê¤³¤È¤¬µ¯¤³¤ë¤è¤¦¤Ç¤¹¡£

¥Æ¥¹¥È¥×¥í¥°¥é¥à
¥Ó¥Ã¥È¥Þ¥Ã¥×¤Î¥µ¥¤¥º¤ò801¡ß801¤Ë¤·¤Æ¼Â¹Ô

10 SET WINDOW 0,800,0,800
20 LET m=2^28
30 ! SET LINE WIDTH 2
31 SET LINE STYLE 2
40 FOR i=1 TO 400
50    PLOT LINES: 0,-m+i; 200,-m+i
60 NEXT i
70 END

20¹Ô¤Ïm=2^29¡¤2^30¤Ç¤âƱÍÍ

Win32API¤Î¾ÜºÙ¤ÊÆ°ºî¤¬¤ï¤«¤é¤Ê¤¤¤Î¤Ç¡¤
¥í¥¸¥«¥ë¤ÊÌäÂê¤Ç¤Ï¤Ê¤¤¤Î¤Ç¡¤²ò·è¤Ë¤Ï¥Æ¥¹¥È¤¬É¬ÍפǤ¹¡£
¾¤Î´Ä¶­¤Ç¤ÎÆ°ºî¥Æ¥¹¥È¤ÎÊó¹ð¤ò´¿·Þ¤·¤Þ¤¹¡£
 

Re: PLOT LINESʸ¤ÎÉÔ¶ñ¹ç

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 4·î16Æü(ÌÚ)12»þ21ʬ59ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.323[¸µµ­»ö¤Ø]

> ¾¤Î´Ä¶­¤Ç¤ÎÆ°ºî¥Æ¥¹¥È¤ÎÊó¹ð¤ò´¿·Þ¤·¤Þ¤¹¡£

30,31¹Ô¤ò¥³¥á¥ó¥È¥¢¥¦¥È¤·¤¿¥×¥í¥°¥é¥à¤Ç¡¢
WindowsMe¤Î¾ì¹ç¡¢²èÌÌ¥µ¥¤¥º¤ÇȯÀ¸¤¹¤ë¡¢¤·¤Ê¤¤¤¬¤¢¤ê¤Þ¤¹¡£


ȯÀ¸¤¹¤ë
¡¡401¡ß401¡¢501¡ß501¡¢801¡ß801¡¢1001¡ß1001¡ÊÇËÀþ¡Ë¡¢1601¡ß1601¡ÊÅÀÀþ¡Ë

ȯÀ¸¤·¤Ê¤¤
¡¡321¡ß321¡¢640¡ß400¡¢640¡ß480¡¢641¡ß641¡¢1281¡ß1281¡¢2001¡ß2001


10 SET WINDOW 0,800,0,800
20 LET m=2^28
30 !SET LINE WIDTH 2
31 !SET LINE STYLE 2
40 FOR i=1 TO 400
50    PLOT LINES: 0,-m+i; 200,-m+i
60 NEXT i
70 END


30,31¹Ô¤òÍ­¸ú¤Ë¤·¤Æ¤âÆ°ºî¤ÏƱ¤¸¤Ç¤¹¡£ÀþÉý¤Ï´Ø·¸¤Ê¤¤¤è¤¦¤Ç¤¹¡£

¤Þ¤¿¡¢²èÌÌ¥µ¥¤¥º¤Ë¤è¤Ã¤Æ¡¢È¯À¸¤¹¤ë¾ì¹ç¤Îm¤ÎÃͤ¬°Û¤Ê¤ê¤Þ¤¹¡£
¤¿¤È¤¨¤Ð¡¢401¡ß401¤Ê¤é¡¢m=2^17°Ê¾å¡£¡¡501¡ß501¤Ê¤é¡¢m=2^19°Ê¾å¡£¡¡801¡ß801¤Ê¤é¡¢m=2^16°Ê¾å¡£


Êä­
¡¡Á°½Ð¤Î¥×¥í¥°¥é¥à¤òPLOT POINTSʸ¤Ç¼Â¹Ô¤¹¤ë¾ì¹ç¤Ï£Ï£Ë¡ÊÅÀ¡¢Àþ¤ÏÉÁ¤«¤ì¤Ê¤¤¡Ë¤Ç¤¹¡£

SET WINDOW -1,1,-1,1
LET y=2^13 !¤³¤ì°Ê¾å¤«¤é
FOR x=-1 TO 1 STEP 0.001
   PLOT POINTS: x,y !OK
   !PLOT LINES: x,y; x,y !NG¡¡Ãæ±û¤Ë²£¼ÂÀþ¤¬¸«¤¨¤ë¡£¡¡m=2^22°Ê¾å¤Ê¤é²èÌ̾åü¤Ø
NEXT x
END
 

Re: PLOT LINESʸ¤ÎÉÔ¶ñ¹ç

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ 4·î16Æü(ÌÚ)19»þ31ʬ56ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.323[¸µµ­»ö¤Ø]

> ¾¤Î´Ä¶­¤Ç¤ÎÆ°ºî¥Æ¥¹¥È¤ÎÊó¹ð¤ò´¿·Þ¤·¤Þ¤¹¡£

¥Ó¥Ã¥È¥Þ¥Ã¥×¥µ¥¤¥º¤äÀþÉý¡¢ÉÁ²è°ÌÃÖ¤òÌÖÍåŪ¤ËÄ´¤Ù¤Þ¤·¤¿¡£
WindowsVista¤Ç¤Ï¡¢LINE WIDTH ¤ÎÀßÄ꤬1¤Î¤È¤­¤Ë¤Ï¥¨¥é¡¼¤Ï¤¢¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£
LINE WIDTH ¤ÎÀßÄ꤬4,5¤Î¤È¤­¤Ï3¤ÈƱ¤¸µóÆ°¤Ç¤·¤¿¡£
¤Þ¤¿¡¢j>=32¤Î¤È¤­¤Ïj=32¡¢j<=-32¤Î¤È¤­¤Ïj=-32¤ÈƱ¤¸µóÆ°¤Ç¤¹(Á´¤Æ¤òÄ´ºº¤·¤¿¤ï¤±¤Ç¤Ï¤Ê¤¤¤Ç¤¹¤¬)¡£


·ë²Ì¤ÎÎã(err=1¤È¤Ê¤ëj¤ÎÃÍ)
801¡ß801¤Î¾ì¹ç
  w=1 ¢ª ¤Ê¤¤
  w=2 ¢ª j<=-28,28<=j<=30 (j<=-32¤Ç¤Ï²èÌ̾åü¤ËÉÁ²è¤µ¤ì¤ë)
  w=3,4,5 ¢ª ABS(j)>=28 (j<=-32¤Ç¤Ï²èÌ̾åü¤ËÉÁ²è¤µ¤ì¤ë)
641¡ß641¤Î¾ì¹ç
  w=1 ¢ª ¤Ê¤¤
  w=2 ¢ª j<=-32 (²èÌ̾åü¤ËÉÁ²è¤µ¤ì¤ë)
  w=3,4,5 ¢ª ABS(j)>=32 (²èÌ̾åü¤ËÉÁ²è¤µ¤ì¤ë)


FOR bs=101 TO 1201 STEP 100
   PRINT "BITMAP SIZE "&STR$(bs)&"¡ß"&STR$(bs)
   SET bitmap SIZE bs,bs
10    SET WINDOW 0,800,0,800
      SET TEXT HEIGHT 30
      FOR w=1 TO 3  ! w=4,5¤Ïw=3¤ÈƱ¤¸µóÆ°
         PRINT "LINE WIDTH =";w
         FOR j=-32 TO -10
            CALL test
         NEXT j
         FOR j=10 TO 32
            CALL test
         NEXT j
         PRINT
      NEXT w
      PRINT
   NEXT bs
   SUB test
      CLEAR
      PLOT TEXT ,AT 300,560 : "BITMAP SIZE "&STR$(bs)&"¡ß"&STR$(bs)
      PLOT TEXT ,AT 300,480 : "w = "&STR$(w)
      PLOT TEXT ,AT 300,400 : "j = "&STR$(j)
20    LET m=SGN(j)*2^ABS(j)
30    SET LINE WIDTH w
31    !SET LINE STYLE 2
40    FOR i=1 TO 400
50       PLOT LINES: 0,-m+i; 200,-m+i
60    NEXT i
      LET err=0
      FOR y=0 TO 800
         ASK PIXEL VALUE(1,y) col
         IF col=1 THEN LET err=1
      NEXT y
      IF err=1 THEN
         PRINT j;
         WAIT DELAY 0.3
      END IF
   END SUB
70 END


Á´·ë²Ì
BITMAP SIZE 101¡ß101
LINE WIDTH = 1

LINE WIDTH = 2
-32 -31  31  32
LINE WIDTH = 3
-32 -31  31  32

BITMAP SIZE 201¡ß201
LINE WIDTH = 1

LINE WIDTH = 2
-32 -31 -30  30  31  32
LINE WIDTH = 3
-32 -31 -30  30  31  32

BITMAP SIZE 301¡ß301
LINE WIDTH = 1

LINE WIDTH = 2
-32 -31  31  32
LINE WIDTH = 3
-32 -31  31  32

BITMAP SIZE 401¡ß401
LINE WIDTH = 1

LINE WIDTH = 2
-32 -31 -30 -29  29  30  31
LINE WIDTH = 3
-32 -31 -30 -29  29  30  31  32

BITMAP SIZE 501¡ß501
LINE WIDTH = 1

LINE WIDTH = 2
-32 -31  31
LINE WIDTH = 3
-32 -31  31  32

BITMAP SIZE 601¡ß601
LINE WIDTH = 1

LINE WIDTH = 2
-32 -31 -30  30  31
LINE WIDTH = 3
-32 -31 -30  30  31  32

BITMAP SIZE 701¡ß701
LINE WIDTH = 1

LINE WIDTH = 2
-32 -31  31
LINE WIDTH = 3
-32 -31  31  32

BITMAP SIZE 801¡ß801
LINE WIDTH = 1

LINE WIDTH = 2
-32 -31 -30 -29 -28  28  29  30
LINE WIDTH = 3
-32 -31 -30 -29 -28  28  29  30  31  32

BITMAP SIZE 901¡ß901
LINE WIDTH = 1

LINE WIDTH = 2
-32 -31
LINE WIDTH = 3
-32 -31  31  32

BITMAP SIZE 1001¡ß1001
LINE WIDTH = 1

LINE WIDTH = 2
-32 -31 -30  30
LINE WIDTH = 3
-32 -31 -30  30  31  32

BITMAP SIZE 1101¡ß1101
LINE WIDTH = 1

LINE WIDTH = 2
-32 -31
LINE WIDTH = 3
-32 -31  31  32

BITMAP SIZE 1201¡ß1201
LINE WIDTH = 1

LINE WIDTH = 2
-32 -31 -30 -29  29  30
LINE WIDTH = 3
-32 -31 -30 -29  29  30  31  32
 

Re: PLOT LINESʸ¤ÎÉÔ¶ñ¹ç

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 4·î16Æü(ÌÚ)20»þ53ʬ47ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.324[¸µµ­»ö¤Ø]

Windows Me¤Î¾ì¹ç¤Ï¡¤GDI¤ÎºÂɸ·Ï¤¬16¥Ó¥Ã¥È¤Ê¤Î¤Ç¡¤
¥Ô¥¯¥»¥ëºÂɸ·Ï¤ËÊÑ´¹¤·¤¿¸å¡¤-2^15¡Á2^15-1¤ÎÈϰϤË
ºÂɸÃͤòÀÚ¤êµÍ¤á¤¿¸å¤ËÉÁ²è¤µ¤»¤Æ¤¤¤Þ¤¹¡£
 

Re: PLOT LINESʸ¤ÎÉÔ¶ñ¹ç

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 4·î16Æü(ÌÚ)22»þ10ʬ58ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.326[¸µµ­»ö¤Ø]

WindowsMe¤Ç¤Î¼Â¹Ô·ë²Ì¤òÊó¹ð¤·¤Þ¤¹¡£

¥×¥í¥°¥é¥à¤Î½¤Àµ
¡¡²èÌ̺¸Ã¼
¡¡¡¡ASK PIXEL VALUE(1,y) col
¡¡¤ò
¡¡¡¡ASK PIXEL VALUE(0,y) col
¡¡¤ÈÊѹ¹


320¡ß240¤Ï£Ï£Ë¤Ç¤¹¡ª
GDIÆâ¤Ç¤Î¥¯¥ê¥Ã¥Ô¥ó¥°¤Ï¡¢¥Ó¥Ã¥È¥Þ¥Ã¥×¡¦¥µ¥¤¥º¤¬16¤ÎÇÜ¿ô°Ê³°¤Ç¤Ï¤¦¤Þ¤¯·×»»¤Ç¤­¤Æ¤¤¤Ê¤¤¤è¤¦¤Ç¤¹¡£

BITMAP SIZE 101¡ß101
LINE WIDTH = 1
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19  19  20  21  22  23  24  25  26  27  28  29  30  31  32
LINE WIDTH = 2
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19  19  20  21  22  23  24  25  26  27  28  29  30  31  32
LINE WIDTH = 3
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19  19  20  21  22  23  24  25  26  27  28  29  30  31  32

BITMAP SIZE 201¡ß201
LINE WIDTH = 1
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19 -18  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32
LINE WIDTH = 2
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19 -18  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32
LINE WIDTH = 3
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19 -18  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32

BITMAP SIZE 301¡ß301
LINE WIDTH = 1
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19  19  20  21  22  23  24  25  26  27  28  29  30  31  32
LINE WIDTH = 2
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19  19  20  21  22  23  24  25  26  27  28  29  30  31  32
LINE WIDTH = 3
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19  19  20  21  22  23  24  25  26  27  28  29  30  31  32

BITMAP SIZE 401¡ß401
LINE WIDTH = 1
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19 -18 -17  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31
LINE WIDTH = 2
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19 -18 -17  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31
LINE WIDTH = 3
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19 -18 -17  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31

BITMAP SIZE 501¡ß501
LINE WIDTH = 1
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19  19  20  21  22  23  24  25  26  27  28  29  30  31
LINE WIDTH = 2
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19  19  20  21  22  23  24  25  26  27  28  29  30  31
LINE WIDTH = 3
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19  19  20  21  22  23  24  25  26  27  28  29  30  31

BITMAP SIZE 601¡ß601
LINE WIDTH = 1
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19 -18  18  19  20  21  22  23  24  25  26  27  28  29  30  31
LINE WIDTH = 2
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19 -18  18  19  20  21  22  23  24  25  26  27  28  29  30  31
LINE WIDTH = 3
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19 -18  18  19  20  21  22  23  24  25  26  27  28  29  30  31

BITMAP SIZE 701¡ß701
LINE WIDTH = 1
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19  19  20  21  22  23  24  25  26  27  28  29  30  31
LINE WIDTH = 2
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19  19  20  21  22  23  24  25  26  27  28  29  30  31
LINE WIDTH = 3
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19  19  20  21  22  23  24  25  26  27  28  29  30  31

BITMAP SIZE 801¡ß801
LINE WIDTH = 1
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19 -18 -17 -16  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30
LINE WIDTH = 2
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19 -18 -17 -16  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30
LINE WIDTH = 3
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19 -18 -17 -16  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30

BITMAP SIZE 901¡ß901
LINE WIDTH = 1
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19  19  20  21  22  23  24  25  26  27  28  29  30
LINE WIDTH = 2
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19  19  20  21  22  23  24  25  26  27  28  29  30
LINE WIDTH = 3
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19  19  20  21  22  23  24  25  26  27  28  29  30

BITMAP SIZE 1001¡ß1001
LINE WIDTH = 1
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19 -18  18  19  20  21  22  23  24  25  26  27  28  29  30
LINE WIDTH = 2
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19 -18  18  19  20  21  22  23  24  25  26  27  28  29  30
LINE WIDTH = 3
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19 -18  18  19  20  21  22  23  24  25  26  27  28  29  30

BITMAP SIZE 1101¡ß1101
LINE WIDTH = 1
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19  19  20  21  22  23  24  25  26  27  28  29  30
LINE WIDTH = 2
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19  19  20  21  22  23  24  25  26  27  28  29  30
LINE WIDTH = 3
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19  19  20  21  22  23  24  25  26  27  28  29  30

BITMAP SIZE 1201¡ß1201
LINE WIDTH = 1
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19 -18 -17  17  18  19  20  21  22  23  24  25  26  27  28  29  30
LINE WIDTH = 2
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19 -18 -17  17  18  19  20  21  22  23  24  25  26  27  28  29  30
LINE WIDTH = 3
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19 -18 -17  17  18  19  20  21  22  23  24  25  26  27  28  29  30





BITMAP SIZE 320¡ß240
LINE WIDTH = 1

LINE WIDTH = 2

LINE WIDTH = 3



BITMAP SIZE 640¡ß400
LINE WIDTH = 1
-17  17  18
LINE WIDTH = 2
-17  17  18
LINE WIDTH = 3
-17  17  18


BITMAP SIZE 640¡ß480
LINE WIDTH = 1
-32
LINE WIDTH = 2
-32
LINE WIDTH = 3
-32


BITMAP SIZE 1281¡ß1281
LINE WIDTH = 1
-32 -31
LINE WIDTH = 2
-32 -31
LINE WIDTH = 3
-32 -31

 

Re: PLOT LINESʸ¤ÎÉÔ¶ñ¹ç

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 4·î17Æü(¶â)14»þ52ʬ13ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.327[¸µµ­»ö¤Ø]

SET WINDOW¤ÇÄêµÁ¤µ¤ì¤ëºÂɸ·Ï¤òGDIºÂɸ·Ï¤È°ìÃפµ¤»¤ë¤¿¤á¤Ë
ASK PIXEL SIZE (0,1;1,0) a,b
LET a=a-1
LET b=b-1
SET WINDOW 0,a,b,0
¤ÇºÂɸ·Ï¤òÄêµÁ¤·¤Æ¤¯¤À¤µ¤¤¡£
Windows¤Ç¤Ï¡¤º¸¾åüºÂɸ¤¬¸¶ÅÀ(0,0)¤Ç¡¤±¦²¼Êý¸þ¤ËºÂɸÃͤ¬Áý²Ã¤·¤Þ¤¹¡£
 

Re: PLOT LINESʸ¤ÎÉÔ¶ñ¹ç

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 4·î17Æü(¶â)15»þ03ʬ3ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.328[¸µµ­»ö¤Ø]

Windows XP¤Ç¤Î·ë²Ì¤Ç¤¹¤¬¡¤¥Ó¥Ã¥È¥Þ¥Ã¥×¥µ¥¤¥º¤¬16¤ÎÇÜ¿ô¤«¤É¤¦¤«¤Ï´Ø·¸¤Ê¤¤¤ß¤¿¤¤¤Ç¤¹¡£

LET s=512
SET bitmap SIZE s,s
SET WINDOW 0,s-1,s-1,0
SET LINE STYLE 2
LET m=2^27
FOR i=m TO m+1000
   PLOT LINES: 100,m+i; 200,m+i
NEXT i
END
 

Re: PLOT LINESʸ¤ÎÉÔ¶ñ¹ç

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 4·î17Æü(¶â)18»þ01ʬ49ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.328[¸µµ­»ö¤Ø]

> SET WINDOW¤ÇÄêµÁ¤µ¤ì¤ëºÂɸ·Ï¤òGDIºÂɸ·Ï¤È°ìÃפµ¤»¤ë¤¿¤á¤Ë

µ¬Â§À­¤¬¸«¤¨¤Æ¤­¤Þ¤·¤¿¡£¾å²¼º¸±¦Ã¼¤¹¤Ù¤Æ¤³¤Î¾õÂ֤ˤʤê¤Þ¤¹¡£
BITMAP SIZE 101¡ß101
LINE WIDTH = 1
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19 -18 -17 -16  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30
LINE WIDTH = 2
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19 -18 -17 -16  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30
LINE WIDTH = 3
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19 -18 -17 -16  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30
FOR bs=101 TO 1201 STEP 100
   PRINT "BITMAP SIZE "&STR$(bs)&"¡ß"&STR$(bs)
   SET bitmap SIZE bs,bs
   !SET bitmap SIZE 640,480
   ASK PIXEL SIZE (0,1;1,0) a,b
   LET a=a-1
   LET b=b-1
   SET WINDOW 0,a,b,0
   !!!10    SET WINDOW 0,800,0,800
   SET TEXT HEIGHT 30
   FOR w=1 TO 3  ! w=4,5¤Ïw=3¤ÈƱ¤¸µóÆ°
      PRINT "LINE WIDTH =";w
      FOR j=-32 TO -10
         CALL test
      NEXT j
      FOR j=10 TO 32
         CALL test
      NEXT j
      PRINT
   NEXT w
   PRINT
NEXT bs
SUB test
   CLEAR
   PLOT TEXT ,AT 300,560 : "BITMAP SIZE "&STR$(bs)&"¡ß"&STR$(bs)
   PLOT TEXT ,AT 300,480 : "w = "&STR$(w)
   PLOT TEXT ,AT 300,400 : "j = "&STR$(j)
20    LET m=SGN(j)*2^ABS(j)
30    SET LINE WIDTH w
31    !!!SET LINE STYLE 2
40    FOR i=1 TO 400
50       PLOT LINES: 0,m+i; 200,m+i !º¸Ã¼¤ËȯÀ¸<---------- ¢¨
         !52       PLOT LINES: m+i,0; m+i,200 !¾åü<---------- ¢¨
60    NEXT i
      LET err=0
      FOR y=0 TO 800
         ASK PIXEL VALUE(0,y) col !º¸Ã¼<---------- ¢¨
         !ASK PIXEL VALUE(y,0) col !¾åü<---------- ¢¨
         IF col=1 THEN LET err=1
      NEXT y
      IF err=1 THEN
         PRINT j;
         WAIT DELAY 0.3
      END IF
   END SUB
70 END
 

Re: PLOT LINESʸ¤ÎÉÔ¶ñ¹ç

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 4·î17Æü(¶â)20»þ41ʬ56ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.328[¸µµ­»ö¤Ø]

ÇòÀС¡ÏÂÉפµ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¸Å¤¤¾ðÊó¤Ç¤¹¤¬
¡¡ºÂɸ¤¬¶Ëü¤ËÂ礭¤¤¾ì¹ç¤Ë GDI ¸Æ¤Ó½Ð¤·¤¬¼ºÇÔ¤¹¤ë
¡¡http://support.microsoft.com/kb/299533/ja


¡Ö¤³¤ÎÌäÂê¤Ï Microsoft Windows XP ¤Ç¤Ï²ò·è¤µ¤ì¤Æ¤¤¤Þ¤¹¡£¡×¤È½ñ¤¤¤Æ¤¢¤ê¤Þ¤¹¤¬¡¢¡¢¡¢

ÀþÉý¤¬£±¡¢Àþ¼ï¤¬¼ÂÀþ°Ê³°¤Ç¤Ï¡¢¤Þ¤À°ìÉôȯÀ¸¤¹¤ë¡¡¤È¸À¤¦¤³¤È¤Ç¤·¤ç¤¦¤«¡£

¡Ê¥¯¥ê¥Ã¥Ô¥ó¥°¤Ê¤É¤¬GDI°Í¸¤Î¤Þ¤Þ¤Ç¤Ï¡ËËÜ·ï¤Ï¡¢À©¸Â»ö¹à¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤¤¤Þ¤¹¤Í¡£
 

Re: PLOT LINESʸ¤ÎÉÔ¶ñ¹ç

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 4·î18Æü(ÅÚ)09»þ39ʬ46ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.333[¸µµ­»ö¤Ø]

Windows XP¤Ç´Ñ»¡¤µ¤ì¤ë¸½¾Ý¤Ï¡¤GDI¤ËÅϤ·¤¿ºÂɸÃͤξå°Ì¡¤²¿¥Ó¥Ã¥È¤«¤ò̵»ë¤·¤Æ½èÍý¤µ¤ì¤Æ¤¤¤ë¤³¤È¤Ç¤¹¡£¤½¤ÎÈϰϤ¬ÌÀ³Î¤Ë¤Ê¤ì¤ÐÂбþ¤Ï²Äǽ¤Ç¤¹¡£
¸½¾õ¤Ï¡¤-2^31¤è¤ê¾®¤µ¤±¤ì¤Ð-2^31¤Ë½ñ¤­´¹¤¨¡¤2^31-1¤è¤êÂ礭¤±¤ì¤Ð2^31-1¤Ë½ñ¤­´¹¤¨¤Æ¤¤¤Þ¤¹¡£SDK¤Îµ­½Ò¤¬´Ö°ã¤Ã¤Æ¤¤¤ë¤È¤Î¤³¤È¤Ê¤Î¤Ç¡¤¤³¤ì¤ò-2^26¡Á2^26-1¤ÎÈϰϤËÊѤ¨¤ì¤Ð¤¤¤¤¤Î¤À¤í¤¦¤È»×¤¤¤Þ¤¹¡£

Windows Me¤Ç¤âƱÍͤʤΤÀ¤í¤¦¤È»×¤¤¤Þ¤¹¤¬¡¤¾å°Ì¤Î²¿¥Ó¥Ã¥È¤¬Ìµ»ë¤µ¤ì¤ë¤Î¤«¤¬ÌäÂê¤Ç¤¹¡£
 

Re: PLOT LINESʸ¤ÎÉÔ¶ñ¹ç

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 4·î18Æü(ÅÚ)14»þ14ʬ37ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.334[¸µµ­»ö¤Ø]

ÇòÀС¡ÏÂÉפµ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> Windows Me¤Ç¤âƱÍͤʤΤÀ¤í¤¦¤È»×¤¤¤Þ¤¹¤¬¡¤¾å°Ì¤Î²¿¥Ó¥Ã¥È¤¬Ìµ»ë¤µ¤ì¤ë¤Î¤«¤¬ÌäÂê¤Ç¤¹¡£

¥×¥í¥°¥é¥à¤È¤·¤Æ¤Ï¡¢¤Á¤ç¤Ã¤È¶¯°ú¤Ç¤¹¤¬¡¢¡¢¡¢

BASIC¤Î¥°¥é¥Õ¥£¥Ã¥¯¥¹²èÌÌ¡Ê¥¿¥¤¥È¥ë¥Ð¡¼¡¢¥á¥Ë¥å¡¼¥Ð¡¼¤ò´Þ¤à¥¦¥¤¥ó¥É¥¦¡Ë¤òhDC¤È¤·¤Æ³Îǧ¤·¤Æ¤ß¤Þ¤·¤¿¡£

·ë²Ì¤Ï¡¢-2^15¡Á2^15¤ÎÈϰϤΤ褦¤Ç¤¹¡£¡Ê32¥Ó¥Ã¥È»ØÄê¤À¤¬¡¢¾å°Ì16¥Ó¥Ã¥È¤Ï̵¸ú¤È¤Ê¤ë¡Ë


>> Windows Me¤Î¾ì¹ç¤Ï¡¤GDI¤ÎºÂɸ·Ï¤¬16¥Ó¥Ã¥È¤Ê¤Î¤Ç¡¤
>> ¥Ô¥¯¥»¥ëºÂɸ·Ï¤ËÊÑ´¹¤·¤¿¸å¡¤-2^15¡Á2^15-1¤ÎÈϰϤË
>> ºÂɸÃͤòÀÚ¤êµÍ¤á¤¿¸å¤ËÉÁ²è¤µ¤»¤Æ¤¤¤Þ¤¹

¤³¤ì¤Ê¤é¤Á¤ã¤ó¤ÈÉÁ²è¤¹¤ë¤Î¤Ç¤Ï¡©

OPTION CHARACTER byte

LET w=320
LET h=240

SET BITMAP SIZE w,h !²èÌÌ¥µ¥¤¥º
SET WINDOW 0,w-1,0,h-1 !º¸²¼¤¬¸¶ÅÀ¡£²£¤¬£Ø¡¢½Ä£Ù


LET hWnd=FndWnd("TPaintForm","") !¥¦¥¤¥ó¥É¥¦¥Ï¥ó¥É¥ë¤ò¼èÆÀ¤¹¤ë

LET Rect$=REPEAT$(" ",4*4)
LET n=ClientRect(hWnd, Rect$)
PRINT int32(Rect$,0);int32(Rect$,4);int32(Rect$,8);int32(Rect$,12)

LET n=GetWndRect(hWnd, Rect$)
PRINT int32(Rect$,0);int32(Rect$,4);int32(Rect$,8);int32(Rect$,12)



IF hWnd>0 THEN
   LET hDC=GetWndDC(hWnd) !¥Ç¥Ð¥¤¥¹¥³¥ó¥Æ¥­¥¹¥È¤ò¼èÆÀ¤¹¤ë

   IF hDC>0 THEN
   !LET n=SetForeWnd(hWnd)

      LET n=Ellipse(hDC,20,20,100,200)

      LET m=-2^16 !<-------------------- -2^15¡Á2^15¤Ï£Ï£Ë
      LET n=MoveTo(hDC,0,m,0) !
      LET n=LineTo(hDC,200,m) !

      WAIT DELAY 2

      LET n=ReleaseDC(hWnd, hDC) !¥Ç¥Ð¥¤¥¹¥³¥ó¥Æ¥­¥¹¥È¤ò³«Êü¤¹¤ë
   END IF
END IF

END



!--------------------------------------------------
!
EXTERNAL FUNCTION DWORD$(n)
OPTION CHARACTER byte
LET r=MOD(n,2^8)
LET s$=CHR$(r)
LET n=(n-r)/2^8
LET r=MOD(n,2^8)
LET s$=s$ & CHR$(r)
LET n=(n-r)/2^8
LET r=MOD(n,2^8)
LET s$=s$ & CHR$(r)
LET n=(n-r)/2^8
LET r=MOD(n,2^8)
LET DWORD$=s$ & CHR$(r)
END FUNCTION

EXTERNAL FUNCTION WORD$(n)
OPTION CHARACTER byte
LET r=MOD(n,2^8)
LET s$=CHR$(r)
LET n=(n-r)/2^8
LET r=MOD(n,2^8)
LET WORD$=s$ & CHR$(r)
END FUNCTION

EXTERNAL FUNCTION int32(s$,p)
OPTION CHARACTER byte
LET n=0
FOR i=1 TO 4
   LET n=n+256^(i-1)*ORD(s$(p+i:p+i))
NEXT i
IF n<2^31 THEN LET int32=n ELSE LET int32=n-2^32
END FUNCTION

EXTERNAL FUNCTION int16(s$,p)
OPTION CHARACTER byte
LET n=0
FOR i=1 TO 2
   LET n=n+256^(i-1)*ORD(s$(p+i:p+i))
NEXT i
IF n<2^15 THEN LET int16=n ELSE LET int16=n-2^16
END FUNCTION


!user32.dll
EXTERNAL FUNCTION CloseWnd(hWnd)
ASSIGN "user32.dll","CloseWindow"
END FUNCTION

EXTERNAL FUNCTION CopyRect(lpDstRect$, lpSrcRect$)
ASSIGN "user32.dll","CopyRect"
END FUNCTION

EXTERNAL FUNCTION FndWnd(lpClassName$, lpWindowName$)
ASSIGN "user32.dll","FindWindowA"
END FUNCTION

EXTERNAL FUNCTION FillRect(hDC, lpRect$, hbr)
ASSIGN "user32.dll","FillRect"
END FUNCTION

EXTERNAL FUNCTION GetActWnd
ASSIGN "user32.dll","GetActiveWindow"
END FUNCTION

EXTERNAL FUNCTION ClientRect(hWnd, lpRect$)
ASSIGN "user32.dll","GetClientRect"
END FUNCTION

EXTERNAL FUNCTION GetForeWnd
ASSIGN "user32.dll","GetForegroundWindow"
END FUNCTION

EXTERNAL FUNCTION GetWndDC(hWnd)
ASSIGN "user32.dll","GetWindowDC"
END FUNCTION

EXTERNAL FUNCTION GetWndRect(hWnd, lpRect$)
ASSIGN "user32.dll","GetWindowRect"
END FUNCTION

EXTERNAL FUNCTION IsWndVisible(hWnd)
ASSIGN "user32.dll","IsWindowVisible"
END FUNCTION

EXTERNAL FUNCTION MoveWnd(hWnd, x, y, cx, cy)
ASSIGN "user32.dll","MoveWindow"
END FUNCTION

EXTERNAL FUNCTION OffsetRect(lpRect$, dx, dy)
ASSIGN "user32.dll","OffsetRect"
END FUNCTION

EXTERNAL FUNCTION ReleaseDC(hWnd, hDC)
ASSIGN "user32.dll","ReleaseDC"
END FUNCTION

EXTERNAL FUNCTION SetActWnd(hWnd)
ASSIGN "user32.dll","SetActiveWindow"
END FUNCTION

EXTERNAL FUNCTION SetForeWnd(hWnd)
ASSIGN "user32.dll","SetForegroundWindow"
END FUNCTION

EXTERNAL FUNCTION SetRect(lpRect$, xLeftRect, yTopRect, xRightRect, yBottomRect)
ASSIGN "user32.dll","SetRect"
END FUNCTION

EXTERNAL FUNCTION SetWndPos(hWnd, hWndInsertAfter, x, y, cx, cy, uFlag)
ASSIGN "user32.dll","SetWindowPos"
END FUNCTION

EXTERNAL FUNCTION SetWndText(hWnd, lpString$)
ASSIGN "user32.dll","SetWindowTextA"
END FUNCTION

EXTERNAL FUNCTION ShowWnd(hWnd, nCmdShow)
ASSIGN "user32.dll","ShowWindow"
END FUNCTION


!gdi32.dll
EXTERNAL FUNCTION SolidBrush(crColor)
ASSIGN "gdi32.dll","CreateSolidBrush"
END FUNCTION

EXTERNAL FUNCTION Ellipse(hDC, nLeftRect, nTopRect, nRightRect, nBottomRect)
ASSIGN "gdi32.dll","Ellipse"
END FUNCTION

EXTERNAL FUNCTION LineTo(hDC, x, y)
ASSIGN "gdi32.dll","LineTo"
END FUNCTION

EXTERNAL FUNCTION MoveTo(hDC, x, y, lpPoint)
ASSIGN "gdi32.dll","MoveToEx"
END FUNCTION

EXTERNAL FUNCTION Rectangle(hDC, nLeftRect, nTopRect, nRightRect, nBottomRect)
ASSIGN "gdi32.dll","Rectangle"
END FUNCTION
 

Re: PLOT LINESʸ¤ÎÉÔ¶ñ¹ç

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 4·î19Æü(Æü)15»þ09ʬ7ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.334[¸µµ­»ö¤Ø]

´°Á´¤«¤É¤¦¤«Ä꤫¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¤¬¡¤½¤ÀµÈǤòºîÀ®¤·¤Þ¤·¤¿¡£(Ver. 3.7.1)
ÌäÂ꤬»Ä¤ë¤è¤¦¤Ç¤¢¤ì¤Ð¤ªÃΤ餻¤¯¤À¤µ¤¤¡£
 

²èÁü½èÍý¡Ê¥¨¥Õ¥§¥¯¥È¡Ë

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 4·î20Æü(·î)20»þ13ʬ25ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¥Ú¡¼¥¸¤á¤¯¤ê
OPTION ARITHMETIC NATIVE !CPU¥Ñ¥ï¡¼

SET COLOR MODE "NATIVE"
GLOAD "c:\BASICw32\SAMPLE\ZENKOUJI.JPG" !²èÁü¤òÆɤ߹þ¤à
ASK PIXEL SIZE (0,0; 1,1) w,h !²èÁü¤Î½Ä²£¤ÎÂ礭¤µ(¥Ô¥¯¥»¥ëñ°Ì)¤òÄ´¤Ù¤ë
DIM p(w,h),q(w,h) !²èÁü¤ÎÂ礭¤µ¤ËÂбþ¤¹¤ëÇÛÎóÍ×ÁǤòÍÑ°Õ¤¹¤ë
ASK PIXEL ARRAY (0,1) p !²èÁü¤Î³ÆÅÀ¤Î¿§¾ðÊó¤òÇÛÎó¤Ë³ÊǼ¤¹¤ë
PRINT "²èÁü¤ÎÂ礭¤µ ½Ä:";h;" ²£:";w
!SET BITMAP SIZE w,h !¥¦¥£¥ó¥É¥¦¤ÎÂ礭¤µ¤ò²èÁü¤Ë¹ç¤ï¤»¤ë


LET R=30 !¤á¤¯¤ê¤ÎȾ·Â¡¡¢¨
LET Dx=20 !¤á¤¯¤ê¤ÎÎÌ¡¡¢¨
LET th=RAD(30) !¤á¤¯¤ê¤ÎÊý¸þ¡¡¢¨


DIM M1(3,3),M2(3,3),M4(3,3),M5(3,3),M7(3,3),M8(3,3)
MAT M1=IDN !²èÁü¤ÎÃæ±û¤ò¸¶ÅÀ¤Ø
LET M1(1,3)=-w/2
LET M1(2,3)=-h/2

MAT M2=IDN !¤á¤¯¤êÊý¸þ¤ò£Ø¼´¤Ë°ìÃפµ¤»¡¢È¾·Â¤ò£±¤È¤¹¤ë
LET M2(1,1)=COS(th)/R
LET M2(1,2)=SIN(th)/R
LET M2(2,1)=-SIN(th)/R
LET M2(2,2)=COS(th)/R

MAT M4=IDN !¤á¤¯¤ê¤ÎÃæ¿´¤ò¸¶ÅÀ¤Ø
LET M4(1,3)=-Dx/R

MAT M5=IDN !INV(M4)
LET M5(1,3)=Dx/R

MAT M7=IDN !INV(M2)
LET M7(1,1)=COS(th)*R
LET M7(1,2)=-SIN(th)*R
LET M7(2,1)=SIN(th)*R
LET M7(2,2)=COS(th)*R

MAT M8=IDN !INV(M1)
LET M8(1,3)=w/2
LET M8(2,3)=h/2


MAT q=ZER !¹õ¿§

!ºÂɸÊÑ´¹ f:(x,y)¢ª(xx,yy)¤ÎµÕÊÑ´¹¤ò¹Í¤¨¤ë

!²¼Â¦¤ÎÉôʬ
DIM t(3)
FOR yy=1 TO h !ÊÑ´¹¸å¤Î²èÁÇ°ÌÃÖ¤ÇÁöºº¤¹¤ë
   FOR xx=1 TO w

      LET t(1)=xx !ÈóÀþ·ÁÊÑ´¹Á°¤ÎÀþ·ÁÊÑ´¹
      LET t(2)=yy
      LET t(3)=1

      MAT t=M1*t
      MAT t=M2*t
      MAT t=M4*t

      !ÈóÀþ·ÁÊÑ´¹

      !²£¤«¤é¸«¤¿¿Þ¡Ê¸ú²Ì¤Î¤«¤«¤ëÊý¸þ¤ò£Ø¼´Êý¸þ¤Ë¤È¤ë¡Ë
      !£Ú¼´
      !¢¬
      !¡¦¢ª £Ø¼´
      !¡¡¡¡¡¡¡¡¡¡¡¡»ëÀþ
      !¡¡¡¡¡¡¡¡¡¡¡¡ ¢­
      !¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡x'=1
      !¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¨¡¨¡¡¦¡¡¡¡¡¡¡¡ ¾å¦
      !¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡À¡¡¡¡¡¡¡¡¢¬
      !¡¡¡¡¤á¤¯¤ê¤ÎÃæ¿´ ¢ª * ¡¡¡¦x'=0¡¡--------
      !¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¿¡¡¡¡¡¡¡¡¢­
      !¡¡²èÁÇÌÌ¡¡¨¡¨¡¨¡¨¡¨¡¡¦¡¡¡¡¡¡¡¡ ²¼Â¦
      !¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡x'=-1
      !
      !¡¦²¼Â¦¤È¾å¦¤Î½ç¤Ë£²²ó¤ÎÉÁ²è¤Ç±¢Ì̾õî¤ò¹Ô¤¦

      LET op=0 !·×»»¸íº¹¤òÈò¤±¤ë¤¿¤á¸µ¤ÎÃͤò»È¤¦
      SELECT CASE t(1) !x'=R*Sin(¦Èz)
      CASE IS >=1
         LET op=-1 !NOP
      CASE IS >=0
         LET t(1)=ASIN(ABS(t(1))) !0¡åR*ArcSin(x'/R)¡åR*PI/2
         LET op=1 !ÊÑ´¹¤µ¤ì¤¿ºÂɸ¤ò»È¤¦
      CASE ELSE !x'
      END SELECT

      MAT t=M5*t !ÈóÀþ·ÁÊÑ´¹¸å¤ÎÀþ·ÁÊÑ´¹
      MAT t=M7*t
      MAT t=M8*t
      !PRINT xx;yy !debug
      !MAT PRINT t;

      LET x=INT(t(1)) !¸µ¤Î²èÁǤǤΰÌÃÖ
      LET y=INT(t(2))

      SELECT CASE op !¸µ¤Î²èÁǤòÆɤ߹þ¤ó¤Ç½ñ¤­¹þ¤à
      CASE 0
         LET q(xx,yy)=p(xx,yy)
      CASE 1
         IF x<1 OR x>w OR y<1 OR y>h THEN !ÈÏ°ÏÆâ¤Ê¤é
         ELSE
            LET q(xx,yy)=p(x,y)
         END IF
      CASE ELSE
      END SELECT

   NEXT xx
NEXT yy

!MAT PLOT CELLS, IN 0,1; 1,0 :q !²èÁü¤òɽ¼¨¤¹¤ë debug
!STOP

!¾å¦¤ÎÉôʬ¡Ê¤á¤¯¤ê¾å¤¬¤Ã¤Æ΢ÊÖ¤ëÉôʬ¡Ë
FOR yy=1 TO h !ÊÑ´¹¸å¤Î²èÁÇ°ÌÃÖ¤ÇÁöºº¤¹¤ë
   FOR xx=1 TO w

      LET t(1)=xx !ÈóÀþ·ÁÊÑ´¹Á°¤ÎÀþ·ÁÊÑ´¹
      LET t(2)=yy
      LET t(3)=1

      MAT t=M1*t
      MAT t=M2*t
      MAT t=M4*t


      !ÈóÀþ·ÁÊÑ´¹
      !!!¡ü´¬¤­¹þ¤Þ¤Ê¤¤¾ì¹ç¤Ï¡¢¤³¤Á¤é
      LET op=0 !·×»»¸íº¹¤òÈò¤±¤ë¤¿¤á¸µ¤ÎÃͤò»È¤¦
      SELECT CASE t(1)
      CASE IS >=1
         LET op=-1 !NOP
      CASE IS >=0
         LET t(1)=PI-ASIN(ABS(t(1))) !R*PI/2¡åR*PI-R*ArcSin(x'/R)¡åR*PI
         LET op=1
      CASE ELSE
         LET t(1)=PI-t(1) !R*PI-x'
         LET op=1
      END SELECT

      !!!¡ü´¬¤­¹þ¤à¾ì¹ç¤Ï¡¢¤³¤Á¤é
      !!!LET op=0 !·×»»¸íº¹¤òÈò¤±¤ë¤¿¤á¸µ¤ÎÃͤò»È¤¦
      !!!SELECT CASE t(1)
      !!!CASE IS >=1
      !!!   LET op=-1 !NOP
      !!!CASE IS >=0
      !!!   LET t(1)=PI-ASIN(ABS(t(1)))
      !!!   LET op=1
      !!!CASE IS >=-1
      !!!   LET t(1)=PI+ASIN(ABS(t(1)))
      !!!   LET op=1
      !!!CASE ELSE
      !!!   LET op=-1 !NOP
      !!!END SELECT


      MAT t=M5*t !ÈóÀþ·ÁÊÑ´¹¸å¤ÎÀþ·ÁÊÑ´¹
      MAT t=M7*t
      MAT t=M8*t
      !PRINT xx;yy !debug
      !MAT PRINT t;

      LET x=INT(t(1)) !¸µ¤Î²èÁǤǤΰÌÃÖ
      LET y=INT(t(2))

      SELECT CASE op !¸µ¤Î²èÁǤòÆɤ߹þ¤ó¤Ç½ñ¤­¹þ¤à
      CASE 0
         LET q(xx,yy)=p(xx,yy)
      CASE 1
         IF x<1 OR x>w OR y<1 OR y>h THEN !ÈÏ°ÏÆâ¤Ê¤é
         ELSE
            LET q(xx,yy)=p(x,y)
         END IF
      CASE ELSE
      END SELECT

   NEXT xx
NEXT yy

MAT PLOT CELLS, IN 0,1; 1,0 :q !²èÁü¤òɽ¼¨¤¹¤ë

END
 

Re: ²èÁü½èÍý¡Ê¥¨¥Õ¥§¥¯¥È¡Ë

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 4·î21Æü(²Ð)10»þ30ʬ2ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.337[¸µµ­»ö¤Ø]

¡üµå
OPTION ARITHMETIC NATIVE !CPU¥Ñ¥ï¡¼

SET COLOR MODE "NATIVE"
GLOAD "c:\BASICw32\SAMPLE\ZENKOUJI.JPG" !²èÁü¤òÆɤ߹þ¤à
ASK PIXEL SIZE (0,0; 1,1) w,h !²èÁü¤Î½Ä²£¤ÎÂ礭¤µ(¥Ô¥¯¥»¥ëñ°Ì)¤òÄ´¤Ù¤ë
DIM p(w,h),q(w,h) !²èÁü¤ÎÂ礭¤µ¤ËÂбþ¤¹¤ëÇÛÎóÍ×ÁǤòÍÑ°Õ¤¹¤ë
ASK PIXEL ARRAY (0,1) p !²èÁü¤Î³ÆÅÀ¤Î¿§¾ðÊó¤òÇÛÎó¤Ë³ÊǼ¤¹¤ë
PRINT "²èÁü¤ÎÂ礭¤µ ½Ä:";h;" ²£:";w
!SET BITMAP SIZE w,h !¥¦¥£¥ó¥É¥¦¤ÎÂ礭¤µ¤ò²èÁü¤Ë¹ç¤ï¤»¤ë


LET Rx=100 !µå¤ÎȾ·Â
LET Ry=100
LET Sx=150 !µå¤ÎÃæ¿´
LET Sy=150
LET Tx=w/2+50 !ŽÉÕ¤±°ÌÃÖ
LET Ty=h/2


DIM M1(3,3),M2(3,3),M3(3,3),M6(3,3),M7(3,3),M8(3,3)
MAT M1=IDN !Ãæ¿´¤Î°ÜÆ°
LET M1(1,3)=-Sx
LET M1(2,3)=-Sy

MAT M2=IDN !ÈæΨ¤ÎÊÑ´¹
LET M2(1,1)=1/Rx
LET M2(2,2)=1/Ry

MAT M7=IDN !INV(M2)
LET M7(1,1)=Rx
LET M7(2,2)=Ry

MAT M8=IDN !ŽÉÕ¤±²èÁü¤Î°ÜÆ°
LET M8(1,3)=Tx
LET M8(2,3)=Ty


MAT q=ZER !¹õ¿§

!ºÂɸÊÑ´¹ f:(x,y)¢ª(xx,yy)¤ÎµÕÊÑ´¹¤ò¹Í¤¨¤ë

DIM t(3)
FOR yy=1 TO h !ÊÑ´¹¸å¤Î²èÁÇ°ÌÃÖ¤ÇÁöºº¤¹¤ë
   FOR xx=1 TO w

      LET t(1)=xx !ÈóÀþ·ÁÊÑ´¹Á°¤ÎÀþ·ÁÊÑ´¹
      LET t(2)=yy
      LET t(3)=1

      MAT t=M1*t
      MAT t=M2*t

      LET tt=SQR(t(1)*t(1)+t(2)*t(2)) !(x,y)¤Ë±þ¤¸¤Æ²óž¤¹¤ë
      IF tt=0 THEN
         LET co=0
         LET si=0
      ELSE
         LET co=t(1)/tt
         LET si=t(2)/tt
      END IF

      MAT M3=IDN
      LET M3(1,1)=co !£Ø¼´¾å¤Ø¤Î¼ÌÁü
      LET M3(1,2)=si
      LET M3(2,1)=-si
      LET M3(2,2)=co

      MAT t=M3*t


      !ÈóÀþ·ÁÊÑ´¹
      IF t(1)>=0 AND t(1)<1 THEN !µå¤ÎÆâ
         LET t(1)=ASIN(t(1)) !ÆÌ
         !LET t(1)=ATN(t(1))*1.5 !±ú
         LET op=1 !ÊÑ´¹¤µ¤ì¤¿ºÂɸ¤ò»È¤¦
      ELSE !µå¤Î³°
         LET op=0 !·×»»¸íº¹¤òÈò¤±¤ë¤¿¤á¸µ¤ÎÃͤò»È¤¦
      END IF


      SELECT CASE op !¸µ¤Î²èÁǤòÆɤ߹þ¤ó¤Ç½ñ¤­¹þ¤à
      CASE 0
         LET q(xx,yy)=p(xx,yy)
      CASE 1
         MAT M6=IDN !INV(M3) !ÈóÀþ·ÁÊÑ´¹¸å¤ÎÀþ·ÁÊÑ´¹
         LET M6(1,1)=co
         LET M6(1,2)=-si
         LET M6(2,1)=si
         LET M6(2,2)=co

         MAT t=M6*t
         MAT t=M7*t
         MAT t=M8*t
         !PRINT xx;yy !debug
         !MAT PRINT t;

         LET x=INT(t(1)) !¸µ¤Î²èÁǤǤΰÌÃÖ
         LET y=INT(t(2))

         IF x<1 OR x>w OR y<1 OR y>h THEN !ÈÏ°ÏÆâ¤Ê¤é
         ELSE
            LET q(xx,yy)=p(x,y)
         END IF
      CASE ELSE !NOP
      END SELECT

   NEXT xx
NEXT yy

MAT PLOT CELLS, IN 0,1; 1,0 :q !²èÁü¤òɽ¼¨¤¹¤ë

END


¡ü¥â¥¶¥¤¥¯
OPTION ARITHMETIC NATIVE !CPU¥Ñ¥ï¡¼

SET COLOR MODE "NATIVE"
GLOAD "c:\BASICw32\SAMPLE\ZENKOUJI.JPG" !²èÁü¤òÆɤ߹þ¤à
ASK PIXEL SIZE (0,0; 1,1) w,h !²èÁü¤Î½Ä²£¤ÎÂ礭¤µ(¥Ô¥¯¥»¥ëñ°Ì)¤òÄ´¤Ù¤ë
DIM p(w,h),q(w,h) !²èÁü¤ÎÂ礭¤µ¤ËÂбþ¤¹¤ëÇÛÎóÍ×ÁǤòÍÑ°Õ¤¹¤ë
ASK PIXEL ARRAY (0,1) p !²èÁü¤Î³ÆÅÀ¤Î¿§¾ðÊó¤òÇÛÎó¤Ë³ÊǼ¤¹¤ë
PRINT "²èÁü¤ÎÂ礭¤µ ½Ä:";h;" ²£:";w
!SET BITMAP SIZE w,h !¥¦¥£¥ó¥É¥¦¤ÎÂ礭¤µ¤ò²èÁü¤Ë¹ç¤ï¤»¤ë


LET Rx=10 !£±ÊÕ¤ÎŤµ
LET Ry=10
LET th=RAD(30) !Êý¸þ


DIM M1(3,3),M2(3,3),M7(3,3),M8(3,3)
MAT M1=IDN !²èÁü¤ÎÃæ±û¤ò¸¶ÅÀ¤Ø
LET M1(1,3)=-w/2
LET M1(2,3)=-h/2

MAT M2=IDN !Êý¸þ¤ò£Ø¼´¤Ë°ìÃפµ¤»¡¢È¾·Â¤ò£±¤È¤¹¤ë
LET M2(1,1)=COS(th)/Rx
LET M2(1,2)=SIN(th)/Rx
LET M2(2,1)=-SIN(th)/Ry
LET M2(2,2)=COS(th)/Ry

MAT M7=IDN !INV(M2)
LET M7(1,1)=COS(th)*Rx
LET M7(1,2)=-SIN(th)*Rx
LET M7(2,1)=SIN(th)*Ry
LET M7(2,2)=COS(th)*Ry

MAT M8=IDN !INV(M1)
LET M8(1,3)=w/2
LET M8(2,3)=h/2


MAT q=ZER !¹õ¿§

!ºÂɸÊÑ´¹ f:(x,y)¢ª(xx,yy)¤ÎµÕÊÑ´¹¤ò¹Í¤¨¤ë

DIM t(3)
FOR yy=1 TO h !ÊÑ´¹¸å¤Î²èÁÇ°ÌÃÖ¤ÇÁöºº¤¹¤ë
   FOR xx=1 TO w

      LET t(1)=xx !ÈóÀþ·ÁÊÑ´¹Á°¤ÎÀþ·ÁÊÑ´¹
      LET t(2)=yy
      LET t(3)=1

      MAT t=M1*t
      MAT t=M2*t

      !ÈóÀþ·ÁÊÑ´¹
      LET t(1)=INT(t(1))+0.5
      LET t(2)=INT(t(2))+0.5

      MAT t=M7*t !ÈóÀþ·ÁÊÑ´¹¸å¤ÎÀþ·ÁÊÑ´¹
      MAT t=M8*t
      !PRINT xx;yy !debug
      !MAT PRINT t;

      LET x=INT(t(1)) !¸µ¤Î²èÁǤǤΰÌÃÖ
      LET y=INT(t(2))

      IF x<1 OR x>w OR y<1 OR y>h THEN !ÈÏ°ÏÆâ¤Ê¤é
      ELSE
         LET q(xx,yy)=p(x,y)
      END IF

   NEXT xx
NEXT yy

MAT PLOT CELLS, IN 0,1; 1,0 :q !²èÁü¤òɽ¼¨¤¹¤ë

END
 

FILE GETNAME ¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§ÌÚÖº¾®½Õ  Åê¹ÆÆü¡§2009ǯ 4·î22Æü(¿å)18»þ39ʬ55ÉÃ
ÊÖ¿®¡¦°úÍÑ
  FILE GETNAME ¤ò»ÈÍѤ·¤Æ¥Õ¥¡¥¤¥ë¤ËÊݸ¤·¤¿¤¤¤Î¤Ç¤¹¤¬¡¤°ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó(7.2.8¤Ç³Îǧ)¤Ï¡¤¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï¿·¤¿¤Ë¥Õ¥¡¥¤¥ë¤òºîÀ®¤·¤ÆÊݸ¤Ç¤­¤Þ¤· ¤¿¡£7.3.1¤Ç²¼µ­¤Î¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¡¤¿·¤¿¤Ê¥Õ¥¡¥¤¥ë̾¤òÆþÎϤ¹¤ë¤È¡¤"¥Õ¥¡¥¤¥ë¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó¡£»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë̾¤¬Àµ¤·¤¤¤«¤É¤¦¤«³Îǧ¤·¤Æ ²¼¤µ¤¤¡£" ¤È¤¤¤¦¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤¬½Ð¤Þ¤¹¡£ÂнèÊýË¡¤ò¶µ¤¨¤Æ²¼¤µ¤¤¡£¤è¤í¤·¤¯¤ª´ê¤¤¤·¤Þ¤¹¡£


PRINT  ; "½ÐÎÏ¥Õ¥¡¥¤¥ë̾  file name = " ;
FILE GETNAME FILENAME2$
OPEN #1 : NAME FILENAME2$
CLOSE #1
END
 

Re: FILE GETNAME ¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 4·î23Æü(ÌÚ)08»þ35ʬ22ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.339[¸µµ­»ö¤Ø]

¤È¤ê¤¢¤¨¤º¡¤
http://hp.vector.co.jp/authors/VA008683/Dialogs.htm
¤Îµ­½Ò¤Ë¤·¤¿¤¬¤Ã¤ÆGetSaveFileName¤ÇÂåÍѤ·¤Æ¤¯¤À¤µ¤¤¡£

¤Ê¤ª¡¤File GetName¤Ïµ¬³Ê³°¤ÎÌ¿Îá¤Ê¤Î¤Ç¡¤¤É¤¦¤¹¤ë¤Î¤¬¤è¤¤¤Î¤«º£¸å¸¡Æ¤¤·¤Þ¤¹¡£
 

Re: FILE GETNAME ¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§ÌÚÖº¾®½Õ  Åê¹ÆÆü¡§2009ǯ 4·î23Æü(ÌÚ)10»þ36ʬ5ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.340[¸µµ­»ö¤Ø]

¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
GetSaveFileName ¤ËÊѹ¹¤·¤Æ¤ß¤Þ¤¹¡£
File GetName ¤¬½¾ÍèÄ̤ê»È¤¨¤ë¤È¥×¥í¥°¥é¥à¤òÊѹ¹¤·¤Ê¤¯¤Æ¤¹¤à¤Î¤Ç½õ¤«¤ê¤Þ¤¹¤¬Ž¥Ž¥Ž¥Ž¥¡£¤è¤í¤·¤¯¤ª´ê¤¤¤·¤Þ¤¹¡£
 

¶ËºÂɸ

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ 4·î27Æü(·î)09»þ22ʬ5ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  °ìÉô½¤Àµ¤·¤Þ¤·¤¿(ÀÖ»ú)¡£

¶ËºÂɸ¼´¤òÉÁ²è¤¹¤ë³°Éô³¨ÄêµÁ(polar)¤òºî¤ê¤Þ¤·¤¿¡£
Æ°·Â,ÊгѤοô»ú¤Î̵ͭ¤äÌÜÀ¹´Ö³Ö¤Ê¤É»ØÄê¤Ç¤­¤Þ¤¹¡£
ÊгѤÎɽ¼¨¤Ï,1[-180<¦È<=180]¤«,2[0<=¦È<360]¤Î¤É¤Á¤é¤«¤ò»ØÄê¤Ç¤­¤Þ¤¹¡£
½½¿ÊBASIC¤Îľ¸òºÂɸ¼´¤òÉÁ²è¤¹¤ëDRAW AXES¤äDRAW GRID¤È»ÅÍͤò¹ç¤»¤Æ¤¤¤ë¤Î¤Ç½Å¤Í¤Æ¤ÎÉÁ²è¤â²Äǽ¤Ç¤¹¡£

³°Éô³¨ÄêµÁ p_coordinate ¤Ï,ÌäÂêºÂɸ¤ò¶ËºÂɸ¤ËÊÑ´¹¤·¤Æɽ¼¨¤·¤Þ¤¹¡£


DECLARE EXTERNAL PICTURE polar,p_coordinate
READ x0,x9,y0,y9
SET WINDOW x0,x9,y0,y9
!DATA -1,1,-1,1   ! 2*2
DATA -2.1,2.1,-2.1,2.1  ! 4.2*4.2
!DATA 0.2,2.5,-0.6,1.7  ! 2.3*2.3
!DATA -8.5,-3.5,4,9  ! 5*5

! ¶ËºÂɸ¼´(Æ°·Âɽ¼¨°ÌÃÖ(0¡Á3),ÊгÑɽ¼¨ÈÏ°Ï(0¡Á2),¼´,Æ°·ÂÌÜÀ¹´Ö³Ö,ÊгÑÌÜÀ¹´Ö³Ö(ÅÙ))
DRAW polar(2,2,"grid",0.5,15)
!DRAW AXES(0.5,0.5) ! ľ¸òºÂɸ¼´(½½¿ÊBASICÆȼ«³ÈÄ¥)
!DRAW GRID(0.5,0.5) ! ľ¸òºÂɸ¼´(½½¿ÊBASICÆȼ«³ÈÄ¥)

DEF r(t)=t/PI       ! ÍæÀû
!DEF r(t)=1*(1-0.8^2)/(1+0.8*COS(t)) ! Âʱß(ĹȾ·Â=1,Î¥¿´Î¨=0.8)
!DEF r(t)=0.8*0.5/(1-0.8*COS(t)) ! Âʱß(Î¥¿´Î¨=0.8,½àÀþx=-0.5)
!DEF r(t)=2*COS(t)   ! ±ß
!DEF r(t)=1+COS(t)   ! ¥«¡¼¥¸¥ª¥¤¥É
!DEF r(t)=2*SIN(2*t) ! ÀµÍÕ¶ÊÀþ
!DEF r(t)=1/(5/4*COS(t)+3/2*SIN(t)) ! ľ¸òºÂɸ(4/5,0),(0,2/3)¤òÄ̤ëľÀþ

CALL red_point1
SET BEAM MODE "IMMORTAL"
LET t0=0       ! LET t0=-PI
LET t9=2*PI    ! LET t9=PI
FOR t=t0 TO t9+1E-8 STEP (t9-t0)/500
   CALL red_point2
   WHEN EXCEPTION IN
      PLOT LINES : r(t)*COS(t),r(t)*SIN(t);
      ! PLOT POINTS : r(t)*COS(t),r(t)*SIN(t)
   USE
      PLOT LINES
   END WHEN
   WAIT DELAY 0.01
NEXT t
PLOT LINES
SET BEAM MODE "RIGOROUS"
BEEP

PLOT TEXT ,AT (x9+x0)/2,y0 : "¥¯¥ê¥Ã¥¯¤Ç¶ËºÂɸɽ¼¨,±¦¥¯¥ê¥Ã¥¯¤Ç½ªÎ»"
DRAW p_coordinate(2,3) ! ¶ËºÂɸɽ¼¨(ÊгÑÈÏ°Ï(1¡Á2),ɽ¼¨°ÌÃÖ(1¡Á4))

SUB red_point1
   IF SGN(x0)<>SGN(x9) THEN LET rx0=0 ELSE LET rx0=MIN(ABS(x0),ABS(x9))
   IF SGN(y0)<>SGN(y9) THEN LET ry0=0 ELSE LET ry0=MIN(ABS(y0),ABS(y9))
   LET r1=SQR(rx0^2+ry0^2)  ! Æ°·ÂºÇ¾®ÃÍ
   LET r9=SQR(MAX(ABS(x0),ABS(x9))^2+MAX(ABS(y0),ABS(y9))^2) ! Æ°·ÂºÇÂçÃÍ
   LET r8=r1+(r9-r1)/SQR(2) ! ÀÖÅÀ°ÜưȾ·Â
   LET x1=r8*COS(t0)
   LET y1=r8*SIN(t0)
END SUB
SUB red_point2
   LET x2=r8*COS(t)
   LET y2=r8*SIN(t)
   SET POINT STYLE 3
   SET POINT COLOR 0
   PLOT POINTS : x1,y1
   SET POINT COLOR 4
   PLOT POINTS : x2,y2 ! ÀÖÅÀ*
   LET x1=x2
   LET y1=y2
   SET POINT STYLE 1
   SET POINT COLOR 1
END SUB

END


REM ¶ËºÂɸ¼´(Æ°·Âɽ¼¨°ÌÃÖ,ÊгÑɽ¼¨ÈÏ°Ï,¼´,Æ°·ÂÌÜÀ¹´Ö³Ö,ÊгÑÌÜÀ¹´Ö³Ö)
EXTERNAL PICTURE polar(rn,tn,ag$,rs,ts)
! rn=Æ°·Âɽ¼¨°ÌÃÖ(0̵,1»ÏÀþ,2½½»ú¾õ,3Êü¼Í¾õ) ; tn=ÊгÑɽ¼¨ÈÏ°Ï(0̵,1[-180¡Á180],2[0¡Á360])
! ag$=¼´("axis"»ÏÀþ¤Î¤ß,"grid"±ßÊü¼Í³Ê»Ò) ; rs=Æ°·ÂÌÜÀ¹´Ö³Ö(>=0) ; ts=ÊгÑÌÜÀ¹´Ö³Ö(0<=ts<360)
ASK LINE COLOR alc
ASK LINE STYLE als
ASK TEXT COLOR atc
ASK TEXT JUSTIFY atjx$,atjy$
ASK AREA COLOR aac
SET LINE COLOR 15
SET TEXT COLOR 15
SET TEXT JUSTIFY "RIGHT","TOP"
ASK WINDOW x0,x9,y0,y9
LET r9=SQR(MAX(ABS(x0),ABS(x9))^2+MAX(ABS(y0),ABS(y9))^2) ! Æ°·ÂºÇÂçÃÍ
IF SGN(x0)<>SGN(x9) THEN LET rx0=0 ELSE LET rx0=MIN(ABS(x0),ABS(x9))
IF SGN(y0)<>SGN(y9) THEN LET ry0=0 ELSE LET ry0=MIN(ABS(y0),ABS(y9))
SET LINE STYLE 1
PLOT LINES : 0,0 ; r9,0  ! ¶ËºÂɸ»ÏÀþ
IF rn>=1 THEN PLOT TEXT ,AT 0,0 : STR$(0)
IF rs>0 THEN  ! Æ°·ÂÌÜÀ¹
   ASK DEVICE SIZE PX,PY,S$
   LET r0=rs*INT(SQR(rx0^2+ry0^2)/rs) ! Æ°·ÂºÇ¾®ÌÜÀ¹
   FOR r=r0 TO r9 STEP rs
      IF LCASE$(ag$)="axis" OR LCASE$(ag$)="axes" THEN
         PLOT LINES : r,-(y9-y0)/PY/2000 ; r,(y9-y0)/PY/2000 ! »ÏÀþÌÜÀ¹
      ELSEIF LCASE$(ag$)="grid" THEN
         SET LINE STYLE 3
         DRAW CIRCLE WITH SHIFT(0,0)*SCALE(r) ! Ʊ¿´±ß
      END IF
      IF rn=>1 THEN  ! Æ°·Â¿ô»ú¤¢¤ê
         PLOT TEXT ,AT r,0 : STR$(r)     ! »ÏÀþ
         IF rn>=2 THEN
            PLOT TEXT ,AT 0,r : STR$(r)  ! ½½»ú¾õ¾å
            PLOT TEXT ,AT -r,0 : STR$(r) ! ½½»ú¾õº¸
            PLOT TEXT ,AT 0,-r : STR$(r) ! ½½»ú¾õ²¼
         END IF
      END IF
   NEXT r
END IF
IF ts>0 THEN  ! ÊгÑÌÜÀ¹
   SET LINE STYLE 3
  !FOR t=ts TO 360-ts+1E-6 STEP ts

   FOR t=ts TO 360-1E-6 STEP ts
       IF LCASE$(ag$)="grid" THEN PLOT LINES : 0,0;r9*COS(RAD(t)),r9*SIN(RAD(t)) ! Êü¼Í¾õÇËÀþ
      IF rn=3 THEN ! Æ°·Â¿ô»úÊü¼Í¾õ
         FOR r=r0 TO r9 STEP rs
            PLOT TEXT ,AT r*COS(RAD(t)),r*SIN(RAD(t)) : STR$(r)
         NEXT r
      END IF
   NEXT t
   IF tn>=1 THEN ! Êгѿô»ú¤¢¤ê(ñ°Ì;ÅÙ)
      LET r1=SQR(rx0^2+ry0^2)  ! Æ°·ÂºÇ¾®ÃÍ
      LET r5=(r1+r9)/2 ! Êгѿô»ú°ÌÃÖ
      IF rn=3 THEN SET TEXT BACKGROUND "OPAQUE"
     !FOR t=ts TO 360-ts+1E-6 STEP ts

      FOR t=ts TO 360-1E-6 STEP ts
         IF MOD(t,90)<>0 OR rn<=1 OR rs=0 THEN
            IF t<=180 OR tn=2 THEN LET a=t ELSE LET a=t-360 ! a=ÊгÑ
            CALL adjust(a)
            PLOT TEXT ,AT r5*COS(RAD(t)),r5*SIN(RAD(t)) : STR$(a)
         END IF
      NEXT t
   END IF
END IF
SET TEXT BACKGROUND "TRANSPARENT"
SET LINE COLOR alc
SET LINE STYLE als
SET TEXT COLOR atc
SET TEXT JUSTIFY atjx$,atjy$
SET AREA COLOR aac

SUB adjust(d) ! Êгѿô»ú°ÌÃÖÄ´À°
   IF ABS(d)<=67.5 OR d>=292.5 THEN
      LET tj1$="LEFT"
   ELSEIF ABS(d)>67.5 AND ABS(d)<112.5 OR d>247.5 AND d<292.5 THEN
      LET tj1$="CENTER"
   ELSE
      LET tj1$="RIGHT"
   END IF
   IF ABS(d)<22.5 OR d>337.5 OR ABS(d)>157.5 AND d<202.5 THEN
      LET tj2$="HALF"
   ELSEIF d>=22.5 AND d<67.5 OR d>112.5 AND d<=157.5 THEN
      LET tj2$="BASE"
   ELSEIF d>=67.5 AND d<=112.5 THEN
      LET tj2$="BOTTOM"
   ELSEIF d>=-112.5 AND d<=-67.5 OR d>=247.5 AND d<=292.5 THEN
      LET tj2$="TOP"
   ELSE
      LET tj2$="CAP"
   END IF
   SET TEXT JUSTIFY tj1$,tj2$
END SUB
END PICTURE


REM ¶ËºÂɸ(r,¦È)ɽ¼¨
EXTERNAL PICTURE p_coordinate(tn,p)
! ¥Þ¥¦¥¹¥Ý¥¤¥ó¥¿¤¬»Ø¤¹ÅÀ¤Î¶ËºÂɸ(Æ°·Â,ÊгÑ)¤òɽ¼¨
! º¸¥¯¥ê¥Ã¥¯(¥É¥é¥Ã¥°)¤Çɽ¼¨,±¦¥¯¥ê¥Ã¥¯¤Ç½ªÎ»
! tn=ÊгÑÈÏ°Ï(1[-¦Ð<¦È<=¦Ð],2[0<=¦È<2¦Ð]) ; p=ɽ¼¨°ÌÃÖ(1±¦¾å,2º¸¾å,3º¸²¼,4±¦²¼)
ASK WINDOW x0,x9,y0,y9
ASK TEXT JUSTIFY atjx$,atjy$
ASK TEXT HEIGHT ath
ASK AREA COLOR aac
SET TEXT FONT "",10
SET AREA COLOR 0
IF SGN(x0)<>SGN(x9) THEN LET rx0=0 ELSE LET rx0=MIN(ABS(x0),ABS(x9))
IF SGN(y0)<>SGN(y9) THEN LET ry0=0 ELSE LET ry0=MIN(ABS(y0),ABS(y9))
LET r1=SQR(rx0^2+ry0^2)  ! Æ°·ÂºÇ¾®ÃÍ
LET r9=SQR(MAX(ABS(x0),ABS(x9))^2+MAX(ABS(y0),ABS(y9))^2) ! Æ°·ÂºÇÂçÃÍ
LET r9d=LOG10(r9)
LET rd=LOG10((r9-r1)/2000)
IF r9d>0 THEN LET u$=REPEAT$("-",CEIL(r9d)-1)&"%" ELSE LET u$="%"
IF rd<0 THEN LET u$=u$&"."&REPEAT$("#",CEIL(ABS(rd)))
CALL position
DO
   MOUSE POLL mx,my,ml,mr
   IF ml=1 THEN
      LET r=SQR(mx^2+my^2)  ! Æ°·Â
      WHEN EXCEPTION IN
         LET t=ANGLE(mx,my) ! ÊгÑ(-¦Ð<t<=¦Ð)
         IF tn=2 AND t<0 THEN LET t=t+2*PI ! ÊгÑ(0<=t<2¦Ð)
      USE
         LET r,t=0 ! ÆðÛÅÀ(¶Ë)
      END WHEN
      LET r$=USING$(u$,r)             ! Æ°·Â
      LET t$=USING$("-%.####",t)      ! ÊгÑ
      LET d$=USING$("---%.##",DEG(t)) ! (ÅÙ)
      PLOT AREA : x1,y1;x2,y1;x2,y2;x1,y2
      PLOT TEXT ,AT x1,y1 : r$&"  "&t$&"("&d$&"¡ë)"
   END IF
   WAIT DELAY 0.01 ! CPUÉé²Ù·Ú¸º
LOOP UNTIL mr=1    ! ±¦¥¯¥ê¥Ã¥¯¤Ç½ªÎ»
SET TEXT JUSTIFY atjx$,atjy$
SET TEXT HEIGHT ath
SET AREA COLOR aac

SUB position ! ɽ¼¨°ÌÃÖ
   ASK TEXT WIDTH(REPEAT$("W",LEN(u$)+20)) atw
   LET x1=x9
   LET x2=x9-atw
   LET y1=y9
   LET y2=y9-1.1*ath
   SELECT CASE p
   CASE 1  ! ²èÌ̱¦¾å
      SET TEXT JUSTIFY "RIGHT","TOP"
   CASE 2  ! ²èÌ̺¸¾å
      SET TEXT JUSTIFY "LEFT","TOP"
      LET x1=x0
      LET x2=x0+atw
   CASE 3  ! ²èÌ̺¸²¼
      SET TEXT JUSTIFY "LEFT","BOTTOM"
      LET x1=x0
      LET x2=x0+atw
      LET y1=y0
      LET y2=y0+1.1*ath
   CASE 4  ! ²èÌ̱¦²¼
      SET TEXT JUSTIFY "RIGHT","BOTTOM"
      LET y1=y0
      LET y2=y0+1.1*ath
   END SELECT
END SUB
END PICTURE
 

Re: ÈùʬÊýÄø¼°¤Î¿ôÃͲòË¡

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 5·î 2Æü(ÅÚ)17»þ18ʬ22ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.315[¸µµ­»ö¤Ø]

!¤É¤Ê¤¿¤«¸æÃηà ÇÒ¼Ú ¤ª´ê¤¤¤·¤Þ¤¹¡£

!Àè¤Î¥ë¥ó¥²¥¯¥Ã¥¿Ë¡¤Ç¡¢Â¾¤ÎÈùʬÍ×ÁǤò´Þ¤ß¡¢Ë½Áö¤òÀ¸¤¸¡¢¤½¤ì¤ò²¡¤¨¤ë¤¿¤á¤Ë
!°ÂÄê²½¥Ð¥Ã¥Õ¥¡¡¢f1_ f2_ ¤òÍѤ¤¤¿¤¬¡¢¤½¤ÎÀ§Èó¤ò¡¢Ê̤ÊÅù²Á²óÏ©¤ÈÌÖ²óÏ©¤Ç·×»»
!¤·Ä¾¤·¡¢Èæ³Ó¤·¤Æ³Î¤«¤á¤¿¡£¡¡°ìÃפ¹¤ëÍͤǡ¢Àµ¤·¤¤ÇÈ·Á¤À¤Ã¤¿¡£
!·×»»´Ö³Ö 0.0105Éà ¤Ç¤Ï¸ß¤¤¤Îº¹( ¥ë¥ó¥²¡¦¥¯¥Ã¥¿£±¡¢¥ë¥ó¥²¡¦¥¯¥Ã¥¿£² )¤¬ÌÜΩ¤Á
!¤Þ¤¹¤¬¡¢¡¡¡Á0.0005É䯤餤¤Ç½Å¤Ê¤ê¤Þ¤¹¡£(Á´Ê¸¥³¥Ô¡¼¡¢RUN)
!
!ÌäÂê¤Ï¡¢¥é¥×¥é¥¹ÊÑ´¹¤È¤âÈæ³Ó¤·¤è¤¦¤È¤·¤¿ºÝ¤ËÀ¸¤¸¡¢R1(b+sin¦Øt)i(t)Éôʬ¤ÎÊÑ´¹¤Ç¡¢
!»þ´Ö´Ø¿ô¤Î¡¢Äñ¹³¤ÈÅÅή¤ÎÀѤ¬¡¢

! R1(b+sin¦Øt)i(t) ¢ª R1*b*i(t)+R1*j/2*( e^(j*w*t)-e^(-j*w*t) )*i(t)
!      ¥é¥×¥é¥¹ÊÑ´¹ ¢ª R1*b*i(s)+R1*j/2*(  i(s-jw) - i(s+jw)   )

!¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¡¢i(s) ¤Ë¤Þ¤È¤Þ¤é¤º¡¢i(s)¤ò·èÄê¤Ç¤­¤º¤Ë¡¢¶¯°ú¤Ë jw=0 ¤Ç¤Î i(s)¤Ë
! s-jw, s+jw ¤òÂåÆþ¤·¤Æµá¤á¤¿ i(s) ¤òµÕÊÑ´¹¤·¤Æ i(t) ¤ò½Ð¤·¤¿¡£(źÉÕ²èÁü¤Î¼°»²¾È¡Ë
!¤·¤«¤·¡¦¡¦

!R1=30 ÉÕ¶á¤ÎÄ㤤ÃͤǤϡ¢Èæ³ÓŪ°ìÃפ¹¤ë¤â¡¢R1=100°Ê¾å¤¢¤¿¤ê¤«¤éÃø¤·¤¯³°¤ì¤ë¡£
!¸¶°ø¤Ï¡¢¶¯°ú¤Ê i(s)¤ÎÁ°Äó¤Ç¤¹¤¬¡¢»²¹ÍÎãÂê¤â¸«Åö¤¿¤é¤ºÆñ½Â¤·¤Æ¤¤¤ë¡£

!²¼¤Î laplace_ON ¤ò£±¤Ë¤¹¤ë¤È¡¢¥ë¥ó¥²¡¦¥¯¥Ã¥¿£² ¤È¤ÎÈæ³Ó¥Æ¥¹¥È¥â¡¼¥É¤ËÆþ¤ê¤Þ¤¹¡£
!¥ë¥ó¥²¡¦¥¯¥Ã¥¿£±¤Ï¡¢¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤·¤ä¤¹¤¤°Ù¡¢½ü¤¤¤Æ¤¤¤Þ¤¹¡£

!ÌäÂê¤ò´Êñ¤Ë¤¹¤ë¤¿¤á¡¢£²¼¡²óÏ©³«ÊüƱÁ³ R2¢ª1e9 ¤Ç¡¢
! E, L1, R1(1+sin¦Øt) ¤Î£³ÁǻҤΤߤÎľÎó²óÏ©¤È¤·¤Æ¡¢¤½¤ÎÅÅήi(t)¤È
!                                   R1(1+sin¦Øt)¤Î¡¢Î¾Ã¼ÅÅ°µv(t)¤ò¡¢ÉÁ¤­¤Þ¤¹¡£
! ¥é¥×¥é¥¹ÊÑ´¹¡¡¡¡¡¡v(t)³¥, i(t)ÎÐ
! ¥ë¥ó¥²¡¦¥¯¥Ã¥¿£²¡¡v(t)ÀÖ, i(t)ÀÄ  ¡Ä £²¼¡Â¦¤ÏñÆÈ¡¢L2³«Êüüv2(t)ÀÖ, i2(t)ÀĢ⣰
!---------------------------
!
OPTION ARITHMETIC COMPLEX
LET laplace_ON=0

!---------------------------¥ë¥ó¥²¡¦¥¯¥Ã¥¿£±¤Ç·×»»¡£(¥Ð¥Ã¥Õ¥¡¤¬Ìµ¤¤¤È˽Áö¤¹¤ë)
!²óÏ©¤ÎÈùʬÊýÄø¼° ¡¡¡¡r(t)=R1*(1+sin(w*t))
!
!  i1¨£¢ª¨¤M¨£¢ª¨¤i2    ¡Ê°ì¼¡Â¦¤ÎÅÅ°µÊ¿¹Õ¼°¡ËL1*(di1/dt)+r(t)*i1-M*(di2/dt)=E
!    ¨£¨¡¨¤ ¨£¨¡¨¤      ¡ÊÆó¼¡Â¦¤ÎÅÅ°µÊ¿¹Õ¼°¡ËM*(di1/dt)=L2*(di2/dt)+R2*i2
!    ¨¢  L1 L2  R2
!    E   ¨¢ ¨¦¨¡¨¥
!    ¨¢  r(t)=R1*(1+sin(w*t))
!    ¨¦¨¡¨¥
!  ¥Ð¥Ã¥Õ¥¡Ìµ¤·¤Ç¤Ï    f1(t, i1)= (di1/dt)= ( E-R1*(1+sin(w*t))*i1+M*(di2/dt) )/L1
!  Ë½Áö¤¹¤ë ÈùʬÊýÄø¼° f2(t, i2)= (di2/dt)= ( M*(di1/dt)-R2*i2 )/L2

!---------------------------¥ë¥ó¥²¡¦¥¯¥Ã¥¿£²¤Ç·×»»¡£(¥Ð¥Ã¥Õ¥¡ÉÔÍ×)
!Áê¸ß¥¤¥ó¥À¥¯¥¿¥ó¥¹ M= k*(¢åL1*L2)¤Î·ë¹ç·¸¿ô k=1 ¤È¤·¤Æ¡¢Ï³¤ì¼§Â«¤Î̵¤¤¾ì¹ç¡¢
!²óÏ©¤Îi1¦¤Ë·¤¨¤ë£Ô·¿Åù²Á²óÏ©¤Ç¡¢ÌÖÏ©¤òÊѹ¹¡£
!
!    ¨£ i31¢ª¨¤         ¾å¤Î²óÏ©¤ÈÅù²Á¤Ê i2 =(i31+i21)*SQR(L1/L2)
!        ¨£¢ª¨¤i21
!    ¨£¨¡¨¨¨¡¨¤                 (i31¤ÎÌÖÏ©) R2*L1/L2*(i31+i21) +r(t)*i31= E
!    ¨¢  L1  R2*L1/L2           (i21¤ÎÌÖÏ©) R2*L1/L2*(i31+i21) +L1*(di21/dt)= 0
!    E   ¨§¨¡¨¥
!    ¨¢  r(t)=R1*(1+sin(w*t))
!    ¨¦¨¡¨¥
!                                              i31= (E-R2*L1/L2*i21) /(r(t)+R2*L1/L2)
!                              E+L1*(di21/dt)= r(t)*i31
!                           ¡¡¡¡E+L1*(di21/dt)= r(t)*(E-R2*L1/L2*i21) /(r(t)+R2*L1/L2)
!                                    (
!                                     )
!ÌäÂê¤Î̵¤¤ ÈùʬÊýÄø¼° f21(t, i21)= (di21/dt)= -(E+r(t)*i21) /(L2/R2*r(t)+L1)

!-------------------------------
LET E=10
LET R1=1000
LET L1=20
LET L2=20
LET R2=1000
LET M=SQR(L1*L2) !·ë¹ç·¸¿ô k=1
!
LET b=1
LET w=2*PI*1 !1Hz
DEF r(t)=R1*(b+SIN(w*t))
!
IF laplace_ON=1 THEN
   LET R1=30
   LET R2=1e9
END IF
!
!-----¥ë¥ó¥²¡¦¥¯¥Ã¥¿£±
DEF f1(t,i1)=( E-r(t)*i1+M*f2_ )/L1 ! f2_¡ÄľÀܤÎf2()¤Ï¡¢ÉÔ²Ä
DEF f2(t,i2)=( M*f1_-R2*i2 )/L2     ! f1_¡ÄľÀܤÎf1()¤Ï¡¢ÉÔ²Ä

SUB RungeKutta_1(t,i1,i2)
   LET k1=f1(t,i1)
   LET k2=f1(t+dt/2, i1+k1*dt/2)
   LET k3=f1(t+dt/2, i1+k2*dt/2)
   LET k4=f1(t+dt,   i1+k3*dt )
   LET i1=i1+(k1+2*k2+2*k3+k4)*dt/6
   LET f1_=f1(t,i1) ! f1_¡Äf1()¤Î¥Ð¥Ã¥Õ¥¡
   !
   LET k1=f2(t,i2)
   LET k2=f2(t+dt/2, i2+k1*dt/2)
   LET k3=f2(t+dt/2, i2+k2*dt/2)
   LET k4=f2(t+dt,   i2+k3*dt )
   LET i2=i2+(k1+2*k2+2*k3+k4)*dt/6
   LET f2_=f2(t,i2) ! f2_¡Äf2()¤Î¥Ð¥Ã¥Õ¥¡
END SUB

!-----¥ë¥ó¥²¡¦¥¯¥Ã¥¿£²
DEF i31=(E-R2*L1/L2*i21)/(r(t)+R2*L1/L2)
DEF f21(t,i21)=-(E+r(t)*i21)/(L2/R2*r(t)+L1)
DEF i20=(i31+i21)*SQR(L1/L2)

SUB RungeKutta_2(t,i21)
   LET k1=f21(t,i21)
   LET k2=f21(t+dt/2, i21+k1*dt/2)
   LET k3=f21(t+dt/2, i21+k2*dt/2)
   LET k4=f21(t+dt,   i21+k3*dt )
   LET i21=i21+(k1+2*k2+2*k3+k4)*dt/6
END SUB

!-----¥é¥×¥é¥¹µÕÊÑ´¹
DIM Xr(5)
!   xr(0)=0 ¡Äº¬¤Ï£¶¸Ä¡¢£°¤Ï¼«ÌÀ¤Ç°ø¿ôʬ²ò¤«¤é½ü¤¤¤¿¡£
LET Xr(1)=-R1*b/L1
LET Xr(2)=COMPLEX(0,w)
LET Xr(3)=COMPLEX(-R1*b/L1,w)
LET Xr(4)=COMPLEX(0,-w)
LET Xr(5)=COMPLEX(-R1*b/L1,-w)
FOR j=1 TO 5
   PRINT Xr(j)
NEXT j
DEF Gs(s)=E/L1*( (s^2+w^2)*((s+R1*b/L1)^2+w^2) -R1/L1*s*w*(2*s+R1*b/L1) )*EXP(s*t)
DEF k_0=Gs(0    )/ (       (0    -Xr(1))*(0    -Xr(2))*(0    -Xr(3))*(0    -Xr(4))*(0    -Xr(5)) )
DEF k_1=Gs(Xr(1))/ ( Xr(1)              *(Xr(1)-Xr(2))*(Xr(1)-Xr(3))*(Xr(1)-Xr(4))*(Xr(1)-Xr(5)) )
DEF k_2=Gs(Xr(2))/ ( Xr(2)*(Xr(2)-Xr(1))              *(Xr(2)-Xr(3))*(Xr(2)-Xr(4))*(Xr(2)-Xr(5)) )
DEF k_3=Gs(Xr(3))/ ( Xr(3)*(Xr(3)-Xr(1))*(Xr(3)-Xr(2))              *(Xr(3)-Xr(4))*(Xr(3)-Xr(5)) )
DEF k_4=Gs(Xr(4))/ ( Xr(4)*(Xr(4)-Xr(1))*(Xr(4)-Xr(2))*(Xr(4)-Xr(3))              *(Xr(4)-Xr(5)) )
DEF k_5=Gs(Xr(5))/ ( Xr(5)*(Xr(5)-Xr(1))*(Xr(5)-Xr(2))*(Xr(5)-Xr(3))*(Xr(5)-Xr(4))               )
DEF k0_5=re(k_0+k_1+k_2+k_3+k_4+k_5) !α¿ô¤ÎÏÂ

!-----run
SET TEXT background "OPAQUE"
DIM baki(10),bakv(10) ! drawing channels
!
FOR dt=0.0105 TO 0.000499 STEP -0.001 !±é»»¥Ô¥Ã¥Á sec. pitch time
   IF laplace_ON=1 THEN LET dt=.0005
   SET DRAW mode hidden
   CLEAR
   SET DRAW mode explicit
   LET t=0 !·×»»³«»Ï sec. calculation start
   LET ts=0 !ÉÁ²è³«»Ï sec. drawing start
   LET tw=3 !ÉÁ²è»þ´Ö sec. drawing time
   LET Vw=28 !¡ÜÌÜÀ¹¾å¸Â(¾å¦¥°¥é¥Õ)£±¤ÎÇÜ¿ô¡¢Volt.Ampere. maximum scale
   LET ofs=15 !¡ÜÌÜÀ¹¾å¸Â(²¼Â¦¥°¥é¥Õ)£µ¤ÎÇÜ¿ô¡¢Under_Graph offset !CEIL(Vw/10)*5
   !
   LET i21= -E/R1   ! ¥ë¥ó¥²¡¦¥¯¥Ã¥¿£² ½é´üÃÍ( i1=i31¢«i21, i2=i20¢«i21+i31) at t=0
   LET i1=i31       !¨¤
   LET i2=i20       !¨«¥ë¥ó¥²¡¦¥¯¥Ã¥¿£± ½é´üÃÍ! at t=0
   LET f2_=f2(t,i2) !¨¥
   !
   IF laplace_ON=1 THEN LET i21=0
   !
   SET WINDOW -.06*tw, tw, -Vw,Vw
   SET COLOR MIX(15) .5,.5,.5
   DRAW grid(1,5)
   PLOT TEXT,AT .1,Vw*0.92,USING"·×»»´Ö³Ö=#.###### Éᣡ¡·×»»³«»Ï¸å###.### É䫤é¤ÎÉÁ²è":dt,ts
   PLOT TEXT,AT .1,Vw*0.86,USING"¦Ø=#.##rad/s E=##V L1=##H L2=##H k=1 R1=####¦¸ R2=####¦¸":w,E,L1,L2,R1,R2
   PLOT TEXT,AT .1,-0.1*Vw:"r(t)="& STR$(R1)& "*("& STR$(b)& "+sin¦Øt)"
   DO
      IF laplace_ON=1 THEN
      !-----¥é¥×¥é¥¹
         CALL Grph( "green","i1(x20mA)", K0_5*50, "gray","v1(x1V)", K0_5*r(t) , 8, 0)
      ELSE
      !-----¥ë¥ó¥²¡¦¥¯¥Ã¥¿£±
         CALL Grph( "blue","i1(x20mA)", i1*50 , "red","v1(x1V)",r(t)*i1          , 1, 0)
         CALL Grph( "blue","i1(x20mA)", i1*50 , "red","v1(x1V)", E-(L1*f1_-M*f2_), 2, 0)
         CALL Grph( "blue","i2(x2mA)" ,-i2*500, "red","v2(x1V)", L2*f2_-M*f1_    , 3, ofs )
         CALL Grph( "blue","i2(x2mA)" ,-i2*500, "red","v2(x1V)",-R2*i2           , 4, ofs )
         CALL RungeKutta_1(t,i1,i2)
      END IF
      !-----¥ë¥ó¥²¡¦¥¯¥Ã¥¿£²
      CALL Grph( "blue","i1(x20mA)", i31*50 , "red","v1(x1V)", r(t)*i31       , 5, 0)
      CALL Grph( "blue","i1(x20mA)", i31*50 , "red","v1(x1V)", E+L1*f21(t,i21), 6, 0)
      CALL Grph( "blue","i2(x2mA)" ,-i20*500, "red","v2(x1V)",-R2*i20         , 7, ofs)
      CALL RungeKutta_2(t, i21)
      !-----
      LET t=t+dt
   LOOP UNTIL ts+tw< t
NEXT dt

!-----draw
SUB Grph( icol$,i$,i, vcol$,v$,v, n, ofs)
   SET WINDOW -.06*tw, tw, -Vw+ofs, Vw+ofs
   IF ts< t THEN
      SET LINE COLOR vcol$
      PLOT LINES :t-ts-dt, bakv(n); t-ts, v
      SET LINE COLOR icol$
      PLOT LINES :t-ts-dt, baki(n); t-ts, i
   ELSEIF t=ts THEN
      SET TEXT COLOR vcol$
      PLOT TEXT,AT .1, .17*Vw :v$
      SET TEXT COLOR icol$
      PLOT TEXT,AT .1, .11*Vw :i$
      IF ofs<>0 THEN
         SET LINE COLOR 15
         PLOT LINES :-.06*tw, 0; tw,0
         SET TEXT COLOR 15
         ASK PIXEL SIZE (0,0 ;tw,Vw) px,py
         FOR j=5*INT((-Vw+ofs)/5+1) TO ofs-1 STEP 5
            PLOT TEXT,AT -22*tw/px, j-15*Vw/py, USING"###":j
         NEXT j
      END IF
      SET TEXT COLOR 1
   END IF
   LET baki(n)=i
   LET bakv(n)=v
END SUB

END
 

Re: ÈùʬÊýÄø¼°¤Î¿ôÃͲòË¡

 Åê¹Æ¼Ô¡§¤·¤Þ¤à¤é1243  Åê¹ÆÆü¡§2009ǯ 5·î 5Æü(²Ð)21»þ04ʬ16ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.343[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

SECOND¤µ¤ó¡¢¤¤¤í¤¤¤í¤´¸¡Æ¤Äº¤¤¤ÆÍ­¤êÆñ¤¦¤´¤¶¤¤¤Þ¤¹¡£

!---------------------------¥ë¥ó¥²¡¦¥¯¥Ã¥¿£²¤Ç·×»»¡£(¥Ð¥Ã¥Õ¥¡ÉÔÍ×)
!Áê¸ß¥¤¥ó¥À¥¯¥¿¥ó¥¹ M= k*(¢åL1*L2)¤Î·ë¹ç·¸¿ô k=1 ¤È¤·¤Æ¡¢Ï³¤ì¼§Â«¤Î̵¤¤¾ì¹ç¡¢
!²óÏ©¤Îi1¦¤Ë·¤¨¤ë£Ô·¿Åù²Á²óÏ©¤Ç¡¢ÌÖÏ©¤òÊѹ¹¡£
!ÌäÂê¤Î̵¤¤ ÈùʬÊýÄø¼° f21(t, i21)= (di21/dt)= -(E+r(t)*i21) /(L2/R2*r(t)+L1)

ÊÑ°µ´ï¤Î°ì¼¡Â¦´¹»»Åù²Á²óÏ©¤Ç¹Í¤¨¤ë¤³¤Î°Æ¡¢¤¤¤¤¤Ç¤¹¤Í¡£
¸¶¼°¤Ë¤·¤¿¤¬¤Ã¤ÆÃé¼Â¤Ë·×»»¤¹¤ë¤Î¤¬°ìÈÖÀµ³Î¤À¤È¹´¤Ã¤Æ¤¤¤Æµ¤ÉÕ¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£

¤¿¤À°ìÀ£Åŵ¤Åª¤ËÍý²ò¤Ç¤­¤Ê¤¤¤Î¤Ï¡¢Åù²Á²óÏ©Êý¼°¤Ç¤Ïk=1¤Î¾ì¹ç¤ò°·¤¨¤ë¤Î¤Ë¡¢¸¶¼°¤«¤é¹ÔÎó¤ò»È¤Ã¤Æ¥ë¥ó¥²¡¦¥¯¥Ã¥¿Ë¡¤òŬÍѤǤ­¤ëϢΩÈùʬ¼°¤òƳ¤«¤ì¤¿ »³Ã椵¤ó¤Î¼°¤À¤Èk=1¤Î¾ì¹ç¤¬°·¤¨¤Ê¤¤¡¢¤È¤¤¤¦ÅÀ¤Ç¤¹¡£Åù²Á²óÏ©¤â»³Ã椵¤ó¤ÎϢΩÈùʬ¼°¤â¡¢Æ±¤¸¸¶¼°¤«¤éÁȤßΩ¤Æ¤é¤ì¤¿¤â¤Î¤Ê¤Î¤Ç¤¹¤¬¡£¡£¤Ç¤â¤³¤ì¤Ï¥× ¥í¥°¥é¥ß¥ó¥°¤È¤ÏÊ̤ÎÌäÂê¤Ç¤¹¤Í¡£

¤µ¤Æ¥é¥×¥é¥¹ÊÑ´¹¤òÍøÍѤ·¤Æ¥ë¥ó¥²¡¦¥¯¥Ã¥¿¤Î½¤ÀµË¡¤ò¸¡¾Ú¤·¤è¤¦¤È

!¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¡¢i(s) ¤Ë¤Þ¤È¤Þ¤é¤º¡¢i(s)¤ò·èÄê¤Ç¤­¤º¤Ë¡¢¶¯°ú¤Ë jw=0 ¤Ç¤Î i(s)¤Ë
! s-jw, s+jw ¤òÂåÆþ¤·¤Æµá¤á¤¿ i(s) ¤òµÕÊÑ´¹¤·¤Æ i(t) ¤ò½Ð¤·¤¿¡£(źÉÕ²èÁü¤Î¼°»²¾È¡Ë

¤È¤µ¤ì¤Æ¤¤¤Þ¤¹¤¬¡¢t=¡Ü0¤Ç¡Ê¤Ï̤¤À¸òή¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¤«¤é¡Ëjw=0¤È¤¹¤ë¡¢¤È¤¤¤¦¼êË¡¤Ïsin(wt)¤Î¥é¥×¥é¥¹ÊÑ´¹¤Î¸¶·¿¤¬Êø¤µ¤ì¤Æ¤·¤Þ¤¦¤Î¤Ç¡¢Íý¶þŪ¤ËÉÔ¹çÍý¤Ë¤Ê¤Ã¤Æ̵Íý¤Ç¤Ï¤Ê¤¤¤«¤È»×¤¤¤Þ¤¹¡£
¤Ç¤Ï¡¢²¿¤«¹ª¤¤ÊýË¡¤Ï¡©¤È¸À¤ï¤ì¤ë¤È¡¢¥é¥×¥é¥¹ÊÑ´¹¤ÏÄê·¸¿ô¤ÎÈùʬ¼°¤ËÍ­ÍѤǤ¢¤Ã¤Æ¡¢ÊÑ·¸¿ô¤ÎÈùʬ¼°¤ËŬÍѽÐÍè¤Ê¤¤¤Î¤Ç¤Ï¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£»ÄÇ°¤Ê¤¬¤é¼ê¸µ¤Î¹©³ØÍÑ¿ô³Ø½ñ¤È¥Í¥Ã¥È¸¡º÷¤·¤¿¸Â¤ê¤Ç¤Ï¤½¤ÎÍͤʵ­ºÜ¤·¤«Ìµ¤«¤Ã¤¿¤Ç¤¹¡£

»ä¤Ï»³Ã椵¤ó¤¬Æ³¤«¤ì¤¿Ï¢Î©Èùʬ¼°¤Ë¥ë¥ó¥²¡¦¥¯¥Ã¥¿Ë¡¤òŬÍѤ·¤¿¤â¤Î¤È¡¢SECOND¤µ¤ó¤¬ºîÀ®¤µ¤ì¤¿¥ë¥ó¥²¡¦¥¯¥Ã¥¿½¤ÀµË¡¤È¤òƱ¤¸¾ò·ï¤Ç·×»»¤·¤Æ¤ß¤Þ¤· ¤¿¤¬¡¢t=¡Ü0¤ÎΩ¤Á¾å¤¬¤êÉÕ¶á¤ÇSECOND¤µ¤ó¤ÎÇÈ·Á¤Ë¤Ï¹â¼þÇÈ¿¶Æ°¤¬´Þ¤Þ¤ì¤Æ¤¤¤¿ÅÀ¤ò½ü¤±¤Ð¡¢¤Ô¤Ã¤¿¤ê¹ç¤Ã¤Æ¤¤¤Þ¤·¤¿¡£
 

Re: ÈùʬÊýÄø¼°¤Î¿ôÃͲòË¡

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 5·î 5Æü(²Ð)22»þ50ʬ21ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.345[¸µµ­»ö¤Ø]

¤·¤Þ¤à¤é1243¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¤³¤ó¤Ë¤Á¤Ï¡¢Ä´ºº¤·¤Æ夤¤¿¤è¤¦¤Ç¡¢ÂçÊÑ´¶¼Õ¤·¤Þ¤¹¡£¤Ç¤âº£¤Î»ä¤Ë¤Ï¡¢

> ¤Ç¤Ï¡¢²¿¤«¹ª¤¤ÊýË¡¤Ï¡©¤È¸À¤ï¤ì¤ë¤È¡¢¥é¥×¥é¥¹ÊÑ´¹¤ÏÄê·¸¿ô¤ÎÈùʬ¼°¤ËÍ­ÍѤǤ¢¤Ã¤Æ¡¢ÊÑ·¸¿ô¤ÎÈùʬ¼°¤ËŬÍѽÐÍè¤Ê¤¤¤Î¤Ç¤Ï¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£»ÄÇ°¤Ê¤¬¤é¼ê¸µ¤Î¹©³ØÍÑ¿ô³Ø½ñ¤È¥Í¥Ã¥È¸¡º÷¤·¤¿¸Â¤ê¤Ç¤Ï¤½¤ÎÍͤʵ­ºÜ¤·¤«Ìµ¤«¤Ã¤¿¤Ç¤¹¡£

¤³¤Îʸ¤À¤±¤·¤«¡¢ÌܤËÆþ¤ê¤Þ¤»¤ó¡£ËÜÅö¤ËÉÔ²Äǽ¤Ê¤Î¤«Èݤ«¡¢¤Ë¤ï¤«¤Ë¤Ï¼õ¤±Æþ¤ì¤¬¤¿¤¯
¤â¤¦¤·¤Ð¤é¤¯¤Ï¡¢Ãµº÷¤Ë¤³¤À¤ï¤Ã¤Æ¤ß¤Þ¤¹¡£¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
 

ÉÁ²è¸øɽ¤È¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§Ï»¹Ã¤Î½é¿´¼Ô  Åê¹ÆÆü¡§2009ǯ 5·î 9Æü(ÅÚ)04»þ36ʬ37ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ½é¤á¤ÆÅê¹Æ¤·¤Þ¤¹¡£¶µ¤¨¤Æ¤¤¤¿¤À¤¯»ö¹à¤À¤±¤Ç¤â¤¤¤¤¤Î¤Ç¤·¤ç¤¦¤«¡£
¤¢¤ëʪÍý¸½¾Ý¤Ë¤Ä¤¤¤Æ¤½¤ì¤ò»þ´ÖŪÊѲ½¤Çɽ¼¨¤¹¤ë¥¢¥ë¥´¥ê¥º¥à¤ò»×¤¤¤Ä¤­BASIC¤Ç½ñ¤­¤Þ¤·¤¿
¤³¤Î·ë²Ì¤ò¸øɽ¤·¤ÆÍ­ÍѤʤâ¤Î¤«¤É¤¦¤«É¾²Á¤ò¤¤¤¿¤À¤±¤ì¤Ð¤È¹Í¤¨¤ë¤Î¤Ç¤¹¤¬¡£
¤Þ¤º¡¢¸øɽ¤Î¼êÃʤ⤵¤À¤«¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£¥Û¡¼¥à¥Ú¥¸¡Ê̤ºî¡Ë¾å¡¢Æ°²èÅê¹Æ¡¢¤Ê¤É¡£
¤¤¤º¤ì¤«¤Î¾ì¹ç¤â¡¢¤Þ¤À¥×¥í¥°¥é¥à¤ò¸øɽ¤»¤º¤ËºÑ¤à¤³¤È¤¬´õ˾¤Ê¤Î¤Ç¤¹¤¬²Äǽ¤Ê¤Î¤Ç¤·¤ç¤¦¤«¡£
¶µ¤¨¤Æ¤¤¤¿¤À¤±¤ì¤Ð¹¬¤¤¤Ç¤¹¡£
 

Re: ÉÁ²è¸øɽ¤È¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 5·î10Æü(Æü)00»þ19ʬ30ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.347[¸µµ­»ö¤Ø]

Ï»¹Ã¤Î½é¿´¼Ô¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¥Ø¥ë¥×¡¦¥Õ¥¡¥¤¥ëËÁƬ¤Î¡¢
(²¾¾Î)½½¿ÊBASIC¤Ë¤Ä¤¤¤Æ¢ª¡Ö»ÈÍѵ¬Äꤪ¤è¤ÓÃøºî¸¢¡×¤ÎÃæ¤Ë¡¢

¡Ö(²¾¾Î)½½¿ÊBASIC¤Ï¶µ°é¸¦µæ¤òÌÜŪ¤È¤·¤ÆºîÀ®¤µ¤ì¤¿¥×¥í¥°¥é¥à¤Ç¤¹¡£
¡¡¡¡ËÜBASIC¤òÍøÍѤ·¤ÆÆÀ¤é¤ì¤¿¸¦µæ·ë²Ì¤Ïɬ¤º¸ø³«¤·¤Æ¤¯¤À¤µ¤¤¡£¡×¡¡¤È¤¢¤ê¤Þ¤¹¡£

À§È󡢸ø³«¤·¤Æ²¼¤µ¤¤¡£Ãøºî¸¢¤Ê¤É¤Ë¤Ï¡¢Ìµ´Ø·¸¤À¤È»×¤¤¤Þ¤¹¡£
¿ô³ØŪ°ä»º¤Ï¡¢²áµî¤Ë¹âÅ٤ʤâ¤Î¤¬Â¿¤¯¡¢¼º¤ï¤ì¤Æ¤¤¤ë¤À¤±¤«¤âÃΤì¤Þ¤»¤ó¡£
»ä¼«¿È Êú¤¨¤ëÌäÂê¤Ê¤É¤â¡¢²¿½è¤«¤Ç²ò·è¤µ¤ì¤Æ¤¤¤Æ¡¢Ëº¤ìµî¤é¤ì¤¿¤â¤Î
¤Ç¤Ï¡¢¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£
 

Re: ÉÁ²è¸øɽ¤È¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§Ï»¹Ã¤Î½é¿´¼Ô  Åê¹ÆÆü¡§2009ǯ 5·î10Æü(Æü)08»þ40ʬ0ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.348[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹
»ä¤Îɽ¸½¤¬Â­¤é¤Ê¤¤¤È¤³¤í¤â¤¢¤Ã¤¿¤Î¤Ç¤¹¤¬¡¢¹Í¤¨¤¿¥×¥í¥»¥¹¤Ï¾ï¤Ë¸øɽ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢¤½¤ì¤¬½ÐÍè¤Ê¤±¤ì¤Ð¾¤Î¸À¸ì¤ËÊѤ¨¤Ê¤µ¤¤¤È¤¤¤¦¤³¤È¤Ç¤¹¤Í
λ²ò¤·¤Þ¤·¤¿

¤¿¤À¡¢BASIC¤Ï»Ò¶¡¤Î¤³¤í¤«¤é°Õ¼±¤»¤º¤Ë½ñ¤­¤È¤á¤Æ¤­¤Þ¤·¤¿¤Î¤Ç²¿¤«ç¥¤ËÍî¤Á¤Ê¤¤µ¤¤¬¤·¤Æ¤¤¤Þ¤¹¤¬


> Ï»¹Ã¤Î½é¿´¼Ô¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£
>
> ¥Ø¥ë¥×¡¦¥Õ¥¡¥¤¥ëËÁƬ¤Î¡¢
> (²¾¾Î)½½¿ÊBASIC¤Ë¤Ä¤¤¤Æ¢ª¡Ö»ÈÍѵ¬Äꤪ¤è¤ÓÃøºî¸¢¡×¤ÎÃæ¤Ë¡¢
>
> ¡Ö(²¾¾Î)½½¿ÊBASIC¤Ï¶µ°é¸¦µæ¤òÌÜŪ¤È¤·¤ÆºîÀ®¤µ¤ì¤¿¥×¥í¥°¥é¥à¤Ç¤¹¡£
> ¡¡¡¡ËÜBASIC¤òÍøÍѤ·¤ÆÆÀ¤é¤ì¤¿¸¦µæ·ë²Ì¤Ïɬ¤º¸ø³«¤·¤Æ¤¯¤À¤µ¤¤¡£¡×¡¡¤È¤¢¤ê¤Þ¤¹¡£
>
> À§È󡢸ø³«¤·¤Æ²¼¤µ¤¤¡£Ãøºî¸¢¤Ê¤É¤Ë¤Ï¡¢Ìµ´Ø·¸¤À¤È»×¤¤¤Þ¤¹¡£
> ¿ô³ØŪ°ä»º¤Ï¡¢²áµî¤Ë¹âÅ٤ʤâ¤Î¤¬Â¿¤¯¡¢¼º¤ï¤ì¤Æ¤¤¤ë¤À¤±¤«¤âÃΤì¤Þ¤»¤ó¡£
> »ä¼«¿È Êú¤¨¤ëÌäÂê¤Ê¤É¤â¡¢²¿½è¤«¤Ç²ò·è¤µ¤ì¤Æ¤¤¤Æ¡¢Ëº¤ìµî¤é¤ì¤¿¤â¤Î
> ¤Ç¤Ï¡¢¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£
 

Re: ÉÁ²è¸øɽ¤È¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 5·î10Æü(Æü)10»þ43ʬ57ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.349[¸µµ­»ö¤Ø]

Ï»¹Ã¤Î½é¿´¼Ô¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

>¾¤Î¸À¸ì¤ËÊѤ¨¤Ê¤µ¤¤¤È¤¤¤¦¤³¡¦¡¦¡¦

¤Ç¤Ï¡¢¤Ê¤¤¤È»×¤¤¤Þ¤¹¡£¸í²ò¤µ¤ì¤Þ¤·¤¿¤Î¤Ç¤¢¤ì¤Ð¡¢¸æÏͤӤ·¤Þ¤¹¡£
¤³¤ì¤Ï¡¢ÀèÀ¸¤Î¤´´õ˾¤È´üÂԤǡ¢¶¯Íפΰտޤϡ¢ÀäÂФˤʤ¤¤È»×¤¤¤Þ¤¹¡£
 

!¥¹¥«¥¤¡¦¥¦¥§¥¤

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 5·î10Æü(Æü)13»þ25ʬ52ÉÃ
ÊÖ¿®¡¦°úÍÑ
  !¤³¤ó¤Ê¤â¤Î¤¬¡¢½Ð¤ÆÍ褿¡£¡ÊºÆÅê¹Æ¡©¡¢ºÆ¡¹¡¦¡¦ÉÔÌÀ¡Ë
!¤³¤Î¥¢¥Ë¥á¤Ï¡¢»³ÃæϵÁ»á¤Î¥¬¥¤¥É¤Ë¤è¤ê¡¢ÂçÀΤ·¤Ë¡¢ºîÀ®¤·¤¿¤â¤Î¤Ç¤¹¡£

!¥¹¥«¥¤¡¦¥¦¥§¥¤
!-----
DIM Tr(4,4),Mv(4,4),Mp(4,4) !Èï¼ÌÂΰÜÆ°¡¢»ëÅÀ°ÜÆ°¡¢¥×¥í¥¸¥§¥¯¥·¥ç¥óÊÑ´¹
DIM mx(4,4),Xz(4,4),zY(4,4) !ºî¶ÈÍÑ¡¢XY_XzÊÑ´¹¡¢XY_zYÊÑ´¹

MAT Tr=IDN
MAT Mv=IDN

!-----£Ù¼´¢ª£Ú¼´¡¡XYÊ¿ÌÌ¿Þ¢ªXZÊ¿ÌÌ¿Þ
MAT READ Xz
DATA 1,0,0,0
DATA 0,0,1,0 !Xz(2,1)=Z¼´¿åÊ¿·¹¼Ð¡¢Xz(2,2)=Z¼´¿âľ·¹¼Ð
DATA 0,0,0,0
DATA 0,0,0,1 !Xz(4,2)=ÁýÀßYºÂɸ

!-----£Ø¼´¢ª£Ú¼´¡¡XYÊ¿ÌÌ¿Þ¢ªZYÊ¿ÌÌ¿Þ
MAT READ zY
DATA 0,0,1,0 !zY(1,1)=Z¼´¿åÊ¿·¹¼Ð¡¢zY(1,2)=Z¼´¿âľ·¹¼Ð
DATA 0,1,0,0
DATA 0,0,0,0
DATA 0,0,0,1 !zY(4,1)=ÁýÀßXºÂɸ

!-----3D(X,Y,Z)¢ª2D(X,Y)/Z¡¡¥×¥í¥¸¥§¥¯¥·¥ç¥óÊÑ´¹¡¡Mp(¹Ô,Îó)

SET WINDOW -1,1,-1,1 ! ²èÌÌ¥¹¥±¡¼¥ë¤Ç¡¢Åê±Æµ÷ΥĴÀ°¡£
!¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¹ÔÎó¤Ï¡¢£±¤ËÀµµ¬²½¤·¤¿¡£
MAT READ Mp
DATA 1,0,0,0 !(X,Y,Z,1)¢ª(1X,1Y,1Z,1Z)¡¡£³ÎóÌܤÎ1Z ¤Ï̵¸ú¡£
DATA 0,1,0,0 !
DATA 0,0,1,1 !¡¡¡¡¡¡¡¡¡¡¡¡£´ÎóÌܤÎ1Z¢ª ÉÁ²èÇÜΨ=1/1Z ¤Ç ±ó¶á¸ú²Ì¤¹¤ë¡£
DATA 0,0,0,0 !¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡(µ÷Î¥£±¤Ø¤ÎÅê±Æ)

!-----
!¸¶²è_¹Ô¥Ù¥¯¥È¥ë¡¡Tr¡¡¡¡¡¡ÏÀÍý_¹Ô¥Ù¥¯¥È¥ë
!¡¡¡¡¡ÊX,Y,0,1)|1 0 0 0| ¢ª¡ÊX,Y,Z,1¡ËZ ºÂɸ¤ÎÄɲá£
!¡¡¡¡¡¡¡¡¡¡¡¡¡¡|0 1 0 0|
!¡¡¡¡¡¡¡¡¡¡¡¡¡¡|0 0 1 0|
!¡¡¡¡¡¡¡¡¡¡¡¡¡¡|0 0 Z 1|
!ÏÀÍý_¹Ô¥Ù¥¯¥È¥ë¡¡¡¡Mv¡¡¡¡¡¡ÏÀÍý_¹Ô¥Ù¥¯¥È¥ë
!¡¡¡¡¡ÊX,Y,Z,1)|1¡¡0¡¡0¡¡0| ¢ª¡ÊX-x,Y-y,Z-z,1¡Ë»ëÅÀ(x,y,z¡Ë¤«¤é¤ÎÁêÂкÂɸ¡£
!¡¡¡¡¡¡¡¡¡¡¡¡¡¡|0¡¡1¡¡0¡¡0|
!¡¡¡¡¡¡¡¡¡¡¡¡¡¡|0¡¡0¡¡1¡¡0|
!¡¡¡¡¡¡¡¡¡¡¡¡¡¡|-x -y -z 1|
!ÏÀÍý_¹Ô¥Ù¥¯¥È¥ë¡¡¡¡Mp¡¡¡¡¡¡¡¡É½¼¨_¹Ô¥Ù¥¯¥È¥ë
!¡ÊX-x,Y-y,Z-z,1)|1 0 0 0| ¢ª¡ÊX-x,Y-y,Z-z,Z-z) Z ºÂɸ¤ò¡¢½Ì¾®Î¨¤Øž¼Ì¡£
!¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡|0 1 0 0|
!¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡|0 0 1 1|
!¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡|0 0 0 0|
!£´ÎóÌÜZ-z¡§ÇÜΨµÕ¿ô(ʬÊì)= 1/{Z-z}¡¡£ÚºÂɸ¢ªÅê±Æ½Ì¾®Î¨¡£

!-----
!Åù²Ã®ÅÙ±¿Æ°
DEF v(t)=v0  +a*t     !®ÅÙ
DEF d(t)=v0*t+a*t*t/2 !°ÜÆ°µ÷Î¥¡¡¢¨¢év(t)dt

LET v0=15 ! m/s ½é®ÅÙ
LET a=-v0^2/2/298 ! m/s^2 ¸ºÂ®²Ã®ÅÙ, -v0^2/2/°ÜÆ°µ÷Î¥
!
LET t0=TIME !³«»Ï
DO WHILE v(t)>0 !¸ºÂ®¡¢Ää»ß¤¹¤ë¤Þ¤Ç
   LET t=TIME-t0 !·Ð²á»þ´Ö¤òÆÀ¤ë
   IF t>tb+0.15 THEN
      LET tb=t
      PRINT USING "»þ´Ö=###.## ®ÅÙ=##.##  Áö¹Ôµ÷Î¥=###.##":t,v(t),d(t)
      SET DRAW mode hidden !΢¥Ú¡¼¥¸¤Ë½ñ¤¯¡¢¤Á¤é¤Ä¤­Ëɻߤγ«»Ï
      CALL Animation( d(t)) !°ÌÃÖd(t)¤ÎÁ°ÊýÉÁ²è
      SET DRAW mode explicit !΢¥Ú¡¼¥¸¤Îɽ¼¨¡¢¤Á¤é¤Ä¤­ËɻߤνªÎ»
   END IF
LOOP

DEF yaw(z)=10*SIN((z-2)*0.1) !¥«¡¼¥Ö¡¢²£¤ÎÊк¹
DEF d_yaw(z)= COS((z-2)*0.1) !¥«¡¼¥Ö¡¢Èùʬ·¸¿ô
DEF pitch(z)=5*SIN(z*0.1) !¥Ô¥Ã¥Á¡¢½Ä¤ÎÊк¹
DEF d_pitch(z)=0.5*COS(z*0.1) !¥Ô¥Ã¥Á¡¢Èùʬ·¸¿ô

SUB Animation(d) !-----¥Ð¥¹°ÌÃÖd ¤Î³°³¦¤òÉÁ¤¯
   CLEAR
   !----¶õ
   SET AREA COLOR 17
   PLOT AREA:-1,0; 1,0; 1,1; -1,1
   !----ÃÏ
   SET AREA COLOR 42
   PLOT AREA:-1,0; 1,0; 1,-1; -1,-1
   !----ʸ»ú
   SET TEXT COLOR 0
   SET TEXT FONT "",90
   !
   !¥Ð¥¹°ÌÃÖd ¤¬¸ÇÄê(Z=1.5m)¤¹¤ëÍÍ¤Ë »ëÅÀdd (Z=0m)¤ò¸å¤í¤Ø²¼¤²¤ë¡£
   !»ëÅÀdd(Z=0)¤òÃæ¿´¡¢¥Ð¥¹°ÌÃÖd(Z=1.5)¤ò²èÌ̤ÎÏȤ˹ç¤ï¤»¤ë¡£Åê±ÆÌÌ(Z=1.5)¤Ë¼Í±Æ¡£
   !Á°Êý170m ¤«¤é¡¢»ëÅÀdd(Z=0)¤Î 0.1mÁ°Êý(Z=0.1)¤ò¸Â³¦¤Ë¡¢¢¨±ü¤«¤éÉÁ¤¯
   !
   !----»ëÅÀ°ÜÆ°¤Î¥Þ¥È¥ê¥¯¥¹ Mv
   LET dd=d-1.5
   LET Mv(4,1)=-2-yaw(d) !¼ÖÆ»º¸Ã¼¤«¤é2m ¤Èº¸±¦Æ°
   LET Mv(4,2)=-1.5-pitch(d) !¹â¤µ1.5m ¤È¾å²¼Æ°
   LET Mv(4,3)=-dd !¥Ð¥¹°ÌÃÖd ¤Î¸åÊý1.5m
   !----
   ! 1¡¡¡¡¡¡¡¡,0¡¡¡¡¡¡¡¡¡¡¡¡,0¡¡, 0|
   ! 0¡¡¡¡¡¡¡¡,1¡¡¡¡¡¡¡¡¡¡¡¡,0¡¡, 0|
   ! 0¡¡¡¡¡¡¡¡,0¡¡¡¡¡¡¡¡¡¡¡¡,1¡¡, 0|
   !-2-yaw(d) ,-1.5-pitch(d),-dd, 1|
   !----
   FOR i=2.5*INT(d/2.5)+170 TO dd+0.1 STEP -2.5
   !¡¡----Èï¼ÌÂΰÜÆ°¤Î¥Þ¥È¥ê¥¯¥¹ Tr
      LET Tr(4,1)=yaw(i) !º¸±¦Æ°
      LET Tr(4,2)=pitch(i) !¾å²¼Æ°
      LET Tr(4,3)=i !£úºÂɸ
      !----
      ! 1¡¡¡¡¡¡,0¡¡¡¡¡¡¡¡,0, 0|
      ! 0¡¡¡¡¡¡,1¡¡¡¡¡¡¡¡,0, 0|
      ! 0¡¡¡¡¡¡,0¡¡¡¡¡¡¡¡,1, 0|
      ! yaw(i) ,pitch(i) ,i, 1|
      !----
      MAT mx=Tr*Mv*Mp
      DRAW ƻϩ WITH mx
      IF REMAINDER(i,10) =5 THEN DRAW ³¹Ï©¼ù WITH mx
      IF REMAINDER(i,10) =0 THEN
         IF REMAINDER(i,50)=0 THEN DRAW ¥Ð¥¹Ää(2)WITH mx ELSE DRAW ¥Ð¥¹Ää(4)WITH mx !(½ªÅÀ=3 ÅÓÃæ=4)
         DRAW ·úʪ(8,-9,3,3,1) WITH mx !(x,y,Éý,¹â,±ü)
         DRAW ·úʪ(-8,-9,3,3,1) WITH mx !(x,y,Éý,¹â,±ü)
      END IF
   NEXT i
END SUB

!¥Ñ¡¼¥Ä¤Î¥µ¥¤¥º¡£¥Ð¥¹¤Î°ÌÃÖd (Z=1.5m)¤Ç¡¢É½¼¨ÇÜΨ 1/z=1/1.5

PICTURE ·úʪ(x,y,w,h,d1)
!¡¡---´éÌÌ
   LET zY(1,1)=d_yaw(i+w/2) !Z¼´¿åÊ¿·¹¼Ð¡¢¥«¡¼¥Ö¤ÎÈùʬ
   LET zY(1,2)=0 !d_pitch(i+w/2) !Z¼´¿âľ·¹¼Ð¡¢¥Ô¥Ã¥Á¤ÎÈùʬ
   LET zY(4,1)=x !ÁýÀßX¼´
   DRAW Á°¸åÌÌ(y,w,h) WITH zY !¸µ¤ÎX¼´¢ªZ¼´
   !---ÇØÌÌ
   LET zY(4,1)=x+d1 !ÁýÀßX¼´
   DRAW Á°¸åÌÌ(y,w,h) WITH zY !¸µ¤ÎX¼´¢ªZ¼´
   !---²°¾å
   LET Xz(2,1)=d_yaw(i+w/2) !Z¼´¿åÊ¿·¹¼Ð¡¢£ú¼´¥«¡¼¥Ö¤ÎÈùʬ
   LET Xz(2,2)=0 !d_pitch(i+w/2) !Z¼´¿âľ·¹¼Ð¡¢£ú¼´¥Ô¥Ã¥Á¤ÎÈùʬ
   LET Xz(4,2)=y+h !ÁýÀßY¼´
   DRAW ¿åÊ¿ÌÌ(x,w,d1) WITH Xz !¸µ¤ÎY¼´¢ªZ¼´
   !---¾²ÌÌ
   LET Xz(4,2)=y !ÁýÀßY¼´
   DRAW ¿åÊ¿ÌÌ(x,w,d1) WITH Xz !¸µ¤ÎY¼´¢ªZ¼´
   !---¦ÌÌ
   SET AREA COLOR 22
   PLOT AREA:x,y; x+d1,y; x+d1,y+h; x,y+h
END PICTURE
!
PICTURE Á°¸åÌÌ(y,w,h)
   SET AREA COLOR 25
   PLOT AREA:0,y; w,y; w,y+h; 0,y+h !(Z,Y)ºÂɸ¤È¤·¤ÆÉÁ¤¯¡£
END PICTURE
PICTURE ¿åÊ¿ÌÌ(x,w,d1)
   SET AREA COLOR 25 !26
   PLOT AREA:x,0; x+d1,0; x+d1,w; x,w !(X,Z)ºÂɸ¤È¤·¤ÆÉÁ¤¯¡£
END PICTURE

PICTURE ƻϩ
   LET Xz(2,1)=d_yaw(i+2.2/2) !Z¼´¿åÊ¿·¹¼Ð¡¢£ú¼´¥«¡¼¥Ö¤ÎÈùʬ
   LET Xz(2,2)=d_pitch(i+2.2/2) !Z¼´¿âľ·¹¼Ð¡¢£ú¼´¥Ô¥Ã¥Á¤ÎÈùʬ
   LET Xz(4,2)=0 !ÁýÀßY¼´
   DRAW Ï©ÌÌ WITH Xz !¸µ¤ÎY¼´¢ªZ¼´
   !---·Ñ¤®ÌÜÀþ
   PLOT LINES:  0,0; 2.9,0
   PLOT LINES:3.1,0;   6,0
END PICTURE
PICTURE Ï©ÌÌ
   SET AREA COLOR 15
   PLOT AREA:0,0; 6,0; 6,2.2; 0,2.2 !(X,Z)ºÂɸ¤È¤·¤ÆÉÁ¤¯¡£
END PICTURE

PICTURE ³¹Ï©¼ù
   SET AREA COLOR 12 !´´
   PLOT AREA:-0.075,0; 0.075,0; 0.025,3; -0.025,3
   SET AREA COLOR 10 !ÍÕ
   FOR w=1 TO 7
      DRAW disk WITH SCALE(0.3+0.05-RND*0.1)*SHIFT(0.4-RND*0.8, 2.7+0.325-RND*0.75)
   NEXT W
END PICTURE

PICTURE ¥Ð¥¹Ää(c)
   SET AREA COLOR c
   PLOT AREA:-0.025,0; 0.025,0; 0.025,2; -0.025,2
   DRAW disk WITH SCALE(0.5)*SHIFT(0,2)
   PLOT TEXT,AT -.35,1.74,USING ">%%":STR$(i)
END PICTURE

END
 

¥×¥ì¥¤¥ê¥¹¥È¤òºî¤ë

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2009ǯ 5·î10Æü(Æü)15»þ30ʬ6ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¥×¥ì¥¤¥ê¥¹¥È¥Õ¥¡¥¤¥ë(³ÈÄ¥»Ò m3u asx)¤òºî¤ë
¥ê¥¹¥È¤ÎÊÔ½¸µ¡Ç½(¥ê¥¹¥È¤ÎÄɲᢺï½ü¡¢½çÈÖ¤ÎÆþ¤ìÂؤ¨Åù)¤Ï¤¢¤ê¤Þ¤»¤ó
̾Á°¤Ç¥½¡¼¥È¤¹¤ë¤Î¤ß


INPUT  PROMPT "INPUT FILE PATH =":PT$ !'ÀäÂХѥ¹
IF RIGHT$(PT$,1)<>"\" THEN LET PT$=PT$ & "\"
LET PA$=PT$
LET PT$=PT$ & "*.*" !'¥ï¥¤¥ë¥É¥«¡¼¥É
LET  N=FILES(PT$)
IF N > 0 THEN
   DIM N$(N),NAME$(N),EXT$(N)
   FILE LIST PT$, N$
ELSE
   PRINT "No File"
   STOP
END IF
FOR I=1 TO N
   FILE SPLITNAME(N$(I)) PATH$,NA$,EX$
   IF POS(".WAV.WMA.MP3",UCASE$(EX$)) > 0 THEN !'³ÈÄ¥»ÒȽÊÌ
      LET  NN=NN+1
      LET  NAME$(NN)=NA$ !'¥ê¥¹¥ÈÅÐÏ¿
      LET  EXT$(NN)=EX$
   END IF
NEXT I
IF NN=0 THEN
   PRINT "No File"
   STOP
END IF
FOR I=1 TO NN  !' ¤»¤¤¤¼¤¤¿ô½½¶ÊÄøÅÙ (1¶Ê3ʬ¡ß100¶Ê=5»þ´Ö !?)
   FOR J=I+1 TO NN
      IF NAME$(I) > NAME$(J) THEN !'!¾º½ç¤Ë¥½¡¼¥È
         SWAP NAME$(I),NAME$(J)
         SWAP EXT$(I),EXT$(J)
      END IF
   NEXT J
NEXT I
PRINT "¥Õ¥¡¥¤¥ë¿ô=";NN
DO
   INPUT  PROMPT "SAVE FILE NAME=":F$ !'³ÈÄ¥»Ò(.asx) OR (.m3u)¤òÉղ乤뤳¤È
LOOP UNTIL UCASE$(RIGHT$(F$,3))="M3U" OR UCASE$(RIGHT$(F$,3))="ASX"
OPEN #1:NAME F$
SELECT CASE UCASE$(RIGHT$(F$,3))
CASE "M3U"
   FOR I=1 TO NN
      PRINT #1:PA$;NAME$(I);EXT$(I) !'ÀäÂХѥ¹»ØÄê
   NEXT I
CASE "ASX"
   PRINT #1:CHR$(60);"asx version = ";CHR$(34);"3.0";CHR$(34);" ";CHR$(62)
   FOR I=1 TO NN
      PRINT #1:CHR$(9);CHR$(60);"entry";CHR$(62)
      PRINT #1:CHR$(9);CHR$(9);CHR$(60);"title";CHR$(62);NAME$(I);CHR$(60);"/title";CHR$(62)
      PRINT #1:CHR$(9);CHR$(9);CHR$(60);"ref href = ";CHR$(34);PA$;NAME$(I);EXT$(I);CHR$(34);" /";CHR$(62)
      PRINT #1:CHR$(9);CHR$(60);"/entry";CHR$(62)
   NEXT I
   PRINT #1:CHR$(60);"/asx";CHR$(62)
END SELECT
CLOSE #1
END
 

2ÊÑ¿ôÆóʬˡ

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2009ǯ 5·î10Æü(Æü)15»þ31ʬ20ÉÃ
ÊÖ¿®¡¦°úÍÑ
  RANDOMIZE
DEF FNF(X, Y) = A * X + B * Y - E
DEF FNG(X, Y) = C * X + D * Y - F
LET A=INT(RND*10)+1
LET B=INT(RND*10)+1
LET C=INT(RND*10)+1
LET D=INT(RND*10)+1
LET E=INT(RND*10)-5
LET F=INT(RND*10)-5
PRINT A;"* X +";B;"* Y=";E
PRINT C;"* X +";D;"* Y=";F
LET  XH = 100
LET  XL = -XH
DO
   LET  XM = (XH + XL) / 2
   LET  YM = (F - C * XM) / D !' G(X,Y)=0 ¤ò Y=GG(X)¤Î·Á¤ËÊÑ·Á¤·¡¢XM¤òÂåÆþ
   LET  YH = (F - C * XH) / D !' G(X,Y)=0 ¤ò Y=GG(X)¤Î·Á¤ËÊÑ·Á¤·¡¢XH¤òÂåÆþ
   IF FNF(XM, YM) * FNF(XH, YH) < 0 THEN LET  XL = XM ELSE LET  XH = XM
LOOP UNTIL ABS(FNF(XM, YM)) < 1E-8 AND ABS(FNG(XM, YM)) < 1E-8
PRINT "X,Y="; XM; YM
PRINT "X,Y=";(D*E-B*F)/(A*D-B*C);(A*F-C*E)/(A*D-B*C) !'¸¡»»
END
 

ÉâÆ°¾®¿ôÊÑ´¹

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2009ǯ 5·î10Æü(Æü)15»þ32ʬ34ÉÃ
ÊÖ¿®¡¦°úÍÑ
  IEEE754 ÉâÆ°¾®¿ôÊÑ´¹
Àµµ¬²½¿ô¤Î¤ßÂбþ (ÈóÀµµ¬²½¿ô¡¢Ìµ¸ÂÂç¡¢NaNÃͤˤÏÂбþ¤·¤Æ¤¤¤Þ¤»¤ó)


OPTION CHARACTER BYTE
LET  X=1/3
PRINT  CVS(FLOAT2STR$(X,8,23)) !'float 32bit
PRINT  STR2FLOAT(PACKDBL$(X),11,52) !'double 64bit
PRINT  STR2FLOAT(FLOAT2STR$(X,15,64),15,64) !'long double 80bit
END

EXTERNAL  FUNCTION AND(X,Y)
LET  XO=X
LET  YO=Y
LET  A=1
LET  S=0
FOR I=0 TO 31
   LET  XX=MOD(XO,2)
   LET  YY=MOD(YO,2)
   IF YY+XX=2 THEN  LET  S=S+A
   LET  XO=INT(XO/2)
   LET  YO=INT(YO/2)
   LET  A=A*2
NEXT I
LET  AND=S
END FUNCTION

EXTERNAL  FUNCTION CVS(A$)
!'IEEE754 32bit str to float
OPTION CHARACTER BYTE
OPTION BASE 0
DIM B(32)
LET  A$=LEFT$(A$,4)
LET  K = 0
FOR I = 4 TO 1 STEP -1
   LET  D$ = MID$(A$, I, 1)
   FOR J = 0 TO 7
      IF AND(ORD(D$),2 ^ (7 - J))<>0 THEN LET  B(K) = 1 ELSE LET  B(K) = 0
      LET  K = K + 1
   NEXT J
NEXT I
FOR I = 1 TO 8
   LET  E = E + B(I) * 2 ^ (8 - I)
NEXT I
LET  E=E-127
FOR I = 9 TO 31
   LET  S = S + B(I) * 2 ^ (8 - I)
NEXT I
LET  X=2^E*(S+1)
IF B(0)=1 THEN LET  X=-X
LET  CVS=X
END FUNCTION

EXTERNAL  FUNCTION MKS$(X)
!'IEEE754 32bit float to str
OPTION CHARACTER BYTE
OPTION BASE 0
DIM B(32)
IF X < 0 THEN LET  B(0)=1
IF X<>0 THEN
   IF ABS(X) < 1 THEN
      DO WHILE 2^(N+1) > ABS(X)
         LET  N=N-1
      LOOP
      LET  N=N+1
   ELSE
      DO WHILE 2^(N+1) < ABS(X)
         LET  N=N+1
      LOOP
   END IF
   LET  NN=N
   LET  N=N+127
   FOR I=1 TO 8
      IF AND(N,2^(8-I))<>0 THEN LET  B(I)=1
   NEXT I
   LET  T=(ABS(X)-2^NN)/2^NN
   FOR I=9 TO 31
      LET  T=T*2
      IF T >= 1 THEN
         LET  B(I)=1
         LET  T=T-INT(T)
      END IF
   NEXT I
END IF
LET  AA$=CHR$(B(0)*128+B(1)*64+B(2)*32+B(3)*16+B(4)*8+B(5)*4+B(6)*2+B(7))
LET  BB$=CHR$(B(8)*128+B(9)*64+B(10)*32+B(11)*16+B(12)*8+B(13)*4+B(14)*2+B(15))
LET  CC$=CHR$(B(16)*128+B(17)*64+B(18)*32+B(19)*16+B(20)*8+B(21)*4+B(22)*2+B(23))
LET  DD$=CHR$(B(24)*128+B(25)*64+B(26)*32+B(27)*16+B(28)*8+B(29)*4+B(30)*2+B(31))
LET  MKS$=DD$ & CC$ & BB$ & AA$
END FUNCTION

EXTERNAL  FUNCTION FLOAT2STR$(X,L,M) !'²ÄÊÑÀºÅÙÉâÆ°¾®¿ôÊÑ´¹
!'Éä¹æ(1 bit) »Ø¿ôÉô(L bit) ²¾¿ôÉô(M bit)
OPTION CHARACTER BYTE
OPTION BASE 0
IF MOD(L+M+1,8)<>0 THEN EXIT FUNCTION
DIM B(1+L+M)
IF X < 0 THEN LET  B(0)=1
IF X<>0 THEN
   IF ABS(X) < 1 THEN
      DO WHILE 2^(N+1) > ABS(X)
         LET  N=N-1
      LOOP
      LET  N=N+1
   ELSE
      DO WHILE 2^(N+1) < ABS(X)
         LET  N=N+1
      LOOP
   END IF
   FOR I=1 TO L
      IF AND(N+2^(L-1)-1,2^(L-I))<>0 THEN LET  B(I)=1
   NEXT I
   LET  T=(ABS(X)-2^N)/2^N
   FOR I=1+L TO 1+L+M
      LET  T=T*2
      IF T >= 1 THEN
         LET  B(I)=1
         LET  T=T-INT(T)
      END IF
   NEXT I
END IF
FOR J=0 TO (1+L+M)/8-1
   LET  AA$=CHR$(B(8*J)*128+B(8*J+1)*64+B(8*J+2)*32+B(8*J+3)*16+B(8*J+4)*8+B(8*J+5)*4+B(8*J+6)*2+B(8*J+7)) & AA$
NEXT J
LET  FLOAT2STR$=AA$
END FUNCTION

EXTERNAL  FUNCTION STR2FLOAT(A$,N,M)
!'Éä¹æ(1 bit) »Ø¿ôÉô(N bit) ²¾¿ôÉô(M bit)
OPTION CHARACTER BYTE
OPTION BASE 0
IF MOD(N+M+1,8)<>0 THEN EXIT FUNCTION
DIM B(1+N+M)
LET  K=0
FOR I=INT((1+N+M)/8) TO 1 STEP -1
   LET  D$=MID$(A$, I, 1)
   FOR J=0 TO 7
      IF AND(ORD(D$),2^(7-J))<>0 THEN LET  B(K)=1
      LET  K=K+1
   NEXT J
NEXT I
FOR I=1 TO N
   LET  E=E+B(I)*2^(N-I)
NEXT I
LET  E=E-(2^(N-1)-1)
FOR I=1+N TO 1+N+M
   LET  S=S+B(I)*2^(N-I)
NEXT I
LET  X=2^E*(1+S)
IF B(0)=1 THEN LET X=-X
LET  STR2FLOAT=X
END FUNCTION
 

¥Ú¥¸¥¨¶ÊÀþ

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2009ǯ 5·î10Æü(Æü)15»þ33ʬ59ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¥Ú¥¸¥¨¶ÊÀþ

!'TT=1-T
!'(TT+T)^(N-1)  N=ÅÀ¤Î¿ô (0 <= T <= 1)
CALL GINIT(640,400)
RANDOMIZE
INPUT PROMPT  "ÅÀ¤Î¿ô =": N !' N > 1
DIM X(N), Y(N)
FOR I = 1 TO N
   LET  X(I) = INT(RND * 640)
   LET  Y(I) = INT(RND * 400)
   CALL CIRCLEFULL (X(I),Y(I),6,I)
NEXT I
FOR T = 0 TO 1 STEP 1 / 256
   LET  XX = 0
   LET  YY = 0
   LET  TT=(1-T)
   SELECT CASE N
   CASE 2
      LET  XX = TT*X(1)+T*X(2)
      LET  YY = TT*Y(1)+T*Y(2)
   CASE 3
      LET  XX = TT^2*X(1)+2*TT*T*X(2)+T^2*X(3)
      LET  YY = TT^2*Y(1)+2*TT*T*Y(2)+T^2*Y(3)
      !'CASE 4
      !'    LET  XX = TT^3*X(1)+3*TT^2*T*X(2)+3*TT*T^2*X(3)+T^3*X(4)
      !'    LET  YY = TT^3*Y(1)+3*TT^2*T*Y(2)+3*TT*T^2*Y(3)+T^3*Y(4)
      !'CASE 5
      !'   LET  XX = TT^4*X(1)+4*TT^3*T*X(2)+6*TT^2*T^2*X(3)+4*TT*T^3*X(4)+T^4*X(5)
      !'   LET  YY = TT^4*Y(1)+4*TT^3*T*Y(2)+6*TT^2*T^2*Y(3)+4*TT*T^3*Y(4)+T^4*Y(5)
   CASE ELSE
      FOR I=1 TO N
         LET XX=XX+TT^(N-I)*T^(I-1)*X(I)*COMB(N-1,I-1)
         LET YY=YY+TT^(N-I)*T^(I-1)*Y(I)*COMB(N-1,I-1)
      NEXT I
   END SELECT
   IF T = 0 THEN
      LET  XA=XX
      LET  YA=YY
   END IF
   CALL LINE(XA,YA,XX,YY,7)
   LET  XA=XX
   LET  YA=YY
NEXT T
IF N=4 THEN
   SET COLOR 1
   PLOT BEZIER: X(1), Y(1) ; X(2), Y(2) ; X(3), Y(3); X(4), Y(4) !'¥é¥¤¥ó¤¬°ìÃפ¹¤ë
END IF
END

EXTERNAL  SUB GINIT(XSIZE,YSIZE)
SET BITMAP SIZE XSIZE,YSIZE
SET WINDOW  0 , XSIZE-1 , YSIZE-1, 0
SET POINT STYLE  1
SET COLOR MIX(0) 0,0,0
SET COLOR MIX(1) 0,0,1
SET COLOR MIX(2) 1,0,0
SET COLOR MIX(3) 1,0,1
SET COLOR MIX(4) 0,1,0
SET COLOR MIX(5) 0,1,1
SET COLOR MIX(6) 1,1,0
SET COLOR MIX(7) 1,1,1
CLEAR
END SUB

EXTERNAL  SUB LINE(XS,YS,XE,YE,C)
SET COLOR C
PLOT LINES: XS,YS;XE,YE
END SUB

EXTERNAL  SUB CIRCLEFULL (X0, Y0, R, C)
LET  X = R
LET  D = X
LET  Y = 0
DO WHILE X >= Y
   CALL LINE (X0 - X, Y0 + Y,X0 + X, Y0 + Y, C)
   CALL LINE (X0 - X, Y0 - Y,X0 + X, Y0 - Y, C)
   CALL LINE (X0 - Y, Y0 + X,X0 + Y, Y0 + X, C)
   CALL LINE (X0 - Y, Y0 - X,X0 + Y, Y0 - X, C)
   LET  D = D - 2 * Y + 1
   LET  Y = Y + 1
   IF D < 0 THEN
      LET  D = D + 2 * X - 2
      LET  X = X - 1
   END IF
LOOP
END SUB
 

¥°¥é¥Ç¡¼¥·¥ç¥ó

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2009ǯ 5·î10Æü(Æü)15»þ35ʬ27ÉÃ
ÊÖ¿®¡¦°úÍÑ
  £Î¼¡Â¿¹à¼°¡¢Êä´Ö¼°¤Ë¤è¤ë¥°¥é¥Ç¡¼¥·¥ç¥ó²èÁü¤ÎÀ¸À®


RANDOMIZE
LET  XSIZE=640 !'²èÁü¥µ¥¤¥º
LET  YSIZE=400
CALL GINIT(XSIZE,YSIZE)
LET  TH=INT(RND*90)
LET  S=SIN(TH*PI/180)
LET  C=COS(TH*PI/180)
LET R1=INT(RND*256)
LET R2=INT(RND*256)
LET R3=INT(RND*256)
LET R4=INT(RND*256)
LET G1=INT(RND*256)
LET G2=INT(RND*256)
LET G3=INT(RND*256)
LET G4=INT(RND*256)
LET B1=INT(RND*256)
LET B2=INT(RND*256)
LET B3=INT(RND*256)
LET B4=INT(RND*256)
LET MODE=INT(RND*40)+1
SELECT CASE INT(RND*4)
CASE 0
   FOR YY=0 TO YSIZE-1
      FOR XX=0 TO XSIZE-1
         LET  T=(C*XX+S*(YSIZE-YY))/(XSIZE*C+YSIZE*S)
         LET RR=INTERPOLANT(MODE,R1,R2,T)
         LET GG=INTERPOLANT(MODE,G1,G2,T)
         LET BB=INTERPOLANT(MODE,B1,B2,T)
         CALL PSET(XX,YY,RR,GG,BB)
      NEXT XX
   NEXT YY
CASE 1
   LET  N=INT(RND*7)+3
   DIM X(N,N),Y(N),R(N),G(N),B(N)
   FOR I=1 TO N
      FOR J=1 TO N
         LET  T=(I-1)/(N-1)
         LET  X(I,J)=T^(N-J)
      NEXT J
   NEXT I
   MAT X=INV(X)
   FOR I=1 TO N
      LET  Y(I)=INT(RND*256)
   NEXT I
   MAT R=X*Y !'red¤Î·¸¿ô
   FOR I=1 TO N
      LET  Y(I)=INT(RND*256)
   NEXT I
   MAT G=X*Y !'green¤Î·¸¿ô
   FOR I=1 TO N
      LET  Y(I)=INT(RND*256)
   NEXT I
   MAT B=X*Y !'blue¤Î·¸¿ô
   FOR YY=0 TO YSIZE-1
      FOR XX=0 TO XSIZE-1
         LET  T=(C*XX+S*(YSIZE-YY))/(XSIZE*C+YSIZE*S)
         LET RR=0
         LET GG=0
         LET BB=0
         FOR I=1 TO N  !'¿¹à¼°¤Î·×»»
            LET  RR=RR*T+R(I)
            LET  GG=GG*T+G(I)
            LET  BB=BB*T+B(I)
         NEXT I
         CALL PSET(XX,YY,RR,GG,BB)
      NEXT  XX
   NEXT  YY
CASE 2 !'»Í³Ñ·Á
   FOR YY=0 TO YSIZE-1
      FOR XX=0 TO XSIZE-1
         LET  RR=RECTCOL(0,0,XSIZE-1,YSIZE-1,R1,R2,R3,R4,XX,YY,MODE)
         LET  GG=RECTCOL(0,0,XSIZE-1,YSIZE-1,G1,G2,G3,G4,XX,YY,MODE)
         LET  BB=RECTCOL(0,0,XSIZE-1,YSIZE-1,B1,B2,B3,B4,XX,YY,MODE)
         CALL PSET(XX,YY,RR,GG,BB)
      NEXT  XX
   NEXT  YY
CASE 3 !'»°³Ñ·Á
   LET R5=INT(RND*256)
   LET G5=INT(RND*256)
   LET B5=INT(RND*256)
   LET X1=0
   LET Y1=0
   LET X2=XSIZE-1
   LET Y2=0
   LET X3=X2
   LET Y3=YSIZE-1
   LET X4=0
   LET Y4=YSIZE-1
   LET X5=INT(XSIZE/2)
   LET Y5=INT(YSIZE/2)
   FOR YY=0 TO YSIZE-1
      FOR XX=0 TO XSIZE-1
         IF AREA3(X5,Y5,X1,Y1,X2,Y2,XX,YY)<>0 THEN
            LET  RR=TRIANGLECOL(X5,Y5,X1,Y1,X2,Y2,R5,R1,R2,XX,YY)
            LET  GG=TRIANGLECOL(X5,Y5,X1,Y1,X2,Y2,G5,G1,G2,XX,YY)
            LET  BB=TRIANGLECOL(X5,Y5,X1,Y1,X2,Y2,B5,B1,B2,XX,YY)
         ELSEIF AREA3(X5,Y5,X2,Y2,X3,Y3,XX,YY)<>0 THEN
            LET  RR=TRIANGLECOL(X5,Y5,X2,Y2,X3,Y3,R5,R2,R3,XX,YY)
            LET  GG=TRIANGLECOL(X5,Y5,X2,Y2,X3,Y3,G5,G2,G3,XX,YY)
            LET  BB=TRIANGLECOL(X5,Y5,X2,Y2,X3,Y3,B5,B2,B3,XX,YY)
         ELSEIF AREA3(X5,Y5,X3,Y3,X4,Y4,XX,YY)<>0 THEN
            LET  RR=TRIANGLECOL(X5,Y5,X3,Y3,X4,Y4,R5,R3,R4,XX,YY)
            LET  GG=TRIANGLECOL(X5,Y5,X3,Y3,X4,Y4,G5,G3,G4,XX,YY)
            LET  BB=TRIANGLECOL(X5,Y5,X3,Y3,X4,Y4,B5,B3,B4,XX,YY)
         ELSEIF AREA3(X5,Y5,X4,Y4,X1,Y1,XX,YY)<>0 THEN
            LET  RR=TRIANGLECOL(X5,Y5,X4,Y4,X1,Y1,R5,R4,R1,XX,YY)
            LET  GG=TRIANGLECOL(X5,Y5,X4,Y4,X1,Y1,G5,G4,G1,XX,YY)
            LET  BB=TRIANGLECOL(X5,Y5,X4,Y4,X1,Y1,B5,B4,B1,XX,YY)
         END IF
         CALL PSET(XX,YY,RR,GG,BB)
      NEXT  XX
   NEXT  YY
END SELECT
END

EXTERNAL SUB GINIT(XSIZE,YSIZE)
SET BITMAP SIZE XSIZE,YSIZE
SET COLOR MODE "NATIVE"
CLEAR
SET POINT STYLE 1
SET WINDOW 0,XSIZE-1,YSIZE-1,0
END SUB

EXTERNAL SUB PSET(X,Y,R,G,B)
LET  RR=MIN(255,MAX(0,INT(R)))
LET  GG=MIN(255,MAX(0,INT(G)))
LET  BB=MIN(255,MAX(0,INT(B)))
SET COLOR COLORINDEX(RR/255,GG/255,BB/255)
PLOT POINTS: X , Y
END SUB

EXTERNAL  FUNCTION RECTCOL(X1,Y1,X2,Y2,C1,C2,C3,C4,X,Y,MODE)
LET  P=(X-X1)/(X2-X1)
LET  Q=(Y-Y1)/(Y2-Y1)
LET S1=INTERPOLANT(MODE,C1,C2,P)
LET S2=INTERPOLANT(MODE,C3,C4,Q)
LET RECTCOL=INTERPOLANT(MODE,S1,S2,Q)
END FUNCTION

EXTERNAL  FUNCTION INTERPOLANT(MODE,A,B,T) !'Êä´Ö¼°
LET T=MIN(1,MAX(0,T))
SELECT CASE MODE
CASE 1
   LET  V=(1-T)*A+B*T
CASE 2
   LET  V=(1-T)^2*A+B*T^2
CASE 3
   LET  V=(1-T)^3*A+B*T^3
CASE 4
   LET  V=(1-T)^4*A+B*T^4
CASE 5
   LET  V=(1-T)^5*A+B*T^5
CASE 6
   LET  V=(1-T^2)*A+B*T^2
CASE 7
   LET  V=(1-T^3)*A+B*T^3
CASE 8
   IF T=1 THEN LET  V=B ELSE  LET  V=SQR(1-T^2)*A+B*T^2
CASE 9
   IF T=1 THEN LET  V=B ELSE  LET  V=SQR(1-T^3)*A+B*T^3
CASE 10
   IF T=1 THEN LET  V=B ELSE  LET  V=SQR(1-T^2)^3*A+B*T
CASE 11
   LET  N=1/2
   LET  M=1/3
   IF T=1 THEN LET  V=B  ELSE LET  V=(1-T^M)^N*A+B*T^M
CASE 12
   LET  V=A*COS(PI/2*T)+B*SIN(PI/2*T)
CASE 13
   LET  V=A*COS(PI/2*T)^2+B*SIN(PI/2*T)^3
CASE 14
   LET  V=A*COS(PI/2*T^2)+B*SIN(PI/2*T^2)
CASE 15
   LET  V=A*(B/A)^T
CASE 16
   LET  V=A*EXP(T*LOG(B/A))
CASE 17
   LET  V=A+(B-A)*TAN(PI/4*T)
CASE 18
   LET  V=A+(B-A)*SIN(PI/2*T)
CASE 19
   LET  V=A+(B-A)*LOG(T+1)/LOG(2)
CASE 20
   LET  V=A+(B-A)*LOG(2*T+1)/LOG(3)
CASE 21
   LET  V=A+(B-A)*LOG((EXP(1)-1)*T+1)
CASE 22
   LET  V=A+(B-A)*(2^T-1)
CASE 23
   LET  V=A+(B-A)*ATN(T)*4/PI
CASE 24
   IF T=0 THEN LET  V=A ELSE  LET  V=A+(B-A)*LOG(10*T)/LOG(10)
CASE 25
   LET  V=A+(B-A)*SQR(T)
CASE 26
   LET  V=A+(B-A)*T^(1/5)
CASE 27
   LET V=A+(B-A)*T^10
CASE 28
   LET  V=A+(B-A)*ATN(T)*4/PI
CASE 29
   LET  V=A+(B-A)*ASIN(T)*2/PI
CASE 30
   LET  V=A+(B-A)*SIN(PI/2*T)^COS(PI/2*T)
CASE 31
   LET V=A+T-1+ABS(B-A)^T
CASE 32
   LET V=A+(B-A)*(1-(1-T)^T)
CASE 33
   LET V=A+(B-A)*(1-(1-T)/(1+T^2))
CASE 34
   LET V=A+(B-A)*(T*T*T+T*T+T)/(2*T*T+1)
CASE 35
   IF T=1 THEN LET V=B ELSE LET V=A+(B-A)*SIN(PI*(1-T))/((1-T)*PI)
CASE 36
   LET V=A+(B-A)*(T^3+3*T^2+2*T)/(T^2+2*T+3)
CASE 37
   LET V=A+(B-A)*T^3/(T^2+T-1)
CASE 38
   LET V=A+(B-A)*(4^T-1)/(2^T+1)
CASE 39
   LET V=A+(B-A)*(T+T^2+T^3+T^4+T^5+T^6+T^7)/7
CASE 40
   LET V=A+(B-A)*(5^T-1)/4
END SELECT
LET INTERPOLANT=V
END FUNCTION

EXTERNAL  FUNCTION AREA3(X1, Y1, X2, Y2, X3, Y3, PX, PY)
LET  T = TRIANGLE(X1, Y1, X2, Y2, X3, Y3)
LET  A = TRIANGLE(X1, Y1, X2, Y2, PX, PY)
LET  B = TRIANGLE(X2, Y2, X3, Y3, PX, PY)
LET  C = TRIANGLE(X1, Y1, X3, Y3, PX, PY)
IF ABS(A + B + C - T) < 1 THEN LET  AREA3 = -1 ELSE LET  AREA3 = 0
END FUNCTION

EXTERNAL  FUNCTION TRIANGLE(X1, Y1, X2, Y2, X3, Y3) !'»°³Ñ·Á¤ÎÌÌÀÑ
LET  TRIANGLE = ABS(X1 * Y2 + X2 * Y3 + X3 * Y1 - X2 * Y1 - X3 * Y2 - Y3 * X1) / 2
END FUNCTION
 

Re: ¥°¥é¥Ç¡¼¥·¥ç¥ó

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2009ǯ 5·î10Æü(Æü)15»þ36ʬ51ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.356[¸µµ­»ö¤Ø]

³¤­


EXTERNAL  FUNCTION TRIANGLECOL(OX,OY,AX,AY,BX,BY,C1,C2,C3,X,Y)
LET  A = AX - OX
LET  B = BX - OX
LET  C = AY - OY
LET  D = BY - OY
LET  PX = X - OX
LET  PY = Y - OY
LET  DET = A * D - B * C
IF DET = 0 THEN
   EXIT FUNCTION
END IF
LET  S = (D * PX - B * PY) / DET
IF S < 0 THEN
   EXIT FUNCTION
END IF
LET  T = (A * PY - C * PX) / DET
IF T < 0 THEN
   EXIT FUNCTION
END IF
IF S + T <= 1 THEN
   LET  TRIANGLECOL=(1-S)*(1-T)*C1+S*C2+T*C3
END IF
END FUNCTION
 

Ⱦ³Ñ¡¢Á´³Ñʸ»úÊÑ´¹

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2009ǯ 5·î10Æü(Æü)15»þ38ʬ13ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  Ⱦ³Ñ¡¢Á´³Ñʸ»úÊÑ´¹


PRINT CDBL$("ABCD£Á£Â£Ã123") !'Ⱦ³Ñ¤òÁ´³Ñʸ»ú¤Ø
PRINT CSNG$("¤¢¤¤¤¦£Á£Â£Ã£Ä£Å123£±£²£³£´") !'Á´³Ñ¤òȾ³Ñʸ»ú¤Ø
FOR I=1 TO 100
   PRINT CDBL$(STR$(I) & ":" & NUM2ROMAN$(I))
NEXT I
END

EXTERNAL  FUNCTION CDBL$(X$)
FOR I=1 TO LEN(X$)
   LET  F$=MID$(X$,I,1)
   RESTORE
   DO
      READ A$,AA$
   LOOP UNTIL A$="" OR F$=A$
   IF A$="" THEN LET  AA$=F$
   LET  L$=L$ & AA$
NEXT I
LET  CDBL$=L$
DATA A,£Á,B,£Â,C,£Ã,D,£Ä,E,£Å,F,£Æ,G,£Ç,H,£È,I,£É,J,£Ê,K,£Ë,L,£Ì,M,£Í,N,£Î,O,£Ï,P,£Ð,Q,£Ñ,R,£Ò,S,£Ó,T,£Ô,U,£Õ,V,£Ö,W,£×,X,£Ø,Y,£Ù,Z,£Ú
DATA a,£á,b,£â,c,£ã,d,£ä,e,£å,f,£æ,g,£ç,h,£è,i,£é,j,£ê,k,£ë,l,£ì,m,£í,n,£î,o,£ï,p,£ð,q,£ñ,r,£ò,s,£ó,t,£ô,u,£õ,v,£ö,w,£÷,x,£ø,y,£ù,z,£ú
DATA 0,£°,1,£±,2,£²,3,£³,4,£´,5,£µ,6,£¶,7,£·,8,£¸,9,£¹
DATA "!",¡ª,"#",¡ô,"$",¡ð,"%",¡ó,"&",¡õ,"'",¡Ç,"(", ¡Ê,")",¡Ë,"=",¡á,"~",¡Á,"+",¡Ü,"-",¡Ý,"*",¡ö,"/",¡¿,".",¡¥,"<",¡ã,">",¡ä,"?",¡©,";",¡¨,":",¡§,"@",¡÷,"\",¡ï
DATA " ","¡¡"
DATA "",""
END FUNCTION

EXTERNAL  FUNCTION CSNG$(X$)
FOR I=1 TO LEN(X$)
   LET  F$=MID$(X$,I,1)
   RESTORE
   DO
      READ A$,AA$
   LOOP UNTIL A$="" OR F$=AA$
   IF A$="" THEN LET  A$=F$
   LET  L$=L$ & A$
NEXT I
LET  CSNG$=L$
DATA A,£Á,B,£Â,C,£Ã,D,£Ä,E,£Å,F,£Æ,G,£Ç,H,£È,I,£É,J,£Ê,K,£Ë,L,£Ì,M,£Í,N,£Î,O,£Ï,P,£Ð,Q,£Ñ,R,£Ò,S,£Ó,T,£Ô,U,£Õ,V,£Ö,W,£×,X,£Ø,Y,£Ù,Z,£Ú
DATA a,£á,b,£â,c,£ã,d,£ä,e,£å,f,£æ,g,£ç,h,£è,i,£é,j,£ê,k,£ë,l,£ì,m,£í,n,£î,o,£ï,p,£ð,q,£ñ,r,£ò,s,£ó,t,£ô,u,£õ,v,£ö,w,£÷,x,£ø,y,£ù,z,£ú
DATA 0,£°,1,£±,2,£²,3,£³,4,£´,5,£µ,6,£¶,7,£·,8,£¸,9,£¹
DATA "!",¡ª,"#",¡ô,"$",¡ð,"%",¡ó,"&",¡õ,"'",¡Ç,"(", ¡Ê,")",¡Ë,"=",¡á,"~",¡Á,"+",¡Ü,"-",¡Ý,"*",¡ö,"/",¡¿,".",¡¥,"<",¡ã,">",¡ä,"?",¡©,";",¡¨,":",¡§,"@",¡÷,"\",¡ï
DATA " ","¡¡"
DATA "",""
END FUNCTION

EXTERNAL  FUNCTION NUM2ROMAN$(X) !'(¥¢¥é¥Ó¥¢)¿ô»ú to ¥í¡¼¥Þ¿ô»ú(1°Ê¾å4000̤Ëþ)
LET R$=""
IF X < 4000 AND X > 0 THEN
   OPTION BASE 0
   DIM T$(4,9)
   FOR I=1 TO 3
      FOR J=1 TO 9
         READ T$(I,J)
      NEXT J
   NEXT I
   DATA I,II,III,IV,V,VI,VII,VIII,IX
   DATA X,XX,XXX,XL,L,LX,LXX,LXXX,XC
   DATA C,CC,CCC,CD,D,DC,DCC,DCCC,CM
   FOR J=1 TO 3
      READ T$(4,J)
   NEXT J
   DATA M,MM,MMM,MMMM
   LET A$=LTRIM$(STR$(INT(X)))
   FOR I=LEN(A$) TO 1 STEP -1
      LET J=VAL(MID$(A$,LEN(A$)-I+1,1))
      LET R$=R$ & T$(I,J)
   NEXT I
END IF
LET NUM2ROMAN$=R$
END FUNCTION
 

¿ô¤¢¤Æ

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2009ǯ 5·î10Æü(Æü)15»þ39ʬ39ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¿ô¤¢¤Æ¥²¡¼¥à

·å¿ô(N)¤ò·è¤á¤ë
N·å¤Î¿ô»ú¤òÆþ¤ì¤Æ¤¤¤¯
³Æ·å¤ÏÁ´¤Æ°Û¤Ê¤ë¿ô»ú
¥Ò¥Ã¥È¡¦¡¦¡¦¿ô»ú¤È°Ì(¿ô»ú¤Î°ÌÃÖ)¤¬°ìÃפ·¤Æ¤¤¤ë¿ô
¥Á¥Ã¥×¡¦¡¦¡¦¿ô»ú¤Ï¹ç¤Ã¤Æ¤¤¤ë¤¬°Ì(¿ô»ú¤Î°ÌÃÖ)¤¬°ã¤Ã¤Æ¤¤¤ë¿ô

RANDOMIZE
LET NUM$="0123456789"
!' LET NUM$="0123456789abcdef"
DO
   INPUT PROMPT  "·å¿ô=": N !' 4¡Á5·åÄøÅÙ
LOOP UNTIL LEN(NUM$) >= N
LET T$=NUM$
FOR I = 1 TO N
   LET  R = INT(RND * LEN(T$))+1 !'Íð¿ô¤Ç1ʸ»ú¤º¤Ä·è¤á¤ë
   LET ANS$=ANS$ & MID$(T$,R,1)
   LET T$=LEFT$(T$,R-1) & RIGHT$(T$,LEN(T$)-R) !'Áª¤Ð¤ì¤¿¿ô»ú¤Ï¸õÊ䤫¤é¾Ã¤¹
NEXT I
PRINT N;"·å¤Î¿ô»ú¤òÆþÎϤ·¤Æ²¼¤µ¤¤Ž¡ "
PRINT "GIVE UP ¤Ï '*' ¤Ç¤¹Ž¡"
LET COUNT=1
DO
   DO
      LET FL=0
      PRINT COUNT; "²óÌÜ ";
      INPUT PROMPT  "NUMBER = ": S$
      !' LET S$=LCASE$(S$)
      IF ANS$ = S$ THEN
         PRINT "ÂçÅö¤¿¤ê ¡ª¡ª"
         STOP
      ELSEIF S$ = "*" THEN
         PRINT "Àµ²ò¤Ï"; ANS$; "¤Ç¤·¤¿Ž¡"
         STOP
      ELSEIF S$ = "/" THEN
         IF LEN(SS$)=N AND H > 0 THEN
            PRINT "¥Ò¥ó¥È  ";
            FOR I=1 TO N
               IF MID$(SS$,I,1)=MID$(ANS$,I,1) THEN PRINT MID$(ANS$,I,1); ELSE PRINT "?";
            NEXT I
            PRINT
            LET SS$=""
            LET COUNT = COUNT + 1
         END IF
         LET FL=1
      ELSEIF LEN(S$)<>N THEN
         PRINT N;"·å¤Î¿ô»ú¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó"
         LET FL=1
      ELSE
         FOR I=1 TO N
            IF POS(NUM$,MID$(S$,I,1))=0 THEN
               PRINT "̵¸ú¤Êʸ»ú¤¬¤¢¤ê¤Þ¤¹"
               LET FL=1
               EXIT FOR
            END IF
         NEXT I
      END IF
   LOOP UNTIL FL=0
   LET  H = 0
   LET  C = 0
   FOR I = 1 TO N
         IF MID$(S$,I,1) = MID$(ANS$,I,1) THEN LET  H = H + 1 !'¿ô»ú¤È°Ì(°ÌÃÖ)¤¬°ìÃ×
      FOR J = 1 TO N
         IF I <> J AND MID$(S$,I,1) = MID$(ANS$,J,1) THEN LET  C = C + 1 !'¿ô»ú¤Ï°ìÃפ¹¤ë¤¬°Ì(°ÌÃÖ)¤¬°ã¤¦
      NEXT J
   NEXT I
   PRINT "¥Ò¥Ã¥È";H; " ¥Á¥Ã¥×"; C
   LET  COUNT = COUNT + 1
   LET SS$=S$
LOOP
END
 

¥«¥é¡¼¥Ñ¥º¥ë

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2009ǯ 5·î10Æü(Æü)15»þ40ʬ56ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¥Ñ¥º¥ë¥²¡¼¥à
£³¡ß£³¥Þ¥¹¤Ç¹½À®¤µ¤ì¡¢ÇÛÃ֤ϥƥ󥭡¼¤Î¿ô»ú¥­¡¼(1¡Á9)¤È°ìÃפ¹¤ë¡£

¿ô»ú¤Î"1"¤Ç 4,1,2
¿ô»ú¤Î"2"¤Ç 1,2,3,5
¿ô»ú¤Î"3"¤Ç 2,3,6
¿ô»ú¤Î"4"¤Ç 1,4,5,7
¿ô»ú¤Î"5"¤Ç 2,4,5,6,8
¿ô»ú¤Î"6"¤Ç 3,5,6,9,
¿ô»ú¤Î"7"¤Ç 4,7,8
¿ô»ú¤Î"8"¤Ç 5,7,8,9
¿ô»ú¤Î"9"¤Ç 6,8,9 ¤ÎÇÛÃÖ¤¬ÊѲ½¤¹¤ë

¿§¤Ï¡¢Çò¡¢²«¡¢¿å¡¢ÎС¢»ç¡¢ÀÖ¡¢ÀÄ¡¢¹õ¡¢¤½¤·¤Æ¤Þ¤¿Çò¤Î½ç¤ËÊѲ½¤·¤Æ¤¤¤¯
²èÌ̤ο§Á´¤Æ¤ò¾Ã¤·¤¿¤é(Á´¤Æ¹õ)¥¯¥ê¥¢


OPTION BASE 0
RANDOMIZE
CALL GINIT(300,300)
SET WINDOW  0 , 3 , 3, 0
DIM X(9),Y(9),M(9),K(9,5)
FOR I=1 TO 9
   READ X(I),Y(I)
NEXT I
DATA -1,1
DATA 0,1
DATA 1,1
DATA -1,0
DATA 0,0
DATA 1,0
DATA -1,-1
DATA 0,-1
DATA 1,-1
FOR I=1 TO 9
   FOR J=1 TO 5
      READ K(I,J)
   NEXT J
NEXT I
DATA 1,2,4,0,0
DATA 1,2,3,5,0
DATA 2,3,6,0,0
DATA 1,4,7,5,0
DATA 2,4,5,6,8
DATA 3,5,6,9,0
DATA 4,7,8,0,0
DATA 5,7,8,9,0
DATA 6,8,9,0,0
!' LET KAISU=INT(RND*18)+3
INPUT  PROMPT "²ó¿ô=":KAISU
DIM ANS(KAISU),UNDO(KAISU)
FOR I=1 TO KAISU
   LET N=INT(RND*9)+1
   LET ANS(I)=N
   CALL MASU(N,1)
NEXT I
CALL DISPLAY
LET L=KAISU
DO
   PRINT "»Ä¤ê²ó¿ô=";L
   INPUT PROMPT "Number=":T$
   IF T$="*" THEN
      EXIT DO
   ELSEIF T$="/" THEN
      IF KK > 0 THEN
         CALL MASU(UNDO(KK),1)
         LET KK=KK-1
         LET L=L+1
      END IF
   ELSEIF POS("123456789",T$) > 0 THEN
      LET TE=VAL(T$)
      LET KK=KK+1
      LET UNDO(KK)=TE
      CALL MASU(TE,-1)
      LET L=L-1
   END IF
   CALL DISPLAY
LOOP UNTIL L=0
FOR I=1 TO 9
   IF M(I)=0 THEN LET CHK=CHK+1
NEXT I
   SET COLOR 7
   CLEAR
IF CHK=9 THEN
   SET TEXT HEIGHT 0.32
   PLOT TEXT ,AT 0,1.5: "Congratulations"
ELSE
   SET TEXT HEIGHT 3/5.6
   PLOT TEXT ,AT 0,1.5: "Game Over"
   WAIT DELAY 1.5
   MAT M=ZER
   FOR L=1 TO KAISU
      CALL MASU(ANS(L),1)
   NEXT   L
   CALL DISPLAY
   WAIT DELAY 2
   FOR L=KAISU TO 1 STEP -1
      LET N=ANS(L)
      PRINT "No.";KAISU-L+1;"Number=";N
      CALL MASU(N,-1)
      CALL DISPLAY
      WAIT DELAY 1
   NEXT  L
END IF

SUB MASU(TE,C)
   FOR J=1 TO 5
      LET V=M(K(TE,J))+C
      IF V < 0 THEN LET V=7
      IF V > 7 THEN LET V=0
      LET M(K(TE,J))=V
   NEXT J
END SUB

SUB DISPLAY
   FOR J=1 TO 9
      CALL BOXFULL(X(J)+1,Y(J)+1,X(J)+2,Y(J)+2,M(J))
   NEXT J
   FOR I=1 TO 2
      FOR J=1 TO 2
         CALL LINE(I,0,I,3,7)
         CALL LINE(0,J,3,J,7)
      NEXT J
   NEXT I
END SUB
END

EXTERNAL  SUB GINIT(XSIZE,YSIZE)
SET BITMAP SIZE XSIZE,YSIZE
SET POINT STYLE  1
SET COLOR MODE "REGULAR"
SET COLOR MIX(0) 0,0,0
SET COLOR MIX(1) 0,0,1
SET COLOR MIX(2) 1,0,0
SET COLOR MIX(3) 1,0,1
SET COLOR MIX(4) 0,1,0
SET COLOR MIX(5) 0,1,1
SET COLOR MIX(6) 1,1,0
SET COLOR MIX(7) 1,1,1
CLEAR
END SUB

EXTERNAL SUB BOXFULL(X1,Y1,X2,Y2,C)
SET COLOR C
PLOT AREA: X1,Y1;X2,Y1;X2,Y2;X1,Y2;X1,Y1
END SUB

EXTERNAL  SUB LINE(XS,YS,XE,YE,C)
SET COLOR C
PLOT LINES
PLOT LINES: XS,YS;XE,YE
END SUB
 

Re: ¥«¥é¡¼¥Ñ¥º¥ë

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2009ǯ 5·î10Æü(Æü)15»þ42ʬ21ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.360[¸µµ­»ö¤Ø]

¥Þ¥¦¥¹ÈÇ ¥Þ¥¹¤òº¸¥¯¥ê¥Ã¥¯¤¹¤ë

OPTION BASE 0
RANDOMIZE
!' INPUT  PROMPT "SIZE ²£,½Ä=":XSIZE,YSIZE
LET XSIZE=INT(RND*7)+3
LET YSIZE=INT(RND*7)+3
CALL GINIT(80*XSIZE,80*YSIZE)
SET WINDOW  0 , XSIZE , YSIZE, 0
SET TEXT JUSTIFY "LEFT" , "HALF"
FOR I=1 TO XSIZE-1
   FOR J=1 TO YSIZE-1
      CALL LINE(I,0,I,YSIZE,7)
      CALL LINE(0,J,XSIZE,J,7)
   NEXT J
NEXT I
LET KAISU=INT(RND*10)+3
!' INPUT  PROMPT "²ó¿ô=":KAISU
DIM M(XSIZE,YSIZE),XX(KAISU),YY(KAISU)
DIM UNDOX(KAISU),UNDOY(KAISU)
FOR K=1 TO KAISU
   LET X=INT(RND*XSIZE)
   LET Y=INT(RND*YSIZE)
   LET XX(K)=X
   LET YY(K)=Y
   CALL MASU(X,Y,1)
NEXT  K
CALL DISPLAY
LET L=KAISU
DO
   LET FL=0
   PRINT "»Ä¤ê²ó¿ô=";L
   DO
      MOUSE POLL X,Y,LEFT,RIGHT
   LOOP WHILE LEFT=1 OR RIGHT=1
   DO
      MOUSE POLL X,Y,LEFT,RIGHT
      IF GETKEYSTATE(27)<0 THEN LET FL=1
   LOOP WHILE LEFT=0 AND RIGHT=0 AND FL=0
   IF FL=1 THEN EXIT DO
   IF RIGHT=1 THEN
      IF KK > 0 THEN
         LET X=UNDOX(KK)
         LET Y=UNDOY(KK)
         LET KK=KK-1
         CALL MASU(X,Y,1)
         CALL DISPLAY
         LET L=L+1
      END IF
   ELSEIF LEFT=1 THEN
      LET X=INT(X)
      LET Y=INT(Y)
      PRINT "X,Y=(";X;",";Y;")"
      LET KK=KK+1
      LET UNDOX(KK)=X
      LET UNDOY(KK)=Y
      CALL MASU(X,Y,-1)
      LET L=L-1
      CALL DISPLAY
   END IF
LOOP UNTIL L=0
FOR I=0 TO XSIZE-1
   FOR J=0 TO YSIZE-1
      IF M(I,J)=0 THEN LET CHK=CHK+1
   NEXT  J
NEXT I
CLEAR
SET COLOR 7
IF CHK=XSIZE*YSIZE THEN !' ¥²¡¼¥à¥¯¥ê¥¢
   SET TEXT HEIGHT XSIZE/9.375
   PLOT TEXT ,AT 0,YSIZE/2: "Congratulations"
ELSE
   SET TEXT HEIGHT XSIZE/5.6
   PLOT TEXT ,AT 0,YSIZE/2: "Game Over"
   WAIT DELAY 1.5
   MAT M=ZER
   FOR K=1 TO KAISU
      CALL MASU(XX(K),YY(K),1)
   NEXT K
   CALL DISPLAY
   WAIT DELAY 2
   FOR K=KAISU TO 1 STEP -1 !'²òÅú¤Îɽ¼¨
      CALL MASU(XX(K),YY(K),-1)
      PRINT "No.";KAISU-K+1;" X,Y=(";XX(K);",";YY(K);")"
      CALL DISPLAY
      WAIT DELAY 1
   NEXT K
END IF

SUB MASU(X,Y,C)
   FOR I=-1 TO 1
      FOR J=-1 TO 1
         IF X+I >= 0 AND Y+J >= 0 AND X+I < XSIZE AND Y+J < YSIZE AND I*J=0 THEN
            LET V=M(X+I,Y+J)+C
            IF V < 0 THEN LET V=7
            IF V > 7 THEN LET V=0
            LET M(X+I,Y+J)=V
         END IF
      NEXT J
   NEXT  I
END SUB

SUB DISPLAY !'²èÌÌɽ¼¨
   FOR I=0 TO XSIZE-1
      FOR J=0 TO YSIZE-1
         CALL BOXFULL(I,J,I+1,J+1,M(I,J))
      NEXT  J
   NEXT I
   FOR I=1 TO XSIZE-1
      FOR J=1 TO YSIZE-1
         CALL LINE(I,0,I,YSIZE,7)
         CALL LINE(0,J,XSIZE,J,7)
      NEXT J
   NEXT I
END SUB
END

EXTERNAL  SUB GINIT(XSIZE,YSIZE)
SET BITMAP SIZE XSIZE,YSIZE
SET POINT STYLE  1
SET COLOR MODE "REGULAR"
SET COLOR MIX(0) 0,0,0
SET COLOR MIX(1) 0,0,1
SET COLOR MIX(2) 1,0,0
SET COLOR MIX(3) 1,0,1
SET COLOR MIX(4) 0,1,0
SET COLOR MIX(5) 0,1,1
SET COLOR MIX(6) 1,1,0
SET COLOR MIX(7) 1,1,1
CLEAR
END SUB

EXTERNAL SUB BOXFULL(X1,Y1,X2,Y2,C)
SET COLOR C
PLOT AREA: X1,Y1;X2,Y1;X2,Y2;X1,Y2;X1,Y1
END SUB

EXTERNAL  SUB LINE(XS,YS,XE,YE,C)
SET COLOR C
PLOT LINES
PLOT LINES: XS,YS;XE,YE
END SUB
 

¿ôÃ͹ç¤ï¤»

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2009ǯ 5·î10Æü(Æü)15»þ44ʬ24ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ÌÜɸÃͤò±Û¤¨¤º¡¢¿ôÃͤιç·×Ãͤ¬ºÇÂç(ÌÜɸÃͤȤκ¹¤¬ºÇ¾®)
¤È¤Ê¤ë¿ôÃͤÎÁȤ߹ç¤ï¤»¤òµá¤á¤ë

ÁȤ߹ç¤ï¤»¤òÍøÍѤ·¤Æõº÷¤¹¤ë

N¸Ä¤ÎÃ椫¤é1¸ÄÁª¤ÖÁȤ߹ç¤ï¤»
N¸Ä¤ÎÃ椫¤é2¸ÄÁª¤ÖÁȤ߹ç¤ï¤»
N¸Ä¤ÎÃ椫¤é3¸ÄÁª¤ÖÁȤ߹ç¤ï¤»
            :
N¸Ä¤ÎÃ椫¤éN¸ÄÁª¤ÖÁȤ߹ç¤ï¤»

Áíõº÷¿ô¤Ï COMB(N,1)+COMB(N,2)+...+COMB(N,N)=2^N-1

DECLARE EXTERNAL FUNCTION COMB
PUBLIC NUMERIC MAXSIZE,MSIZE,B(20),EPS
PUBLIC STRING T$(20),TT$(20)
DIM A(20),C(20),TI$(20),TEMP(20) !'¸Ä¿ô¤Ï10¡Á15ÄøÅÙ¤òÁÛÄê
LET N=1
LET EPS=0
LET SUM=0
DO
   INPUT  PROMPT "¿ôÃÍ(" & STR$(N) & ") ":A(N) !'(¥Õ¥¡¥¤¥ë¥µ¥¤¥º¡¢±éÁÕ»þ´ÖÅù)
   IF A(N)=0 THEN !' £°¤ÇÆþÎϽªÎ»
      LET N=N-1
      EXIT DO
   END IF
   LET SUM=SUM+A(N)
   !' INPUT  PROMPT "¥¿¥¤¥È¥ë(" & STR$(N) & ") ":T$(N) !'(¥Õ¥¡¥¤¥ë̾¡¢¶Ê̾Åù)
   LET N=N+1
LOOP
INPUT  PROMPT "ÌÜɸÃÍ=":MAXSIZE !'(¥á¥Ç¥£¥¢ÍÆÎÌ¡¢¶õ¤­ÍÆÎÌÅù)
IF MAXSIZE >= SUM THEN
   CALL DISPLAY(N,A,T$)
   STOP
END IF
!' INPUT  PROMPT "µöÍÆÈÏ°Ï=":EPS !'ÌÜɸÃÍ - ¹ç·×ÃÍ <= µöÍÆÈÏ°Ï ¤È¤Ê¤ëÁȤ߹ç¤ï¤»¤Îɽ¼¨
LET MMIN=MAXSIZE
LET K=0
DO
   LET K=K+1
   FOR I=1 TO N
      IF A(I) >= MAXSIZE/K THEN EXIT DO
   NEXT I
LOOP UNTIL K=N
FOR R=K TO N-1
   LET MSIZE=MAXSIZE
   MAT TEMP=ZER
   LET RR=R
   CALL COMB(A,N,RR,TEMP,1)
   IF MSIZE < MMIN THEN
      LET MMIN=MSIZE
      MAT C=B
      MAT TI$=TT$
   END IF
NEXT R
IF MMIN > 0 THEN CALL DISPLAY(N,C,TI$)
END

EXTERNAL SUB COMB(X(),N,R,A(),K)
IF R=0 THEN
   LET S=0
   FOR I=1 TO N
      IF A(I)=1 THEN
         LET S=S+X(I)
      END IF
      IF S > MAXSIZE THEN EXIT SUB
   NEXT I
   IF MAXSIZE >= S AND MAXSIZE-S <= MSIZE THEN
      LET MSIZE=MAXSIZE-S
      MAT B=ZER
      MAT TT$=NUL$
      LET M=0
      FOR J=1 TO N
         IF A(J)=1 THEN
            LET M=M+1
            LET B(M)=X(J)
            LET TT$(M)=T$(J)
         END IF
      NEXT  J
      IF MSIZE <= EPS THEN
         CALL DISPLAY(N,B,TT$)
      END IF
   END IF
ELSE
   FOR I=K TO N-R+1
      LET A(I)=1
      CALL COMB(X,N,R-1,A,I+1)
      LET A(I)=0
   NEXT I
END IF
END SUB

EXTERNAL  SUB DISPLAY(N,A(),K$())
LET S=0
FOR I=1 TO N
   IF A(I)<>0 THEN
      PRINT "No.";I;":";A(I);"  ";K$(I)
      LET S=S+A(I)
   END IF
NEXT I
PRINT "·×";S;"»Äº¹";MAXSIZE-S
END SUB

ex.1
ÌÜɸÃͤȹç·×ÃͤȤκ¹¤¬ºÇ¾®¤È¤Ê¤ëÁȤ߹ç¤ï¤»

37  39  43  69  75  81  88  108  120  122  128
ÌÜɸÃÍ 700

ex.2
ɬ¤º¤·¤âÌÜɸÃͤȹç·×ÃͤϰìÃפ·¤Ê¤¤

20  23  26  44  54  58  75  78  90  95  110  132
ÌÜɸÃÍ 700
 

¿¹à¼°ÂåÆþ

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2009ǯ 5·î10Æü(Æü)15»þ46ʬ3ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¿¹à¼°¤Ë¿¹à¼°¤òÂåÆþ f(g(x))


OPTION BASE 0
PUBLIC NUMERIC MAXLEVEL
LET  MAXLEVEL=20
DIM X(MAXLEVEL),Y(MAXLEVEL)
CALL COSINE(X)
CALL SINE(Y)
PRINT "COS(SIN(X))"
CALL HORNER(X,Y)
CALL DISPLAY(X)
LET XX=.5
PRINT VALUE(X,XX);COS(SIN(XX)) !'¸¡»»
PRINT
CALL CLR(X)
LET X(0)=-1
LET X(2)=2 !'2*X^2-1  COS 2ÇܳѼ°
CALL REPEATFUNC(X,4) !'COS 2^4ÇܳѼ°
PRINT "F(F(F(F(X))))"
CALL DISPLAY(X)
LET XX=COS(RAD(30)/2^4)
PRINT VALUE(X,XX);F(F(F(F(XX)))) !'¸¡»»
PRINT COS(RAD(30))
PRINT
CALL COSINE(X)
CALL RCPFUNC(X) !'µÕ¿ô
PRINT "1/COS(X)"
CALL DISPLAY(X)
LET XX=.5
PRINT VALUE(X,XX);1/COS(XX) !'¸¡»»
PRINT
CALL COSINE(X)
CALL SQRFUNC(X) !'Ê¿Êýº¬
PRINT "SQR(COS(X))"
CALL DISPLAY(X)
LET XX=.5
PRINT VALUE(X,XX);SQR(COS(XX)) !'¸¡»»
PRINT
CALL COSINE(X)
LET N=SQR(2)
CALL ROOTFUNC(X,N) !'ÈóÀ°¿ô¾è
PRINT "COS(X)^";N
CALL DISPLAY(X)
LET XX=.5
PRINT VALUE(X,XX);COS(XX)^N !'¸¡»»
PRINT
CALL COSINE(X)
CALL SINE(Y)
CALL POWERFUNC(X,Y) !'¿¹à¼°¾è
PRINT "COS(X)^SIN(X)"
CALL DISPLAY(X)
LET XX=.5
PRINT VALUE(X,XX);COS(XX)^SIN(XX) !'¸¡»»
END

EXTERNAL  FUNCTION F(X)
LET F=2*X*X-1 !'COS 2ÇܳÑ
END FUNCTION

EXTERNAL  FUNCTION VALUE(A(),XX) !'¿¹à¼° F(X)¤ÎÃÍ
LET  N=DIMCHECK(A)
LET  Y=A(N)
FOR I=N-1 TO 0 STEP -1
   LET  Y=Y*XX+A(I)
NEXT I
LET  VALUE=Y
END FUNCTION

EXTERNAL  SUB HORNER(F(),G())
!' ¿¹à¼° F[X}¤Ë¿¹à¼° G[X]¤òÂåÆþ F[G[X]]
OPTION BASE 0
DIM Y(MAXLEVEL)
LET  N=DIMCHECK(F)
LET  Y(0)=F(N)
FOR I=N-1 TO 0 STEP -1
   CALL MUL(Y,G)
   LET  Y(0)=Y(0)+F(I)
NEXT I
CALL COPY(F,Y)
END SUB

EXTERNAL  SUB REPEATFUNC(X(),N)
!'F[F[F[...F[X]]]]...]
OPTION BASE 0
DIM C(MAXLEVEL),T(MAXLEVEL)
CALL COPY(C,X)
CALL COPY(T,X)
FOR I=2 TO N
   CALL HORNER(C,X)
   CALL COPY(X,C)
   CALL COPY(C,T)
NEXT I
END SUB

EXTERNAL  SUB RCPFUNC(X())
!'1/(1-F[X])=1+F[X]+F[X]^2+F[X]^3+...¼ý«Ⱦ·Â(ABS(F[X]) < 1)
!'1/F[X]=1/(1-(1-F[X])
OPTION BASE 0
DIM C(MAXLEVEL),Y(MAXLEVEL)
LET  Y(0)=1
FOR I=0 TO MAXLEVEL
   LET  C(I)=1 !'1+F[X]+F[X]^2+F[X]^3+...
NEXT I
CALL SUBST(Y,X) !'1-F[X]
CALL HORNER(C,Y)
CALL COPY(X,C)
END SUB

EXTERNAL  SUB SQRFUNC(X())
!' SQR(1-(1-F[X]))  ¼ý«Ⱦ·Â(ABS(F[X]) < 1)
OPTION BASE 0
DIM C(MAXLEVEL),Y(MAXLEVEL)
LET  Y(0)=1
CALL SUBST(Y,X) !'1-F[X]
CALL COMB(C,1,-1,1,.5) !'(1-X)^.5
CALL HORNER(C,Y)
CALL COPY(X,C)
END SUB

EXTERNAL  SUB ROOTFUNC(X(),N)
!' (1-(1-F[X]))^N  ¼ý«Ⱦ·Â(ABS(F[X]) < 1)
OPTION BASE 0
DIM C(MAXLEVEL),Y(MAXLEVEL)
LET  Y(0)=1
CALL SUBST(Y,X) !'1-F[X]
CALL COMB(C,1,-1,1,N) !'(1-X)^N
CALL HORNER(C,Y)
CALL COPY(X,C)
END SUB

EXTERNAL  SUB LOGFUNC(X())
!'LOG(F[X])
OPTION BASE 0
DIM C(MAXLEVEL)
CALL LN(C)
LET  X(0)=X(0)-1
CALL HORNER(C,X)
CALL COPY(X,C)
END SUB

EXTERNAL  SUB EXPFUNC(X())
!'EXP(F[X])
OPTION BASE 0
DIM C(MAXLEVEL)
CALL EXPON(C)
CALL HORNER(C,X)
CALL COPY(X,C)
END SUB

EXTERNAL  SUB POWERFUNC(F(),G())
!' F[X] ^ G[X] = EXP(G[X]*LOG(F[X]))
CALL LOGFUNC(F)
CALL MUL(F,G)
CALL EXPFUNC(F)
END SUB

EXTERNAL  SUB DISPLAY(A())
LET  N=DIMCHECK(A)
IF N > 1 THEN
   IF A(N)<0 THEN PRINT "-";
   IF ABS(A(N))<>1 THEN
      PRINT STR$(ABS(A(N)));"*X^";STR$(N);
   ELSE
      PRINT "X^";STR$(N);
   END IF
END IF
FOR I=N-1 TO 2 STEP -1
   IF A(I)<>0 THEN
      IF A(I) < 0 THEN PRINT "-"; ELSE PRINT "+";
      IF ABS(A(I))<>1 THEN
         PRINT STR$(ABS(A(I)));"*X^";STR$(I);
      ELSEIF ABS(A(I))=1 THEN
         PRINT "X^";STR$(I);
      END IF
   END IF
NEXT I
IF A(1)<>0 THEN
   IF N > 1 THEN
      IF A(1) < 0 THEN PRINT "-"; ELSE PRINT "+";
   END IF
   IF ABS(A(1))<>1 THEN
      PRINT STR$(ABS(A(1)));"*X";
   ELSEIF ABS(A(1))=1 THEN
      PRINT "X";
   END IF
END IF
IF A(0)<>0 THEN
   IF A(0) < 0 THEN PRINT "-"; ELSE PRINT "+";
   PRINT STR$(ABS(A(0)));
END IF
PRINT
END SUB

EXTERNAL  SUB COMB(X(),A,B,M,N) !'Æó¹àÄêÍý  ¼ý«Ⱦ·Â(ABS(F[X]) < 1)
!' (A+B*X^M)^N = A^N+N*A^(N-1)*B*X^M+N*(N-1)/2!*A^(N-2)*B^2*X^(2*M)+...B^N*X^(M*N)+B^N
CALL CLR(X)
LET  NN=1
LET  X(0)=A^N
FOR I=1 TO INT(MAXLEVEL/M)
   LET  NN=NN*(N-I+1)/I
   LET  X(M*I)=NN*A^(N-I)*B^I
NEXT I
END SUB

EXTERNAL  SUB SINE(X())
!' SIN(X)
CALL CLR(X)
LET  X(1)=1
LET  T=1
FOR I=3 TO MAXLEVEL STEP 2
   LET T=-T/(I-1)/I
   LET  X(I)=T
NEXT I
END SUB

EXTERNAL  SUB COSINE(X())
!' COS(X)
CALL CLR(X)
LET  X(0)=1
LET  T=1
FOR I=2 TO MAXLEVEL STEP 2
   LET T=-T/(I-1)/I
   LET  X(I)=T
NEXT I
END SUB

EXTERNAL  SUB EXPON(X())
!' EXP(X)
LET  X(0)=1
LET  T=1
FOR I=1 TO MAXLEVEL
   LET  T=T/I
   LET  X(I)=T
NEXT I
END SUB

EXTERNAL  SUB LN(X())
!'LOG(1+X)
LET X(0)=0
FOR I=1 TO MAXLEVEL
   IF MOD(I,2)=1 THEN LET  X(I)=1/I ELSE LET  X(I)=-1/I
NEXT I
END SUB

EXTERNAL  SUB SUBST(Y(),X())
FOR I=0 TO MAXLEVEL
   LET  Y(I)=Y(I)-X(I)
NEXT I
END SUB
 

Re: ¿¹à¼°ÂåÆþ

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2009ǯ 5·î10Æü(Æü)15»þ47ʬ11ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.363[¸µµ­»ö¤Ø]

³¤­


EXTERNAL  SUB COPY(X(),Y())
FOR I=0 TO MAXLEVEL
   LET  X(I)=Y(I)
NEXT I
END SUB

EXTERNAL  SUB MUL(Y(),X())
OPTION BASE 0
DIM C(MAXLEVEL)
FOR J=0 TO MAXLEVEL
   FOR I=0 TO MAXLEVEL-J
      LET  C(I+J)=C(I+J)+Y(I)*X(J)
   NEXT I
NEXT J
CALL COPY(Y,C)
END SUB

EXTERNAL  SUB CLR(X())
FOR I=0 TO MAXLEVEL
   LET  X(I)=0
NEXT I
END SUB

EXTERNAL  FUNCTION DIMCHECK(X())
FOR N=MAXLEVEL TO 0 STEP -1
   IF X(N)<>0 THEN EXIT FOR
NEXT N
LET  DIMCHECK=N
END FUNCTION
 

Re: ÉÁ²è¸øɽ¤È¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§Ï»¹Ã¤Î½é¿´¼Ô  Åê¹ÆÆü¡§2009ǯ 5·î10Æü(Æü)16»þ05ʬ40ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.350[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

SECOND¤µ¤ó¤¬¤³¤Î¤è¤¦¤Ë¤ª¤Ã¤·¤ã¤Ã¤Æ¤â
> ¤³¤ì¤Ï¡¢ÀèÀ¸¤Î¤´´õ˾¤È´üÂԤǡ¢¶¯Íפΰտޤϡ¢ÀäÂФˤʤ¤¤È»×¤¤¤Þ¤¹¡£

Ãøºî¸¢¤È¤·¤Æ
¡ÖËÜBASIC¤òÍøÍѤ·¤ÆÆÀ¤é¤ì¤¿¸¦µæ·ë²Ì¤Ïɬ¤º¸ø³«¤·¤Æ¤¯¤À¤µ¤¤¡£¡×
¤ÈÌÀʸ²½¤·¤Æ¤¢¤ì¤Ð¡Ö¶¯Íפΰտޤϡ¢ÀäÂФˤʤ¤¡×¤È¤Ï¸À¤¨¤Ê¤¯Ã¯¤ò¤âÇû¤ë¤â¤Î¤ÈÃǸÀ¤Ç¤­¤ë¤È»×¤¤¤Þ¤¹

SECOND¤µ¤ó¤Î¶¯Íפʤ·¤Î¤ªÏäò¤¤¤¿¤À¤­
ÅöÊý¤È¤·¤Æ¤Ï£²¡Á£³Ç¯¤Î½ñ¤­´¹¤¨¤ò³Ð¸ç¤·¤«¤±¤Æ¤¤¤¿¤Î¤Ç¡¢¾¯¤·¤¿¤¸¤í¤¤¤Ç¤¤¤Þ¤¹¡£
½ÐÍè¤ì¤Ð¤â¤ä¤â¤ä¤Î¤Þ¤Þ¤Ç²á¤´¤·¤¿¤¯¤¢¤ê¤Þ¤»¤ó¤Î¤Ç¡ÖÀèÀ¸¡×¤Î¤´°Õ»×¤ò³Î¤«¤á¤é¤ì¤¿¤é¤È»×¤¦¤Î¤Ç¤¹¤¬
¤â¤·SECOND¤µ¤ó¤Î¤ª¤Ã¤·¤ã¤ë¤È¤ª¤ê¤Ê¤Î¤Ç¤·¤¿¤é¡¢¾åµ­¤ÎÃøºî¸¢¤Î¹à¤ò½ñ¤­´¹¤¨¤Æ¤¤¤¿¤À¤­¤¿¤¯»×¤¤¤Þ¤¹

¹Í¤¨¤Æ¤ß¤ì¤Ð¡¢²Éʹ¤Ë¤·¤ÆBASIC¤ÏÆüËܿͤ¬£±¿Í¤Çºî¤Ã¤¿¤â¤Î¤Ç¤Ï¤Ê¤¤¤Ç¤¹¤è¤Í
¤¿¤Þ¤¿¤Þ¤³¤ÎBASIC¤ò»È¤Ã¤Æµ»½Ñ³«È¯¤Ê¤É¤ò¤·¤Æ¤¤¤Æ¿·µ¬¤Î¥¢¥ë¥´¥ê¥º¥à¤ä¥Î¥¦¥Ï¥¦¤òÀ¸¤ß½Ð¤¹¤³¤È¤â½½Ê¬¤Ë¹Í¤¨¤é¤ì¡¢¤½¤Î¾ì¹ç¤âÆâÍƸø³«¤ò£±¿Í¤Î¡ÖÀèÀ¸¡×¤¬Í×µá¤Ç¤­¤ë¤Î¤«¡¢¤Ï¤Ê¤Ï¤Àµ¿Ìä¤Ç¤¹¤Í
¤½¤ì¤È¤â¡¢¤³¤ÎBASIC¤Ï¡ÖÀèÀ¸¡×¤Î¸Ä¿Í¤Î¸¢Íø¤¬³ÎΩ¤·¤Æ¤¤¤ë¤Î¤Ç¤·¤ç¤¦¤«¡£¤½¤ì¤Ê¤é²¿¤â¸À¤¦¤³¤È¤Ï¤Ê¤¤¤Î¤Ç¤¹¤¬





> Ï»¹Ã¤Î½é¿´¼Ô¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£
>
> >¾¤Î¸À¸ì¤ËÊѤ¨¤Ê¤µ¤¤¤È¤¤¤¦¤³¡¦¡¦¡¦
>
> ¤Ç¤Ï¡¢¤Ê¤¤¤È»×¤¤¤Þ¤¹¡£¸í²ò¤µ¤ì¤Þ¤·¤¿¤Î¤Ç¤¢¤ì¤Ð¡¢¸æÏͤӤ·¤Þ¤¹¡£
> ¤³¤ì¤Ï¡¢ÀèÀ¸¤Î¤´´õ˾¤È´üÂԤǡ¢¶¯Íפΰտޤϡ¢ÀäÂФˤʤ¤¤È»×¤¤¤Þ¤¹¡£
 

Re: ÉÁ²è¸øɽ¤È¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§¤Ê¤«¤à¤é  Åê¹ÆÆü¡§2009ǯ 5·î11Æü(·î)00»þ56ʬ47ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.365[¸µµ­»ö¤Ø]

Ï»¹Ã¤Î½é¿´¼Ô¤µ¤ó¡¢SECOND¤µ¤ó¤Ø¤Î¥³¥á¥ó¥È¤Ç¤¹¡£

ˡΧ¤ÎÀìÌç²È¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¤¬¡¢¸Ä¿ÍŪ¤Ê°Õ¸«¤ò½Ò¤Ù¤µ¤»¤Æ¤¯¤À¤µ¤¤¡£

¡ÖËÜBASIC¤òÍøÍѤ·¤ÆÆÀ¤é¤ì¤¿¸¦µæ·ë²Ì¤Ïɬ¤º¸ø³«¤·¤Æ¤¯¤À¤µ¤¤¡£¡×

¤È¤¢¤ê¤Þ¤¹¤Î¤Ç¡¢¸¦µæ·ë²Ì¤Î¸ø³«¤Ï¸¶Â§¤È¤·¤ÆÍ×ÀÁ¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤È
¹Í¤¨¤é¤ì¤Þ¤¹¡£
¤·¤«¤·¡¢Í×ÀÁ¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤Ï¸¦µæ·ë²Ì¤Ç¤¹¤Î¤Ç¡¢¤½¤ì¤¬¤¹¤Ê¤ï¤Á
¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹¥³¡¼¥É¤Ç¤¢¤ë¤«Èݤ«¤Ï¾ì¹ç¤Ë¤è¤ë¤«¤È¹Í¤¨¤Þ¤¹¡£

¤¿¤È¤¨¤Ð¡¢¤¢¤ë¥¯¥é¥¹¤ÎÀ¸Å̤˽½¿ÊBASIC¤È¾¤Î¸À¸ì¤ò¤Ä¤«¤Ã¤Æ¡¢
¥³¥ó¥Ô¥å¡¼¥¿¤Î¼ø¶È¤ò¹Ô¤Ã¤¿¤È¤­¡Ê¤¿¤È¤¨¤Ð»°³Ñ·Á¤ÎÌÌÀѤò¤â¤È¤á
¤µ¤»¤ë¤È¤«¡Ë¡¢¤É¤Á¤é¤Î¸À¸ì¤òÍѤ¤¤¿¤Û¤¦¤¬¤è¤êÍý²ò¤¬Íưפ«¡©
¤È¤¤¤¦Ä´ºº¤ò¹Ô¤Ã¤¿¾ì¹ç¡¢¤³¤Î·ë²Ì¤ÏÍý²òÅ٤κ¹¤Ç¤¢¤ê¡¢¤½¤Î¤È¤­
ÍѤ¤¤¿»°³Ñ·Á¤ÎÌÌÀѤòµá¤á¤ë¥×¥í¥°¥é¥à¤Ç¤Ï¤Ê¤¤¤È»×¤¤¤Þ¤¹¡£
¡ÊÈæ³Ó¤òÀµ³Î¤Ë¹Ô¤¦¤¿¤á¤Ë¤Ï¥½¡¼¥¹¥³¡¼¥É¤ÎÈæ³Ó¤âɬÍפ«¤â¤·¤ì¤Þ
¤»¤ó¤¬¡Ë

¤·¤¿¤¬¤Ã¤Æ¡¢Ï»¹Ã¤Î½é¿´¼Ô¤µ¤ó¤ÎºÇ½é¤Î¤´¼ÁÌä¤Ë¤â¤É¤Ã¤Æ¡¢
ȯɽ¤·¤¿¤¤À®²Ì¤¬¤¢¤ë¤¬¡¢¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹¤¹¤Ù¤Æ¤Ï¸ø³«¤·¤¿¤¯¤Ê¤¤¡¢
¤É¤¦¤·¤¿¤é¤è¤¤¤«¡©
¤È¤¤¤¦¤È¤³¤í¤ËÃηäò¹Ê¤ë¤È¤¤¤¦¤³¤È¤ÇÎɤ¤¤Î¤Ç¤Ï¤Ê¤¤¤«¤È»×¤¤¤Þ¤¹¡£
»ÄÇ°¤Ê¤¬¤é¸½¾õ¤Ç¤Ï¤É¤Î¤è¤¦¤ÊÊýË¡¤¬¤¢¤ë¤«»ä¤Ë¤Ï¸«Åö¤¬¤Ä¤­¤Þ¤»¤ó¤¬¡£

¸¦µæ¤Î·ë²Ì¤ò¸ø³«¤·¤¿¤¯¤Ê¤¤¡¢¤È¤¤¤¦¤Î¤Ç¤¢¤ì¤Ð¡¢½½¿ÊBASIC¤Ï»È¤¦¤Ù¤­
¤Ç¤Ï¤Ê¤¤¡¢¤È¤¤¤¦µ¤¤¬¤·¤Þ¤¹¤¬º£²ó¤Î¾ì¹ç¤ÏÀ®²Ì¤òȯɽ¤·¤¿¤¤¤¬¤É¤¦¤·
¤¿¤é¤è¤¤¤«¡©¤È¤¤¤¦ÏäΤ褦¤Ë¸«¼õ¤±¤é¤ì¤Þ¤¹¤¬¡¢¤¤¤«¤¬¤Ç¤·¤ç¤¦¡©
¡Êñ¤ËÕûÍý¶þ¤Ç¤·¤ç¤¦¤«¡©¡Ë
¸Ä¿ÍŪ¤Ë¤Ï¡¢¤¿¤È¤¨¤Ð·×»»µ¡¤¬¤ï¤ê¤Ë½½¿ÊBASIC¤ò¤Ä¤«¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë
¤½¤Î·×»»·ë²Ì¤ä·×»»¼°¤ò¤¹¤Ù¤Æ¸¦µæ·ë²Ì¤È¤·¤Æ¸ø³«¤¹¤Ù¤­¤«¤È¤¤¤ï¤ì
¤ì¤Ð¡¢Åú¤¨¤Ï No ¤Ç¤Ï¤Ê¤¤¤«¤È»×¤¤¤Þ¤¹¡£
¸¦µæ·ë²Ì¤Îȯɽ¤È¤¤¤¦·Á¤Ç¤³¤Î¥³¥ß¥å¥Ë¥Æ¥£¤Ë²¿¤é¤«¤Î¹×¸¥¤¬¤Ç¤­¤ì¤Ð
¤È¤¤¤¦»ÑÀª¤¬½ÅÍפʤΤǤϤʤ¤¤«¤È»×¤¤¤Þ¤¹¡£
¤â¤Á¤í¤ó¡¢¤½¤¦¤¤¤Ã¤¿»ÈÍѤÏÉԲĤÀ¤È¤¤¤¦¤³¤È¤Ç¤¢¤ì¤ÐÏäÏÊ̤Ǥ¹¤¬¡£
 

Re: ÉÁ²è¸øɽ¤È¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§Ï»¹Ã¤Î½é¿´¼Ô  Åê¹ÆÆü¡§2009ǯ 5·î11Æü(·î)09»þ11ʬ38ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.366[¸µµ­»ö¤Ø]

¤Ê¤«¤à¤é¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

ÅöÊý¤Î¼ñ»Ý¤ò¤â¤¦°ìÅÙÊá¤é¤¨¤Æ¤¤¤¿¤À¤¤¤Æ¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹
Ëؤɤʤ«¤à¤é¤µ¤ó¤Î¤ª¤Ã¤·¤ã¤ë¤È¤ª¤ê¤Ç¤¹

ÀΤ«¤éµ¤·Ú¤Ë»È¤¤¡Ê¡Á£³£°Ç¯¡Ë·×»»¤ä¥°¥é¥Õɽ¼¨¤ò¤¿¤Î¤·¤ó¤Ç¤­¤Þ¤·¤¿
¿ôǯÁ°¤«¤é¤Ê¤ó¤È̵¤·¤Ë¼è¤êÁȤó¤Ç¡Ê¤³¤Î¤È¤­¤³¤ÎBASIC¤ò¥À¥¦¥ó¥í¡¼¥É¤·¤¿¤È»×¤ï¤ì¤ë¡Ë¤­¤¿¥Æ¡¼¥Þ¤¬¡¢ºÇ¶á·ë²Ì¤¬½Ð¤ë¤è¤¦¤Ë¤Ê¤ê¤³¤Î´Ø·¸¼Ô¤Ë¤Ï¤«¤Ê¤êÌò¤ËΩ¤Ä¤Î¤Ç¤Ï¤Ê¤¤¤«¤È»×¤¤¸ø³«¤·¤Æɾ²Á¤·¤Æ¤â¤é¤ª¤¦¤«¤È¹Í¤¨¤Þ¤·¤¿
¤·¤«¤·¡¢¤³¤Î·ï¤Ç¤ÏÂçÊѤʻþ´Ö¡Ê£³Ëü»þ´Ö°Ê¾å¡Ë¤ÈÏ«ÎϤ¬³Ý¤Ã¤Æ¤¤¤ë¡£³Î¤«Â¾¤Î¸À¸ì¤Ç¤Ï²¿¤«½èÍý¤ò¤·¤Æ¥½¡¼¥¹¥×¥í¥°¥é¥à¤¬¤ï¤«¤é¤Ê¤¤¤è¤¦¤Ë¤Ê¤Ã¤¿¤Ï¤º¡¢BASIC¤Ç¤â²¿¤«ÊýË¡¤¬¤¢¤ë¤Î¤«¤Ê

¤È»×¤Ã¤Æ¡¢ÅöÊý¤ÎºÇ½é¤Î¼ÁÌä¤Ë¤Ê¤Ã¤¿¤ï¤±¤Ç¤¹¡£¤½¤·¤¿¤é¡¢¤¹¤Ù¤Æ¸ø³«¤¹¤ëµ¬Äê¤Î¤¢¤ë¤³¤È¤òÃΤ餵¤ì¤¿¤ï¤±¤Ç¤¹

ÅöÊý¤ÎȯÁۤοô²Õ½ê¤ÎÉôʬ¤Î¸¢Íø¤¬Êݸ¤ì¤ì¤Ð¤Ê¤ó¤éÌäÂê¤Ï¤Ê¤¤¤Î¤Ç¤¹¤¬¡¢¾¯¤Ê¤¯¤È¤â¤½¤ì¤Þ¤Ç¤ÏÃæ¿È¤Î¸ø³«¤òÈò¤±¤ëÊýË¡¤¬¤¢¤ì¤Ð¡¢¤È¤¤¤¦¤³¤È¤Ç¤¹

¤Ê¤«¤à¤é¤µ¤ó¤â¤´Â¸ÃΤʤ¤¤È¤¤¤¦¤³¤È¤Ç¤¹¤¬¡¢¤ä¤Ã¤Ñ¤ê¤³¤Î¸À¸ì¤ò»È¤Ã¤Æ¤·¤Þ¤Ã¤¿½ÉÌ¿¤Ç¤·¤ç¤¦¤«

Ä´¤Ù¤Þ¤·¤¿¤é¡¢Ê¸¶µÂç³Ø¤ÎÇòÀÐÏÂÉ׶µ¼ø¤È¤Î¤³¤È¤Ç¤¹¤Í¡£
ÇòÀжµ¼øÅ¡¢À§Èó¤È¤âÅöÊý¤ÎǺ¤ß¤Ë¶µ°é¼Ô¤È¤·¤Æ¤ªÅú¤¨¤¯¤À¤µ¤¤¡£
¤Þ¤¿¤Ï¸¢Íø¤Îº¬µò¤ò¤ª¼¨¤·¤¤¤¿¤À¤±¤ì¤Ð¨²ò·è¤Ç¤¹¡£


> Ï»¹Ã¤Î½é¿´¼Ô¤µ¤ó¡¢SECOND¤µ¤ó¤Ø¤Î¥³¥á¥ó¥È¤Ç¤¹¡£
>
> ˡΧ¤ÎÀìÌç²È¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¤¬¡¢¸Ä¿ÍŪ¤Ê°Õ¸«¤ò½Ò¤Ù¤µ¤»¤Æ¤¯¤À¤µ¤¤¡£
>
> ¡ÖËÜBASIC¤òÍøÍѤ·¤ÆÆÀ¤é¤ì¤¿¸¦µæ·ë²Ì¤Ïɬ¤º¸ø³«¤·¤Æ¤¯¤À¤µ¤¤¡£¡×
>
> ¤È¤¢¤ê¤Þ¤¹¤Î¤Ç¡¢¸¦µæ·ë²Ì¤Î¸ø³«¤Ï¸¶Â§¤È¤·¤ÆÍ×ÀÁ¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤È
> ¹Í¤¨¤é¤ì¤Þ¤¹¡£
> ¤·¤«¤·¡¢Í×ÀÁ¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤Ï¸¦µæ·ë²Ì¤Ç¤¹¤Î¤Ç¡¢¤½¤ì¤¬¤¹¤Ê¤ï¤Á
> ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹¥³¡¼¥É¤Ç¤¢¤ë¤«Èݤ«¤Ï¾ì¹ç¤Ë¤è¤ë¤«¤È¹Í¤¨¤Þ¤¹¡£
>
> ¤¿¤È¤¨¤Ð¡¢¤¢¤ë¥¯¥é¥¹¤ÎÀ¸Å̤˽½¿ÊBASIC¤È¾¤Î¸À¸ì¤ò¤Ä¤«¤Ã¤Æ¡¢
> ¥³¥ó¥Ô¥å¡¼¥¿¤Î¼ø¶È¤ò¹Ô¤Ã¤¿¤È¤­¡Ê¤¿¤È¤¨¤Ð»°³Ñ·Á¤ÎÌÌÀѤò¤â¤È¤á
> ¤µ¤»¤ë¤È¤«¡Ë¡¢¤É¤Á¤é¤Î¸À¸ì¤òÍѤ¤¤¿¤Û¤¦¤¬¤è¤êÍý²ò¤¬Íưפ«¡©
> ¤È¤¤¤¦Ä´ºº¤ò¹Ô¤Ã¤¿¾ì¹ç¡¢¤³¤Î·ë²Ì¤ÏÍý²òÅ٤κ¹¤Ç¤¢¤ê¡¢¤½¤Î¤È¤­
> ÍѤ¤¤¿»°³Ñ·Á¤ÎÌÌÀѤòµá¤á¤ë¥×¥í¥°¥é¥à¤Ç¤Ï¤Ê¤¤¤È»×¤¤¤Þ¤¹¡£
> ¡ÊÈæ³Ó¤òÀµ³Î¤Ë¹Ô¤¦¤¿¤á¤Ë¤Ï¥½¡¼¥¹¥³¡¼¥É¤ÎÈæ³Ó¤âɬÍפ«¤â¤·¤ì¤Þ
> ¤»¤ó¤¬¡Ë
>
> ¤·¤¿¤¬¤Ã¤Æ¡¢Ï»¹Ã¤Î½é¿´¼Ô¤µ¤ó¤ÎºÇ½é¤Î¤´¼ÁÌä¤Ë¤â¤É¤Ã¤Æ¡¢
> ȯɽ¤·¤¿¤¤À®²Ì¤¬¤¢¤ë¤¬¡¢¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹¤¹¤Ù¤Æ¤Ï¸ø³«¤·¤¿¤¯¤Ê¤¤¡¢
> ¤É¤¦¤·¤¿¤é¤è¤¤¤«¡©
> ¤È¤¤¤¦¤È¤³¤í¤ËÃηäò¹Ê¤ë¤È¤¤¤¦¤³¤È¤ÇÎɤ¤¤Î¤Ç¤Ï¤Ê¤¤¤«¤È»×¤¤¤Þ¤¹¡£
> »ÄÇ°¤Ê¤¬¤é¸½¾õ¤Ç¤Ï¤É¤Î¤è¤¦¤ÊÊýË¡¤¬¤¢¤ë¤«»ä¤Ë¤Ï¸«Åö¤¬¤Ä¤­¤Þ¤»¤ó¤¬¡£
>
> ¸¦µæ¤Î·ë²Ì¤ò¸ø³«¤·¤¿¤¯¤Ê¤¤¡¢¤È¤¤¤¦¤Î¤Ç¤¢¤ì¤Ð¡¢½½¿ÊBASIC¤Ï»È¤¦¤Ù¤­
> ¤Ç¤Ï¤Ê¤¤¡¢¤È¤¤¤¦µ¤¤¬¤·¤Þ¤¹¤¬º£²ó¤Î¾ì¹ç¤ÏÀ®²Ì¤òȯɽ¤·¤¿¤¤¤¬¤É¤¦¤·
> ¤¿¤é¤è¤¤¤«¡©¤È¤¤¤¦ÏäΤ褦¤Ë¸«¼õ¤±¤é¤ì¤Þ¤¹¤¬¡¢¤¤¤«¤¬¤Ç¤·¤ç¤¦¡©
> ¡Êñ¤ËÕûÍý¶þ¤Ç¤·¤ç¤¦¤«¡©¡Ë
> ¸Ä¿ÍŪ¤Ë¤Ï¡¢¤¿¤È¤¨¤Ð·×»»µ¡¤¬¤ï¤ê¤Ë½½¿ÊBASIC¤ò¤Ä¤«¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë
> ¤½¤Î·×»»·ë²Ì¤ä·×»»¼°¤ò¤¹¤Ù¤Æ¸¦µæ·ë²Ì¤È¤·¤Æ¸ø³«¤¹¤Ù¤­¤«¤È¤¤¤ï¤ì
> ¤ì¤Ð¡¢Åú¤¨¤Ï No ¤Ç¤Ï¤Ê¤¤¤«¤È»×¤¤¤Þ¤¹¡£
> ¸¦µæ·ë²Ì¤Îȯɽ¤È¤¤¤¦·Á¤Ç¤³¤Î¥³¥ß¥å¥Ë¥Æ¥£¤Ë²¿¤é¤«¤Î¹×¸¥¤¬¤Ç¤­¤ì¤Ð
> ¤È¤¤¤¦»ÑÀª¤¬½ÅÍפʤΤǤϤʤ¤¤«¤È»×¤¤¤Þ¤¹¡£
> ¤â¤Á¤í¤ó¡¢¤½¤¦¤¤¤Ã¤¿»ÈÍѤÏÉԲĤÀ¤È¤¤¤¦¤³¤È¤Ç¤¢¤ì¤ÐÏäÏÊ̤Ǥ¹¤¬¡£
 

Re: ÉÁ²è¸øɽ¤È¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 5·î11Æü(·î)10»þ13ʬ33ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.365[¸µµ­»ö¤Ø]

¸¦µæ·ë²Ì¤Î¸ø³«¤Ë¤Ä¤¤¤Æ¤Ï¡¤¤½¤ÎÊýË¡¤ä»þ´ü¤Ê¤É¤Ë¤Ä¤¤¤Æ²¿¤â¸ÀµÚ¤·¤Æ¤¤¤Ê¤¤¤Î¤Ç¡¤
¤µ¤Û¤É¼Â¸úÀ­¤Î¤¢¤ëµ¬Äê¤È¤Ï»×¤Ã¤Æ¤¤¤Þ¤»¤ó¤¬¡¤
¥Õ¥ê¡¼¥½¥Õ¥È¤Ï¥³¥ß¥å¥Ë¥Æ¥£¤Ë¤è¤Ã¤Æ°é¤Æ¤é¤ì¤ë¤â¤Î¤Ç¤¢¤ë¤³¤È¤Ê¤É¡¤
¥Õ¥ê¡¼¥½¥Õ¥È¤È¤·¤Æ¸ø³«¤·¤Æ¤¤¤ë¤³¤È¤Î°ÕÌ£¤òÍý²ò¤·¤¿¾å¤Ç¤´ÍøÍѤ¤¤¿¤À¤­¤¿¤¤¤È»×¤¤¤Þ¤¹¡£
 

Re: ÉÁ²è¸øɽ¤È¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§Ï»¹Ã¤Î½é¿´¼Ô  Åê¹ÆÆü¡§2009ǯ 5·î11Æü(·î)11»þ06ʬ19ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.368[¸µµ­»ö¤Ø]

ÇòÀС¡ÏÂÉפµ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

ÁᮤÎÀèÀ¸¤«¤é¤Î¤´ÊÖ¿®¤ò¤¤¤¿¤À¤­¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹
¤·¤«¤·ÅöÊý¤Î´õ˾¤·¤¿¤ªÅú¤¨¤È¤ÏÎ¥¤ì¤Æ¤¤¤Þ¤¹
¤´Ëܿͤ¬¤¢¤¤¤Þ¤¤¤Ë¸À¤¦¤³¤È¤Ë¤è¤Ã¤ÆºÑ¤Þ¤»¤¿¤È¤·¤Æ¤â¼þ¤ê¤ÎÊý¡¹¤Ï½½Ê¬¤ÊÇÛθ¤ò½Å¤Í¤ÆºÇÂç¸Â¤Î´õ˾¤¬¤½¤³¤Ë¤¢¤ë¤È²ò¼á¤·Î®ÉÛ¤¹¤ë¤³¤È¤Ç¤·¤ç¤¦¡¡Âç³Ø¤Ç¤ÏÅöÁ³¤Î¤Ê¤ê¤æ¤­¤Ç¤¹

½½Ê¬¤ÊÃÏ°Ì¡¢Ì¾À¼¤â¤¹¤Ç¤ËÆÀ¤é¤ì¤¿¤³¤È¤Ç¤¹¤«¤é¡¡¤Ä¤Þ¤é¤ó¸À¤¤¤¬¤«¤ê¤òÈò¤±¤ë¤¿¤á¤ËÃøºî¸¢¤Î¤È¤³¤í¤Îɽ¸½¤ò¾¯¤·ÊѤ¨¤Æ¸«¤é¤ì¤ë¤³¤È¤ò¤ª´«¤á¤·¤Þ¤¹

ÆÃÄê¤Î¥³¥ß¥å¥Ë¥Æ¥£¤È¤Ï´Ø·¸¤Ê¤¯¤³¤Ä¤³¤ÄÀ®²Ì¤¬¾å¤¬¤ë¤³¤È¤â¤¢¤ê¤Þ¤¹¡£¼êÃʤι©Éפ«¤é¤Ç¤Ï¤Ê¤¯ËܼÁŪ¸½¾Ý¤òª¤¨¤¿¾ì¹ç¤Ê¤É¤Ç¤¹

¤Þ¤µ¤«¤½¤ì¤òÊá¤é¤¨¤ë¤¿¤á¤ÎÌ֤ǤϤʤ¤¤Ç¤·¤ç¤¦¤Í

> ¸¦µæ·ë²Ì¤Î¸ø³«¤Ë¤Ä¤¤¤Æ¤Ï¡¤¤½¤ÎÊýË¡¤ä»þ´ü¤Ê¤É¤Ë¤Ä¤¤¤Æ²¿¤â¸ÀµÚ¤·¤Æ¤¤¤Ê¤¤¤Î¤Ç¡¤
> ¤µ¤Û¤É¼Â¸úÀ­¤Î¤¢¤ëµ¬Äê¤È¤Ï»×¤Ã¤Æ¤¤¤Þ¤»¤ó¤¬¡¤
> ¥Õ¥ê¡¼¥½¥Õ¥È¤Ï¥³¥ß¥å¥Ë¥Æ¥£¤Ë¤è¤Ã¤Æ°é¤Æ¤é¤ì¤ë¤â¤Î¤Ç¤¢¤ë¤³¤È¤Ê¤É¡¤
> ¥Õ¥ê¡¼¥½¥Õ¥È¤È¤·¤Æ¸ø³«¤·¤Æ¤¤¤ë¤³¤È¤Î°ÕÌ£¤òÍý²ò¤·¤¿¾å¤Ç¤´ÍøÍѤ¤¤¿¤À¤­¤¿¤¤¤È»×¤¤¤Þ¤¹¡£
 

Re: ÉÁ²è¸øɽ¤È¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 5·î11Æü(·î)16»þ58ʬ22ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.369[¸µµ­»ö¤Ø]

GPLÈǤϰۤʤ俥饤¥»¥ó¥¹¤Î¸µ¤ÇÇÛÉÛ¤·¤Æ¤¤¤Þ¤¹¡£
GPL¤ÎÍýÇ°¤ËƱ°Õ¤µ¤ì¤ë¤è¤¦¤Ç¤¢¤ì¤Ð¡¤GPLÈǤò¤ª»È¤¤¤¯¤À¤µ¤¤¡£
WindowsÈǼ¹ԥե¡¥¤¥ë¤ÎÇÛÉۤϤ¢¤ê¤Þ¤»¤ó¤¬¡¤
³«È¯¤ÏWindows¾å¤Ç¹Ô¤Ã¤Æ¤¤¤ë¤Î¤Ç¡¤Windows¤Ç¤âÆ°ºî¤·¤Þ¤¹¡£
http://www.geocities.jp/thinking_math_education/IntelMac.htm#SOURCE
 

Re: ÉÁ²è¸øɽ¤È¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§Ï»¹Ã¤Î½é¿´¼Ô  Åê¹ÆÆü¡§2009ǯ 5·î12Æü(²Ð)05»þ00ʬ57ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.370[¸µµ­»ö¤Ø]

ÇòÀС¡ÏÂÉפµ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¤´ÊÖ»ö¤¬ÃÙ¤ì¤Þ¤·¤¿

Ãøºî¸¢¤Î¹à¤ÎÊѹ¹¤Î¤´°Õ»×¤Ï¤Ê¤·¤È¾µÃΤ·¤Þ¤·¤¿
¼ÂÀÓ¤¢¤ëÀèÀ¸¤Î̾À¼¤Ë½ý¤ò¤Ä¤±¤ëµ¤¤ÏÁ´¤¯¤¢¤ê¤Þ¤»¤ó¤Î¤Ç¤³¤Î¾ì¤Ç¤ÎµÄÏÀ¤ÏÅöÊý¤È¤·¤Æ¤Ï¤³¤ì¤Þ¤Ç¤È¤·¤Þ¤¹

¤¿¤À¡¢ÀèÀ¸¤Ë¤È¤Ã¤Æ¥Þ¥¤¥Ê¥¹Í×°ø¤È¤Ê¤ê¤¦¤ëÅö³º¤Î»ö¹à¤ÎÊѹ¹¤Ï¶¯¤¯¤ª´«¤á¤·¤Þ¤¹¡ÊˡŪ¤Ë¤â¶¯¤¯¤Ê¤¤¤È»×¤¤¤Þ¤¹¡Ë¡¡¤³¤Î¤è¤¦¤ÊÀ¼¤ÏÂç³Ø¤ÎÀ¤³¦¤Ç¤Ï¤Ï¤Ê¤«¤Ê¤«Ê¹¤³¤¨¤Ê¤¤¤È»×¤¤¤Þ¤¹¤¬¡¢ÅöÊý¤Î¤è¤¦¤Ê¾õ¶·¤Ë¤Ê¤Ã¤¿¿Í¤Ï¤¤¤¯¤é¤Ç¤â¤¤¤ë¤Î¤Ç¤Ï¤Ê¤¤¤Ç¤¹¤«
¹¹¤Ë¡¢¤½¤Î¤è¤¦¤Ê¿Í¤¬½Ð¤Ê¤¤¤è¤¦¤Ë¡Ö¾ò·ïÉÕ¤­¥Õ¥ê¡¼¥½¥Õ¥Õ¥È¡×¤Ç¤¢¤ë¤³¤È¤òÌÀ³Î¤Ë¤¦¤¿¤¦¤Ù¤­¤Ç¤¹¡¡¤¦¤Ã¤«¤ê¥À¥¦¥ó¥í¡¼¥É¤µ¤ì¤ë¤Î¤òËɤ¤¤Ç¤¯¤À¤µ¤¤

¤â¤·¡¢Êѹ¹¤µ¤ì¤ë¾ì¹ç¤Ï¡¢¤³¤Î¾ì¤Ë¤ª¤¤¤Æ¤ªÃΤ餻¤¤¤¿¤À¤¯¤è¤¦¤ª´ê¤¤¤·¤Þ¤¹



> GPLÈǤϰۤʤ俥饤¥»¥ó¥¹¤Î¸µ¤ÇÇÛÉÛ¤·¤Æ¤¤¤Þ¤¹¡£
> GPL¤ÎÍýÇ°¤ËƱ°Õ¤µ¤ì¤ë¤è¤¦¤Ç¤¢¤ì¤Ð¡¤GPLÈǤò¤ª»È¤¤¤¯¤À¤µ¤¤¡£
> WindowsÈǼ¹ԥե¡¥¤¥ë¤ÎÇÛÉۤϤ¢¤ê¤Þ¤»¤ó¤¬¡¤
> ³«È¯¤ÏWindows¾å¤Ç¹Ô¤Ã¤Æ¤¤¤ë¤Î¤Ç¡¤Windows¤Ç¤âÆ°ºî¤·¤Þ¤¹¡£
> http://www.geocities.jp/thinking_math_education/IntelMac.htm#SOURCE
 

Re: ÉÁ²è¸øɽ¤È¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 5·î12Æü(²Ð)09»þ11ʬ39ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.371[¸µµ­»ö¤Ø]

Ï»¹Ã¤Î½é¿´¼Ô¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¥Õ¥ê¡¼¥½¥Õ¥È¤Ç¤¢¤ë°Ê¾å¡¤ºî¼Ô¤ÎÄê¤á¤¿»ÈÍѾò·ï¤¬¹ç¤ï¤Ê¤¤¤È´¶¤¸¤¿¤é¡¤
¤½¤Î»þÅÀ¤Ç»îÍѤò¤¢¤­¤é¤á¤Æ¤¤¤¿¤À¤¯¤·¤«¤¢¤ê¤Þ¤»¤ó¡£
¤¿¤È¤¨¤Ð¡¤¥Ð¥°Êó¹ð¤ò¤·¤¿¤¯¤Ê¤¤¤È¤¤¤¦¿Í¤Ï¡¤¥Ð¥°¤òȯ¸«¤·¤¿»þÅÀ¤Ç
°Ê¸å¡¤»ÈÍѤ¹¤ë¸¢Íø¤ò¼º¤¤¤Þ¤¹¡£

¤Ê¤ª¡¤¥Õ¥ê¡¼¥½¥Õ¥È¤Ë¤Ï¡¡¡Éas is¡É¤Ç¤¢¤ë¤³¤È¤ò¶¯Ä´¤·¤¿¤â¤Î¤â¤¢¤ê¤Þ¤¹¤¬¡¤
½½¿ÊBASIC¤Ï¤½¤ì¤È¤Ï°Û¤Ê¤ê¡¤ÍøÍѼԤȤȤâ¤Ë°é¤Æ¤Æ¤¤¤¯¤³¤È¤òÌܻؤ·¤¿¥Õ¥ê¡¼¥½¥Õ¥È¤Ç¤¹¡£
¤½¤ÎÍýÇ°¤Ë»¿Æ±¤µ¤ì¤ëÊý¤Ë»È¤Ã¤Æ¤¤¤¿¤À¤­¤¿¤¯»×¤¤¤Þ¤¹¡£
 

½ô·»ÅÂ

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 5·î12Æü(²Ð)13»þ15ʬ51ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ½ô·»ÅÂ
°á¿©½»Â­¤ê¤Ê¤±¤ì¤Ð¡¢¤¢¤é¤æ¤ëµÁ̳¤Ï¡¢Ìµ¤¤¤Ç¤¹¤Í¡£¤·¤«¤·¡¢¤½¤¦¤Ç¤Ê¤«¤Ã¤¿¤Ê¤é¡¢
Êٳؤȶµ°é¤Ï¡¢¿ÍÎब¡¢Ãϵå´Ä¶­¤ØÊÖ¤»¤ë¡¡Í£°ì¤Î»Ùʧ¤¤¤Î¥Ó¥¸¥Í¥¹¤Ç¤Ï¤Ê¤¤¤À¤í¤¦¤«¡£
¤³¤ÎÉÔʧ¤¤¤¬¡¢Å·ºÒ¤Ë¤Ä¤Ê¤¬¤é¤Ê¤¤¤«¤ò¡¢¿´ÇÛ¤¹¤ë¡£

¤½¤ÎÀΡ¢Ë·¼ç¤¿¤Á¤Ï¡¢¿§Â¨À§¶õ¡Ê¤·¤­¤½¤¯¤¼¤¯¤¦¡Ë¤È¾§¤¨¤Æ¤¤¤Þ¤·¤¿¡£
¾¤Î¿Í¤â¡¢¼«Ê¬¤ÈƱ¤¸Íͤˡ¢¥â¥Î¤ò¸«¤Æ¤¤¤ë¤È¡¢»×¤¦¤Î¤Ï¡¢´Ö°ã¤¤¤Î°ÕÌ£¤Ç¤¹¡£
ǧ¼±¤È²ÁÃʹѤϡ¢ÁêÂÐÀ­¤Ç¡¢¿Í¤Ë¤è¤ê¡¢¼Â¤Ë¡¢ÍÍ¡¹°ã¤¤¤Þ¤¹¡£

£±¤Ä¤Î¸À¸ì¥·¥¹¥Æ¥à¤ò¡¢µ­½Ò¤·¡¢¤½¤Î¥Ç¥Ð¥Ã¥°¤ò³¤±¤ë»ö¤Ï¡¢°ìÀ¸¤òÈñ¤ä¤¹¤Û¤ÉÂçÊѤʡ¢
ºî¶È¤Ç¤¹¡£À¸¹ÃÈ夬¡¢½Å¤Ê¤é¤Ê¤¤¸Â¤ê¡¢Íø³²¤À¤±¤Ç½ÐÍè¤ë»ö¤Ç¤Ï¡¢¤¢¤ê¤Þ¤»¤ó¡£
¥Õ¥ê¡¼¥½¥Õ¥È¤Ç¤¹¤«¤é¡¢¤´¼«Í³¤Ë¤Ê¤ë¤Ç¤·¤ç¤¦¡£

»ä¤â¡¢¤Ç¤·¤ã¤Ð¤ê¤¹¤®¤¿¤È¡¢È¿¾Ê¤·¤Æ¤ª¤ê¤Þ¤¹¡£
 

ʸ»ú¤ÎÊÑ´¹

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 5·î12Æü(²Ð)13»þ39ʬ43ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¤Ò¤é¤¬¤Ê
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¢¬¢­
¡¡È¾³Ñ¥«¥¿¥«¥Ê¡¡¢ª¡¡Á´³Ñ¥«¥¿¥«¥Ê
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¢«
¡¡È¾³Ñ¿ô»ú¡¡¡¡¡¡¡¡¡¡Á´³Ñ¿ô»ú
¡¡È¾³Ñ±Ñ»ú¡¡¡¡¡¡¡¡¡¡Á´³Ñ±Ñ»ú
¡¡È¾³Ñµ­¹æ¡¡¡¡¡¡¡¡¡¡Á´³Ñµ­¹æ

¤ò¹Ô¤¦¥µ¥Ö¥ë¡¼¥Á¥ó¤ò¤Ä¤¯¤Ã¤Æ¤ß¤Þ¤·¤¿¡£

DECLARE EXTERNAL FUNCTION StrConv.ASC$ ,StrConv.JIS$ !Ⱦ³Ñ¡¢Á´³Ñ
DECLARE EXTERNAL FUNCTION StrConv.ToHiragana$ ,StrConv.ToKatakana$ !¤Ò¤é¤¬¤Ê¡¢¥«¥¿¥«¥Ê


LET t$="BASIC¥×¥í¥°¥é¥ß¥ó¥°¡¼¤¥¡Á¡ª"
PRINT ASC$(t$) !Ⱦ³Ñ¤Ø
PRINT JIS$(ASC$(t$)) !Á´³Ñ¤Ø

PRINT ToKatakana$("abcXYZ¤¢¤¤¤¦¥«¥­¥¯890 *?")
PRINT ToHiragana$("abcXYZ¤¢¤¤¤¦¥«¥­¥¯890 *?")

END


MODULE StrConv !ʸ»ú¤ÎÊÑ´¹

!¡ÖȾ³Ñ ¢ª Á´³Ñ¡×Âбþɽ¡¡¢¨JIS¥³¡¼¥É¡ÊJIS X 0201¡Ë½ç
DATA " ","¡¡" !32
DATA "!","¡ª" !33
DATA """","¡É" !34
DATA "#","¡ô" !35
DATA "$","¡ð" !36
DATA "%","¡ó" !37
DATA "&","¡õ" !38
DATA "'","¡Ç" !39
DATA "(","¡Ê" !40
DATA ")","¡Ë" !41
DATA "*","¡ö" !42
DATA "+","¡Ü" !43
DATA ",","¡¤" !44
DATA "-","¡Ý" !45
DATA ".","¡¥" !46
DATA "/","¡¿" !47
DATA "0","£°" !48
DATA "1","£±" !49
DATA "2","£²" !50
DATA "3","£³" !51
DATA "4","£´" !52
DATA "5","£µ" !53
DATA "6","£¶" !54
DATA "7","£·" !55
DATA "8","£¸" !56
DATA "9","£¹" !57
DATA ":","¡§" !58
DATA ";","¡¨" !59
DATA "<","¡ã" !60
DATA "=","¡á" !61
DATA ">","¡ä" !62
DATA "?","¡©" !63
DATA "@","¡÷" !64
DATA "A","£Á" !65
DATA "B","£Â" !66
DATA "C","£Ã" !67
DATA "D","£Ä" !68
DATA "E","£Å" !69
DATA "F","£Æ" !70
DATA "G","£Ç" !71
DATA "H","£È" !72
DATA "I","£É" !73
DATA "J","£Ê" !74
DATA "K","£Ë" !75
DATA "L","£Ì" !76
DATA "M","£Í" !77
DATA "N","£Î" !78
DATA "O","£Ï" !79
DATA "P","£Ð" !80
DATA "Q","£Ñ" !81
DATA "R","£Ò" !82
DATA "S","£Ó" !83
DATA "T","£Ô" !84
DATA "U","£Õ" !85
DATA "V","£Ö" !86
DATA "W","£×" !87
DATA "X","£Ø" !88
DATA "Y","£Ù" !89
DATA "Z","£Ú" !90
DATA "[","¡Î" !91
DATA "\","¡ï" !92
DATA "]","¡Ï" !93
DATA "^","¡°" !94
DATA "_","¡²" !95
DATA "`","¡Æ" !96
DATA "a","£á" !97
DATA "b","£â" !98
DATA "c","£ã" !99
DATA "d","£ä" !100
DATA "e","£å" !101
DATA "f","£æ" !102
DATA "g","£ç" !103
DATA "h","£è" !104
DATA "i","£é" !105
DATA "j","£ê" !106
DATA "k","£ë" !107
DATA "l","£ì" !108
DATA "m","£í" !109
DATA "n","£î" !110
DATA "o","£ï" !111
DATA "p","£ð" !112
DATA "q","£ñ" !113
DATA "r","£ò" !114
DATA "s","£ó" !115
DATA "t","£ô" !116
DATA "u","£õ" !117
DATA "v","£ö" !118
DATA "w","£÷" !119
DATA "x","£ø" !120
DATA "y","£ù" !121
DATA "z","£ú" !122
DATA "{","¡Ð" !123
DATA "|","¡Ã" !124
DATA "}","¡Ñ" !125
DATA "~","¡Á" !126

DATA "Ž¡","¡£" !161
DATA "Ž¢","¡Ö" !162
DATA "Ž£","¡×" !163
DATA "Ž¤","¡¢" !164
DATA "Ž¥","¡¦" !165
DATA "Ž¦","¥ò" !166
DATA "Ž§","¥¡" !167
DATA "Ž¨","¥£" !168
DATA "Ž©","¥¥" !169
DATA "Žª","¥§" !170
DATA "Ž«","¥©" !171
DATA "Ž¬","¥ã" !172
DATA "Ž­","¥å" !173
DATA "Ž®","¥ç" !174
DATA "Ž¯","¥Ã" !175
DATA "Ž°","¡¼" !176
DATA "Ž±","¥¢" !177
DATA "Ž²","¥¤" !178
DATA "Ž³","¥¦" !179
DATA "Ž´","¥¨" !180
DATA "Žµ","¥ª" !181
DATA "Ž¶","¥«" !182
DATA "Ž·","¥­" !183
DATA "Ž¸","¥¯" !184
DATA "Ž¹","¥±" !185
DATA "Žº","¥³" !186
DATA "Ž»","¥µ" !187
DATA "Ž¼","¥·" !188
DATA "Ž½","¥¹" !189
DATA "Ž¾","¥»" !190
DATA "Ž¿","¥½" !191
DATA "ŽÀ","¥¿" !192
DATA "ŽÁ","¥Á" !193
DATA "ŽÂ","¥Ä" !194
DATA "ŽÃ","¥Æ" !195
DATA "ŽÄ","¥È" !196
DATA "ŽÅ","¥Ê" !197
DATA "ŽÆ","¥Ë" !198
DATA "ŽÇ","¥Ì" !199
DATA "ŽÈ","¥Í" !200
DATA "ŽÉ","¥Î" !201
DATA "ŽÊ","¥Ï" !202
DATA "ŽË","¥Ò" !203
DATA "ŽÌ","¥Õ" !204
DATA "ŽÍ","¥Ø" !205
DATA "ŽÎ","¥Û" !206
DATA "ŽÏ","¥Þ" !207
DATA "ŽÐ","¥ß" !208
DATA "ŽÑ","¥à" !209
DATA "ŽÒ","¥á" !210
DATA "ŽÓ","¥â" !211
DATA "ŽÔ","¥ä" !212
DATA "ŽÕ","¥æ" !213
DATA "ŽÖ","¥è" !214
DATA "Ž×","¥é" !215
DATA "ŽØ","¥ê" !216
DATA "ŽÙ","¥ë" !217
DATA "ŽÚ","¥ì" !218
DATA "ŽÛ","¥í" !219
DATA "ŽÜ","¥ï" !220
DATA "ŽÝ","¥ó" !221
DATA "ŽÞ","¡«" !222
DATA "Žß","¡¬" !223


!¡ÖÁ´³Ñ¥«¥¿¥«¥Ê ¢ª Ⱦ³Ñ¥«¥¿¥«¥Ê¡×¤ÎÂбþɽ
DATA "¥¡","Ž§", "¥¢","Ž±", "¥£","Ž¨", "¥¤","Ž²", "¥¥","Ž©", "¥¦","Ž³", "¥§","Žª", "¥¨","Ž´", "¥©","Ž«", "¥ª","Žµ"
DATA "¥«","Ž¶", "¥¬","Ž¶ŽÞ", "¥­","Ž·", "¥®","Ž·ŽÞ", "¥¯","Ž¸", "¥°","Ž¸ŽÞ", "¥±","Ž¹", "¥²","Ž¹ŽÞ", "¥³","Žº", "¥´","ŽºŽÞ"
DATA "¥µ","Ž»", "¥¶","Ž»ŽÞ", "¥·","Ž¼", "¥¸","Ž¼ŽÞ", "¥¹","Ž½", "¥º","Ž½ŽÞ", "¥»","Ž¾", "¥¼","Ž¾ŽÞ", "¥½","Ž¿", "¥¾","Ž¿ŽÞ"
DATA "¥¿","ŽÀ", "¥À","ŽÀŽÞ", "¥Á","ŽÁ", "¥Â","ŽÁŽÞ", "¥Ã","Ž¯", "¥Ä","ŽÂ", "¥Å","ŽÂŽÞ", "¥Æ","ŽÃ", "¥Ç","ŽÃŽÞ", "¥È","ŽÄ", "¥É","ŽÄŽÞ"
DATA "¥Ê","ŽÅ", "¥Ë","ŽÆ", "¥Ì","ŽÇ", "¥Í","ŽÈ", "¥Î","ŽÉ"
DATA "¥Ï","ŽÊ", "¥Ð","ŽÊŽÞ", "¥Ñ","ŽÊŽß", "¥Ò","ŽË", "¥Ó","ŽËŽÞ", "¥Ô","ŽËŽß", "¥Õ","ŽÌ", "¥Ö","ŽÌŽÞ", "¥×","ŽÌŽß", "¥Ø","ŽÍ", "¥Ù","ŽÍŽÞ", "¥Ú","ŽÍŽß", "¥Û","ŽÎ", "¥Ü","ŽÎŽÞ", "¥Ý","ŽÎŽß"
DATA "¥Þ","ŽÏ", "¥ß","ŽÐ", "¥à","ŽÑ", "¥á","ŽÒ", "¥â","ŽÓ"
DATA "¥ã","Ž¬", "¥ä","ŽÔ", "¥å","Ž­", "¥æ","ŽÕ", "¥ç","Ž®", "¥è","ŽÖ"
DATA "¥é","Ž×", "¥ê","ŽØ", "¥ë","ŽÙ", "¥ì","ŽÚ", "¥í","ŽÛ"
DATA "¥î","ŽÜ", "¥ï","ŽÜ", "¥ð","Ž²", "¥ñ","Ž´", "¥ò","Ž¦", "¥ó","ŽÝ", "¥ô","Ž³ŽÞ", "¥õ","Ž¶", "¥ö","Ž¹"


SHARE STRING JisTBL$(0 TO 255), KataTBL$(9505 TO 9590)
DO
   READ IF MISSING THEN EXIT DO : a$,aa$ !¥¤¥ó¥Ç¥Ã¥¯¥¹¡¢ÊÑ´¹ÃÍ
   IF ORD(a$)<256 THEN
      LET JisTBL$(ORD(a$))=aa$ !¥Ï¥Ã¥·¥åɽ¤ò¤Ä¤¯¤ë
   ELSE
      LET KataTBL$(ORD(a$))=aa$
   END IF
LOOP
!-------------------- ¤³¤³¤Þ¤Ç¤¬½é´ü½èÍý


¤Ä¤Å¤¯
 

Re: ʸ»ú¤ÎÊÑ´¹

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 5·î12Æü(²Ð)13»þ42ʬ8ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.374[¸µµ­»ö¤Ø]

¤Ä¤Å¤­

!´Ø¿ô¡¢¥µ¥Ö¥ë¡¼¥Á¥ó¤ÎÄêµÁ

PUBLIC FUNCTION ASC$
EXTERNAL FUNCTION ASC$(x$) !Á´³Ñʸ»ú¤òȾ³Ñʸ»ú¤ËÊÑ´¹¤¹¤ë
   LET xx$=""
   FOR i=1 TO LEN(x$) !ÂоݤÎʸ»úÎó¤Ë¤Ä¤¤¤Æ
      LET t=ORD(x$(i:i))

      SELECT CASE t
      CASE 9008 TO 9017 !¿ô»ú£°¡Á£¹
         LET w$=CHR$(t-ORD("£°")+ORD("0"))

      CASE 9025 TO 9050 !±Ñ»ú£Á¡Á£Ú
         LET w$=CHR$(t-ORD("£Ú")+ORD("Z"))
      CASE 9057 TO 9082 !±Ñ»ú£á¡Á£ú
         LET w$=CHR$(t-ORD("£ú")+ORD("z"))

      CASE 9505 TO 9590 !¥«¥¿¥«¥Ê
         LET w$=KataTBL$(t) !ÊÑ´¹É½¤ò»²¾È¤·¤ÆÃÖ¤­´¹¤¨¤ë

      CASE 8481 !µ­¹æ
         LET w$=" "
      CASE 8490
         LET w$="!"
      CASE 8521
         LET w$=""""
      CASE 8564
         LET w$="#"
      CASE 8560
         LET w$="$"
      CASE 8563
         LET w$="%"
      CASE 8565
         LET w$="&"
      CASE 8519
         LET w$="'"
      CASE 8522
         LET w$="("
      CASE 8523
         LET w$=")"
      CASE 8566
         LET w$="*"
      CASE 8540
         LET w$="+"
      CASE 8484
         LET w$=","
      CASE 8541
         LET w$="-"
      CASE 8485
         LET w$="."
      CASE 8511
         LET w$="/"
      CASE 8487
         LET w$=":"
      CASE 8488
         LET w$=";"
      CASE 8547
         LET w$="<"
      CASE 8545
         LET w$="="
      CASE 8548
         LET w$=">"
      CASE 8489
         LET w$="?"
      CASE 8567
         LET w$="@"
      CASE 8526
         LET w$="["
      CASE 8559
         LET w$="\"
      CASE 8527
         LET w$="]"
      CASE 8496
         LET w$="^"
      CASE 8498
         LET w$="_"
      CASE 8518
         LET w$="`"
      CASE 8528
         LET w$="{"
      CASE 8515
         LET w$="|"
      CASE 8529
         LET w$="}"
      CASE 8513
         LET w$="~"

      CASE 8483 !µ­¹æ¡¡¢¨¥«¥¿¥«¥Ê
         LET w$="Ž¡"
      CASE 8534
         LET w$="Ž¢"
      CASE 8535
         LET w$="Ž£"
      CASE 8482
         LET w$="Ž¤"
      CASE 8486
         LET w$="Ž¥"
      CASE 8508
         LET w$="Ž°"
      CASE 8491
         LET w$="ŽÞ"
      CASE 8492
         LET w$="Žß"

      CASE ELSE
         LET w$=CHR$(t) !¤½¤Î¤Þ¤Þ
      END SELECT

      LET xx$=xx$ & w$
   NEXT i
   LET ASC$=xx$
END FUNCTION

PUBLIC FUNCTION JIS$
EXTERNAL FUNCTION JIS$(x$) !Ⱦ³Ñʸ»ú¤òÁ´³Ñʸ»ú¤ËÊÑ´¹¤¹¤ë
   LET xx$=""
   LET i=1
   DO WHILE i<=LEN(x$) !ÂоÝʸ»ú¤ò½ç¤ËÄ´¤Ù¤ë
      LET t=ORD(x$(i:i))

      SELECT CASE t
      CASE 32 TO 126 !µ­¹æ¡¦±Ñ¿ô»ú¤Ê¤é
         LET xx$=xx$ & JisTBL$(t) !ÊÑ´¹É½¤ò»²¾È¤·¤ÆÃÖ¤­´¹¤¨¤ë
      CASE 161 TO 223 !Ⱦ³Ñ¥«¥¿¥«¥Ê¤Ê¤é
         IF i<LEN(x$) THEN LET tt=ORD(x$(i+1:i+1)) ELSE LET tt=0
         IF tt=222 AND ( (t>=182 AND t<=196) OR (t>=202 AND t<=206) ) THEN !¥«¡Á¥È¡¢¥Ï¡Á¥Û¤ÎÂùÅÀ
            LET xx$=xx$ & CHR$(ORD(JisTBL$(t))+1) !£±Ê¸»ú¤È¤¹¤ë
            LET i=i+1
         ELSEIF tt=223 AND (t>=202 AND t<=206) THEN !¥Ï¡Á¥Û¤ÎȾÂùÅÀ
            LET xx$=xx$ & CHR$(ORD(JisTBL$(t))+2)
            LET i=i+1
         ELSE
            LET xx$=xx$ & JisTBL$(t)
         END IF
      CASE ELSE !¤½¤ì°Ê³°¤Ê¤é
         LET xx$=xx$ & CHR$(t) !¤½¤Î¤Þ¤Þ
      END SELECT

      LET i=i+1 !¼¡¤Ø
   LOOP

   LET JIS$=xx$
END FUNCTION

PUBLIC FUNCTION ToHiragana$
EXTERNAL FUNCTION ToHiragana$(x$) !Á´³Ñ¥«¥¿¥«¥Ê¤ò¤Ò¤é¤¬¤Ê¤ËÊÑ´¹¤¹¤ë
   LET xx$=x$
   FOR i=1 TO LEN(x$) !ÂоÝʸ»ú¤ò½ç¤ËÄ´¤Ù¤ë
      LET t=ORD(x$(i:i))
      IF t<ORD("¥¡") OR t>ORD("¥ó") THEN
      ELSE
         LET xx$(i:i)=CHR$(t-ORD("¥¡")+ORD("¤¡"))
      END IF
   NEXT i
   LET ToHiragana$=xx$
END FUNCTION

PUBLIC FUNCTION ToKatakana$
EXTERNAL FUNCTION ToKatakana$(x$) !¤Ò¤é¤¬¤Ê¤òÁ´³Ñ¥«¥¿¥«¥Ê¤ËÊÑ´¹¤¹¤ë
   LET xx$=x$
   FOR i=1 TO LEN(x$) !ÂоÝʸ»ú¤ò½ç¤ËÄ´¤Ù¤ë
      LET t=ORD(x$(i:i))
      IF t<ORD("¤¡") OR t>ORD("¤ó") THEN
      ELSE
         LET xx$(i:i)=CHR$(t-ORD("¤¡")+ORD("¥¡"))
      END IF
   NEXT i
   LET ToKatakana$=xx$
END FUNCTION

END MODULE

 

¥°¥é¥Ç¡¼¥·¥ç¥ó¤Ê¿Þ·Á

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 5·î14Æü(ÌÚ)11»þ03ʬ26ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¥°¥é¥Ç¡¼¥·¥ç¥ó¿Þ·Á¤òÉÁ¤¯¥ë¡¼¥Á¥ó¤ò¤Ä¤¯¤Ã¤Æ¤ß¤Þ¤·¤¿¡£¡¡¼Â¤Ï°ÊÁ°¤Ä¤¯¤Ã¤¿¤â¤Î¤ÎÈ´¿è¤Ç¤¹¤¬¡¢¡¢¡¢

¡ü¥µ¥ó¥×¥ë£±
DIM x(0 TO 20),y(0 TO 20),r(0 TO 20),g(0 TO 20),b(0 TO 20) !ĺÅÀ¤Î°ÌÃ֤ȿ§

SET WINDOW -10,10,-10,10 !ɽ¼¨Îΰè

DATA 1,0,0 !¿§RGB
DATA 1,1,0
DATA 0,1,0
DATA 0,1,1
DATA 0,0,1
DATA 1,0,1
DATA 1,0,0

CALL PLOT.Init !¢¨


LET x(0)=0 !»ÏÅÀ(0,0)¡¢½ªÅÀ(3,0)
LET x(1)=3
LET y(0)=0
LET y(1)=0
PICTURE L1 !²£Àþ
   CALL PLOT.LINES(x,y,r,g,b) !¢¨
END PICTURE

READ r(0),g(0),b(0) !»ÏÅÀ¤Î¿§

FOR i=1 TO 6
   READ r(1),g(1),b(1) !½ªÅÀ¤Î¿§

   DRAW BAR WITH SHIFT(i*3-12,0)

   LET r(0)=r(1) !¼¡¤Ø
   LET g(0)=g(1)
   LET b(0)=b(1)
NEXT i

PICTURE BAR !ËÀ¾õ
   FOR j=8 TO -8 STEP -0.05
      DRAW L1 WITH SHIFT(0,j)
   NEXT j
END PICTURE

END




¡ü¥µ¥ó¥×¥ë£²
DIM x(0 TO 20),y(0 TO 20),r(0 TO 20),g(0 TO 20),b(0 TO 20) !ĺÅÀ¤Î°ÌÃ֤ȿ§

SET WINDOW -10,10,-10,10 !ɽ¼¨Îΰè

DATA 1,0,0 !¿§RGB
DATA 1,1,0
DATA 0,1,0
DATA 0,1,1
DATA 0,0,1
DATA 1,0,1
DATA 1,0,0

CALL PLOT.Init !¢¨

LET  x(0)=0 !£±ÅÀÌܤΰÌÃÖ¡ÊÃæ±û¡Ë
LET  y(0)=0

LET  r(0)=0.2 !ĺÅÀ¤Î¿§
LET  g(0)=0.2
LET  b(0)=0.2

LET  x(1)=9*COS(0) !£²ÅÀÌÜ
LET  y(1)=9*SIN(0)
READ r(1),g(1),b(1)

FOR i=1 TO 6 !Ï»³Ñ·Á¡¡¢¨»°³Ñ·Á¤¬£¶¤Ä
   LET  x(2)=9*COS(i*PI/3) !£³ÅÀÌÜ
   LET  y(2)=9*SIN(i*PI/3)
   READ r(2),g(2),b(2)

   CALL PLOT.AREALIMIT(3, x,y, r,g,b) !¢¨

   LET  x(1)=x(2) !¼¡¤Ø
   LET  y(1)=y(2)

   LET  r(1)=r(2)
   LET  g(1)=g(2)
   LET  b(1)=b(2)
NEXT i

END


¤Ä¤Å¤¯
 

Re: ¥°¥é¥Ç¡¼¥·¥ç¥ó¤Ê¿Þ·Á

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 5·î14Æü(ÌÚ)11»þ04ʬ36ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.376[¸µµ­»ö¤Ø]

¤Ä¤Å¤­

°Ê²¼¤Î¥×¥í¥°¥é¥à¤ò¡¢¤½¤ì¤¾¤ì¤Î¥µ¥ó¥×¥ë¤ÎENDʸ°Ê¹ß¤Ë¤Ä¤Ê¤²¤Æ¤¯¤À¤µ¤¤¡£

MODULE PLOT !³ÆĺÅÀ¤Î¿§¤ò¤â¤È¤ËÀþʬ¤ÈÆÌ¿³Ñ·Á¤Ë¥°¥é¥Ç¡¼¥·¥ç¥ó¤ò¤«¤±¤ë

SET POINT STYLE 1 !¥Þ¡¼¥¯¤Î·Á¾õ

SHARE NUMERIC Xmin(0 TO 1024),Xmax(0 TO 1024) !yºÂɸ(y¹Ô)¤Ë¤ª¤±¤ëxºÂɸ¤ÎºÇ¾®ÃÍ¡¢ºÇÂçÃÍ¡¡¢¨Í×Ä´À°
SHARE NUMERIC Rmin(0 TO 1024),Rmax(0 TO 1024)
SHARE NUMERIC Gmin(0 TO 1024),Gmax(0 TO 1024)
SHARE NUMERIC Bmin(0 TO 1024),Bmax(0 TO 1024)

SHARE NUMERIC ww,hh !¥¹¥¯¥ê¡¼¥ó¤Î°ÌÃÖ¡¢Â礭¤µ

EXTERNAL SUB Init !¥ì¥ó¥À¥ê¥ó¥°¥¿¡¼¥²¥Ã¥È¤ò½é´ü²½¤¹¤ë
   SET COLOR mode "NATIVE" !RGB»ØÄê
   SET TEXT font "",12 !ʸ»ú¥µ¥¤¥º
   ASK WINDOW x1,x2,y1,y2 !ºÂɸ·Ï¤Îü¤ÎºÂɸ¤ò¼èÆÀ¤¹¤ë
   ASK PIXEL SIZE (x1,y1; x2,y2) ww,hh !²èÌ̤ÎÂ礭¤µ(¥Ô¥¯¥»¥ëñ°Ì)¤òÄ´¤Ù¤ë
END SUB

EXTERNAL SUB SetPixel(x,y,c) !ºÂɸ(x,y,z)¤Ë¿§(r,g,b)¤ÇÅÀ¤òÉÁ¤¯¡¡¢¨PLOT POINTS: x,y ¤ÈƱ¤¸
   SET POINT COLOR c
   PLOT POINTS: WORLDX(x), WORLDX(y) !ÌäÂêºÂɸ¤ËÌᤷ¤ÆÉÁ¤¯
   !!!PLOT POINTS: x * (x2 - x1) / ww + x1, y * (y2 - y1) / hh + y1 !ÌäÂêºÂɸ¤ËÌᤷ¤ÆÉÁ¤¯
END SUB


PUBLIC SUB POINTS !¢¨PLOT POINTS: x,y ¤ÈƱ¤¸
EXTERNAL SUB POINTS(xx,yy,rr,gg,bb) !Àþʬ¤òÉÁ²è¤¹¤ë
   LET  x1 = PIXELX(xx)
   LET  y1 = PIXELY(yy)

   IF (y1 >= 0) AND (y1 < hh) THEN !²èÌÌÆâ¤Ê¤é
      IF (x1 >= 0) AND (x1 < ww) THEN
         CALL SetPixel(INT(x1),INT(y1), colorindex(rr,gg,bb))
      END IF
   END IF
END SUB

PUBLIC SUB LINES !¢¨PLOT LINES: x0,y0; x1,y1 ¤Þ¤¿¤Ï MAT PLOT LINES,LIMIT 2: x,y ¤ÈƱ¤¸
EXTERNAL SUB LINES(xx(),yy(),rr(),gg(),bb()) !Àþʬ¤òÉÁ²è¤¹¤ë
   LET  x1 = PIXELX(xx(0))
   LET  y1 = PIXELY(yy(0))

   LET  x2 = PIXELX(xx(1))
   LET  y2 = PIXELY(yy(1))

   LET  r1 = rr(0) !½é´üÃͤòÀßÄꤹ¤ë
   LET  g1 = gg(0)
   LET  b1 = bb(0)

   SET DRAW mode hidden !¤Á¤é¤Ä¤­ËÉ»ß(³«»Ï)

   IF (x1 = x2) AND (y1 = y2) THEN !»ÏÅÀ¤È½ªÅÀ¤¬Æ±¤¸¤Ê¤é
      IF (y1 >= 0) AND (y1 < hh) THEN !²èÌÌÆâ¤Ê¤é
         IF (x1 >= 0) AND (x1 < ww) THEN
            CALL SetPixel(INT(x1),INT(y1), colorindex(r1,g1,b1))
         END IF
      END IF
   ELSE
      LET  dx = x2 - x1 !ÁêÂÐŪŤµ
      LET  dy = y2 - y1

      IF ABS(dy) < ABS(dx) THEN !x¤ÎÊý¤¬Áýʬ¤¬Â¿¤¤
      !¢¢¢¢¢¢¢£
      !¢¢¢£¢£¢¢¡¡¡¡y=l*x+m¤Î¼°¤È¤·¤Æ¹Í¤¨¤ë
      !¢£¢¢¢¢¢¢
         LET  l = dy / dx !·¹¤­¤òµá¤á¤ë
         LET  dr = (rr(1) - rr(0)) / dx
         LET  dg = (gg(1) - gg(0)) / dx
         LET  db = (bb(1) - bb(0)) / dx
         FOR i=0 TO dx STEP SGN(dx)
            LET  x = x1 + i
            LET  y = l * i + y1
            LET  r = dr * i + r1
            LET  g = dg * i + g1
            LET  b = db * i + b1
            IF (y >= 0) AND (y < hh) THEN !²èÌÌÆâ¤Ê¤é
               IF (x >= 0) AND (x < ww) THEN
                  CALL SetPixel(INT(x),INT(y), colorindex(r,g,b))
               END IF
            END IF
         NEXT i
      ELSE !y¤ÎÊý¤¬Áýʬ¤¬Â¿¤¤
      !¢¢¢¢¢£
      !¢¢¢£¢¢¡¡¡¡x=l*y+m¤Î¼°¤È¤·¤Æ¹Í¤¨¤ë
      !¢¢¢£¢¢
      !¢£¢¢¢¢
         LET  l = dx / dy !·¹¤­¤òµá¤á¤ë
         LET  dr = (rr(1) - rr(0)) / dy
         LET  dg = (gg(1) - gg(0)) / dy
         LET  db = (bb(1) - bb(0)) / dy
         FOR i=0 TO dy STEP SGN(dy)
            LET  x = l * i + x1
            LET  y = y1 + i
            LET  r = dr * i + r1
            LET  g = dg * i + g1
            LET  b = db * i + b1
            IF (y >= 0) AND (y < hh) THEN !²èÌÌÆâ¤Ê¤é
               IF (x >= 0) AND (x < ww) THEN
                  CALL SetPixel(INT(x),INT(y), colorindex(r,g,b))
               END IF
            END IF
         NEXT i
      END IF
   END IF

   SET DRAW mode explicit !¤Á¤é¤Ä¤­ËÉ»ß(½ªÎ»)
END SUB

PUBLIC SUB AREALIMIT !!¢¨MAT PLOT AREA,LIMIT n: x,y ¤ÈƱ¤¸
EXTERNAL SUB AREALIMIT(NumOfVtx, xx(),yy(),rr(),gg(),bb()) !ÆÌ¿³Ñ·Á(ĺÅÀÈÖ¹æ¤Ë¤è¤ëÌ̤ÎÄêµÁ)¤òÉÁ²è¤¹¤ë
   IF NumOfVtx < 3 THEN EXIT SUB

   DIM sx(0 TO NumOfVtx-1),sy(0 TO NumOfVtx-1)
   FOR i=0 TO NumOfVtx-1 !ÌäÂêºÂɸ¤«¤é¥Ô¥¯¥»¥ëºÂɸ¤ËÊÑ´¹¤¹¤ë
      LET  sx(i) = PIXELX(xx(i))
      LET  sy(i) = PIXELY(yy(i))
      !!!LET  sx(i) = (xx(i) - x1) * ww / (x2 - x1)
      !!!LET  sy(i) = (yy(i) - y1) * hh / (y2 - y1)
   NEXT i

   LET  top = +2147483647 !¥Ð¥Ã¥Õ¥¡¤Î»ÈÍÑÈϰϤòÀßÄꤹ¤ë
   LET  btm = -2147483648
   FOR i=0 TO NumOfVtx-1
      IF top > sy(i) THEN LET  top = sy(i)
      IF btm < sy(i) THEN LET  btm = sy(i)
   NEXT i
   LET  top = INT(top)
   LET  btm = INT(btm)
   IF top < 0 THEN LET  top = 0
   IF btm > hh THEN LET  btm = hh

   FOR i=top TO btm-1 !ºÇÂçºÇ¾®¥Ð¥Ã¥Õ¥¡¤ò½é´ü²½¤¹¤ë
      LET  Xmin(i) = +2147483647
      LET  Xmax(i) = -2147483648
   NEXT i

   FOR i=0 TO NumOfVtx-2 !ÎÇÀþ¤Î¿ô¤À¤±
      CALL ScanEdge(i,i+1, sx,sy,rr,gg,bb) !ÎÇÀþ¤¬ÉÁ¤¯³ÆÅÀ¤òµá¤á¤ë
   NEXT i
   CALL ScanEdge(NumOfVtx-1,0, sx,sy,rr,gg,bb)

   SET DRAW mode hidden !¤Á¤é¤Ä¤­ËÉ»ß(³«»Ï)

   FOR y=top TO btm-1 !³Æ¥é¥¤¥ó(yºÂɸ)¤´¤È¤ËÁöºº¤¹¤ë - ¥é¥¹¥¿¥é¥¤¥º

      LET  l = (Xmax(y) - Xmin(y)) + 1 !ÁýʬÃͤò·×»»¤¹¤ë
      LET  dr = (Rmax(y) - Rmin(y)) / l
      LET  dg = (Gmax(y) - Gmin(y)) / l
      LET  db = (Bmax(y) - Bmin(y)) / l

      LET  r = Rmin(y) !½é´üÃͤòÀßÄꤹ¤ë
      LET  g = Gmin(y)
      LET  b = Bmin(y)

      FOR x=Xmin(y) TO Xmax(y) !¥é¥¤¥ó¾å¤Ç¤ÎľÀþ¤òÉÁ¤¯¡¡¢¨PLOT LINES: Xmin(y),y; Xmax(y),y
         IF (x >= 0) AND (x < ww) THEN !²èÌÌÆâ¤Ê¤é
            CALL SetPixel(x,y,colorindex(r,g,b)) !ÌäÂêºÂɸ¤ËÌᤷ¤ÆÉÁ¤¯
         END IF
         LET  r = r + dr !¼¡¤Ø
         LET  g = g + dg
         LET  b = b + db
      NEXT x

   NEXT y

   SET DRAW mode explicit !¤Á¤é¤Ä¤­ËÉ»ß(½ªÎ»)
END SUB

EXTERNAL SUB ScanEdge(v1,v2, xx(),yy(),rr(),gg(),bb()) !ĺÅÀv1¤ÈĺÅÀv2¤ò·ë¤ÖÎÇÀþ(ÊÕ)¤¬ÉÁ¤¯³ÆÅÀ¤òµá¤á¤ë
   LET  l = ABS(INT(yy(v2) - yy(v1))) + 1 !Éý¤ò·×»»¤¹¤ë

   LET  dx = (xx(v2) - xx(v1)) / l !ÁýʬÃͤò·×»»¤¹¤ë
   LET  dy = (yy(v2) - yy(v1)) / l
   LET  dr = (rr(v2) - rr(v1)) / l
   LET  dg = (gg(v2) - gg(v1)) / l
   LET  db = (bb(v2) - bb(v1)) / l

   LET  x = xx(v1) !½é´üÃͤòÀßÄꤹ¤ë
   LET  y = yy(v1)
   LET  r = rr(v1)
   LET  g = gg(v1)
   LET  b = bb(v1)

   FOR i=0 TO l-1 !³Æ¥é¥¤¥ó(yºÂɸ)¤´¤È¤Ë
      LET  px = INT(x)
      LET  py = INT(y)

      IF (py >= 0) AND (py < hh) THEN !²èÌÌÆâ¤Ê¤é
         IF Xmin(py) > px THEN !º¸Ã¼°ÌÃÖ¤òµ­Ï¿¤¹¤ë
            LET  Xmin(py) = px
            LET  Rmin(py) = r
            LET  Gmin(py) = g
            LET  Bmin(py) = b
         END IF

         IF Xmax(py) < px THEN !±¦Ã¼°ÌÃÖ¤òµ­Ï¿¤¹¤ë
            LET  Xmax(py) = px
            LET  Rmax(py) = r
            LET  Gmax(py) = g
            LET  Bmax(py) = b
         END IF
      END IF
      LET  x = x + dx !¼¡¤Ø
      LET  y = y + dy
      LET  r = r + dr
      LET  g = g + dg
      LET  b = b + db
   NEXT i

END SUB

END MODULE
 

£Ã¸À¸ìÈǤΰܿ¢

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 5·î15Æü(¶â)10»þ58ʬ0ÉÃ
ÊÖ¿®¡¦°úÍÑ
  Tiny programs for constants computation
¡¡http://numbers.computation.free.fr/Constants/TinyPrograms/tinycodes.html
¤Ë¦Ð¡¢£å¤Ê¤É¤Î¿·å¤òµá¤á¤ë£Ã¸À¸ì¤Î¥·¥ç¡¼¥È¥×¥í¥°¥é¥à¤¬¤¢¤ê¤Þ¤¹¡£

£Ñ¡õ£Á¤Î¥³¡¼¥Ê¡¼
¡¡C¤äJava¤Ç½ñ¤«¤ì¤¿¿ôÃÍ·×»»¥¢¥ë¥´¥ê¥º¥à¤Î°Ü¿¢
¡¡¡¡http://hp.vector.co.jp/authors/VA008683/ImportC.htm
¤ò»²¹Í¤Ë¡¢½ñ¤­´¹¤¨¤Æ¤ß¤Þ¤·¤¿¡£

¤³¤ì¤è¤ê¡¢µ¡³£Åª¤ËÃÖ¤­´¹¤¨¤ë¥Ñ¥¿¡¼¥ó¤¬¸«¤¨¤Æ¤­¤Þ¤¹¡£


¡ü¥µ¥ó¥×¥ë£±
!£å¤Î9000·å
!main(){int N=9009,n=N,a[9009],x;while(--n)a[n]=1+1/n;
!for(;N>9;printf("%d",x))
!for(n=N--;--n;a[n]=x%n,x=10*a[n-1]+x/n);}

!À°·Á¤¹¤ë¤È
!main(){
!  int N=9009,n=N,a[9009],x;
!  while(--n)
!    a[n]=1+1/n;
!  for( ;N>9; printf("%d",x) )
!    for( n=N--; --n; a[n]=x%n, x=10*a[n-1]+x/n );
!}

REM---> main(){
!nop

REM---> int N=9009,n=N,a[9009],x;
LET N=9009
LET n_=N !¢¨£Ã¸À¸ì¤ÏÂçʸ»ú¤È¾®Ê¸»ú¤Ï¶èÊ̤µ¤ì¤ë
DIM a(0 TO 9009-1) !¢¨£Ã¸À¸ì¤Ï½é´ü²½¤·¤Ê¤¤¤¿¤áÃͤÏÉÔÄê
LET x=0 !¢¨

REM --> while(--n)
DO
   LET n_=n_-1
   IF n_=0 THEN EXIT DO

   REM --> a[n]=1+1/n;
   LET a(n_)=1+IP(1/n_)

LOOP

REM---> for(;N>9;printf("%d",x))
!nop !for(¢¨; ; )Éôʬ

DO !for( ;¢¨; )Éôʬ
   IF NOT N>9 THEN EXIT DO


   REM---> for(n=N--;--n;a[n]=x%n,x=10*a[n-1]+x/n)
   LET n_=N !for(¢¨; ; )Éôʬ
   LET N=N-1

   DO !for( ;¢¨; )Éôʬ
      LET n_=n_-1
      IF NOT n_<>0 THEN EXIT DO


      REM---> ;


      LET a(n_)=REMAINDER(x,n_) !for( ; ;¢¨)Éôʬ
      LET x=10*a(n_-1)+IP(x/n_)

   LOOP


   PRINT x; !for( ; ;¢¨)Éôʬ

LOOP

REM---> }

END


¡ü¥µ¥ó¥×¥ë£²
!¦Ð
!main(){int a=1e4,c=3e3,b=c,d=0,e=0,f[3000],g=1,h=0;
!for(;b;!--b?printf("%04d",e+d/a),e=d%a,h=b=c-=15:f[b]=(d=d/g*b+a*(h?f[b]:2e3))%(g=b*2-1));}

!À°·Á¤¹¤ë¤È
!main(){
!  int a=1e4,
!      c=3e3,
!      b=c,
!      d=0,
!      e=0,
!      f[3000],
!      g=1,
!      h=0;
!  for(;
!      b;
!      !--b?
!        printf("%04d",e+d/a),
!        e=d%a,
!        h=b=c-=15
!      :
!        f[b]=(d=d/g*b+a*(h?
!                           f[b]
!                         :
!                           2e3
!                        )
!                         )%(g=b*2-1)
!     )
!    ;
!}

REM---> main(){
!nop

REM---> int a=1e4,c=3e3,b=c,d=0,e=0,f[3000],g=1,h=0;
LET a=1E4
LET c=3E3
LET b=c
LET d=0
LET e=0
DIM f(0 TO 3000-1) !¢¨£Ã¸À¸ì¤Ï½é´ü²½¤·¤Ê¤¤¤¿¤áÃͤÏÉÔÄê
LET g=1
LET h=0

REM---> for(;b;!--b?printf("%04d",e+d/a),e=d%a,h=b=c-=15:f[b]=(d=d/g*b+a*(h?f[b]:2e3))%(g=b*2-1))
!nop !for(¢¨; ; )Éôʬ

DO !for( ;¢¨; )Éôʬ
   IF NOT b<>0 THEN EXIT DO


   REM---> ;


   !for( ; ;¢¨)Éôʬ
   LET b=b-1 ! !--b?¡Á:¡ÁÉôʬ
   IF NOT b<>0 THEN
      PRINT USING "%%%%": e+IP(d/a); !printf("%04d",e+d/a),
      LET e=REMAINDER(d,a) !e=d%a,
      LET AX_=c-15 !h=b=c-=15
      LET h,b,c=AX_
   ELSE
      IF h<>0 THEN LET AX_=f(b) ELSE LET AX_=2E3 !h?¡Á:¡ÁÉôʬ
      LET d=IP(d/g)*b+a*AX_ !d=d/g*b+a*(¡Á)Éôʬ
      LET g=b*2-1 !g=b*2-1Éôʬ
      LET f(b)=REMAINDER(d,g) !f[b]=(¡Á)%(¡Á)
   END IF

LOOP

REM---> }

END
 

Re: £Ã¸À¸ìÈǤΰܿ¢

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 5·î16Æü(ÅÚ)11»þ12ʬ42ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.378[¸µµ­»ö¤Ø]

¡ü¥µ¥ó¥×¥ë£³
!£²¤ÎÊ¿Êýº¬¤Î2400·å
!main(){int a=1000,b=0,c=1413,d,f[1414],n=800,k;
!for(;b<c;f[b++]=14);
!for(;n--;d+=*f*a,printf("%.3d",d/a),*f=d%a)
!for(d=0,k=c;--k;d/=b,d*=2*k-1)f[k]=(d+=f[k]*a)%(b=100*k);}

!À°·Á¤¹¤ë¤È
!main(){
!  int a=1000,b=0,c=1413,d,f[1414],n=800,k;
!  for( ;b<c; f[b++]=14 );
!  for( ;n--; d+=*f*a,printf("%.3d",d/a),*f=d%a )
!    for( d=0,k=c; --k; d/=b,d*=2*k-1 )
!      f[k]=(d+=f[k]*a)%(b=100*k);
!  }

REM---> main(){
!nop

REM---> int a=1000,b=0,c=1413,d,f[1414],n=800,k;
LET a=1000
LET b=0
LET c=1413
DIM f(0 TO 1414-1) !¢¨£Ã¸À¸ì¤Ï½é´ü²½¤·¤Ê¤¤¤¿¤áÃͤÏÉÔÄê
LET n=800
LET k=0 !¢¨£Ã¸À¸ì¤Ï½é´ü²½¤·¤Ê¤¤¤¿¤áÃͤÏÉÔÄê

REM---> for( ;b<c; f[b++]=14 );
!nop !for(¢¨; ; )Éôʬ

DO !for( ;¢¨; )Éôʬ
   IF NOT b<c THEN EXIT DO


   REM--> ;


   LET f(b)=14 !for( ; ;¢¨)Éôʬ
   LET b=b+1

LOOP


REM---> for( ;n--; d+=*f*a,printf("%.3d",d/a),*f=d%a )
!nop !for(¢¨; ; )Éôʬ

DO !for( ;¢¨; )Éôʬ
   IF NOT n<>0 THEN EXIT DO
   LET n=n-1


   REM---> for(d=0,k=c; --k; d/=b,d*=2*k-1 )
   LET d=0 !for(¢¨; ; )Éôʬ
   LET k=c

   DO !for( ;¢¨; )Éôʬ
      LET k=k-1
      IF NOT k<>0 THEN EXIT DO


      REM--> f[k]=(d+=f[k]*a)%(b=100*k);
      LET d=d+f(k)*a
      LET b=100*k
      LET f(k)=REMAINDER(d,b)


      LET d=IP(d/b) !for( ; ;¢¨)Éôʬ
      LET d=d*(2*k-1)

   LOOP


   LET d=d+f(0)*a !for( ; ;¢¨)Éôʬ
   PRINT USING "%%%": IP(d/a) !ºÇ¾®·å¿ô£³·å
   LET f(0)=REMAINDER(d,a)

LOOP


REM---> }

END
 

¼ÁÌä¤Ç¤¹

 Åê¹Æ¼Ô¡§¥­¥å¡¼¥Ô¡¼  Åê¹ÆÆü¡§2009ǯ 5·î18Æü(·î)02»þ30ʬ11ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ºÇ¶á£Â£Á£Ó£É£Ã¤Î¸ºß¤òÃΤäƾ¯¤·»È¤¤¤À¤·¤Þ¤·¤¿¡£
ʬ¿ô¤ÎϤη׻»¤â½ÐÍè¤Þ¤¹¤«¡©
1/1+1/2+1/3+¡¦¡¦¡¦+1/1129¤Ã¤Æ¤¤¤¦¤Î¤ò¤ä¤Ã¤Æ¤ß¤¿¤¤¤ó¤Ç¤¹¤¬¡¢¤É¤Î¤è¤¥¤Ë¥×¥í¥°¥é¥à¤ò»È¤¨¤Ð¤¤¤¤¤ó¤Ç¤¹¤«¡©
¤¹¤ß¤Þ¤»¤ó¤¬Ã¯¤«²óÅú¤ª´ê¤¤¤·¤Þ¤¹¡Ê¥Î¢¤£Ô¡Ë
 

Re: ¼ÁÌä¤Ç¤¹

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 5·î18Æü(·î)07»þ59ʬ58ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.380[¸µµ­»ö¤Ø]

·ë²Ì¤òʬ¿ô¤Î·Á¤Ç¤Û¤·¤¤¤È¤­¤ÏÍ­Íý¿ô¥â¡¼¥É¤ò»È¤¤¤Þ¤¹¡£
10 OPTION ARITHMETIC RATIONAL
20 LET t=0
30 FOR k=1 TO 1129
40    LET t=t+1/k
50 NEXT k
60 PRINT t
70 END
¤¿¤À¤·¡¤Í­Íý¿ô¥â¡¼¥É¤ÏJISµ¬³Ê¤ÎÈϰϳ°¤Ç¤¹¡£
ɸ½àBASIC¤ÎÈÏ°ÏÆâ¤Ç¤³¤Î·×»»¤ò¹Ô¤¦¥×¥í¥°¥é¥à¤òºî¤ë¤Î¤Ï¾åµé¼Ô¸þ¤­¤Î²ÝÂê¤Ç¤¹¡£
 

Re: ¼ÁÌä¤Ç¤¹

 Åê¹Æ¼Ô¡§¥­¥å¡¼¥Ô¡¼  Åê¹ÆÆü¡§2009ǯ 5·î19Æü(²Ð)08»þ38ʬ51ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.381[¸µµ­»ö¤Ø]

¾åµé¼Ô¸þ¤­¤À¤Ã¤¿¤ó¤Ç¤¹¤«¡£¡£¡£
½éµé¤«¤é²¿¤«¤È´èÄ¥¤ê¤Þ¤¹¡£
¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
 

¥Õ¥é¥¯¥¿¥ë¿Þ·Á¤È¥¢¥Õ¥£¥ó¼ÌÁü

 Åê¹Æ¼Ô¡§ËÙ¹¾¡¡¿­°ì  Åê¹ÆÆü¡§2009ǯ 5·î22Æü(¶â)10»þ54ʬ52ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  £±£°¿ÊBasicÁÇÀ²¤é¤·¤¤¥½¥Õ¥È¤Ç¤¹¤Í¡£
¥¤¥á¡¼¥¸¤·¤Ë¤¯¤«¤Ã¤¿¥Õ¥é¥¯¥¿¥ë¤ä¥¢¥Õ¥£¥ó¼ÌÁü¤ÎϢ³ŬÍѤ˴ط¸¤¹¤ëÉôʬ¤¬Íý²ò¤·¤ä¤¹¤¯Áàºî¤âÍưפȤ¤¤¦¤Î¤ÏÈó¾ï¤Ë¤¢¤ê¤¬¤¿¤¤¤Ç¤¹¡£

³Ø½¬Ãæ¥Õ¥é¥¯¥¿¥ë¿Þ·Á¤òºî¤Ã¤Æ¤¤¤Æ¤è¤¯¤ï¤«¤é¤Ê¤¤¤³¤È¤¬½Ð¤Æ¤­¤Þ¤·¤¿¡£
Ê£¿ô¤Î¥¢¥Õ¥£¥ó¼ÌÁü¤òÁȤ߹ç¤ï¤»¤ë¤³¤È¤Ë¤è¤ëϢ³¼ÌÁü¤Ë´Ø¤¹¤ëÍýÏÀ¤Ë¤Ä¤¤¤Æ¤Ç¤¹¡£



¤Þ¤ÀÊÙ¶¯Ãæ¤Ç¤è¤¯¤ï¤«¤é¤Ê¤¤¤Î¤Ç¤¹¤¬¡¢¥¢¥Õ¥£¥ó¼ÌÁü¤È¥Õ¥é¥¯¥¿¥ë¤Î´Ø·¸¤Ï¤É¤Î¤è¤¦¤Ê¤â¤Î¤Ê¤Î¤Ç¤·¤ç¤¦¤«¡©
Æäˡ¢µ¬Â§Åª¤Ê¥Õ¥é¥¯¥¿¥ë¿Þ·Á¤¬ÆÀ¤é¤ì¤ë¤È¤­¤È¤½¤¦¤Ç¤Ê¤¤¤È¤­¤Î¸«¶Ë¤á¤Ë¶½Ì£¤¬¤¢¤ê¤Þ¤¹¡£

¸Ä¿ÍŪ¤Ë¤Ï¹ÔÎó¤ÎÌÌÀѳÈÂçΨ¤¬£±°Ê²¼¤Î¤È¤­¥Õ¥é¥¯¥¿¥ë¿Þ·Á¤Ïµ¬Â§Åª¤ËÉÁ¤«¤ì¡¢¹ÔÎó¤ÎÌÌÀѳÈÂçΨ¤¬£±°Ê¾å¤Î¤È¤­¤Ï¿Þ·Á¤¬µðÂç²½¤·¡¢¥«¥ª¥¹¤Ê¿Þ¤¬ÉÁ¤«¤ì¤ë¤È¤¤¤¦´¶¤¸¤ò¤¦¤±¤¿¤Î¤Ç¤¹¤¬¤è¤¯¤ï¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£
²óž¤¬¤«¤«¤Ã¤Æ¤¯¤ë¾ì¹ç¤È¡¢³ÈÂç½Ì¾®¤Î¤ß¤Î¾ì¹ç¤Ç°ã¤¦´¶¤¸¤â¤¦¤±¤Þ¤¹¡£


¥«¥ª¥¹ÍýÏÀ¤Ë¤¯¤é¤Ù¤¿¤é¡¢¥¢¥Õ¥£¥ó¼ÌÁü¤È¤¤¤¦Àþ·ÁÂå¿ô¤ÎÃæ¤Ç¤ÎÊÑ·Á¤Ï¤Þ¤Àñ½ã¤ÊÀ¤³¦¡£
¤¢¤ëÄøÅ٤γؽ¬¤Ï²Äǽ¤À¤È´¶¤¸¤Æ¤¤¤Þ¤¹¡£
 

Re: ¥Õ¥é¥¯¥¿¥ë¿Þ·Á¤È¥¢¥Õ¥£¥ó¼ÌÁü

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 5·î22Æü(¶â)14»þ43ʬ49ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.383[¸µµ­»ö¤Ø]

¥³¥ó¥Ô¥å¡¼¥¿¤Î¤è¤¤¤È¤³¤í¤Ï¡¤²¾Àâ¤ò´Êñ¤Ë¸¡¾Ú¤·¤Æ¤ß¤ì¤ë¤È¤³¤í¤Ë¤¢¤ë¤È»×¤¤¤Þ¤¹¡£
¤¤¤í¤¤¤í¼Â¸³¤·¤Æ¤ß¤Æ¡¤²¾À⤬Àµ¤·¤¤¤½¤¦¤À¤È¤¤¤¦³Î¾Ú¤¬ÆÀ¤é¤ì¤¿¤é¾ÚÌÀ¤ò»î¤ß¤ë
¤È¤¤¤¦¸¦µæ¥¹¥¿¥¤¥ë¤¬¤È¤ì¤ë¤Î¤¬¥³¥ó¥Ô¥å¡¼¥¿¤ÎÍøÅÀ¤Ç¤¹¡£
¤¿¤À¤·¡¤·×»»µ¡¤Ë¤Ï·×»»ÀºÅ٤賦¤È¤¤¤¦Êɤ¬¤¢¤ê¤Þ¤¹¡£
¤¿¤È¤¨¤Ð¡¤¥¢¥Õ¥£¥óÊÑ´¹¤Ï¤¤¤¯¤Ä¹çÀ®¤·¤Æ¤â¥¢¥Õ¥£¥óÊÑ´¹¤Ç¤¹¤¬¡¤
¥³¥ó¥Ô¥å¡¼¥¿¤À¤È¡¤¶Ë¸Â¤Ë¶á¤¤¤È¤³¤í¤Ç¤Ï¤ª¤«¤·¤ÊµóÆ°¤ò¼¨¤¹¤«¤âÃΤì¤Þ¤»¤ó¡£
 

¦²1/k¤Î¿·å¤òµá¤á¤ë

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 5·î22Æü(¶â)22»þ06ʬ56ÉÃ
ÊÖ¿®¡¦°úÍÑ
  °ÊÁ°Åê¹Æ¤·¤¿Â¿·å¡Ê¿ÇÜĹ¡Ë¥ë¡¼¥Á¥ó¤Î¡Ö½ü»»¡×¤¬¤Ç¤­¤Þ¤·¤¿¡£
Æ°ºî¸¡¾Ú¤Î¤¿¤á¡¢Àè¤Îʬ¿ô·×»»¤ò¹Ô¤¤¤Þ¤·¤¿¡£
!Äê¿ô
DECLARE EXTERNAL NUMERIC MultiPrecision.RADIX, MultiPrecision.L2
DECLARE EXTERNAL NUMERIC MultiPrecision.c0(), MultiPrecision.c1()

!񂯯
DECLARE EXTERNAL FUNCTION MultiPrecision.lNum2Str$, MultiPrecision.lcomp
DECLARE EXTERNAL SUB MultiPrecision.lStr2Num, MultiPrecision.lcopy
DECLARE EXTERNAL SUB MultiPrecision.ladd, MultiPrecision.lsub
DECLARE EXTERNAL SUB MultiPrecision.lmul, MultiPrecision.ldiv

DECLARE EXTERNAL SUB MultiPrecision.llmul, MultiPrecision.ldivqr
!----------------------------------------


!¦²[k=1,n]1/k ¤Î·×»»

LET t0=TIME


DIM P(0 TO L2),Q(0 TO L2)
CALL lStr2Num("0",P) !t=P/Q=1
CALL lStr2Num("1",Q)

DIM T1(0 TO L2),T2(0 TO L2)
FOR k=1 TO 1129
   CALL lmul(P,k, T1) !t=t+1/k=(P*k+Q)/(Q*k)¡¡ÄÌʬ
   CALL ladd(T1,Q, P)
   CALL lmul(Q,k, T2)
   CALL lcopy(T2,Q)
NEXT k
PRINT lNum2Str$(P)
PRINT lNum2Str$(Q)


DIM A(0 TO L2),B(0 TO L2)
CALL lcopy(P,A) !LET A=P !copy it
CALL lcopy(Q,B) !LET B=Q

LET c=0 !·«¤êÊÖ¤·²ó¿ô debug
DO UNTIL lcomp(B,c0)=0 !ºÇÂç¸øÌó¿ô¤òµá¤á¤ë
   LET c=c+1 !debug
   CALL ldivqr(A,B, T1,T2) !LET R=MOD(A,B) !MOD(x,y)=x-y*INT(x/y)
   CALL lcopy(B,A) !LET A=B
   CALL lcopy(T2,B) !LET B=R
LOOP
PRINT "c=";c !debug
PRINT "gcd=";lNum2Str$(A) !PRINT "gcd=";A !debug

CALL ldivqr(P,A, T1,T2) !LET P=P/A !Ìóʬ
CALL lcopy(T1,P)
CALL ldivqr(Q,A, T1,T2) !LET Q=Q/A
CALL lcopy(T1,Q)

PRINT "P=";lNum2Str$(P) !PRINT "P=";P !·ë²Ì¤Îɽ¼¨
PRINT "Q=";lNum2Str$(Q) !PRINT "Q=";Q


PRINT TIME-t0

END


MODULE MultiPrecision !Àµ¤Î¿·å¡Ê¿ÇÜĹ¡ËÀ°¿ô¤Î·×»»

!·å¤Î¿ô»ú¤ÎÎó¤ò³ÊǼ¤¹¤ëÇÛÎóa()¤ò¹Í¤¨¤ë¡£
!¾å°Ì·å¡¡¡¡¡¡¡¡¡¡¡¡²¼°Ì·å
!a(L2),a(L2-1),¡Ä,a(1),a(0)¡¡¤Î¹½Â¤¤Çɽ¤¹¤³¤È¤¬¤Ç¤­¤ë¡£
!¸À¤¤´¹¤¨¤ë¤È¡¢n¿Ê¿ôɽµ­¤Î³Æ·å¤¬a()¤È¤Ê¤ë¡£
!¤¿¤È¤¨¤Ð¡¢100¿Ê¿ô¤È¤¹¤ë¤È¡¢a(k)¤ÏÀµ¤ÎÀ°¿ô£²·å¡Ê0¡Á99¡Ë¤È¤Ê¤ë¡£
!Îã. 12345¤Ï1*100*100+23*100+45¤À¤«¤é¡¢a(2)=1¡¢a(1)=23¡¢a(0)=45¡£


SHARE NUMERIC KETA
PUBLIC NUMERIC RADIX,L2

LET KETA=4 !·å¿ô 1,2,3,4¡¡¢¨32bit¤«64bitÀ°¿ô¤ÎÈÏ°Ï
LET RADIX=10^KETA !´ð¿ô

LET L=3000 !µá¤á¤ë·å¿ô¡¡¢¨
LET L2=INT(L/KETA)+1 !ÇÛÎó¤ÎÂ礭¤µ


PUBLIC NUMERIC c0(0 TO 1000) !¢¨
CALL lStr2Num("0",c0) !Äê¿ô£°
PUBLIC NUMERIC c1(0 TO 1000) !¢¨
CALL lStr2Num("1",c1) !Äê¿ô£±

SHARE NUMERIC aa(0 TO 1000),bb(0 TO 1000),m(0 TO 1000) !ºî¶ÈÍÑ¡¡¢¨


!----- ²¼°Ì¤Î±é»»¥ë¡¼¥Á¥ó

PUBLIC SUB ladd
EXTERNAL SUB ladd(a(),b(), c()) !¿·å¡Ü¿·å¡¡¢¨C=A+B
   LET cy=0 !·å¾å¤¬¤ê
   FOR i=0 TO L2 !²¼¤Î·å¤«¤é
      LET d=a(i)+b(i)+cy !Ʊ¤¸·å¤Ç
      IF d<RADIX THEN
         LET c(i)=d
         LET cy=0
      ELSE
         LET c(i)=d-RADIX
         LET cy=1 !¾å¤Î·å¤Ø
      END IF
   NEXT i
   IF cy>0 THEN
      PRINT "²Ã»»¥ª¡¼¥Ð¡¼¥Õ¥í¡¼"
      STOP
   END IF
END SUB
PUBLIC SUB lsub
EXTERNAL SUB lsub(a(),b(), c()) !¿·å¡Ý¿·å¡¡¢¨A>B¡¢C=A-B
   LET brrw=0 !¼Ú¤ê
   FOR i=0 TO L2 !²¼¤Î·å¤«¤é
      LET d=a(i)-b(i)-brrw !Ʊ¤¸·å¤Ç
      IF d>=0 THEN
         LET c(i)=d
         LET brrw=0
      ELSE
         LET c(i)=d+RADIX
         LET brrw=1 !¾å¤Î·å¤«¤é¼Ú¤ê¤ë
      END IF
   NEXT i
   IF brrw>0 THEN
      PRINT "¸º»»A-B¤Ç¡¢A>B¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£"
      STOP
   END IF
END SUB
PUBLIC SUB lmul
EXTERNAL SUB lmul(a(),b, c())  !¿·å¡ßÀµ¤ÎÀ°¿ô¡Ê0¡Á255¡Ë¢¨10000¿Ê¿ô¤Ê¤é32767
   LET cy=0
   FOR i=0 TO L2 !²¼¤Î·å¤«¤é
      LET d=a(i)*b+cy
      LET cy=INT(d/RADIX) !·å¾å¤¬¤ê
      LET c(i)=MOD(d,RADIX) !¤³¤Î·å
   NEXT i
   IF cy>0 THEN
      PRINT "¾è»»¥ª¡¼¥Ð¡¼¥Õ¥í¡¼"
      STOP
   END IF
END SUB
PUBLIC SUB ldiv
EXTERNAL SUB ldiv(a(),b, c()) !¿·å¡àÀµ¤ÎÀ°¿ô¡Ê0¡Á255¡Ë¢¨10000¿Ê¿ô¤Ê¤é32767
   IF b=0 THEN
      PRINT "£°¤Ç¤Ï³ä¤ì¤Þ¤»¤ó¡£"
      STOP
   END IF

   LET r=0 !;¤ê
   FOR i=L2 TO 0 STEP -1 !¾å¤Î·å¤«¤é
      LET d=a(i)+r
      LET c(i)=INT(d/b) !¾¦¤Ï¤³¤Î·å
      LET r=MOD(d,b)*RADIX !;¤ê¤ò²¼¤Î·å¤Ø
   NEXT i
END SUB

PUBLIC SUB lcopy
EXTERNAL SUB lcopy(a(), b()) !¥³¥Ô¡¼ B=A
   FOR i=0 TO L2 !mat b=a
      LET b(i)=a(i) !Ʊ¤¸·å¤Ç
   NEXT i
END SUB
PUBLIC FUNCTION lcomp
EXTERNAL FUNCTION lcomp(a(),b()) !Èæ³Ó¡¡A>B¤Ê¤é1¡¢A=B¤Ê¤é0¡¢A<B¤Ê¤é-1
   FOR i=L2 TO 0 STEP -1 !¾å¤Î·å¤«¤é
      IF a(i)>b(i) THEN
         LET lcomp=1
         EXIT FUNCTION
      ELSEIF a(i)<b(i) THEN
         LET lcomp=-1
         EXIT FUNCTION
      END IF
   NEXT i
   LET lcomp=0
END FUNCTION

¤Ä¤Å¤¯
 

Re: ¦²1/k¤Î¿·å¤òµá¤á¤ë

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 5·î22Æü(¶â)22»þ08ʬ13ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.385[¸µµ­»ö¤Ø]

¤Ä¤Å¤­

!----- ÆþÎÏ¡¢½ÐÎϥ롼¥Á¥ó

PUBLIC SUB lStr2Num
EXTERNAL SUB lStr2Num(a$, a()) !¿ô»úÎó¤ò¿·åÀ°¿ô¤ËÊÑ´¹¤¹¤ë
   FOR i=0 TO L2
      LET A(i)=0
   NEXT i
   FOR i=LEN(a$) TO 1 STEP -KETA
      LET d=INT((LEN(a$)-i)/KETA)
      IF d>L2 THEN
         PRINT "·å¿ô¤¬Â­¤ê¤Þ¤»¤ó¡£"
         STOP
      END IF
      LET a(d)=VAL(a$(i-KETA+1:i))
   NEXT i
END SUB
PUBLIC FUNCTION lNum2Str$
EXTERNAL FUNCTION lNum2Str$(a()) !¿·åÀ°¿ô¤ò¿ô»úÎó¤ËÊÑ´¹¤¹¤ë
   LET aMSD=GetMSD(a)
   IF aMSD<0 THEN !£°¤Ê¤é
      LET a$=" 0"
   ELSE
      LET a$=" "&STR$(a(aMSD)) !£±·åÌÜ
      FOR i=aMSD-1 TO 0 STEP -1 !£²·åÌܰʹß
         LET a$=a$&right$("000"&STR$(a(i)),4)
      NEXT i
   END IF
   LET lNum2Str$=a$
END FUNCTION


!----- ¾å°Ì¤Î±é»»¥ë¡¼¥Á¥ó

PUBLIC SUB llmul
EXTERNAL SUB llmul(a(),b(), c())  !¿·å¡ß¿·å¡¡¢¨C=A*B
   FOR i=0 TO L2*2 !mat c=zer
      LET c(i)=0
   NEXT i

   LET aMSD=GetMSD(a)
   LET bMSD=GetMSD(b)
   IF aMSD<0 OR bMSD<0 THEN EXIT SUB !¾è¿ô¡¢Èï¾è¿ô¤¬£°¤Ê¤é

   FOR j=0 TO bMSD !¾è¿ô¡§²¼¤Î·å¤«¤é
      LET cy=0
      IF b(j)>0 THEN !£°¤Ï·×»»¤·¤Ê¤¤
         FOR i=0 TO aMSD !Èï¾è¿ô¡§²¼¤Î·å¤«¤é
            LET d=a(i)*b(j)+cy + c(i+j) !ÎßÀÑ¡¡¢¨É®»»»²¾È O(n^2)
            LET c(i+j)=MOD(d,RADIX) !¤³¤Î·å
            LET cy=INT(d/RADIX) !·å¾å¤¬¤ê
         NEXT i
         IF cy>0 THEN LET c(j+aMSD+1)=cy !¾å°Ì·å¤Ø
      END IF
   NEXT j
END SUB

EXTERNAL FUNCTION GetMSD(a()) !ºÇ¾å°Ì·å¤Î°ÌÃÖ¤òÆÀ¤ë
   FOR i=L2 TO 0 STEP -1
      IF a(i)<>0 THEN EXIT FOR
   NEXT i
   LET GetMSD=i !·å°ÌÃÖ¡¡¢¨£°¤Ê¤é-1
END FUNCTION

PUBLIC SUB ldivqr
EXTERNAL SUB ldivqr(a(),b(), q(),r()) !¿·å¡à¿·å¡¡¢¨¾¦q ;¤êr
   LET bMSD=GetMSD(b)
   IF bMSD<0 THEN !½ü¿ô¤¬£°¤«¤É¤¦¤«³Îǧ¤¹¤ë
      PRINT "£°¤Ç¤Ï³ä¤ì¤Þ¤»¤ó¡£"
      STOP
   END IF

   FOR i=0 TO L2 !¾¦¤ò£°¤È¤¹¤ë
      LET q(i)=0
   NEXT i

   LET v=b(bMSD) !ºÇ¾å°Ì·å¤ÎÃͤòÆÀ¤ë
   LET nk=INT(RADIX/(v+1)) !b(MSD)¤òRADIX/2°Ê¾å¤Ë¤¹¤ë¤¿¤á¤ÎºÇ¾®·¸¿ô
   IF nk>1 THEN
      CALL lmul(b,nk, bb) !½ü¿ô¤ÎºÇ¾å°Ì·å¤òRADIX/2°Ê¾å¡¢RADIX̤Ëþ¤Ë¤¹¤ë
      CALL lmul(a,nk, aa) !a¤ânkÇܤ¹¤ë
   ELSE
      CALL lcopy(b, bb) !¡ß£±
      CALL lcopy(a, aa)
   END IF

   LET t=GetMSD(bb)
   DO UNTIL lcomp(aa,bb)<0 !a<b¤Ê¤é½ªÎ»
      LET s=GetMSD(aa)
      IF aa(s)>=bb(t) THEN
         IF CompareOffset(aa,bb,s-t)>=0 THEN !a>=b*RADIX^(s-t)¤ò¸¡ºº¤¹¤ë
            LET u=s-t !¾¦¤ÎºÇ¾å°Ì·å°ÌÃÖu¤ª¤è¤ÓÃÍq(u)¤Î¸õÊä¤òµá¤á¤ë
            LET q(u)=1
         ELSE
            LET u=s-t-1
            LET q(u)=RADIX-1
         END IF
      ELSE
         LET u=s-t-1
         LET q(u)=INT( (aa(s)*RADIX+aa(s-1))/bb(t) )
      END IF

      CALL lmul(bb,q(u), m)
      DO WHILE CompareOffset(aa,m,u)<0 !a>=m=b*q(0)¤òËþ¤¿¤¹ºÇÂç¤Îq(u)¤òµá¤á¤ë
         LET q(u)=q(u)-1
         CALL lmul(bb,q(u), m)
      LOOP

      CALL SubOffset(aa,m, u) !a=a-b*q(u)*RADIX^u
   LOOP

   IF nk>1 THEN
      CALL ldiv(aa,nk, r) !;¤ê 1/nkÇÜ
   ELSE
      CALL lcopy(aa, r)
   END IF
END SUB
EXTERNAL FUNCTION CompareOffset(a(),b(),n) !·å¤ò¤º¤é¤·¤ÆÈæ³Ó¤¹¤ë
   LET aMSD=GetMSD(a)
   LET bMSD=GetMSD(b)+n
   IF aMSD>bMSD THEN
      LET CompareOffset=1
   ELSEIF aMSD<bMSD THEN
      LET CompareOffset=-1
   ELSE
      FOR i=aMSD TO n STEP -1
         IF a(i)>b(i-n) THEN
            LET CompareOffset=1
            EXIT FUNCTION
         END IF
         IF a(i)<b(i-n) THEN
            LET CompareOffset=-1
            EXIT FUNCTION
         END IF
      NEXT i
      DO !a(aMSD)¡Áa(n)¤Èb(bMSD)¡Áb(0)¤¬°ìÃפ¹¤ë¾ì¹ç¡¢
         IF NOT i>=0 THEN EXIT DO !a(n-1)¡Áa(0)¤ËÈóÎí¤Î¤â¤Î¤¬¤¢¤ì¤Ð¡¢a¤ÎÊý¤¬Â礭¤¤
         IF a(i)<>0 THEN
            LET CompareOffset=1
            EXIT FUNCTION
         END IF
         LET i=i-1
      LOOP
      LET CompareOffset=0
   END IF
END FUNCTION
EXTERNAL SUB SubOffset(a(),b(),n) !·å¤ò¤º¤é¤·¤Æ¸º»»¡¡¢¨a=a-b*RADIX^n
   LET brrw=0 !¼Ú¤ê
   LET bMSD=GetMSD(b) !ºÇ¾å°Ì·å¤Þ¤Çb¤ò¤Ò¤¯
   FOR i=0 TO bMSD
      LET d=a(i+n)-b(i)-brrw !Ʊ¤¸·å¤Ç
      IF d>=0 THEN
         LET a(i+n)=d
         LET brrw=0
      ELSE
         LET a(i+n)=d+RADIX
         LET brrw=1 !¾å¤Î·å¤«¤é¼Ú¤ê¤ë
      END IF
   NEXT i
   DO !¾å°Ì·å¤Ø¤Î·å¼Ú¤ê
      IF NOT brrw<>0 THEN EXIT DO
      IF a(i+n)<>0 THEN
         LET a(i+n)=a(i+n)-1
         LET brrw=0
      ELSE
         LET a(i+n)=RADIX-1
         LET brrw=1
      END IF
      LET i=i+1
   LOOP
END SUB

END MODULE
 

Re: ¥Õ¥é¥¯¥¿¥ë¿Þ·Á¤È¥¢¥Õ¥£¥ó¼ÌÁü

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 5·î23Æü(ÅÚ)11»þ07ʬ0ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.383[¸µµ­»ö¤Ø]

ËÙ¹¾¡¡¿­°ì¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¥¢¥Õ¥£¥ó¼ÌÁü¤È¥Õ¥é¥¯¥¿¥ë¤Î´Ø·¸¤Ï¤É¤Î¤è¤¦¤Ê¤â¤Î¤Ê¤Î¤Ç¤·¤ç¤¦¤«¡©
> Æäˡ¢µ¬Â§Åª¤Ê¥Õ¥é¥¯¥¿¥ë¿Þ·Á¤¬ÆÀ¤é¤ì¤ë¤È¤­¤È¤½¤¦¤Ç¤Ê¤¤¤È¤­¤Î¸«¶Ë¤á¤Ë¶½Ì£¤¬¤¢¤ê¤Þ¤¹¡£


ºî¿ÞŪ¤Ê²ò¼á¤Ç¤¹¤¬¡¢¡¢¡¢


½Ì¾®¼ÌÁü¡Ê¤ÎϽ¸¹ç¦¸¡Ë¤ò

¥¢¥Õ¥£¥óÊÑ´¹¡Ê³ÈÂ硦½Ì¾®¡¢²óž¡¢Ê¿¹Ô°ÜÆ°¡Ë¤Çɽ¤·¡¢¡ÊÂå¿ô¼°¡¢¹ÔÎó¡¢Ê£ÁÇ¿ô¤Ë¤è¤ëɽµ­¤¬²Äǽ¤Ç¤¢¤ë¡Ë

¸¶·Á¤ËÂФ·¤Æ¤³¤ì¤ò¡Ê¤¢¤ë³ÎΨ¤Ç¡Ë·«¤êÊÖ¤·Å¬ÍѤµ¤»¤Æ¡¢¡ÊºÆµ¢½èÍý¡¢·«¤êÊÖ¤·½èÍý¤ò¼Â¹Ô¤¹¤ë¡Ë

¼«¸ÊÁê»÷¤Ê¿Þ·Á¡Ê½¸¹ç£Á¡Ë¤òȯÀ¸¤µ¤»¤ë¡£
 

Re: ¥Õ¥é¥¯¥¿¥ë¿Þ·Á¤È¥¢¥Õ¥£¥ó¼ÌÁü

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 5·î23Æü(ÅÚ)14»þ48ʬ49ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.383[¸µµ­»ö¤Ø]

ËÙ¹¾¡¡¿­°ì¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¡Ö¼þ´ü¤ò¡ç¤Ëȯ»¶¤µ¤»¤ÆÆóÅ٤ȸµ¤ËÌá¤ë»ö¤Ï̵¤¤¡£¡×¤¬¡¢¤³¤ì¤é¤Ë¶¦Ä̤·¤Æ¤¤¤Þ¤¹¡£
¤Ë¤â¤«¤«¤ï¤é¤º¡¢
ÎÙÀܤ¹¤ë½ÐÎϤȽÐÎϤδ֤ˡ¢¹Ô¤Ê¤ï¤ì¤¿·×»»¤Ï¡¢³µ¤·¤Æ¥·¥ó¥×¥ë¤Ç¡¢
°ì°ÕŪ¤ÊÆþ½ÐÎϤ¬¡¢¤·¤«¤â¡¢·«ÊÖ¤·Æ±¤¸¼°¤ò¡¢ÍѤ¤¤Æ¤¤¤ë¤Î¤â¡¢ÃíÌܤµ¤ì¤Þ¤¹¡£

°Ê¾å¤ÎÆÃħ¤Ï¡¢¥«¥ª¥¹¤ÎÄêµÁ¤È¸À¤Ã¤Æ¤âÎɤ¤¤Î¤Ç¤Ï¡¢¼«Ê¬¤Ç¤Ï¡¢¹Í¤¨¤Æ¤¤¤Þ¤¹¡£
¥Õ¥é¥¯¥¿¥ë¤â¡¢¥«¥ª¥¹¤Î°ì·ÁÂÖ¤À¤È¡¢»×¤¤¤Þ¤¹¡£

¥é¥ó¥À¥à¤È¤µ¤ì¤ë¸½¾Ý¤â¡¢¥Ý¥¢¥ó¥«¥ìÀÚÃÇÌÌ¡ÊÃí£±¡Ë¤ÎÍͤʡ¢µ¬Â§À­¤¬¡¢È¯¸«
¤µ¤ì¤ì¤Ð¡¢¥«¥ª¥¹¤Ë¡¢ÊѤï¤ë¤Î¤Ç¤¹¤«¤é¡¢ÉÔÌÀ¤Ê¤À¤±¤Î¥é¥ó¥À¥à¤«¤âÃΤì¤Þ¤»¤ó¡£

¤«¤Ä¤Æ¡¢À¸Êª¤Ï¡¢¥ß¥¯¥í¤Ê°äÅÁ¾ðÊ󤫤顢Á´¿È¤Î·Á¾õ¤ò¡¢¤É¤ó¤ÊÊýË¡¤ÇÀ©¸æ¡¢
·Áºî¤Ã¤Æ¤¤¤ë¤Î¤«¤¬¡¢Ææ¤Ç¤·¤¿¡£¤¬¡¢¥Õ¥é¥¯¥¿¥ë¼ÌÁü¤Ë¡¢¤½¤Î¸°¤¬Í­¤ë¤è¤¦¤Ç¤¹¡£


¡ÊÃí£±¡Ë£îÈÖÌܤνÐÎϤ¬¡¢¤½¤ì°ÊÁ°¤Î£î¡Ý£±¡¢£î¡Ý£²¡¢¡¦¡¦¡¦¤Î½ÐÎϤò¡¢ÆþÎϤȤ·¤Æ¤Î¡¢
¡¡¡¡¡¡¡¡´Ø¿ô½ÐÎϤˤʤäƤ¤¤ë¤Ê¤é¤Ð¡¢¤½¤Î´Ø¿ô¤ÎÆþ½ÐÎ϶õ´Ö¤¬¡¢¥Ý¥¢¥ó¥«¥ìÀÚÃÇÌ̤Ǥ¹¡£
¡¡¡¡¡¡¡¡£²¼¡¸µÌ̤Ǥʤ¤¤«¤â¤·¤ì¤Þ¤»¤ó¤¬¡¢
¡¡¡¡¡¡¡¡»þ´Ö¼´¤«¤é¸«¤ë¤È¡¢¿âľÃÇÌ̤ÎÍͤʡ¢³µÇ°¤Ê¤Î¤Ç¡¢¤½¤¦¸Æ¤Ð¤ì¤ë¤è¤¦¤Ç¤¹¡£

¡¡¡¡¡¡¡¡Îã¡ËXn = 4 * Xn-1 *( 1 - Xn-1 )¡¡¤Ï¡¢y=4x(1-x) ¤Î£²¼¡¶ÊÀþ¤ÎÌ̤ò
¡¡¡¡¡¡¡¡¡¡¡¡¥Ý¥¢¥ó¥«¥ìÀÚÃÇÌ̤Ȥ·¤Æ¡¢Î¥»¶¶õ´Ö¤Ç¤Ï¡¢¥«¥ª¥¹¤Ë¤Ê¤Ã¤Æ¤¤¤ë¿ôÎó¤Ç¤¹¡£

¡¡¥¢¥Õ¥¡¥¤¥ó(¥¢¥Õ¥£¥ó)½¸¹ç¤òÍ¿¤¨¤ë¹ÔÎó¤ä¡¢¿ÍÂΤΰäÅÁ¾ðÊó¡¢³ô²Á¤Îͽ¬¼°¡©¤Ê¤É¤â¡¢
¡¡¥Ý¥¢¥ó¥«¥ìÀÚÃÇÌ̤Υѥ屡¼¥¸¤Ç¤Ï¡¢¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£

¡¡Ëô¡¢¤³¤ì¤é¤Ï¡¢¼¡À¤Âå¤Î¡¢·àŪ¤Ê¡¢°µ½Ì¡¢²òÅà¤Ø¤Î±þÍÑÀ­¤ò»ý¤Á¡¢
¡¡¡¡¡¡Àþ·¿°µ½Ì¤Î¿ôÍýŪ¤Ê¸Â³¦¡¢KLTÊÑ´¹¤ò±Û¤¨¤Þ¤¹¡£DNA ¤Ï¡¢¤½¤Î¼ÂºÝÎã¡©¥µ¥ó¥×¥ë¡©
 

¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹

 Åê¹Æ¼Ô¡§ËÙ¹¾¿­°ì  Åê¹ÆÆü¡§2009ǯ 5·î23Æü(ÅÚ)15»þ07ʬ20ÉÃ
ÊÖ¿®¡¦°úÍÑ
  »³ÃæϵÁ¤µ¤ó¡¢ÄêµÁ¤ò¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
SECOND¤µ¤ó¥Ý¥¢¥ó¥«¥ìÀÚÃÇÌÌ¡£
¿·¤·¤¤¸ÀÍÕ¤ò³Ð¤¨¤Þ¤·¤¿¡£

Xi+1=f(Xi)
¤Î´Ø¿ôf¤¬¥Ý¥¢¥ó¥«¥ìÀÚÃÇÌ̤Ǥ¹¤Í¡©


¼ÌÁü£æ¤¬¸«¤Ä¤«¤ì¤Ð¥é¥ó¥À¥à¤Ç¤Ê¤¯¥«¥ª¥¹¡£
Íý²ò¤·¤Þ¤·¤¿¡£


»³ÃæϵÁ¤µ¤ó¡£
´ûÄê¤Î¿Þ·Á¤ò¥¢¥Õ¥£¥óÊÑ´¹¤ÇÊÑ·Á¤·¤Æ½Å¤Í¤ë¡¢Â礭¤µ¤Î°Û¤Ê¤ë¥¹¥¿¥ó¥×¤ò½Å¤Í¤ë¤è¤¦¤Ê¼ÌÁü¤Ê¤é¤¤¤¤¤Ç¤¹¤¬¡¢¤É¤¦¤ß¤Æ¤â´ðËܤȤʤ륹¥¿¥ó¥×¤Î¤è¤¦¤Ê·Á¤¬¸«½Ð¤»¤½¤¦¤â¤Ê¤¤¤è¤¦¤Ê¥¢¥Õ¥£¥óÊÑ´¹¤ÎÁȤ¬ÀßÄê¤Ç¤­¤ë¤è¤¦¤Ê¤­¤¬¤·¤Æ¤Ê¤ê¤Þ¤»¤ó¡£


¤Þ¤À½é³Ø¤Ê¤Î¤Ç¤­¤ì¤¤¤Ë°·¤¨¤ë¤è¤¦¤Ê¤È¤³¤í¤«¤é³Ø½¬¤·¤è¤¦¤«¤È¹Í¤¨¤Æ¤¤¤Þ¤¹¤¬¤Á¤ç¤Ã¤Èµ¤¤Ë¤Ê¤ê¤Þ¤¹¡£
 

Re: ¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 5·î24Æü(Æü)06»þ26ʬ47ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.389[¸µµ­»ö¤Ø]

> Xi+1=f(Xi)
> ¤Î´Ø¿ôf¤¬¥Ý¥¢¥ó¥«¥ìÀÚÃÇÌ̤Ǥ¹¤Í¡©

´Ø¿ôf¤½¤Î¤â¤Î¤Ç¤Ï¤Ê¤¯¤Æ¡¢´Ø¿ôf¤ÎÆþ½ÐÎÏÎΰè¤Î·Á¾õ¤Ç¤¹¡£
°ì¼¡¸µ¤ÎÎã¤Ç¤Ï¡¢¤½¤Î·Á¤¬¡¢´Ø¿ôf¤ÈƱ°ì¤Ç¡¢¶èÊ̽ÐÍè¤Ê¤¯¤Æ¡¢
¤Þ¤º¤«¤Ã¤¿¤Ç¤¹¤¬¡¢Â¿¤¯¤Ï¡¢´Ø¿ôf¤¬¡¢ÈùʬÊýÄø¼°¤Î·Á¼°¤Ç¡¢²ò¤â
ÉÔÌÀ¤Ê¤Þ¤Þ¡¢¥ë¥ó¥²¥¯¥Ã¥¿¤ÇÉÁ¤±¤ëÄøÅ٤ǡ¢Ê¬¤ê¤Þ¤»¤ó¡£
¥Ý¥¢¥ó¥«¥ìÀÚÃÇÌ̤ϡ¢¤½¤Î¶ÊÀþ¤äÎΰè¤ÎÃæ¤Ë¡¢´Ø¿ôf¤ÎÆþ½ÐÎϤ¬¡¢
ÊĤ¸¤Æ¤¤¤ë°ÕÌ£¤ò»ý¤Á¡¢´Ø¿ôf¤Î¸ºß¤ò¼¨º¶¤¹¤ë¤â¤Î¤Ç¤¹¡£

ÈùʬÊýÄø¼°¤â¡¢º¹Ê¬²½¤·¤ÆÉÁ¤¤¤Æ¤¤¤ë²áÄø¤ò¹Í¤¨¤ë¤È¡¢
iÈÖÌܤ«¤éi+1ÈÖÌܤζ­³¦¤Î´Ø¿ô¤Ç¡¢´Ø¿ô¤È¤·¤Æ¸ÇÄꤵ¤ì¤Æ¤¤¤Þ¤¹¤¬¡¢
¥Ý¥¢¥ó¥«¥ìÀÚÃÇÌ̤ξì½ê¤Î°ÜÆ°(i¤Î°ÜÆ°)¤Ç¡¢¤½¤ÎÆþ½ÐÎÏÎΰè¤Î
·Á¾õ¤¬¡¢ÊѲ½¤·¤¿¤ê¤â¤·¤Þ¤¹¡£

¤Ç¤â³µÇ°¤Ï¡¢¤½¤Î¤È¤ª¤ê¤«¤âÃΤì¤Ê¤¤¡£¤³¤ÎÊդϡ¢»ä¤â¤ï¤«¤é¤Ê¤¤¡£
 

Re: ¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 5·î25Æü(·î)00»þ20ʬ17ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.390[¸µµ­»ö¤Ø]

!¥Ý¥¢¥ó¥«¥ìÀÚÃÇÌ̤μºÝÎã¤Ç¤¹¡£
!
!¥ì¥¹¥é¡¼ÊýÄø¼°¤ò¡¢¥ë¥ó¥²¡¦¥¯¥Ã¥¿£´¤ÇÉÁ¤¤¤Æ¤¤¤Þ¤¹¡£¥°¥é¥Õ¤Ï¡¢
!£ø£ù£ú¤Î£³¼¡¸µ¤Î¿¶¤ëÉñ¤¤¤Ç¤¹¤¬¡¢Ãæ±û¤Î¿Þ¤Ï¡¢¾å¤«¤é¸«¤¿£ø£ùÊ¿Ì̤Ǥ¹¡£
!¼þ°Ï£³£°ÅÙ ³ÑÅÙ¤´¤È¤ËÇÛÃÖ¤µ¤ì¤¿£±£²Ëç¤Î¿Þ¤¬¡¢
!¤½¤Î³ÑÅ٤ǤΡ¢¥Ý¥¢¥ó¥«¥ìÀÚÃÇÌ̤ǡ¢½Ä¡§£Ú¼´¡¢²£¡§Ãæ¿´¤«¤é¤ÎȾ·Âµ÷Î¥
!¤Ë¤Ê¤ê¤Þ¤¹¡£

!-------------------------------
OPTION ANGLE DEGREES
LET x=-2
LET y=0
LET z=0
LET a=0.398
LET b=2
LET c=4
!-----¥ì¥¹¥é¡¼ÊýÄø¼°( ÈóÀþ·Á¹à¤¬¡¢z*x £±¤Ä¤À¤±¤Î¥«¥ª¥¹)
DEF dxdt(  y,z)=-y-z       ! (dx/dt)= -y -z
DEF dydt(x,y  )= x+a*y     ! (dy/dt)=  x +a*y
DEF dzdt(x  ,z)= b+z*(x-c) ! (dz/dt)=  b +z*(x-c)

SUB RungeKutta
   LET kx1=dxdt(  y,z)
   LET ky1=dydt(x,y  )
   LET kz1=dzdt(x  ,z)
   !
   LET kx2=dxdt(            y+ky1*dt/2 ,z+kz1*dt/2)
   LET ky2=dydt(x+kx1*dt/2, y+ky1*dt/2            )
   LET kz2=dzdt(x+kx1*dt/2             ,z+kz1*dt/2)
   !
   LET kx3=dxdt(            y+ky2*dt/2 ,z+kz2*dt/2)
   LET ky3=dydt(x+kx2*dt/2, y+ky2*dt/2            )
   LET kz3=dzdt(x+kx2*dt/2             ,z+kz2*dt/2)
   !
   LET kx4=dxdt(          y+ky3*dt ,z+kz3*dt)
   LET ky4=dydt(x+kx3*dt, y+ky3*dt          )
   LET kz4=dzdt(x+kx3*dt           ,z+kz3*dt)
   !
   LET x=x+(kx1+2*kx2+2*kx3+kx4)*dt/6
   LET y=y+(ky1+2*ky2+2*ky3+ky4)*dt/6
   LET z=z+(kz1+2*kz2+2*kz3+kz4)*dt/6
END SUB

!-----run
SET TEXT background "OPAQUE"
SET COLOR MIX(15) .5,.5,.5
SET POINT STYLE 1
DIM vl(12),vr(12),vb(12),vt(12) ,va(12)
DATA .8, .8, .6, .4, .2, 0 , 0 , 0 , .2, .4, .6, .8
DATA 1 , 1 , .8, .6, .4, .2, .2, .2, .4, .6, .8, 1
DATA .4, .6, .8, .8, .8, .6, .4, .2, 0 , 0 , 0 , .2
DATA .6, .8, 1 , 1 , 1 , .8, .6, .4, .2, .2, .2, .4
DATA  0, 30, 60, 90,120,150,180,-150,-120,-90,-60,-30
MAT READ vl,vr,vb,vt,va
!
CLEAR
LET dt=.03 !±é»»¥Ô¥Ã¥Á sec. pitch time
LET t=0
DO
   SET VIEWPORT .2, .8, .2, .8
   SET WINDOW -7,7,-7,7! -4,6, -6,3
   IF 0< t THEN
      PLOT LINES:bakx,baky; x,y
   ELSE
      DRAW axes !grid(1,1)
      FOR p=1 TO 12
         PLOT LINES:0,0;8*COS(va(p)),8*SIN(va(p))
         PLOT TEXT,AT 6.6*COS(va(p))-.15, 6.6*SIN(va(p))-.3 :STR$(va(p))
      NEXT p
   END IF
   LET bakx=x
   LET baky=y
   CALL RungeKutta
   FOR p=1 TO 12
      IF ABS( va(p)-ANGLE(x,y))< 1 THEN
         CALL poincare
      END IF
   NEXT p
   LET t=t+dt
LOOP UNTIL 2000< t

SUB poincare
   SET VIEWPORT vl(p),vr(p),vb(p),vt(p)
   SET WINDOW -1,7,-1,7
   !PLOT LINES:-1,-1;7,-1;7,7;-1,7;-1,-1
   DRAW axes
   PLOT POINTS: SQR(x^2+y^2),z
END SUB

END
 

¤ï¤«¤é¤Ê¤¤¤Ç¤¹¡¦¡¦¡¦

 Åê¹Æ¼Ô¡§¥­¥å¡¼¥Ô¡¼  Åê¹ÆÆü¡§2009ǯ 5·î25Æü(·î)02»þ48ʬ58ÉÃ
ÊÖ¿®¡¦°úÍÑ
  N=INT£±£±¤Ë¤ª¤¤¤Æ
Hn>N¤È¤Ê¤ëºÇ¾®¤În¤òµá¤á¤ë¥×¥í¥°¥é¥à¤Ã¤Æ¤¤¤¦¤Î¤Ï¡¢¤É¤¦¤ä¤Ã¤Æµá¤á¤ì¤Ð¤¤¤¤¤ó¤Ç¤¹¤«¡©
Hn¡á1/1+1/2+1/3+1/4+¡¦¡¦¡¦
¤Ê¤ó¤Ç¤¹¤±¤É(¡÷_¡÷;)
 

Re: ¤ï¤«¤é¤Ê¤¤¤Ç¤¹¡¦¡¦¡¦

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 5·î25Æü(·î)09»þ13ʬ7ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.392[¸µµ­»ö¤Ø]

¼ÁÌä°Õ¿Þ¤¬ÉÔÌÀ¡ÊÆüËܸ줬??¡Ë¤Ç¤¹¤¬¡¤
http://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q1126545731
¤ÈƱ¤¸¼ñ»Ý¤Î²ÝÂê¤Ç¤¢¤ë¤Î¤Ê¤é¡¤
»î¹Ôºø¸í¤Ë¤è¤Ã¤ÆÏÀÍý¤ò¹½ÃÛ¤¹¤ë·±Îý¤Î¤¿¤á¤Î²ÝÂê¤À¤È»×¤¤¤Þ¤¹¡£
¤ª¤½¤é¤¯¡¤¤³¤³¤ò¼«ÎϤǾè¤ê±Û¤¨¤Ê¤¤¤È¡¤¸å¤¬¶ì¤·¤¯¤Ê¤ëµÞ½ê¤Ç¤·¤ç¤¦¡£
 

Re: ¤ï¤«¤é¤Ê¤¤¤Ç¤¹¡¦¡¦¡¦

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 5·î25Æü(·î)10»þ39ʬ44ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.392[¸µµ­»ö¤Ø]

¥­¥å¡¼¥Ô¡¼¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¤³¤ó¤Ê¥µ¥¤¥È¤ò¸«¤Ä¤±¤Þ¤·¤¿¡£

Ìû²÷¤ÊÅù¼°
¡¡http://blue.kakiko.com/mmrmmr/


¤³¤Î¥µ¥¤¥È¤Î¾å¤«¤é2/3¤Î½ê

À°¿ôÃͤ˶ᤤµÕ¿ôÏÂ
¡¡http://blue.kakiko.com/mmrmmr/htm/eqtn27.html


Àè¤Î¥µ¥ó¥×¥ë¤Î¤è¤¦¤Ë¡¢FOR¡ÁNEXTʸ¤ÇÃÖ¤­´¹¤¨¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¤¬¡¢
FOR¡ÁNEXTʸ¤Ï¡¢°ìÈÌŪ¤Ë·«¤êÊÖ¤·²ó¿ô¤¬¤ï¤«¤Ã¤Æ¤¤¤ë¤È¤­¤Ë»È¤¤¤Þ¤¹¡£

¦²1/k=1/1+1/2+1/3+ ¡Ä +1/k ¤ò¼¡¤Î¤è¤¦¤Ë²ò¼á¤¹¤ë¤È¤¤¤¤¤Ç¤·¤ç¤¦¡£

Àè¤ÎÌäÂê¤Ï¡¢
!¡¡1129
!t=¦²1/k=1/1+1/2+1/3+ ¡Ä +1/1129
!¡¡k=1

LET t=0 !ÉôʬÏÂ

LET k=1
DO
   LET t=t+1/k !t=¦²1/k

   IF k=1129 THEN EXIT DO
   LET k=k+1
LOOP
PRINT k

PRINT t !·ë²Ì

END

¤È¤Ê¤ê¤Þ¤¹¡£º£²ó¤Ï¡¢

¡¡t>11
t=¦²1/k
¡¡k=1

¤Ç¤¹¤«¤é¡¢¡¢¡¢ ¥Ñ¥º¥ë¤Ç¤¹¤Í!?
 

Re: ¥»¥ó¥¿¡¼»î¸³ÄøÅÙ¤Î¥×¥í¥°¥é¥à±é½¬

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 5·î26Æü(²Ð)10»þ05ʬ2ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.309[¸µµ­»ö¤Ø]

¿ôÎó¤Î¿ôÃÍ·×»» - °ìÈ̹ࡢÁ²²½¼°¡¢¦²

¼¡¤Î¤è¤¦¤Ê¥Ñ¥¿¡¼¥ó¤Ç¡¢ÄêµÁ¤ä·×»»¼°¤òBASIC¸À¸ì¤ËÃÖ¤­´¹¤¨¤Æ·×»»¤¹¤ë¡£
!ÎãÂ꣱¡¡¼«Á³¿ô¤ÎÏÂ
!¡¡def a(n)=n (n>=1)¡¡¢¨°ìÈ̹à
!¡¡t=¦²{a[k]; k=1,t>300}¡¡¢¨Ï¤¬300¤òĶ¤¨¤ë¤È¤­¡¢ºÇ¾®¤Îk¤È¤½¤ÎϤòɽ¼¨¤¹¤ë
!¡¡print k,t
!
!¡¡¢¨µ¼»÷¸À¸ì¤Ë¤è¤ëɽ¸½

DEF a(n)=n !def a(n)=n (n>=1) ¤ÎÉôʬ

LET t=0 !¦²{a[k]; k=1,t>300} ¤ÎÉôʬ
LET k=1
DO
   LET t=t+a(k)

   IF t>300 THEN EXIT DO
   LET k=k+1
LOOP

PRINT "k=";k, "t=";t !print k,t ¤ÎÉôʬ



!ÎãÂ꣱¤ÎÊ̲ò
FOR k=1 TO 300 !¾å¸Â¡¡¢è1+2+3+ ¡Ä +k
   LET t=k*(k+1)/2 !Ϥθø¼° ¦²k
   IF t>300 THEN EXIT FOR
NEXT k
PRINT "k=";k, t



!ÎãÂꣲ
!¡¡def2 y[1]=1, y[n+1]=3*y[n]+2 (n>=1)¡¡¢¨ÎÙÀÜÆó¹à´ÖÁ²²½¼°
!¡¡print y[n=1,10]¡¡¢¨£±¡Á10¹à¤òɽ¼¨¤¹¤ë

FUNCTION y(n) !def2 y[1]=1, y[n+1]=3*y[n]+2 (n>=1) ¤ÎÉôʬ
   local k,y0,y1
   LET y1=1 !<---
   IF n=1 THEN !Â裱¹à
      LET y=y1
   ELSE
      FOR k=2 TO n !Â裲¹à°Ê¹ß
         LET y0=y1
         LET y1=3*y0+2 !<---
      NEXT k
      LET y=y1
   END IF
END FUNCTION

FOR n=1 TO 10 !print x[n=1,10] ¤ÎÉôʬ
   PRINT n;y(n)
NEXT n




!!ÎãÂꣳ¡¡¥Õ¥£¥Ü¥Ê¥Ã¥Á¿ôÎó
!¡¡def3 x[1]=0, x[2]=1, x[n+2]=x[n+1]+x[n] (n>=1)¡¡¢¨ÎÙÀÜ»°¹à´ÖÁ²²½¼°
!¡¡for n=1 to n¡¡¢¨¼þ´ü¤Î¤¢¤ë¿ôÎó¤Ø
!¡¡¡¡print x[n] mod 4¡¡¢¨Í¾¤ê¤òɽ¼¨¤¹¤ë
!¡¡next

FUNCTION x(n) !def3 x[1]=1, x[2]=1, x[n+2]=x[n+1]+x[n] (n>=1) ¤ÎÉôʬ
   local k,x0,x1,x2
   LET x1=0 !<---
   IF n=1 THEN !Â裱¹à
      LET x=x1
   ELSE
      LET x2=1 !<---
      IF n=2 THEN !Â裲¹à
         LET x=x2
      ELSE
         FOR k=3 TO n !Â裳¹à°Ê¹ß
            LET x0=x1
            LET x1=x2
            LET x2=x1+x0 !<---
         NEXT k
         LET x=x2
      END IF
   END IF
END FUNCTION

FOR n=1 TO 30
   PRINT n; MOD(x(n+1),4) !print x[n] mod 4 ¤ÎÉôʬ
NEXT n



END


°·¤¦¹à¤¬¾®¤µ¤¤¾ì¹ç¡¢ÇÛÎó¤ÈÂбþ¤µ¤»¤ëÊýË¡¤â¤¢¤ë¡£
¥á¥â¥êÀ­Ç½¤ÏÍî¤Á¤ë¤¬¡¢Í½¤á·×»»¤¹¤ë¤³¤È¤Ç»þ´ÖÀ­Ç½¤Ï¸þ¾å¤¹¤ë¡£


»þ´ÖÀ­Ç½¤ÎÈæ³Ó¤È¤·¤Æ¡¢¥Õ¥£¥Ü¥Ê¥Ã¥Á¿ôÎó¤Î¡ÖºÆµ¢¸Æ½Ð¤·¡×¤ò·ÇºÜ¤¹¤ë¡£

ÄêµÁ¤Ï´Ê·é¤Ë¤Ê¤ë¤¬¡¢¹à¤¬Â礭¤¯¤Ê¤ë¤È»þ´Ö¤¬¤«¤«¤ê¡¢BASIC¦¤Î¥¹¥¿¥Ã¥¯¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¬È¯À¸¤¹¤ë¡£
FUNCTION f(n)
   IF n<2 THEN
      LET f=n !f(0)=0, f(1)=1
   ELSE
      LET f=f(n-1)+f(n-2) !f(n)=f(n-1)+f(n-2) n¡æ2
   END IF
END FUNCTION

FOR k=0 TO 30 !£±¡Á£³£°¹à¤òɽ¼¨¤¹¤ë
   PRINT k;f(k)
NEXT k

END
 

¤Ä¤Å¤­¡£

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 5·î26Æü(²Ð)12»þ10ʬ6ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.391[¸µµ­»ö¤Ø]

!Àè¤Î¡¢²þÎÉÈÇ¡£
!
!³ÑÅÙ¤ÎÁë¤ò»ß¤á¡¢³ÑÅÙ¤ò±Û¤¨¤ë£±ÈÖÌܤǡ¢ºÎ¼è¤¹¤ë¡£(sens lead edge)
!ʸ¤ÏÆɤ߿ɤ¯¤Ê¤ë¤¬¡¢¥Ô¥Ã¥ÁÉý¹­¤¯¤Æ¤â¡¢ºÎ¼è½ÐÍè¡¢¥Ô¥Ã¥ÁÉý¤Ë±þ¤¸¤¿
!¥Ü¥±¤Ë¤Ê¤ë¤¿¤á¡¢¥Ô¥Ã¥ÁÉý¤Î¡¢É¾²Á¤¬½ÐÍè¤ë¡£Â®Å٤⮤¤¡£
!-30¡ë(330¡ë)ÅÙÉÕ¶á¤Î¥Ü¥±¤¬¡¢¼è¤ì¤¿¡£

!¥ì¥¹¥é¡¼ÊýÄø¼°¡¢£³¼¡¸µ¥°¥é¥Õ¡¢Ãæ±û¤Î¿Þ¤Ï¡¢¾å¤«¤é¸«¤¿£ø£ùÊ¿ÌÌ¡£
!¼þ°Ï£³£°ÅÙ ¤´¤È¤ËÇÛÃÖ¤µ¤ì¤¿£±£²Ëç¤Î¿Þ¤Ï¡¢
!¤½¤Î³ÑÅ٤ǤΡ¢¥Ý¥¢¥ó¥«¥ìÀÚÃÇÌÌ( ½Ä:£ú¼´¡¢²£:Ãæ¿´¤«¤é¤Îµ÷Î¥)
!-------------------------------
LET x=-3
LET y=0
LET z=0
LET a=0.398
LET b=2
LET c=4
!-----¥ì¥¹¥é¡¼ÊýÄø¼°( ÈóÀþ·Á¹à¤¬¡¢z*x £±¤Ä¤À¤±¤Î¥«¥ª¥¹¡£·Á¾õ:¥á¥Ó¥¦¥¹¤ÎÂÓ)
DEF dxdt(  y,z)=-y-z       ! (dx/dt)= -y -z
DEF dydt(x,y  )= x+a*y     ! (dy/dt)=  x +a*y
DEF dzdt(x  ,z)= b+z*(x-c) ! (dz/dt)=  b +z*(x-c)

SUB RungeKutta
   LET kx1=dxdt(  y,z)
   LET ky1=dydt(x,y  )
   LET kz1=dzdt(x  ,z)
   !
   LET kx2=dxdt(            y+ky1*dt/2 ,z+kz1*dt/2)
   LET ky2=dydt(x+kx1*dt/2, y+ky1*dt/2            )
   LET kz2=dzdt(x+kx1*dt/2             ,z+kz1*dt/2)
   !
   LET kx3=dxdt(            y+ky2*dt/2 ,z+kz2*dt/2)
   LET ky3=dydt(x+kx2*dt/2, y+ky2*dt/2            )
   LET kz3=dzdt(x+kx2*dt/2             ,z+kz2*dt/2)
   !
   LET kx4=dxdt(          y+ky3*dt ,z+kz3*dt)
   LET ky4=dydt(x+kx3*dt, y+ky3*dt          )
   LET kz4=dzdt(x+kx3*dt           ,z+kz3*dt)
   !
   LET x=x+(kx1+2*kx2+2*kx3+kx4)*dt/6
   LET y=y+(ky1+2*ky2+2*ky3+ky4)*dt/6
   LET z=z+(kz1+2*kz2+2*kz3+kz4)*dt/6
END SUB

!-----run
SET TEXT background "OPAQUE"
SET COLOR MIX(15) .5,.5,.5
SET POINT STYLE 1
OPTION ANGLE DEGREES
OPTION BASE 0
DIM vl(11),vr(11),vb(11),vt(11) ,va(11)
DATA .8, .8, .6, .4, .2, 0 , 0 , 0 , .2, .4, .6, .8
DATA 1 , 1 , .8, .6, .4, .2, .2, .2, .4, .6, .8, 1
DATA .4, .6, .8, .8, .8, .6, .4, .2, 0 , 0 , 0 , .2
DATA .6, .8, 1 , 1 , 1 , .8, .6, .4, .2, .2, .2, .4
DATA  0, 30, 60, 90,120,150,180,210,240,270,300,330
MAT READ vl,vr,vb,vt,va
!
LET dt=.02 !sec. pitch time
LET t=0
DO
   SET VIEWPORT .2, .8, .2, .8
   SET WINDOW -7,7,-7,7
   LET xya= MOD(ANGLE(x,y),360) !xya= 0~< 360 ¢«  0~180~(-180)< ~< 0
   IF 0< t THEN
      PLOT LINES: bakx,baky; x,y
   ELSE
      DRAW axes
      FOR i=11 TO 0 STEP -1
         PLOT LINES:0,0;8*COS(va(i)),8*SIN(va(i))
         PLOT TEXT,AT 6.6*COS(va(i))-.15, 6.6*SIN(va(i))-.3 :STR$(va(i))
         IF xya<=va(i) THEN LET p=i ! ½é´ü³ÑÅ٤Πva()ÈÖ¹æ ¤òõ¤¹¡£
      NEXT i
   END IF
   !----
   IF p=0 THEN
      IF xya< va(1) THEN CALL poincare ! 0Å٤Πva() ¤Î¤ß¡£
   ELSE
      IF va(p)<=xya THEN CALL poincare ! 30~330Å٤Πva()
   END IF
   !----
   LET bakx=x
   LET baky=y
   CALL RungeKutta
   LET t=t+dt
LOOP UNTIL 1400< t

SUB poincare
   SET VIEWPORT vl(p),vr(p),vb(p),vt(p)
   SET WINDOW -1,7,-1,7
   DRAW axes
   PLOT POINTS: SQR(x^2+y^2),z
   LET p=MOD(p+1,12) ! ¼¡¤Î va()ÈÖ¹æ
END SUB

END
 

´Ø¿ôÄêµÁ¤Ç¥¨¥é¡¼¤¬È¯À¸

 Åê¹Æ¼Ô¡§¸×¤Î¼ª  Åê¹ÆÆü¡§2009ǯ 5·î26Æü(²Ð)22»þ25ʬ46ÉÃ
ÊÖ¿®¡¦°úÍÑ
  DEF f(x)=LOG(1-x)
¤È¤«,
DEF f(x)=SQR(4-x^2)
¤Ç¥¨¥é¡¼¤¬¤Ç¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤·¤¿.
(°ÊÁ°¤Ï¤Ç¤Æ¤¤¤Ê¤«¤Ã¤¿¤è¤¦¤Ê¡¦¡¦¡¦)
¤´¸¡Æ¤¤ò¤è¤í¤·¤¯¤ª¤Í¤¬¤¤¤·¤Þ¤¹.
 

Re: ´Ø¿ôÄêµÁ¤Ç¥¨¥é¡¼¤¬È¯À¸

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 5·î27Æü(¿å)08»þ07ʬ4ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.397[¸µµ­»ö¤Ø]

¸×¤Î¼ª¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> DEF f(x)=LOG(1-x)
> ¤È¤«,
> DEF f(x)=SQR(4-x^2)
> ¤Ç¥¨¥é¡¼¤¬¤Ç¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤·¤¿.
> (°ÊÁ°¤Ï¤Ç¤Æ¤¤¤Ê¤«¤Ã¤¿¤è¤¦¤Ê¡¦¡¦¡¦)
> ¤´¸¡Æ¤¤ò¤è¤í¤·¤¯¤ª¤Í¤¬¤¤¤·¤Þ¤¹.

¤É¤ó¤Ê¥¨¥é¡¼¤¬½Ð¤Þ¤¹¤«¡£
ËÝÌõ»þ¥¨¥é¡¼¤Ç¤¹¤«¡¤¼Â¹Ô»þ¥¨¥é¡¼¤Ç¤¹¤«¡£
½½¿ÊBASIC¤Î¥Ð¡¼¥¸¥ç¥ó¤Ï¤¤¤¯¤Ä¤Ç¤¹¤«¡£

¤Ê¤ª¡¤
10 DEF f(x)=LOG(1-x)
20 PRINT f(2)
30 END
¤ß¤¿¤¤¤Ê¥×¥í¥°¥é¥à¤Ï¡¤¼Â¹Ô»þ¤Î¥¨¥é¡¼¤Ë¤Ê¤ë¤Î¤¬»ÅÍͤǤ¹¡£
¡Ê¥¨¥é¡¼¤Ë¤Ê¤é¤Ê¤±¤ì¤Ð¥Ð¥°¤Ç¤¹¡£¡Ë
 

Ãí¼á¹Ô

 Åê¹Æ¼Ô¡§¥«¥Î¥ó  Åê¹ÆÆü¡§2009ǯ 5·î27Æü(¿å)15»þ50ʬ57ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ÇÒ·¼¡¡¤Ï¤¸¤á¤Þ¤·¤Æ¡£¤«¤Ä¤Æ¡¢¿§¡¹¤ÊBASIC¤ò¿¨¤Ã¤Æ¤ª¤ê¤Þ¤·¤¿¤¬¡¢¤³¤Î¤¿¤Ó½½¿ÊBASIC¤ò
¸«¤Ä¤±¤Þ¤·¤¿¡£Ç¯´ó¤ê¤Î¼ê½¬¤¤¤È»×¤Ã¤Æ¼è¤êÁȤߤޤ·¤¿¤¬¡¢¤Ï¤ä¤Ð¤ä¤È°ú¤Ã¤«¤«¤Ã¤Æ¤·¤Þ¤¤¤Þ¤·¤¿¡£¥×¥í¥°¥é¥à¤Î"END"¤Î¤¢¤È¤Ë¡¢¾¯¤·Ä¹Ê¸¤Î¥³¥á¥ó¥È¤òÆþ ¤ì¤¿¤È¤³¤í¡¢¤Ê¤ó¤À¤«¤ó¤À¤È¥¯¥ì¡¼¥à¤¬¤Ä¤­¡¢¥×¥í¥°¥é¥à¤Î¼Â¹Ô¤¬¤Ç¤­¤Þ¤»¤ó¡£¤«¤Ã¤Æ¤Ï¡¢¤É¤ÎBASIC¤Ç¤â¤³¤ó¤Ê¤³¤È¤Ï¤Ê¤«¤Ã¤¿¤è¤¦¤Ë»×¤¤¤Þ¤¹¡£¤É¤¦¤¹¤ì ¤Ð¤¤¤¤¤Î¤«¤´¶µ¼¨¤Í¤¬¤¤¤Þ¤¹¡£
 

Re: Ãí¼á¹Ô

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 5·î27Æü(¿å)16»þ13ʬ30ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.399[¸µµ­»ö¤Ø]

¥«¥Î¥ó¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¥×¥í¥°¥é¥à¤Î"END"¤Î¤¢¤È¤Ë¡¢¾¯¤·Ä¹Ê¸¤Î¥³¥á¥ó¥È¤òÆþ¤ì¤¿¤È¤³¤í¡¢
REM Ãí¼á
REM Ãí¼á
REM Ãí¼á

! Ãí¼á
! Ãí¼á
! Ãí¼á

END

REM Ãí¼á
REM Ãí¼á
REM Ãí¼á

¤Î¤è¤¦¤Êµ­½Ò¤Ç¤·¤ç¤¦¤«¡©

ENDʸ°Ê¹ß¤Ï¡¢!¡Ê´¶Ã²Éä¡Ë¤Ë¤è¤ëÃí¼á¤ò»È¤Ã¤Æ¤¯¤À¤µ¤¤¡£

REM Ãí¼á
REM Ãí¼á
REM Ãí¼á

! Ãí¼á
! Ãí¼á
! Ãí¼á

END

! Ãí¼á
! Ãí¼á
! Ãí¼á


¤Þ¤¿¡¢¼¡¤Î¤è¤¦¤ËREMʸ¤¬ºÇ¸å¤Ë¤Ê¤é¤Ê¤±¤ì¤Ðµ­½Ò¤â¤Ç¤­¤Þ¤¹¡£
¡¡¡§¡Êά¡Ë
¡¡¡§

END

REM Ãí¼á
REM Ãí¼á
REM Ãí¼á

EXTERNAL SUB test !¤Þ¤¿¤ÏEXTERNAL FUNCTION
END SUB
 

¤³¤ì¤Ï¡¢Ä»¤Ê¤Î¤«

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 5·î27Æü(¿å)21»þ09ʬ8ÉÃ
ÊÖ¿®¡¦°úÍÑ
  !¤³¤ì¤Ï¡¢Ä»¤Ê¤Î¤«¡£
!
OPTION ARITHMETIC NATIVE
!---------------------------------------
LET t$="¥°¥â¥¥¥¹¥­¡¼~¥ß¥é¡¼¼ÌÁü"
LET u=-0.8
DEF F(x)= u*x+2*(1-u)*x^2/(1+x^2)
DEF x1(x,y)= y+0.008*(1-0.05*y^2)*y+F(x)
DEF y1(x,y)=-x+F(x1(x,y))
!---------------------------------------
!¼ÌÁü¤ÎÏ¢º¿¤¬¡¢¥«¥ª¥¹¤Ë¤Ê¤Ã¤Æ¤¤¤ëºÂɸ(x,y)¤ÎÉÁ²è¤Ç¤¹¡£
!Affine ¼ÌÁü¤ÎÍͤʡ¢£²Ê¬´ô¤ä¡¢Â¿Ê¬´ô ¤Ï̵¤¯¡¢£Î²óÌܤμÌÁü¤â¡¢
!£±¤Ä¤À¤±¤Î¼ÌÁü¤¬Â³¤­¡¢Áý¤¨¤Þ¤»¤ó¤Î¤Ç¡¢ºÆµ¢·¿¤Ï¡¢¤¢¤Þ¤êÍפϤʤ¯¡¢
!£±:ºÆµ¢¥³¡¼¥ë¤·¤Ê¤¤Àµ½çÈÖ¡¢£²:ºÆµ¢·¿¤ÎµÕ½çÈÖ¡¢¤Î£²Ä̤êÉÁ²è¡£

! ºÆµ¢·¿¡£Ã¢¤·¡¢£Î²ó¸å¤ÎºÇ½ª¼ÌÁü¤«¤é¡¢N,,,2,1,0 µÕ½ç¤ÇÉÁ²è¤µ¤ì¤ë¡£
SUB fr(k, x,y)
   IF 0< k THEN CALL fr(k-1, x1(x,y),y1(x,y))
   PLOT POINTS: x,y
END SUB

! ¼ÌÁü¤Î½çÈ֤ɤ¦¤ê¤Ë¡¢0,1,2,,,N Àµ½çÈÖ¤ÇÉÁ²è¡£
SUB fo(N, x,y)
   FOR k=0 TO N
      PLOT POINTS: x,y
      LET wx= x1(x,y) ! x= x1(x,y) ¢«ËÜÍè¤Ç¤¹¤¬¡¢x ¤ÎÊѲ½¤Ï¡¢¼¡¼°¤Î¸å¤Ë¡£
      LET y= -x+F(wx) ! y= y1(x,y) ¢«ËÜÍè¤Ç¤¹¤¬¡¢wx ¤Ç·×»»¤ÎÀáÌó¡£
      LET x=wx
   NEXT k
END SUB

SET TEXT FONT "£Í£Ó ÌÀÄ«",12
SET TEXT BACKGROUND "OPAQUE"
SET POINT STYLE 1
LET N=50000
!
LET h=20
LET xm= h*0.1
LET ym= h*0.35
SET WINDOW xm-h,xm+h, ym-h,ym+h
CALL fo(N,.1,2) !¡¡¼ÌÁü¤ÎÀµ½ç¤ÇÉÁ²è 0,1,2,,,N
!
LET h=30
LET xm= h*0.2
LET ym=-h*0.4
SET WINDOW xm-h,xm+h, ym-h,ym+h
PLOT TEXT,AT xm-h*0.15, ym+h*0.85:t$& " N= "& STR$(N)
PLOT TEXT,AT xm-h*0.9, ym+h*0.85:"¤·¤Ð¤é¤¯¸æÂÔ¤Á²¼¤µ¤¤¡£"
CALL fr(N,.1,2) !¡¡ºÇ½ª¼ÌÁü¤«¤éµÕ½ç¤ÇÉÁ²è N,,,2,1,0
PLOT TEXT,AT xm-h*0.9, ym+h*0.85:"¡¡ÉÁ²è¤Î½ªÎ»¡¡¡¡¡¡¡¡¡¡"

END
 

Ãí¼á¹Ô

 Åê¹Æ¼Ô¡§¥«¥Î¥ó  Åê¹ÆÆü¡§2009ǯ 5·î28Æü(ÌÚ)18»þ05ʬ15ÉÃ
ÊÖ¿®¡¦°úÍÑ
  »³ÃæϵÁ¤É¤Î¡¢ÁᮤΤ´²óÅú¤òÍ­Æñ¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£¤ª°þÍͤǡ¢³Æ¹Ô¤Î"REM"¤ò"!"¤ËÊѤ¨¤Æ¤ß¤Þ¤·¤¿¤é¡¢¥×¥í¥°¥é¥à¤Î¼Â¹Ô¤¬²Äǽ¤È¤Ê¤ê¤Þ¤·¤¿¡£¤³¤Î·ï°Ê³°¤Ç¤â´¶¤¸¤Æ¤¤¤Þ¤¹¤¬¡¢¤³¤Î
½½¿ÊBASIC¤È¤¤¤¦¤Î¤Ï´Êñ¤Ê¤è¤¦¤Ç¡¢¤³¤ì¤Þ¤Ç¤ÎÍÍ¡¹¤ÊBASIC¤ÈÈæ³Ó¤¹¤ë¤È¡¢ºÙ¤«¤¤¤È¤³¤í¤Ç¿§¡¹¤ÈÊʤ¬¤¢¤ê¤Þ¤¹¤Í¡£
¤³¤ì¤«¤é¤â¶òÌä¤òȯ¤¹¤ë¤«¤âÃΤì¤Þ¤»¤ó¤¬¡¢¤è¤í¤·¤¯¤ª´ê¤¤¤¹¤ë¼¡Âè¤Ç¤¹¡£
 

Re: ´Ø¿ôÄêµÁ¤Ç¥¨¥é¡¼¤¬È¯À¸

 Åê¹Æ¼Ô¡§¸×¤Î¼ª  Åê¹ÆÆü¡§2009ǯ 5·î28Æü(ÌÚ)21»þ42ʬ45ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.398[¸µµ­»ö¤Ø]

ÇòÀС¡ÏÂÉפµ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¤ªÁû¤¬¤»¤·¤Þ¤·¤¿¡¥
»ä¤Î¥×¥í¥°¥é¥à¥ß¥¹¤Ç¤·¤¿¡¥
 

Re: ¤³¤ì¤Ï¡¢Ä»¤Ê¤Î¤«

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 5·î29Æü(¶â)11»þ10ʬ47ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.401[¸µµ­»ö¤Ø]

µ¤¤¬ÉÕ¤«¤Ê¤«¤Ã¤¿¡¦¡¦

! ºÆµ¢·¿¡£Ã¢¤·¡¢£Î²ó¸å¤ÎºÇ½ª¼ÌÁü¤«¤é¡¢N,,,2,1,0 µÕ½ç¤ÇÉÁ²è¤µ¤ì¤ë¡£
SUB fr(k, x,y)
   IF 0< k THEN CALL fr(k-1, x1(x,y),y1(x,y))
   PLOT POINTS: x,y
END SUB

¡¡  ¢­¤ÎÍͤˡ¢¹Ô¤òÆþ¤ìÂؤ¨¤ë¤È¡¢

! ºÆµ¢·¿¡£! ¼ÌÁü¤Î½çÈ֤ɤ¦¤ê¤Ë¡¢0,1,2,,,N Àµ½çÈÖ¤ÇÉÁ²è¡£
SUB fr(k, x,y)
   PLOT POINTS: x,y
   IF 0< k THEN CALL fr(k-1, x1(x,y),y1(x,y))
END SUB
 

ºÂɸ¼´ÉÁ²è¤Î¥Ð¥°

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ 6·î 5Æü(¶â)18»þ49ʬ43ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¼´¡¦³Ê»Ò¤òÉÁ¤¯Áȹþ¤ß¤Î³¨ÄêµÁ¤Ë¡¢¤¤¤¯¤Ä¤«¤ÎÉÔ¶ñ¹ç¤òȯ¸«¤·¤¿¤Î¤ÇÊó¹ð¤·¤Þ¤¹¡£

(1) GRID(p,q),AXES(p,q),GRID0(p,q),AXES0(p,q)¤Ç°ìÊý¤Î°ú¿ô¤ò0¤Ë¤¹¤ë¤È²£¼´½Ä¼´¤È¤â¤ËÌÜÀ¹¤ê¤¬ÉÁ¤«¤ì¤Ê¤¤¡£

(2) GRID(p,q),AXES(p,q)¤ÇÆÃÄê¤Î¿ôÃͤòÀßÄꤹ¤ë¤È±¦Ã¼,¾åü¤Î¿ô»ú¤¬ÉÁ¤«¤ì¤Ê¤¤¡£
10 LET a=23  ! a=41,46,51,82,87,92,97,¡Ä
20 LET b=1   ! b=2,4,8,11,13,16,21,22,26,27,¡Ä
30 SET WINDOW -a,a,-b,b
40 DRAW GRID(a/5,b/10)
50 END

(3) GRID(p,q),AXES(p,q)¤ÇyºÂɸ¤ÎÎΰè¤ÎÉý¤ò¤´¤¯¾®¤µ¤¯ÀßÄꤹ¤ë¤È¡¢ÉÁ¤«¤ì¤Ê¤¤¤Ï¤º¤Îx¼´¤Î¿ô»ú¤¬¾åü¤ËÉÁ²è¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£
10 LET c=.0000001
20 SET WINDOW -5,5,7-c,7
30 DRAW GRID(1,c/10)
40 END
 

Re: ºÂɸ¼´ÉÁ²è¤Î¥Ð¥°

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 6·î 6Æü(ÅÚ)18»þ07ʬ17ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.405[¸µµ­»ö¤Ø]

¤´Êó¹ð¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
ʸ»úÎó¤Î°ìÉô¤¬¶­³¦¤Ë¤«¤«¤ë¤Èʸ»úÎóÁ´ÂΤòÉÁ¤«¤Ê¤¤¤Î¤ÏWindows API¤Î»ÅÍͤÀ¤È»×¤¤¤Þ¤¹¡£
ºÂɸÃͤΰ·¤¤¤¬ÊѤʤΤϡ¤°ÊÁ°¤ËÊó¹ð¤Î¤¢¤Ã¤¿PLOT LINESʸ¤ÎÉÔ¶ñ¹ç¤ÈƱ¼ï¤Î¤â¤Î¤Ç¤¹¡£
¤³¤Á¤é¤ÏPLOT TEXTʸ¤Ë¤â¤«¤«¤ï¤ëÉÔ¶ñ¹ç¤Ê¤Î¤ÇÂкö¤ò¹Í¤¨¤Þ¤¹¡£
 

ΩÂζÊÀþ¤Î¡¢ÊÑ·Á»Ø¼¨MATʸ ¤Ë¤è¤ëÉÁ²è¡£

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 6·î 7Æü(Æü)00»þ37ʬ5ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ! ΩÂζÊÀþ f(x,y,z,t)¤Î¡¢ÊÑ·Á»Ø¼¨MATʸ ¤Ë¤è¤ëÉÁ²è¡£
!
! PLOT LINES :x1,y1,z1; x2,y2,z2 ¤Ï¡¢¥¨¥é¡¼¤Ç¤¹¤¬¡¢¤³¤ì¤ò¡¢picture ʸ¤Ë
! ÃÖ¤¤¤Æ¡¢draw picture with matrix ¤·¤¿¤«¤ÎÍͤˡ¢ÉÁ¤¯¡£
!
! x1,y1,z1; x2,y2,z2 ¤Îξü ºÂɸ¤À¤±¤ò¡¢picture ʸ¤ËÅϤ·¤Æ¡¢
! draw ¡Ä with ¡Ä ¤ò¼Â¹Ô¤·¡¢ºÂɸ¤Î¤ß¤Î¡¢ÊÑ·Á¡¢²óž¤ò¤¹¤ë¡£
! x1,y1,z1; x2,y2,z2 ¤Î¤½¤Î½ÐÎϤ«¤é¡¢x,y À®Ê¬¤À¤±¤ÎÀþ¤ò°ú¤¯¡£

!¡Ê¸À¤¤´¹¤¨¤ë¤È¡¢picture ʸ¤ÎÃæ¤Ç¡¢PLOT LINES ¤ò¤»¤º¡¢½Ð¤Æ¤«¤é¡¢PLOT ¤¹¤ë)
!-------------------------------

! ¥í¡¼¥ì¥ó¥ÄÊýÄø¼°¡¢£³¼¡¸µ¥°¥é¥Õ

!¡ÖÎã¡×ÉÁ¤¯¥°¥é¥Õ¤Ï¡¢ÂÐή¸½¾Ý¤Î¶á»÷¼°¤È¤·¤ÆÃΤé¤ì¤ë¥«¥ª¥¹¤Ç¤¹¡£
!-------------------------------
LET s=10
LET b=8/3
LET r=28
!-----¥í¡¼¥ì¥ó¥ÄÊýÄø¼°(¥«¥ª¥¹)
DEF dxdt(x,y  )= -s*x +s*y    ! (dx/dt)= -s*x +s*y
DEF dydt(x,y,z)= -x*z +r*x -y ! (dy/dt)= -x*z +r*x -y
DEF dzdt(x,y,z)=  x*y -b*z    ! (dz/dt)=  x*y -b*z

SUB RungeKutta
   LET kx1=dxdt(x,y  )
   LET ky1=dydt(x,y,z)
   LET kz1=dzdt(x,y,z)
   !
   LET kx2=dxdt(x+kx1*dt/2, y+ky1*dt/2            )
   LET ky2=dydt(x+kx1*dt/2, y+ky1*dt/2 ,z+kz1*dt/2)
   LET kz2=dzdt(x+kx1*dt/2, y+ky1*dt/2 ,z+kz1*dt/2)
   !
   LET kx3=dxdt(x+kx2*dt/2, y+ky2*dt/2            )
   LET ky3=dydt(x+kx2*dt/2, y+ky2*dt/2 ,z+kz2*dt/2)
   LET kz3=dzdt(x+kx2*dt/2, y+ky2*dt/2 ,z+kz2*dt/2)
   !
   LET kx4=dxdt(x+kx3*dt, y+ky3*dt          )
   LET ky4=dydt(x+kx3*dt, y+ky3*dt ,z+kz3*dt)
   LET kz4=dzdt(x+kx3*dt, y+ky3*dt ,z+kz3*dt)
   !
   LET x=x+(kx1+2*kx2+2*kx3+kx4)*dt/6
   LET y=y+(ky1+2*ky2+2*ky3+ky4)*dt/6
   LET z=z+(kz1+2*kz2+2*kz3+kz4)*dt/6
END SUB

!-----run
OPTION ANGLE DEGREES
DIM pV1(4), pV2(4), P3D(4,4), rotx(4,4)
MAT rotx=IDN
!
LET ax=-75 !¡¡¸¶ÅÀ¤òÄ̤ꡢ²èÌ̤οåÊ¿¼´¤Ç¤Î²óž¡Ê x ¼´¤È¤Ï¡¢¸Â¤é¤º¡£¡Ë
!
! 1,       0, 0, 0
! 0, cos(ax), 0, 0
! 0,-sin(ax), 1, 0
! 0,       0, 0, 1
!
LET rotx(2,2)=COS(ax)
LET rotx(3,2)=-SIN(ax)
!
LET xm=0
LET ym=20
LET h=40
SET WINDOW xm-h,xm+h,ym-h,ym+h
LET dt=.005 !sec. pitch time
!
FOR az=-45 TO 315 STEP 10 !¡¡£ú¼´¤Ç¤Î²óž¡£360 ÅÙ¡¢°ì²ó¤ê¡£
!----
   LET x=2
   LET y=1
   LET z=24
   !----
   LET t=0
   IF -45< az THEN SET DRAW mode hidden
   CLEAR
   PLOT TEXT,AT xm+h*.2,ym+h*.9 :"lorenz ¥í¡¼¥ì¥ó¥ÄÊýÄø¼°"
   DO
      IF 0< t THEN
      !---3D ¶ÊÀþ(x,y,z)
         DRAW line3D( bakx,baky,bakz, x,y,z) WITH ROTATE(az)*rotx
         PLOT LINES: pV1(1),pV1(2); pV2(1),pV2(2)
      ELSE
      !   ---X ¼´
         DRAW line3D( -30,0,0, 30,0,0) WITH ROTATE(az)*rotx
         PLOT LINES: pV1(1),pV1(2); pV2(1),pV2(2)
         PLOT TEXT,AT pV2(1),pV2(2) :"(X)"
         !---Y ¼´
         DRAW line3D( 0,-30,0, 0,30,0) WITH ROTATE(az)*rotx
         PLOT LINES: pV1(1),pV1(2); pV2(1),pV2(2)
         PLOT TEXT,AT pV2(1),pV2(2) :"(Y)"
         !---Z ¼´
         DRAW line3D( 0,0,-10, 0,0,50) WITH ROTATE(az)*rotx
         PLOT LINES: pV1(1),pV1(2); pV2(1),pV2(2)
         PLOT TEXT,AT pV2(1),pV2(2) :"(Z)"
      END IF
      !----
      LET bakx=x
      LET baky=y
      LET bakz=z
      CALL RungeKutta
      LET t=t+dt
   LOOP UNTIL 30< t !¡¡100 ¤¯¤é¤¤¤¬Îɤ¤¤Î¤«¤â¡Ä¡¡ÃÙ¤¯¤Ê¤ë¡£
   SET DRAW mode explicit
NEXT az

PICTURE line3D(x1,y1,z1, x2,y2,z2)
   MAT P3D=TRANSFORM !¢« draw Ž¥Ž¥Ž¥ with matrix ¤ÇÍ¿¤¨¤é¤ì¤¿ matrix
   LET pV1(1)=x1
   LET pV1(2)=y1
   LET pV1(3)=z1   !ÆþÎÏ z1 ºÂɸ¤Ï¡¢½ÐÎÏ x1,y1 ¤ËÈ¿±Ç¡¢ÉÁ²è¤µ¤ì¤ë¡£
   LET pV1(4)=1
   MAT pV1=pV1*P3D !½ÐÎÏ z1 ºÂɸpV1(3)¤Ï¡¢ÉÁ²è¤·¤Ê¤¤¡£
   LET pV2(1)=x2
   LET pV2(2)=y2
   LET pV2(3)=z2   !ÆþÎÏ z2 ºÂɸ¤Ï¡¢½ÐÎÏ x2,y2 ¤ËÈ¿±Ç¡¢ÉÁ²è¤µ¤ì¤ë¡£
   LET pV2(4)=1
   MAT pV2=pV2*P3D !½ÐÎÏ z2 ºÂɸpV2(3)¤Ï¡¢ÉÁ²è¤·¤Ê¤¤¡£
END PICTURE

END
 

Re: ºÂɸ¼´ÉÁ²è¤Î¥Ð¥°

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ 6·î 7Æü(Æü)21»þ49ʬ10ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.406[¸µµ­»ö¤Ø]

¤è¤í¤·¤¯¤ª´ê¤¤¤¤¤¿¤·¤Þ¤¹¡£
 

¤Ä¤Å¤­

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 6·î 9Æü(²Ð)05»þ14ʬ11ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.407[¸µµ­»ö¤Ø]

! ΩÂζÊÀþ f(x,y,z,t)¤ò¡¢ÊÑ·Á»Ø¼¨MATʸ¤Ç¡¢ÉÁ¤¯¡Ê£²¡Ë
!
! Á°²ó¡¢¤¯¤É¤¤»ö¤ò¤·¤Æ¤¤¤¿¤è¤¦¤Ç¡¢À°Íý¤·¤¿¡£
! ÇÛÎó¥Ù¥¯¥È¥ë x,y,z ºÂɸ¤òÆþÎϤˡ¢Ã±¤Ë¡¢ÊÑ·Á»Ø¼¨MATʸ¤À¤±¤ÇÊÑ·Á²óž¤¹¤ë¡£
! x,y,z ¤Î¤½¤Î½ÐÎϤ«¤é¡¢x,y À®Ê¬¤À¤±¤Î PLOT¡£
!-------------------------------

! ¥ì¥¹¥é¡¼ÊýÄø¼°¡¡£³¼¡¸µ¥°¥é¥Õ

!¡¡ÈóÀþ·Á¹à¤¬¡¢z*x £±¤Ä¤À¤±¤Î¥«¥ª¥¹¡£·Á¾õ:¥á¥Ó¥¦¥¹¤ÎÂÓ
!-------------------------------
LET a=0.398
LET b=2
LET c=4
!-----¥ì¥¹¥é¡¼ÊýÄø¼°
SUB Dxyz( kx,ky,kz, x,y,z)
   LET kx=-y-z       ! (dx/dt)= -y -z
   LET ky= x+a*y     ! (dy/dt)=  x +a*y
   LET kz= b+z*(x-c) ! (dz/dt)=  b +z*(x-c)
END SUB

SUB RungeKutta
   CALL Dxyz( kx1,ky1,kz1, x,y,z)
   CALL Dxyz( kx2,ky2,kz2, x+kx1*dt/2,y+ky1*dt/2,z+kz1*dt/2)
   CALL Dxyz( kx3,ky3,kz3, x+kx2*dt/2,y+ky2*dt/2,z+kz2*dt/2)
   CALL Dxyz( kx4,ky4,kz4, x+kx3*dt  ,y+ky3*dt  ,z+kz3*dt  )
   LET x=x+(kx1+2*kx2+2*kx3+kx4)*dt/6
   LET y=y+(ky1+2*ky2+2*ky3+ky4)*dt/6
   LET z=z+(kz1+2*kz2+2*kz3+kz4)*dt/6
END SUB

!-----run
OPTION CHARACTER byte !¥¦¥à¥é¥¦¥È"o" =CHR$(246) ¤ò¥¨¥é¡¼¤Ë¤µ¤»¤Ê¤¤¡£
OPTION ANGLE DEGREES
DIM pV(4), P3D(4,4), rotx(4,4)
!
MAT rotx=IDN !¡¡Ã±°Ì¹ÔÎó
LET ax=-55   !¡¡¸¶ÅÀ¤òÄ̤ꡢ²èÌ̤οåÊ¿¼´¤Ç¤Î²óž¡Ê x ¼´¤È¤Ï¡¢¸Â¤é¤º¡£¡Ë
!
!(x,y,z,1)| 1,       0, 0, 0 |¡¡PLOT ºÂɸ¥Ù¥¯¥È¥ë¤Ï¡¢¹Ô¥Ù¥¯¥È¥ë¡£
!         | 0, cos(ax), 0, 0 |¡¡£´ÎóÌܤΣ±¤Ï¡¢³ÈÂçΨ¤ÎµÕ¿ô¤Ç¤¢¤ë¤¬¡¢
!         | 0,-sin(ax), 1, 0 |¡¡draw ʸ¤Ç¡¢ÉÁ²è¤·¤Ê¤¤¤Î¤Ç¡¢Ìµ»ë¤·¤Æ²Ä¡£
!         | 0,       0, 0, 1 |
!
LET rotx(2,2)=COS(ax)
LET rotx(3,2)=-SIN(ax)
!
LET xm=0
LET ym=2
LET h=7
SET WINDOW xm-h,xm+h,ym-h,ym+h
LET dt=.05    ! sec. pitch time
LET SS=35     ! £ú¼´²ó¤ê¡¢³«»Ï³ÑÅÙ
LET EE=SS-360 ! +360¡§º¸²óž¡¡-360¡§±¦²óž
!
FOR az=SS TO EE STEP SGN(EE-SS)*10 !¡¡£ú¼´¡¢°ì²ó¤ê360 ÅÙ
   MAT P3D=ROTATE(az)*rotx
   !----
   IF az<>SS THEN SET DRAW mode hidden
   CLEAR
   SET TEXT font "Courier",11
   PLOT TEXT,AT xm+h*.2,ym+h*.9 :"R"& CHR$(246)& "ssler"
   SET TEXT font "ɸ½à¥´¥·¥Ã¥¯",11
   PLOT TEXT,AT xm+h*.45,ym+h*.9 :"¥ì¥¹¥é¡¼ÊýÄø¼°" ! PEN-off
   !---ºÂɸ¼´
   CALL axes3D( -6,0,0, 6,0,0, "(X)" )
   CALL axes3D( 0,-6,0, 0,6,0, "(Y)" )
   CALL axes3D( 0,0,-2, 0,0,8, "(Z)" )
   !---3D ¶ÊÀþ
   LET x=-3
   LET y=0
   LET z=0
   FOR t=0 TO 300 STEP dt
      CALL line3D(x,y,z)
      CALL RungeKutta
   NEXT t
   SET DRAW mode explicit
NEXT az

SUB axes3D(x1,y1,z1, x2,y2,z2, a$ )
   CALL line3D(x1,y1,z1)
   CALL line3D(x2,y2,z2)
   PLOT TEXT,AT pV(1),pV(2) :a$ ! PEN-off
END SUB

SUB line3D(x,y,z)
   LET pV(1)=x
   LET pV(2)=y
   LET pV(3)=z   !ÆþÎÏ z ºÂɸ¤Ï¡¢½ÐÎÏ x,y ¤ËÈ¿±Ç¡¢ÉÁ²è¤µ¤ì¤ë¡£
   MAT pV=pV*P3D
   PLOT LINES: pV(1),pV(2); !½ÐÎÏ z ºÂɸpV(3)¤Ï¡¢ÉÔÍס£ PEN-on
END SUB

END
 

ÅŻҲóÏ©¤Ç ºî¤é¤ì¤¿¥«¥ª¥¹

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 6·î12Æü(¶â)05»þ12ʬ43ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.407[¸µµ­»ö¤Ø]

!Àè¤ÎÅê¹Æ¡¢¥í¡¼¥ì¥ó¥ÄÊýÄø¼°¤Ç¡¢DEF dxdt()¡¢DEF¡¦¡¦¡¦¤Î°ú¿ô¤ËæÍ
!¤¢¤ê¤Þ¤·¤¿¡£¤¹¤ß¤Þ¤»¤ó¡£¡¡¡Ê ¸½ºß¡¢ÄûÀµºÑ¤ß¡£¡Ë
!-------------------------------

! ΩÂζÊÀþ f(x,y,z,t)¤ò¡¢ÊÑ·Á»Ø¼¨MATʸ¤Ç¡¢ÉÁ¤¯¡Ê£³¡Ë
!-------------------------------
OPTION ARITHMETIC NATIVE
OPTION ANGLE DEGREES
DIM pV(4), P3D(4,4), rotx(4,4), LH(6), copy(0 TO 100000, 3)
MAT rotx=IDN ! ñ°Ì¹ÔÎó
!
!-----
!¡¡ÅŻҲóÏ©¤Ç ºî¤é¤ì¤¿¥«¥ª¥¹¡£(źÉÕ¿Þ»²¾È)
LET t$="Double Scroll Attractor ¥À¥Ö¥ë ¥¹¥¯¥í¡¼¥ë ¥¢¥È¥é¥¯¥¿"

!¡¡ÊѶÊÅÀ(¡ÞBp)¤Î¤¢¤ë ÉéÀ­Äñ¹³²óÏ©¤Ø¤Î ÅÅή¡áih( ÅÅ°µ )
DEF ih(x)= g0*x+(g1-g0)*( ABS(x+Bp)-ABS(x-Bp) )/2

SUB Dxyz( kx,ky,kz, x,y,z)
   LET kx= (gR*(y-x) -ih(x))/C1 ! (d vC1/dt)= (gR*(vC2-vC1)-ih(vC1))/C1
   LET ky= (gR*(x-y) +z )/C2    ! (d vC2/dt)= (gR*(vC1-vC2)+iL     )/C2
   LET kz= -y/L                 ! (d iL /dt)= -vC2/L
END SUB

LET C1= 1/9 !¥³¥ó¥Ç¥ó¥µ¡¼¡¡¡¡¡¡¡Ê¥Ñ¥é¥á¡¼¥¿¡¼ C1~Bp¡Ë
LET C2= 1   !¥³¥ó¥Ç¥ó¥µ¡¼
LET L=  1/7 !¥¤¥ó¥À¥¯¥¿¡¼
LET gR= 0.7 !£Ò¤Î¥³¥ó¥À¥¯¥¿¥ó¥¹¡Ê¥¢¥É¥ß¥¿¥ó¥¹¤Î¼Â¿ôÉô¡Ë
LET g0=-0.5 !ÉéÀ­Äñ¹³²óÏ©¤ÎÈùʬ¥³¥ó¥À¥¯¥¿¥ó¥¹¡Ê¡Á¡ã-Bp¡¡¡¡  +Bp¡ã¡Á)
LET g1=-0.8 !ÉéÀ­Äñ¹³²óÏ©¤ÎÈùʬ¥³¥ó¥À¥¯¥¿¥ó¥¹¡Ê¡¡¡¡-Bp¡ã¡Á¡ã+Bp¡¡¡¡)
LET Bp= 1   !ÉéÀ­Äñ¹³²óÏ©¤Î¡¢ÊѶÊÅÀ¤ÎÅÅ°µ ÀäÂÐÃÍ¡£
!
LET x=-1e-7 !½é´üÃÍ x,y,z
LET y= 1e-7
LET z= 1e-7
DATA -3,3, -3,3, -2.5,3 !ºÂɸ¼´¤Îξü xL,xH, yL,yH, zL,zH
MAT READ LH
LET xm=0    !²èÌÌÃæ¿´ xm,ym
LET ym=.5   !
LET h=3.5   !²èÌÌÊÒÉý ¡Þh
LET dt=.01  ! pitch time
LET t99=120 ! close time
LET ax=-85  !£ú¼´¤ò¡¢²èÌ̤οåÊ¿¼´¤Ç²óž¡¢·¹¤±¤ë³ÑÅÙ
LET SS=-25  !£ú¼´¤Ç¤Î¡¢²óž ³«»Ï³ÑÅÙ
LET EE=SS+360 !¡¡¡¡¡¡¡¡²óž ½ªÎ»³ÑÅÙ +360¡§º¸²óž¡¡-360¡§±¦²óž
CALL graph3D


!-----
SUB RungeKutta
   CALL Dxyz( kx1,ky1,kz1, x,y,z)
   CALL Dxyz( kx2,ky2,kz2, x+kx1*dt/2,y+ky1*dt/2,z+kz1*dt/2)
   CALL Dxyz( kx3,ky3,kz3, x+kx2*dt/2,y+ky2*dt/2,z+kz2*dt/2)
   CALL Dxyz( kx4,ky4,kz4, x+kx3*dt  ,y+ky3*dt  ,z+kz3*dt  )
   LET x=x+(kx1+2*kx2+2*kx3+kx4)*dt/6
   LET y=y+(ky1+2*ky2+2*ky3+ky4)*dt/6
   LET z=z+(kz1+2*kz2+2*kz3+kz4)*dt/6
END SUB

SUB graph3D
!-----run
!£ú¼´¤ò¡¢²èÌ̤οåÊ¿¼´¤Ç²óž¡¢·¹¤±¤ë¹ÔÎó rotx
!(x,y,z,1)| 1,       0, 0, 0 |¡¡½½¿Ê¤Î¡¢PLOT¥Ù¥¯¥È¥ë¤Ï¡¢¹Ô¥Ù¥¯¥È¥ë¡£
!         | 0, cos(ax), 0, 0 |¡¡£´ÎóÌܤΣ±¤Ï¡¢³ÈÂçΨ¤ÎµÕ¿ô¤Ç¤¢¤ë¤¬¡¢
!         | 0,-sin(ax), 1, 0 |¡¡draw~with~ ¤Ç¸ú²Ì¤¹¤ë¡£
!         | 0,       0, 0, 1 |¡¡¤³¤Î¥×¥í¥°¥é¥à¤Ç¤Ï¡¢Ìµ»ë¤·¤Æ²Ä¡£
   LET rotx(2,2)=COS(ax)
   LET rotx(3,2)=-SIN(ax)
   !
   SET WINDOW xm-h,xm+h,ym-h,ym+h
   !
   FOR az=SS TO EE STEP SGN(EE-SS)*10 !¡¡£ú¼´¤Ç¡¢°ì²ó¤ê360 ÅÙ
      MAT P3D=ROTATE(az)*rotx
      !----
      IF az<>SS THEN SET DRAW mode hidden
      CLEAR
      PLOT TEXT,AT xm-h*.8,ym+h*.9 :t$ !¡¡PEN-off
      !---ºÂɸ¼´
      CALL axes3D( LH(1),0,0, LH(2),0,0, "(X)" )
      CALL axes3D( 0,LH(3),0, 0,LH(4),0, "(Y)" )
      CALL axes3D( 0,0,LH(5), 0,0,LH(6), "(Z)" )
      !---3D ¶ÊÀþ
      IF az=SS THEN
         LET n=0
         FOR t=0 TO t99 STEP dt
            LET copy(n,1)=x
            LET copy(n,2)=y !¡¡£±²óÌÜ(³«»Ï³ÑÅÙ)¤Ç¡¢£³£Äµ­Ï¿¤ò»£¤ë¡£
            LET copy(n,3)=z
            CALL line3D(x,y,z)
            CALL RungeKutta
            LET n=n+1
         NEXT t
      ELSE
         FOR n=0 TO n-1
            LET x=copy(n,1)
            LET y=copy(n,2) !¡¡£²²óÌܰʹߤϡ¢µ­Ï¿¤ÎºÆÀ¸¤Ç¡¢¹â®ÉÁ²è¡£
            LET z=copy(n,3)
            CALL line3D(x,y,z)
         NEXT n
      END IF
      SET DRAW mode explicit
   NEXT az
END SUB

SUB axes3D(x1,y1,z1, x2,y2,z2, a$ )
   CALL line3D(x1,y1,z1)
   CALL line3D(x2,y2,z2)
   PLOT TEXT,AT pV(1),pV(2) :a$ !¡¡PEN-off
END SUB

SUB line3D(x,y,z)
   LET pV(1)=x
   LET pV(2)=y
   LET pV(3)=z   !ÆþÎÏ z ºÂɸ¤Ï¡¢½ÐÎÏ x,y ¤ËÈ¿±Ç¡¢ÉÁ²è¤µ¤ì¤ë¡£
   MAT pV=pV*P3D
   PLOT LINES: pV(1),pV(2); !½ÐÎÏ z ºÂɸpV(3)¤Ï¡¢ÉÔÍס£ PEN-on
END SUB

END
 

¥ä¥ê¥¤¥«¤ÎµðÂç¿À·Ð

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 6·î14Æü(Æü)22»þ46ʬ58ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ! ΩÂζÊÀþ f(x,y,z,t)¤ò¡¢ÊÑ·Á»Ø¼¨MATʸ¤Ç¡¢ÉÁ¤¯¡Ê£´¡Ë
!-------------------------------
OPTION ARITHMETIC NATIVE
OPTION ANGLE DEGREES
DIM pV(4), P3D(4,4), rotx(4,4), LH(6), copy(0 TO 100000, 3)
LET pV(4)=1 ! shift()*rotate()* ¡Ä ¤ÇɬÍס£
MAT rotx=IDN
!
!-----
LET t$="¥ä¥ê¥¤¥«¤ÎµðÂç¿À·Ð¡Ê¥«¥ª¥¹¡Ë¡¡¿ô³Ø¥â¥Ç¥ë"
LET t2$="Hodgkin-Huxley ¥Û¥¸¥­¥ó¡Ý¥Ï¥¯¥¹¥ì¥¤ÊýÄø¼° ¤Î¥¹¥È¥ì¥ó¥¸ ¥¢¥È¥é¥¯¥¿"

DEF I(t)= I0+A*SIN( 360*f*t ) ! ËìÅÅή +³°ÉôÆþÎÏ

LET t3$="ËìÅÅ°Ì V ¢ª( X)"
!¡¡(d V/dt)= I(t)-120*m^3*h*(V-115) -40*n^4*(V+12) -.24*(V-10.613)
!
LET t4$="¥Ê¥È¥ê¥¦¥à¡¡³èÀ­²½ÊÑ¿ô( 0< m< 1) ¢ª( Y)"
!¡¡(d m/dt)= .1*(25-V)/(EXP((25-V)/10)-1)*(1-m) -4*EXP(-V/18)*m
!
LET t5$="¥Ê¥È¥ê¥¦¥àÉÔ³èÀ­²½ÊÑ¿ô( 0< h< 1) ¢ª( Z)"
!¡¡(d h/dt)= .07*EXP(-V/20)*(1-h) -1/(EXP((30-V)/10)+1)*h

! ¥«¥ê¥¦¥à³èÀ­²½ÊÑ¿ô( 0< n< 1)¡¡¢ªÉÁ²è¤·¤Ê¤¤¡£
!¡¡(d n/dt)= .01*(10-V)/(EXP((10-V)/10)-1)*(1-n) -.125*EXP(-V/80)*n

SUB Dxyzn( kx,ky,kz,kn, x,y,z,n)
   LET kx= I(t)-120*y^3*z*(x-115) -40*n^4*(x+12) -.24*(x-10.613) ! (d V/dt)
   LET ky= .1*(25-x)/(EXP((25-x)/10)-1)*(1-y) -4*EXP(-x/18)*y    ! (d m/dt)
   LET kz= .07*EXP(-x/20)*(1-z) -1/(EXP((30-x)/10)+1)*z          ! (d h/dt)
   LET kn= .01*(10-x)/(EXP((10-x)/10)-1)*(1-n) -.125*EXP(-x/80)*n! (d n/dt)
END SUB

LET I0=20   !ËìÅÅή ¥Ñ¥é¥á¡¼¥¿¡¼
LET A=40
LET f=.3000001
!
LET x=6.24  !½é´üÃÍ x,y,z,n
LET y=.0761
LET z=.301
LET n=.519
!
DATA -15,100, -.3,1, -.04,.49 !ºÂɸ¼´¤ÎξüºÂɸ xL,xH, yL,yH, zL,zH
MAT READ LH
LET Sx=1    !¥¹¥±¡¼¥ëÇÜΨ Sx,Sy,Sz
LET Sy=50
LET Sz=200
!
LET xm=40   !²èÌÌÃæ¿´ xm,ym
LET ym=52
LET hw=80   !²èÌÌÉý/2 ¡Þhw
LET dt=.05  ! pitch time
LET t99=500 ! close time
LET zox=40  !£ú¼´¤È¡¢Ê¿¹Ô¤Ê²óž¼´¤Ø¤Î¥ª¥Õ¥»¥Ã¥È£ø£ù
LET zoy=20
LET ax=-75  !²óž¼´¤ò¡¢²èÌ̤οåÊ¿¼´¤ÇÅݤ·¡¢·¹¤±¤ë³ÑÅÙ
LET SS=-25    !²óž ³«»Ï³ÑÅÙ
LET EE=SS+360 !²óž ½ªÎ»³ÑÅÙ +360¡§º¸²óž¡¡-360¡§±¦²óž
CALL graph3D


!-----
SUB RungeKutta
   CALL Dxyzn( kx1,ky1,kz1,kn1, x,y,z,n)
   CALL Dxyzn( kx2,ky2,kz2,kn2, x+kx1*dt/2,y+ky1*dt/2,z+kz1*dt/2,n+kn1*dt/2)
   CALL Dxyzn( kx3,ky3,kz3,kn3, x+kx2*dt/2,y+ky2*dt/2,z+kz2*dt/2,n+kn2*dt/2)
   CALL Dxyzn( kx4,ky4,kz4,kn4, x+kx3*dt  ,y+ky3*dt  ,z+kz3*dt  ,n+kn3*dt  )
   LET x=x+(kx1+2*kx2+2*kx3+kx4)*dt/6
   LET y=y+(ky1+2*ky2+2*ky3+ky4)*dt/6
   LET z=z+(kz1+2*kz2+2*kz3+kz4)*dt/6
   LET n=n+(kn1+2*kn2+2*kn3+kn4)*dt/6
END SUB

SUB graph3D
!-----run
!²óž¼´¤ò¡¢²èÌ̤οåÊ¿¼´¤ÇÅݤ·¡¢·¹¤±¤ë¹ÔÎó rotx
!(x,y,z,1)| 1,       0, 0, 0 |¡¡½½¿Ê¤Î¡¢PLOT¥Ù¥¯¥È¥ë¤Ï¡¢¹Ô¥Ù¥¯¥È¥ë¡£
!         | 0, cos(ax), 0, 0 |¡¡£´ÎóÌܤΣ±¤Ï¡¢³ÈÂçΨ¤ÎµÕ¿ô¡¢drawʸ ¤Ç¸ú²Ì¡£
!         | 0,-sin(ax), 1, 0 |¡¡Ä¾ÀܤΠplot lines ¤Ç¤Ï¡¢1 ¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤ë¡£
!         | 0,       0, 0, 1 |¡¡¹ÔÎó¤Î·×»»¤Ç¤Ï¡¢Ê¿¹Ô°ÜÆ°¤ò¡¢²Äǽ¤Ë¤¹¤ë¡£
   LET rotx(2,2)=COS(ax)       !¤³¤Î¥×¥í¥°¥é¥à¤Ç¤Ï¡¢SHIFT(,) ¤ÇɬÍס£
   LET rotx(3,2)=-SIN(ax)
   !
   SET WINDOW xm-hw,xm+hw,ym-hw,ym+hw
   !
   FOR az=SS TO EE STEP SGN(EE-SS)*10 !¡¡²óž¼´¤Ç¡¢10 Å٤ŤIJ󤹡£
      MAT P3D=SHIFT(-zox,-zoy)*ROTATE(az)*SHIFT(zox,zoy)*rotx
      !----
      IF az<>SS THEN SET DRAW mode hidden
      CLEAR
      PLOT TEXT,AT xm-hw*.9,ym+hw*.90 :t$
      PLOT TEXT,AT xm-hw*.9,ym+hw*.83 :t2$
      PLOT TEXT,AT xm-hw*.9,ym-hw*.92 :t5$
      PLOT TEXT,AT xm-hw*.9,ym-hw*.99 :t4$& "¡¡¡¡"& t3$ !¡¡PEN-off
      !---ºÂɸ¼´
      CALL axes3D( LH(1),0,0, LH(2),0,0, STR$(LH(2))& "( X)" )
      CALL axes3D( 0,LH(3),0, 0,LH(4),0, STR$(LH(4))& "( Y)" )
      CALL axes3D( 0,0,LH(5), 0,0,LH(6), STR$(LH(6))& "( Z)" )
      !---3D ¶ÊÀþ
      IF az=SS THEN
         LET ci=0
         FOR t=0 TO t99 STEP dt
            LET copy(ci,1)=x
            LET copy(ci,2)=y !¡¡£±²óÌÜ(³«»Ï³ÑÅÙ)¤Ç¡¢£³£Äµ­Ï¿¤ò»£¤ë¡£
            LET copy(ci,3)=z
            ! PRINT x;y;z;n !¡¡¥Ç¡¼¥¿¡¼¤òÊݸ¤·¤¿¤¤»þ¡£
            CALL line3D(x,y,z)
            CALL RungeKutta
            LET ci=ci+1
         NEXT t
      ELSE
         FOR ci=0 TO ci-1 !¡¡£²²óÌܰʹߤϡ¢µ­Ï¿¤ÎºÆÀ¸¤Ç¡¢¹â®ÉÁ²è¡£
            CALL line3D( copy(ci,1),copy(ci,2),copy(ci,3) )
         NEXT ci
      END IF
      SET DRAW mode explicit
   NEXT az
END SUB

SUB axes3D(x1,y1,z1, x2,y2,z2, a$ )
   CALL line3D(x1,y1,z1)
   CALL line3D(x2,y2,z2)
   PLOT TEXT,AT pV(1),pV(2) :a$ !¡¡PEN-off
END SUB

SUB line3D(x,y,z)
   LET pV(1)=x*Sx  !ÉÁ²èÌÜÀ¹¤Ï¡¢Á´Êý¸þÅù¤·¤¯¤Ê¤¤¤È¡¢²óž¤Ç¡¢·Á¤¬ÊݤƤʤ¤¡£
   LET pV(2)=y*Sy  !¥¹¥±¡¼¥ë Sx,Sy,Sz ¤Î°ã¤¤¤Ï¡¢ÆþÎϤÎÇÜΨ¤È¤·¤Æ¡¢¹Ô¤Ê¤¦¡£
   LET pV(3)=z*Sz  !ÆþÎÏ z ºÂɸ¤Ï¡¢½ÐÎÏ x,y ¤ËÈ¿±Ç¡¢ÉÁ²è¤µ¤ì¤ë¡£
   MAT pV=pV*P3D
   PLOT LINES: pV(1),pV(2); !¡¡PEN-on
END SUB

END
 

Re: ºÂɸ¼´ÉÁ²è¤Î¥Ð¥°

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 6·î15Æü(·î)10»þ49ʬ32ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.406[¸µµ­»ö¤Ø]

¥æ¡¼¥¶¡¼³¨ÄêµÁ¤ò»È¤Ã¤¿¾ì¹ç¤Ï¡¢(2),(3)¤ÏÀµ¾ï¤Ëɽ¼¨¤¹¤ë¤è¤¦¤À¡£
10 LET c=.0000001
20 SET WINDOW -5,5,7-c,7
30 DRAW GRID2(1,c/10) ! <-----
40 END
50 MERGE "grid2.lib" ! <-----¡¡¢¨EXTERNAL PICTURE ʸ¤Ë¤è¤ëľÀܤε­½Ò¤âOK


¤Þ¤¿¡¢DRAW circle¡¢DRAW disk ¤Ë¤Ä¤¤¤Æ¤âƱ¤¸¸½¾Ý¤¬È¯À¸¤¹¤ë¡£
SET WINDOW -500,500,-500,500

LET phi=(1+SQR(5))/2 !²«¶âÈæ
LET a=2*PI*phi !²«¶â³Ñ

LET r=1
LET th=0
FOR i=0 TO 900
   LET r=1.1*r !¤é¤»¤ó¾õ
   LET th=th+a
   LET x1=r*COS(th)
   LET y1=r*SIN(th)
   !DRAW disk WITH SCALE(r*0.3)*SHIFT(x1,y1)
   DRAW circle WITH SCALE(r*0.3)*SHIFT(x1,y1)
NEXT i

END

MERGE "circle.lib"


WindowsMe¤ÈXP¤Ç¤Ï¡¢¾ã³²ÆâÍƤ¬°ã¤¦¡£
¡¡Me¤Î¾ì¹ç¡¢OS¤ÎDIBENG.DLL¤Ç¥¨¥é¡¼¤È¤Ê¤êBASIC¤¬¶¯À©½ªÎ»¤È¤Ê¤ë¡£
¡¡XP¤Î¾ì¹ç¡¢ÉÁ²è¤·¤Ê¤¤¡¢¹õ¥Ù¥¿¤Ë¤Ê¤ë¡£
 

Re: ¥»¥ó¥¿¡¼»î¸³ÄøÅÙ¤Î¥×¥í¥°¥é¥à±é½¬

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 6·î17Æü(¿å)10»þ24ʬ11ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.395[¸µµ­»ö¤Ø]

ÌäÂê
¡¡¼«Á³¿ôn¤ËÂФ·¤Æ¡¢n=p^2*q¡Êp,q¤Ï¼«Á³¿ô¡Ë¤È¤Ê¤ëp¤Èq¤òµá¤á¤ë

²òÅú
!¡ü¤½¤Î£±¡¡1¡åp^2¡ån¡¢1¡åq¡ån¤òËþ¤¿¤¹p,q¤ÎÀѤ¬¡¢¼°n=p^2*q¤òËþ¤¿¤¹

LET n=324

FOR p=INT(SQR(n)) TO 1 STEP -1 !p^2¤Î¸õÊä
   LET x=p^2
   FOR q=1 TO n !q¤Î¸õÊä
   !FOR q=1 TO n/x !q¤Î¸õÊä¡¡¢¨q=n/p^2¤è¤ê
      IF x*q=n THEN !¼°¤òËþ¤¿¤¹
         PRINT "p=";p; "q=";q
      END IF
   NEXT q
NEXT p



!¡ú¤½¤Î£²¡Ý£±¡¡n=p^2*q¤è¤ê¡¢p^2¤Ïn¤ÎÌó¿ô¡Ên¤Ïp^2¤ÎÇÜ¿ô¡Ë

LET n=324

FOR p=INT(SQR(n)) TO 1 STEP -1 !¸õÊä¤òÂ礭¤¤Êý¤«¤é
   LET x=p^2
   IF MOD(n,x)=0 THEN !p^2¤Ïn¤ÎÌó¿ô¤è¤ê
   !IF INT(n/x)*x=n THEN !n¤Ïp^2¤ÎÇÜ¿ô¤è¤ê
      LET q=n/x
      PRINT "p=";p; "q=";q
   END IF
NEXT p



!¡ü¤½¤Î£²¡Ý£²¡¡n=p^2*q¤è¤ê¡¢q¤Ïn¤ÎÌó¿ô¡Ên¤Ïq¤ÎÇÜ¿ô¡Ë

LET n=324

FOR q=1 TO n !¸õÊä¤ò¾®¤µ¤¤Êý¤«¤é
   IF MOD(n,q)=0 THEN !q¤Ïn¤ÎÌó¿ô¤è¤ê
   !IF INT(n/q)*q=n THEN !n¤Ïq¤ÎÇÜ¿ô¤è¤ê
      LET p=SQR(n/q)
      IF p=INT(p) THEN !p¤Ï¼«Á³¿ô
         PRINT "p=";p; "q=";q
      END IF
   END IF
NEXT q



!¡ú¤½¤Î£³¡Ý£±¡¡n=p^2*q¤è¤ê¡¢q¤Î£±¼¡ÊýÄø¼°q=n/p^2¤ò²ò¤¯

LET n=324

FOR p=INT(SQR(n)) TO 1 STEP -1 !Ìó¿ôp^2¤Î¸õÊä¤òÂ礭¤¤Êý¤«¤é
   LET q=n/p^2
   IF q=INT(q) THEN !q¤Ï¼«Á³¿ô¤è¤ê
      PRINT "p=";p; "q=";q
   END IF
NEXT p



!¡ü¤½¤Î£³¡Ý£²¡¡n=p^2*q¤è¤ê¡¢p¤Î£²¼¡ÊýÄø¼°p^2=n/q¤ò²ò¤¯

LET n=324

FOR q=1 TO n !Ìó¿ôq¤Î¸õÊä¤ò¾®¤µ¤¤Êý¤«¤é
   LET x=n/q
   IF x=INT(x) THEN !p¤Ï¼«Á³¿ô¤è¤ê¡¢x=n/q=p^2¤Ï¼«Á³¿ô
      LET p=SQR(x)
      IF p=INT(p) THEN !ƱÍͤˡ¢p=SQR(n/q)¤Ï¼«Á³¿ô
         PRINT "p=";p; "q=";q
      END IF
   END IF
NEXT q



!¡ú¤½¤Î£´¡¡ÁÇ°ø¿ôʬ²ò¡¡n=2^a*3^b*5^c* ¡Ä¤È¤¹¤ë¤È¡¢a=INT(a/2)*2+MOD(a,2)¡¢b,c,¡Ä¤âƱÍÍ

LET n=324

LET p=1
LET q=1

LET x=n
LET m=2
DO WHILE x>1 !£±¤Þ¤Ç·«¤êÊÖ¤¹
   LET K=0
   DO WHILE MOD(x,m)=0 !m¤Ç³ä¤êÀÚ¤ì¤ë¤Ê¤é¡Êm¤Ï°ø¿ô¡Ë
      LET x=x/m !³ä¤êÀÚ¤ì¤ë¤Þ¤Ç¡Êm^K¤Î·Á¡Ë
      LET K=K+1
   LOOP

   PRINT m;"^";K !debug
   LET p=p*m^INT(K/2) !¾¦
   LET q=q*m^MOD(K,2) !;¤ê

   IF m>2 THEN !2,3,5,7,9,¡¦¡¦¡¦¤ÇÄ´¤Ù¤ë
      LET m=m+2
   ELSE
      LET m=m+1
   END if
LOOP

PRINT "p=";p; "q=";q


END
 

Ê¿Êýº¬¤Î·×»»

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 6·î20Æü(ÅÚ)15»þ37ʬ30ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  SQR(32)-SQR(3)*{2*SQR(2)+SQR(6)}+12/SQR(6) = SQR(2)

¤ò·×»»¤¹¤ë¥×¥í¥°¥é¥à¤ò»îºî¤·¤Æ¤ß¤Þ¤·¤¿¡£

¸½¾õ¡¢¼ê¥³¥ó¥Ñ¥¤¥ë¤Ç¼°¤ÏÄêµÁ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£

·¸¿ô¤¬Ê¬¿ô¤Ë¤Ê¤ë¾ì¹ç¤Ï¡¢Í­Íý¿ô¥â¡¼¥É¤Ç¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£
¡Ê¥ë¡¼¥Á¥óSqNormalize¤ÎINT(SQR(n))¤òINTSQR(n)¤ËÊѹ¹¤¹¤ë¡Ë

!Ê¿Êýº¬¤Î·×»»

!p*SQR(q)¤ò¡¢¡ÖSQR(q)¤È¤½¤Î·¸¿ôp¡×¤È¤·¤Æ¡¢ÇÛÎóa(q)=p¤Çɽ¤»¤ë¡£
!¢èn=p^2*q¡¢n,p,q¡æ0¤È¤¹¤ë¤È¡¢SQR(n)=p*SQR(q)¤ÈÊÑ·Á¤Ç¤­¤ë¡£
!¡¡¤³¤ì¤è¤ê¡¢SQR(32)=4*SQR(2)¤È¤Ê¤ê¡¢Æ±Îà¹à¤ò¤Þ¤È¤á¤ë¾ì¹ç¡¢¶¦Ä̹àSQR(2)¤È¤·¤Æ°·¤¨¤ë¡£
!¡¡¤Þ¤¿¡¢SQR()¤òÇÛÎó¤È¤·¤Æ²ò¼á¤¹¤ë¤È¡¢SQR(n)¤ò°ì°Õ¤Ëɽ¸½¤Ç¤­¤ë¡£

LET szRt=10 !°·¤¦Ê¿Êýº¬¤ÎÈÏ°Ï¡¡¢¨É¬Íפ˱þ¤¸¤ÆÊѹ¹¤Î¤³¤È

!±é»»´ØÏ¢
SUB SqSet(n, a()) !a=SQR(n)¤È¤¹¤ë
   IF INT(n)<>n THEN
      PRINT "À°¿ô¤òÀßÄꤷ¤Æ¤¯¤À¤µ¤¤¡£"; n
      STOP
   END IF
   MAT a=ZER
   CALL SqNormalize(ABS(n), p,q)
   IF n<0 THEN LET q=-q
   LET a(q)=p
END SUB
SUB SqSetQ(x,y, a()) !a=SQR(x/y)¡¢x:À°¿ô¡¢y:Àµ¤ÎÀ°¿ô ¤È¤¹¤ë
   IF y<=0 OR INT(y)<>y THEN
      PRINT "Àµ¤ÎÀ°¿ô¤òÀßÄꤷ¤Æ¤¯¤À¤µ¤¤¡£"; y
      STOP
   END IF
   CALL SqSet(x*y, a)
   CALL SqDivN(a,y, a)
END SUB
SUB SqSetN(n, a()) !a=n¤È¤¹¤ë
   MAT a=ZER
   LET a(1)=n
END SUB

SUB SqAdd(a(),b(), c()) !²Ã»» c=a+b
   MAT c=a+b
END SUB
SUB SqSub(a(),b(), c()) !¸º»» c=a-b
   MAT c=a-b
END SUB
SUB SqMulN(a(),N, c()) !¾è»» c=a*N¡¡¢¨{¢å(x)+¢å(y)+ ¡Ä }*N
   MAT c=(N)*a
END SUB
SUB SqDivN(a(),N, c()) !½ü»» c=a/N¡¡¢¨{¢å(x)+¢å(y)+ ¡Ä }/N
   IF N=0 THEN
      PRINT "£°¤Ç¤Ï³ä¤ì¤Þ¤»¤ó¡£"
      STOP
   END IF
   MAT c=(1/N)*a
END SUB
DIM w(-szRt TO szRt) !ºî¶ÈÍÑ
SUB SqMulS(a(),B, c()) !¾è»» c=a*B¡¡¢¨{¢å(x)+¢å(y)+ ¡Ä }*¢å(B)
   MAT w=ZER
   FOR i=LBOUND(a) TO UBOUND(a)
      IF a(i)<>0 THEN !·¸¿ô¤¬£°°Ê³°¤Ê¤é
         IF i*B<0 THEN
            CALL SqNormalize(ABS(i*B), p,q) !¢¨¢å(-a)*¢å(b)=¢å(-a*b)¡¢¢å(a)*¢å(-b)=¢å(-a*b)
            LET q=-q
         ELSE
            CALL SqNormalize(i*B, p,q) !¢¨¢å(a)*¢å(b)=¢å(a*b)
            IF B<0 THEN LET p=-p !¢¨¢å(-a)*¢å(-b)=-¢å(a*b)
         END IF
         LET w(q)=w(q)+a(i)*p !¢å(a[])*¢å(B)
      END IF
   NEXT i
   MAT c=w
END SUB
SUB SqDivS(a(),B, c()) !½ü»» c=a/B¡¡¢¨{¢å(x)+¢å(y)+ ¡Ä }/¢å(B)
   IF B=0 THEN
      PRINT "£°¤Ç¤Ï³ä¤ì¤Þ¤»¤ó¡£"
      STOP
   END IF
   CALL SqMulS(a,B, c) !¢å(i)*¢å(B)/B¡¡¢¨Ê¬Êì¤òÍ­Íý²½¤¹¤ë
   CALL SqDivN(c,B, c)
END SUB

DIM w0(-szRt TO szRt),w1(-szRt TO szRt) !ºî¶ÈÍÑ
SUB SqMul(a(),b(), c()) !¾è»» c=a*b¡¡¢¨{¢å(x)+¢å(y)+ ¡Ä }*{¢å(u)+¢å(v)+ ¡Ä }
   MAT w0=ZER
   FOR k=LBOUND(b) TO UBOUND(b)
      LET Bk=b(k) !¢å(a[])*¢å(b[k])
      IF Bk<>0 THEN !·¸¿ô¤¬£°°Ê³°¤Ê¤é
         CALL SqMulS(a,k, w1) !Ê¿Êýº¬¤ÎÃæ¤ÎÉôʬ
         CALL SqMulN(w1,Bk, w1) !·¸¿ô¤ÎÉôʬ
         MAT w0=w0+w1
      END IF
   NEXT k
   MAT c=w0
END SUB
DIM w2(-szRt TO szRt),w3(-szRt TO szRt),w4(-szRt TO szRt),w5(-szRt TO szRt) !ºî¶ÈÍÑ
SUB SqDiv(a(),b(), c()) !½ü»» c=a/b¡¡¢¨{¢å(x)+¢å(y)+ ¡Ä }/{¢å(u)+¢å(v)+ ¡Ä }
   MAT w2=a
   MAT w3=b
   DO
      FOR k=LBOUND(b) TO UBOUND(b) !Ê¿Êýº¬¤òõ¤¹
         IF k<>1 AND w3(k)<>0 THEN EXIT FOR
      NEXT k
      IF k>UBOUND(b) THEN EXIT DO !Ê¿Êýº¬¤¬¤Ê¤¯¤Ê¤ì¤Ð¡¢Í­Íý²½¤ò½ªÎ»¤¹¤ë

      MAT w4=w3 !{¢å(u)+¢å(v)+ ¡Ä }-¢å(k)¤ò¤Ä¤¯¤Ã¤Æ¡¢(s+t)*(s-t)=s^2-t^2¤Î·Á¤Ø
      LET w4(k)=-w3(k)

      CALL SqMul(w2,w4, w5) !ʬ»Ò¦¡¡{¢å(x)+¢å(y)+ ¡Ä }*{¢å(u)+¢å(v)+ ¡Ä -¢å(k)}
      MAT w2=w5
      CALL SqMul(w3,w4, w5) !ʬÊ즡¡{{¢å(u)+¢å(v)+ ¡Ä }+¢å(k)}*{{¢å(u)+¢å(v)+ ¡Ä }-¢å(k)}
      MAT w3=w5
   LOOP
   CALL SqDivN(w2,w3(1), c) !ʬ»Ò/ʬÊì
END SUB
SUB SqPow(a(),n, x()) !¤Ù¤­¾è x=a^n¡¡¢¨{¢å(x)+¢å(y)+ ¡Ä }^n
   IF INT(n)<>n THEN
      PRINT "¤Ù¤­¾è¿ô¤¬À°¿ô¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£"; n
      STOP
   END IF
   CALL SqSetN(1, w3) !x=1
   MAT w2=a !b=a
   LET n2=ABS(n)
   DO UNTIL n2=0
      IF MOD(n2,2)=1 THEN CALL SqMul(w3,w2, w3) !x=x*b
      CALL SqMul(w2,w2, w2) !b=b*b
      LET n2=INT(n2/2)
   LOOP
   IF n<0 THEN !Éé¤Ê¤éµÕ¿ô¤Ë¤¹¤ë
      CALL SqSetN(1, w2)
      CALL SqDiv(w2,w3, w3) !x=1/x
   END IF
   MAT x=w3
END SUB

SUB SqNormalize(n, p,q) !Ê¿Êýº¬¤ÎÃæ¤ò¤Ç¤­¤ë¤À¤±¾®¤µ¤ÊÀµ¤ÎÀ°¿ô¤Ëľ¤¹
!¢¨n=p^2*q¡¢n,p,q¡æ0¤È¤¹¤ë¤È¡¢SQR(n)=p*SQR(q)¤ÈÊÑ·Á¤Ç¤­¤ë¡£
   LET q=1 !¢¨SQR(0)=0*SQR(1)¤È¤¹¤ë¡¡¢¨n=0¤Ê¤é¡¢£±¹Ô²¼¤ÎFORʸ¤Çp=0¤ÏÀßÄꤵ¤ì¤ë
   FOR p=INT(SQR(n)) TO 1 STEP -1 !Ìó¿ôp^2¤Î¸õÊä¤òÂ礭¤¤Êý¤«¤é
   !FOR p=INTSQR(n) TO 1 STEP -1 !Ìó¿ôp^2¤Î¸õÊä¤òÂ礭¤¤Êý¤«¤é¡¡¢¨Í­Íý¿ô¥â¡¼¥É¤Î¤È¤­
      LET q=n/p^2
      IF q=INT(q) THEN EXIT FOR !q¤Ï¼«Á³¿ô¤è¤ê
   NEXT p
END SUB

!½ÐÎÏ´ØÏ¢
SUB SqPrint(a()) !¢å(x)+¢å(y)+ ¡Ä ·Á¼°¤Çɽ¼¨¤¹¤ë
   LET flg=0
   FOR i=LBOUND(a) TO UBOUND(a) !¾®¤µ¤¤½ç¤Ë
      LET Ai=a(i) !·¸¿ô
      IF Ai<>0 THEN
         IF flg=1 THEN PRINT " + "; !·Ñ³¤Ê¤é
         IF Ai<0 THEN
            PRINT "( ";Ai;") ";
         ELSE
            IF i=1 OR Ai<>1 THEN PRINT Ai; !·¸¿ô¤¬£±°Ê³°¤Ê¤é
         END IF
         IF i<>1 THEN !SQR(1)°Ê³°¤Ê¤é
            IF Ai<>1 THEN PRINT "* "; !·¸¿ô¤¬£±°Ê³°¤Ê¤é
            PRINT "SQR(";i;")";
         END IF
         LET flg=1
      END IF
   NEXT i
   IF flg=0 THEN PRINT " 0";
   PRINT
END SUB
!------------------------------ ¤³¤³¤Þ¤Ç¤¬¥µ¥Ö¥ë¡¼¥Á¥ó

DIM T1(-szRt TO szRt),T2(-szRt TO szRt),T3(-szRt TO szRt) !ºî¶ÈÍÑ



!¡üÎ㣱¡¡SQR(32)-SQR(3)*{2*SQR(2)+SQR(6)}+12/SQR(6) ¤Î·×»»

DIM c2(-szRt TO szRt),c3(-szRt TO szRt),c6(-szRt TO szRt),c32(-szRt TO szRt) !Äê¿ô
CALL SqSet(32, c32) !c32=SQR(32)
CALL SqSet(3, c3) !c3=SQR(3)
CALL SqSet(2, c2) !c2=SQR(2)
CALL SqSet(6, c6) !c6=SQR(6)

CALL SqMulN(c2,2, T1) !T1=2*SQR(2)
CALL SqAdd(T1,c6, T1) !T1=2*SQR(2)+SQR(6)
!CALL SqPrint(T1)
CALL SqMul(c3,T1, T3) !T3=SQR(3)*{2*SQR(2)+SQR(6)}
!!!¤Þ¤¿¤Ï¡¢CALL SqMulS(T1,3, T3) !T3=SQR(3)*{2*SQR(2)+SQR(6)}
!CALL SqPrint(T3)

CALL SqSub(c32,T3, T1) !T1=SQR(32)-SQR(3)*{2*SQR(2)+SQR(6)}

DIM n12(-szRt TO szRt) !Äê¿ô
CALL SqSetN(12, n12) !n12=12

CALL SqDivS(n12,6, T2) !T2=12/SQR(6)
!CALL SqPrint(T2)
CALL SqAdd(T1,T2, T1) !T1=SQR(32)-SQR(3)*{2*SQR(2)+SQR(6)}+12/SQR(6)

CALL SqPrint(T1) !·ë²Ì




!¡üÎ㣲 (-5+SQR(-9))/(3-SQR(-4)) ¤Î·×»»

DIM n3(-szRt TO szRt),nm5(-szRt TO szRt) !Äê¿ô
CALL SqSetN(3, n3) !n3=3
CALL SqSetN(-5, nm5) !nm5=-5

DIM cm4(-szRt TO szRt),cm9(-szRt TO szRt) !Äê¿ô
CALL SqSet(-4, cm4) !cm4=SQR(-4)
CALL SqSet(-9, cm9) !cm9=SQR(-9)

CALL SqAdd(nm5,cm9, T1) !T1=-5+SQR(-9)
CALL SqSub(n3,cm4, T2) !T2=3-SQR(-4)
CALL SqDiv(T1,T2, T3) !T3=(-5+SQR(-9))/(3-SQR(-4))

CALL SqPrint(T3) !·ë²Ì


END
 

³¨ÄêµÁ¤Ë´Ø¤·¤Æ

 Åê¹Æ¼Ô¡§sukehiro  Åê¹ÆÆü¡§2009ǯ 6·î21Æü(Æü)07»þ56ʬ21ÉÃ
ÊÖ¿®¡¦°úÍÑ
  Microsoft BASIC¸ß´¹¥â¡¼¥É¤Ë±÷¤¤¤Æ¡¢

xbase=100:ybase=100
draw enban1
draw enban1 with rotate(0.2)*scale(2)

picture enban1
  circle(xbase+100,ybase+100),100,4
  line(xbase,ybase)-(xbase+100,ybase+100),5
end picture

¤ò¼Â¹Ô¤¹¤ë¤È¡¢
with rotate(0.2)*scale(2)¤¬Ìµ»ë¤µ¤ì¤Þ¤¹¡£
Æä˥¨¥é¡¼¤Ë¤Ï¤Ê¤ê¤Þ¤»¤ó¡£

Microsoft BASIC¸ß´¹¥â¡¼¥É¤Ë±÷¤¤¤Æ¡¢ÂçÉôʬ¤Î¡¢É¸½àBASIC¥â¡¼¥É¤ÎÌ¿Îáµ­½Ò¤ÇÆ°ºî¤¹¤ë¤Î¤Ç¤¹¤¬¡¢ËÜ»öÎã¤Ë¤Ä¤Æ¤Ï¡¢Æ°ºîÉԲĤʤΤǤ·¤ç¤¦¤«¡£
 

Re: ³¨ÄêµÁ¤Ë´Ø¤·¤Æ

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 6·î21Æü(Æü)11»þ03ʬ51ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.415[¸µµ­»ö¤Ø]

Microsoft BASIC¸ß´¹¥â¡¼¥É¤ÇÍ­¸ú¤ÊCIRCLEʸ¤Ï¡¤Full BASIC¤ÎÌ¿Îá¤Ç¤Ï¤Ê¤¤¤Î¤Ç¡¤
³¨ÄêµÁ¤ÎÆâÉô¤Ç»È¤ï¤ì¤ë¤³¤È¤ò¹Íθ¤·¤Æ¤¤¤Þ¤»¤ó¡£
Full BASIC¸ß´¹¤ò°Õ¼±¤·¤¿Æȼ«³Èĥ̿Îá¤ÎDRAW CIRCLEʸ¤ÏÊÑ´¹¤ËÂбþ¤·¤Þ¤¹¡£
¤Ê¤ª¡¤Full BASICµ¬³Ê¤Ë´Þ¤Þ¤ì¤ëÌ¿Îá¤Ë¤Ï¿Þ·ÁÊÑ·Á¤Î±Æ¶Á¤ò¼õ¤±¤ë¤ÈÄê¤á¤é¤ì¤¿¤â¤Î¤È
±Æ¶Á¤ò¼õ¤±¤Ê¤¤¤ÈÄê¤á¤é¤ì¤¿¤â¤Î¤¬¤¢¤ê¤Þ¤¹¡£¿Þ·ÁÊÑ·Á¤Î±Æ¶Á¤ò¼õ¤±¤ëÌ¿Îá¤Ïµ¡Ç½¸ì
PLOT¤Èµ¡Ç½¸ìGET¤ò´Þ¤à¤â¤Î¤Î¤ß¤Ç¤¹¡£
http://hp.vector.co.jp/authors/VA008683/G_COMMANDS.htm
¤ò»²¹Í¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£
 

Re: ºÂɸ¼´ÉÁ²è¤Î¥Ð¥°

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 6·î22Æü(·î)17»þ18ʬ41ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.405[¸µµ­»ö¤Ø]

> (1) GRID(p,q),AXES(p,q),GRID0(p,q),AXES0(p,q)¤Ç°ìÊý¤Î°ú¿ô¤ò0¤Ë¤¹¤ë¤È²£¼´½Ä¼´¤È¤â¤ËÌÜÀ¹¤ê¤¬ÉÁ¤«¤ì¤Ê¤¤¡£
¡¡»ÅÍͤǤ¹¡£
¡¡ËÜÍè¤Ç¤¢¤ì¤Ð³¹Ô²ÄǽÎã³°¤È¤¹¤Ù¤­¤È¤³¤í¤Ç¤¹¤¬¡¤Ìµ¾ò·ï¤Ë̵»ë¤·¤ÆÀè¤Ë¿Ê¤ß¤Þ¤¹¡£


> (2) GRID(p,q),AXES(p,q)¤ÇÆÃÄê¤Î¿ôÃͤòÀßÄꤹ¤ë¤È±¦Ã¼,¾åü¤Î¿ô»ú¤¬ÉÁ¤«¤ì¤Ê¤¤¡£
> 10 LET a=23  ! a=41,46,51,82,87,92,97,¡Ä
> 20 LET b=1   ! b=2,4,8,11,13,16,21,22,26,27,¡Ä
> 30 SET WINDOW -a,a,-b,b
> 40 DRAW GRID(a/5,b/10)
> 50 END
¡¡¿ô»ú¤À¤±¤ÎÌäÂê¤Ç¤Ê¤¯¡¤³Ê»Ò¼«ÂΤÎÉÁ²è¤¬·çÍ¤Æ¤¤¤Þ¤·¤¿¡£

> (3) GRID(p,q),AXES(p,q)¤ÇyºÂɸ¤ÎÎΰè¤ÎÉý¤ò¤´¤¯¾®¤µ¤¯ÀßÄꤹ¤ë¤È¡¢ÉÁ¤«¤ì¤Ê¤¤¤Ï¤º¤Îx¼´¤Î¿ô»ú¤¬¾åü¤ËÉÁ²è¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£
> 10 LET c=.0000001
> 20 SET WINDOW -5,5,7-c,7
> 30 DRAW GRID(1,c/10)
> 40 END
¡¡Windows¤ÎºÂɸ·Ï¤Ë½Ì¾®¤¹¤ë¥¢¥ë¥´¥ê¥º¥à¤¬Windows¤Î¼ÂºÝ¤ÎÆ°ºî¤ËŬ¹ç¤·¤Ê¤¤¤Î¤¬¸¶°ø¤Î¤è¤¦¤Ç¤¹¡£
 

Re: ºÂɸ¼´ÉÁ²è¤Î¥Ð¥°

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 6·î22Æü(·î)18»þ25ʬ16ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.412[¸µµ­»ö¤Ø]

> SET WINDOW -500,500,-500,500
> LET phi=(1+SQR(5))/2 !²«¶âÈæ
> LET a=2*PI*phi !²«¶â³Ñ
> LET r=1
> LET th=0
> FOR i=0 TO 900
>    LET r=1.1*r !¤é¤»¤ó¾õ
>    LET th=th+a
>    LET x1=r*COS(th)
>    LET y1=r*SIN(th)
>    !DRAW disk WITH SCALE(r*0.3)*SHIFT(x1,y1)
>    DRAW circle WITH SCALE(r*0.3)*SHIFT(x1,y1)
> NEXT i
> END
> ¡¡Me¤Î¾ì¹ç¡¢OS¤ÎDIBENG.DLL¤Ç¥¨¥é¡¼¤È¤Ê¤êBASIC¤¬¶¯À©½ªÎ»¤È¤Ê¤ë¡£

Win Me¤Î¾ì¹ç¡¤Windows¤ÎºÂɸ·Ï¤Ëµö¤µ¤ì¤ëÈϰϳ°¤ÎºÂɸÃͤò»ØÄꤹ¤ë¤È
DIBENG.DLL¤Ç¥¨¥é¡¼¤Ë¤Ê¤ë¤è¤¦¤Ç¤¹¡£
¤È¤ê¤¢¤¨¤º¡¤GDIºÂɸ·Ï¤ÎÈϰϳ°¤Î¿ôÃͤ¬ÅϤé¤Ê¤¤¤è¤¦¤Ë¤·¤Æ¤ß¤Þ¤¹¡£
 

Re: ºÂɸ¼´ÉÁ²è¤Î¥Ð¥°

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ 6·î24Æü(¿å)22»þ14ʬ51ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.417[¸µµ­»ö¤Ø]

Âн褷¤Æ¤¤¤¿¤À¤­¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£

>> (1) GRID(p,q),AXES(p,q),GRID0(p,q),AXES0(p,q)¤Ç°ìÊý¤Î°ú¿ô¤ò0¤Ë¤¹¤ë¤È²£¼´½Ä¼´¤È¤â¤ËÌÜÀ¹¤ê¤¬ÉÁ¤«¤ì¤Ê¤¤¡£
>¡¡»ÅÍͤǤ¹¡£
>¡¡ËÜÍè¤Ç¤¢¤ì¤Ð³¹Ô²ÄǽÎã³°¤È¤¹¤Ù¤­¤È¤³¤í¤Ç¤¹¤¬¡¤Ìµ¾ò·ï¤Ë̵»ë¤·¤ÆÀè¤Ë¿Ê¤ß¤Þ¤¹¡£

y=tan(x)¤Î¥°¥é¥ÕÉÁ²è¤Ç DRAW GRID(PI/2,0) ¤È¤¤¤¦ºÂɸ¼´¤¬¤Û¤·¤«¤Ã¤¿¤Î¤Ç̵Íý¤Ê¤ª´ê¤¤¤ò¤·¤Þ¤·¤¿¡£
Æȼ«¤ÎÂкö¤È¤·¤Æ¡¢ºÂɸÀßÄê¤è¤êÂ礭¤Ê¿ôÃͤò°ú¿ô¤Ë¼è¤ì¤ÐÌÜÀ¹¤ê¤ÏÉÁ²è¤µ¤ì¤Ê¤¤¤Î¤Ç DRAW GRID(PI/2,100) ¤È¤·ÌÜŪ¤ò㤷¤Þ¤·¤¿¡£
°ìÈÌŪ¤Ë¤Ï¼¡¤Î³¨ÄêµÁgrid2¤ÇÉÁ²è²Äǽ¤Ç¤¹¡£

SET WINDOW -5,5,-5,5
DRAW grid2(0,1)
END
EXTERNAL PICTURE grid2(p,q)
ASK WINDOW x1,x2,y1,y2
IF p<>0 THEN LET a=p ELSE LET a=2*(ABS(x1)+ABS(x2))
IF q<>0 THEN LET b=q ELSE LET b=2*(ABS(y1)+ABS(y2))
DRAW GRID(a,b)
END PICTURE
 

£³£Ä¶ÊÀþ ¤ò¡¢¥Þ¥¦¥¹¤Ç¡¢¤Ò¤Ã¤¯¤êÊÖ¤¹

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 6·î27Æü(ÅÚ)18»þ52ʬ20ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ! £³£Ä¶ÊÀþ ¤ò¡¢¥Þ¥¦¥¹¤Ç¡¢¤Ò¤Ã¤¯¤êÊÖ¤¹¡£
!¡¡¥µ¥ó¥×¥ë¤Ë¡¢¸«¤Å¤é¤¤ Hodgkin-Huxley ÊýÄø¼° ¤Î¥°¥é¥Õ¤ò¡¢»ÈÍÑ¡£
!-------------------------------
OPTION ARITHMETIC NATIVE
OPTION ANGLE DEGREES
DIM pV(4), P3D(4,4), LH(6), copy(0 TO 100000, 3)
DIM rotx(4,4), shxyzM(4,4), shxyzP(4,4)
MAT rotx=IDN
MAT shxyzM=IDN
MAT shxyzP=IDN
!
!-----
LET t$="¥ä¥ê¥¤¥«¤ÎµðÂç¿À·Ð¡Ê¥«¥ª¥¹¡Ë"
LET t2$="Hodgkin-Huxley ¥Û¥¸¥­¥ó¡Ý¥Ï¥¯¥¹¥ì¥¤ÊýÄø¼° ¤Î¥¹¥È¥ì¥ó¥¸ ¥¢¥È¥é¥¯¥¿"

DEF I(t)= I0+A*SIN( 360*f*t ) ! ËìÅÅή +³°ÉôÆþÎÏ

LET t3$="ËìÅÅ°Ì V ¢ª( X)"
!¡¡(d V/dt)= I(t)-120*m^3*h*(V-115) -40*n^4*(V+12) -.24*(V-10.613)
LET t4$="¥Ê¥È¥ê¥¦¥à¡¡³èÀ­²½ÊÑ¿ô( 0< m< 1) ¢ª( Y)"
!¡¡(d m/dt)= .1*(25-V)/(EXP((25-V)/10)-1)*(1-m) -4*EXP(-V/18)*m
LET t5$="¥Ê¥È¥ê¥¦¥àÉÔ³èÀ­²½ÊÑ¿ô( 0< h< 1) ¢ª( Z)"
!¡¡(d h/dt)= .07*EXP(-V/20)*(1-h) -1/(EXP((30-V)/10)+1)*h
!            ¥«¥ê¥¦¥à³èÀ­²½ÊÑ¿ô( 0< n< 1) ¢ªÉÁ²è¤·¤Ê¤¤¡£
!¡¡(d n/dt)= .01*(10-V)/(EXP((10-V)/10)-1)*(1-n) -.125*EXP(-V/80)*n

SUB Dxyzn( kx,ky,kz,kn, x,y,z,n)
   LET kx= I(t)-120*y^3*z*(x-115) -40*n^4*(x+12) -.24*(x-10.613) ! (d V/dt)
   LET ky= .1*(25-x)/(EXP((25-x)/10)-1)*(1-y) -4*EXP(-x/18)*y    ! (d m/dt)
   LET kz= .07*EXP(-x/20)*(1-z) -1/(EXP((30-x)/10)+1)*z          ! (d h/dt)
   LET kn= .01*(10-x)/(EXP((10-x)/10)-1)*(1-n) -.125*EXP(-x/80)*n! (d n/dt)
END SUB

LET I0=20   !ËìÅÅή ¥Ñ¥é¥á¡¼¥¿¡¼
LET A=40
LET f=.3000001
!
LET x=6.24  !½é´üÃÍ x,y,z,n
LET y=.0761
LET z=.301
LET n=.519
LET dt=.05  !RungeKutta pitch time
LET t99=500 !RungeKutta close time
DATA -15,100, -.3,1, -.04,.45 !ºÂɸ¼´¤ÎξüºÂɸ xL,xH, yL,yH, zL,zH
MAT READ LH
LET zox=35  !²óž Àû²óÃæ¿´ÅÀ center ¤Ø¤Î¥ª¥Õ¥»¥Ã¥È£ø£ù£ú
LET zoy=.6
LET zoz=.2
!
LET Sx=1    !¥¹¥±¡¼¥ëÇÜΨ Sx,Sy,Sz
LET Sy=50
LET Sz=200
LET xm=35   !²èÌÌÃæ¿´ xm,ym
LET ym=35
LET hw=80   !²èÌÌÉý/2 ¡Þhw
!
LET ax=-75  !£ú¼´¤ò£ø¼´¤ÇÅݤ¹³«»Ï³ÑÅÙ
LET ay=0    !£ú¼´¤ò£ù¼´¤ÇÅݤ¹³«»Ï³ÑÅÙ
LET SS=0    !£ú¼´ ²óž³«»Ï³ÑÅÙ
LET ST= +5  !£ú¼´ ²óž¥¹¥Æ¥Ã¥×¡¡+¡§º¸²óž¡¡-¡§±¦²óž
!
SET WINDOW xm-hw,xm+hw,ym-hw,ym+hw
CALL graph3D


!-----
SUB RungeKutta
   CALL Dxyzn( kx1,ky1,kz1,kn1, x,y,z,n)
   CALL Dxyzn( kx2,ky2,kz2,kn2, x+kx1*dt/2,y+ky1*dt/2,z+kz1*dt/2,n+kn1*dt/2)
   CALL Dxyzn( kx3,ky3,kz3,kn3, x+kx2*dt/2,y+ky2*dt/2,z+kz2*dt/2,n+kn2*dt/2)
   CALL Dxyzn( kx4,ky4,kz4,kn4, x+kx3*dt  ,y+ky3*dt  ,z+kz3*dt  ,n+kn3*dt  )
   LET x=x+(kx1+2*kx2+2*kx3+kx4)*dt/6
   LET y=y+(ky1+2*ky2+2*ky3+ky4)*dt/6
   LET z=z+(kz1+2*kz2+2*kz3+kz4)*dt/6
   LET n=n+(kn1+2*kn2+2*kn3+kn4)*dt/6
END SUB

SUB graph3D
! ²óž Àû²óÃæ¿´ÅÀ center ¤ò ¸¶ÅÀ¤Ø°ÜÆ°¤·¡¢Ëô¡¢¸µ¤ØÌ᤹¹ÔÎó¡£
!(x,y,z,1)|      1,      0,      0, 0 |
!         |      0,      1,      0, 0 |
!         |      0,      0,      1, 0 |
!         |-zox*Sx,-zoy*Sy,-zoz*Sz, 1 |
   LET shxyzM(4,1)=-zox*Sx
   LET shxyzM(4,2)=-zoy*Sy
   LET shxyzM(4,3)=-zoz*Sz
   !
   !(x,y,z,1)|      1,      0,      0, 0 |
   !         |      0,      1,      0, 0 |
   !         |      0,      0,      1, 0 |
   !         | zox*Sx, zoy*Sy, zoz*Sz, 1 |
   LET shxyzP(4,1)=zox*Sx
   LET shxyzP(4,2)=zoy*Sy
   LET shxyzP(4,3)=zoz*Sz
   !
   LET az=SS
   CALL rot_panel
   !---3D ¶ÊÀþ¡¢£±²óÌܤǡ¢£³£Ä¸¶²è µ­Ï¿¤ò»£¤ë¡£
   LET ci=0
   FOR t=0 TO t99 STEP dt
      LET copy(ci,1)=x
      LET copy(ci,2)=y
      LET copy(ci,3)=z
      ! PRINT x;y;z;n !¡¡¥Ç¡¼¥¿¡¼¤òÊݸ¤·¤¿¤¤»þ¡£
      CALL line3D(x,y,z)
      CALL RungeKutta
      LET ci=ci+1
   NEXT t
   !----
   MOUSE POLL m_x,m_y,mlb,mrb
   LET mxbak=m_x
   LET mybak=m_y
   DO
      IF mlb=0 THEN LET az=MOD(az+ST,360) !¡¡£ú¼´¤Ç¡¢£±¥¹¥Æ¥Ã¥×²ó¤¹¡£
      SET DRAW mode hidden
      CALL rot_panel
      !---3D ¶ÊÀþ¡¢£²²óÌܰʹߤϡ¢µ­Ï¿¤ÎºÆÀ¸¤Ç¡¢¹â®ÉÁ²è¡£
      FOR ci=0 TO ci-1
         CALL line3D( copy(ci,1),copy(ci,2),copy(ci,3) )
      NEXT ci
      SET DRAW mode explicit
      !----
      MOUSE POLL m_x,m_y,mlb,mrb
      IF mlb=1 THEN
         LET ax=ax -(m_y-mybak)!/2 !¡¡ÊÑ°ÜÊý¸þ¤Ï¡¢+90ÅÙ ²ó¤¹¡£
         LET ay=ay +(m_x-mxbak)!/2
      END IF
      LET mxbak=m_x
      LET mybak=m_y
      ! WAIT DELAY 0.05
   LOOP UNTIL mrb=1
END SUB

SUB rot_panel
   LET ar0=SQR(ax^2+ay^2) !¡¡Àû²ó³ÑÅÙ
   IF ar0<>0 THEN LET DIRar0=ANGLE(ax,ay) !¡¡Àû²ó¼´¤ÎÊý¸þ
   IF 180< ar0 THEN
      LET ax=(ar0-360)*COS(DIRar0)
      LET ay=(ar0-360)*SIN(DIRar0)
   END IF
   ! £ø£ùÊ¿Ì̾塢£°ÅÙÊý¸þ(£ø¼´)¤ò¡¢¼´¤È¤·¤ÆÀû²ó¤¹¤ë¹ÔÎó rotx
   !(x,y,z,1)| 1,        0,        0, 0 |
   !         | 0, cos(ar0), sin(ar0), 0 |
   !         | 0,-sin(ar0), cos(ar0), 0 |
   !         | 0,        0,        0, 1 |
   LET rotx(2,2)=COS(ar0)
   LET rotx(3,2)=-SIN(ar0)
   LET rotx(2,3)=SIN(ar0)
   LET rotx(3,3)=COS(ar0)
   !
   MAT P3D= shxyzM*ROTATE(az-DIRar0)*rotx*ROTATE(DIRar0)*shxyzP !ÊÑ·Á»Ø¼¨MAT
   !----
   CLEAR
   PLOT TEXT,AT xm-hw*.9,ym+hw*.90 :t2$
   PLOT TEXT,AT xm-hw*.9,ym+hw*.83 :t$
   PLOT TEXT,AT xm+hw*.1,ym+hw*.83,USING"Ax=####  Ay=####  Az=####":ax,ay,az
   PLOT TEXT,AT xm-hw*.9,ym-hw*.92 :t5$
   PLOT TEXT,AT xm-hw*.9,ym-hw*.99 :t4$& "¡¡¡¡"& t3$ !¡¡PEN-off
   !---
   IF ar0< 90 THEN SET AREA COLOR "cyan" ELSE SET AREA COLOR "black"
   DRAW disk WITH SCALE(15)*P3D ! ¸¶ÅÀ¶á˵¡¢Î¢É½ ¤Î¥Þ¡¼¥«¡¼£±
   DRAW disk WITH SCALE(5)*SHIFT(zox*Sx,zoy*Sy)*P3D ! ¥Þ¡¼¥«¡¼£²
   CALL axes3D( zox,zoy,0, zox,zoy,zoz, "center" ) ! ¥Þ¡¼¥«¡¼£³
   !---ºÂɸ¼´
   CALL axes3D( LH(1),0,0, LH(2),0,0, STR$(LH(2))& "( X)" )
   CALL axes3D( 0,LH(3),0, 0,LH(4),0, STR$(LH(4))& "( Y)" )
   CALL axes3D( 0,0,LH(5), 0,0,LH(6), STR$(LH(6))& "( Z)" )
END SUB

SUB axes3D(x1,y1,z1, x2,y2,z2, a$ )
   CALL line3D(x1,y1,z1)
   CALL line3D(x2,y2,z2)
   PLOT TEXT,AT pV(1),pV(2) :a$ !¡¡PEN-off
END SUB

SUB line3D(x,y,z)
   LET pV(1)=x*Sx  !ÉÁ²èÌÜÀ¹¤Ï¡¢Á´Êý¸þÅù¤·¤¯¤Ê¤¤¤È¡¢²óž¤Ç¡¢·Á¤¬ÊݤƤʤ¤¡£
   LET pV(2)=y*Sy  !¥¹¥±¡¼¥ë Sx,Sy,Sz ¤Î°ã¤¤¤Ï¡¢ÆþÎϤÎÇÜΨ¤È¤·¤Æ¡¢¹Ô¤Ê¤¦¡£
   LET pV(3)=z*Sz  !ÆþÎÏ z ºÂɸ¤Ï ½ÐÎÏ x,y ¤ËÈ¿±Ç¡£½ÐÎÏ£ú¤Ï ÉÁ²èÉԲġ£
   LET pV(4)=1 ! shxyzM ¡ÄshxyzP ¤ÇɬÍס£
   MAT pV=pV*P3D
   PLOT LINES: pV(1),pV(2); !¡¡PEN-on
END SUB

END

!-----
!£±¡Ë²èÌ̤˼̤ë£ø£ù£ú¼´¤Î¡¢£ú¼´¤ËÊ¿¹Ô¤Ç¡¢
!¡¡¡¡center ¤òÄ̤뼴¤Ç¡¢¾ï»þ²óž¡£
!
!£²¡Ë¥Þ¥¦¥¹ º¸¥Ü¥¿¥ó²¡²¼¤Ç °ì»þÄä»ß¡¢Î¥¤¹¤ÈºÆ³«¡£
!¡¡¡¡¡¡¡¡¡¡ ±¦¥Ü¥¿¥ó²¡²¼¤Ç ½ªÎ»¡£
!
!£³¡Ëº¸¥Ü¥¿¥ó²¡²¼¤Î¤Þ¤Þ¡¢°ú¤­¤º¤ë¤È¡¢
!¡¡¡¡£ø£ùÊ¿Ì̤ËÊ¿¹Ô¤Ç¡¢center ¤òÄ̤ë
!¡¡¡¡Ç¤°Õ¤ÊÊý¸þ¤Î¼´¤Ç¡¢Á´ÂΤ¬Àû²ó¤¹¤ë¡£
!
!¡¡¡Ê£ú¼´ Àèü¤ò¡¢¥É¥é¥Ã¥°¤¹¤ë´¶¤¸¡£¡Ë
!
!¢¨¤³¤³¤Þ¤Ç Ž¤êÉÕ¤±¤Æ¡¢¼Â¹Ô»þ¤Î¥Ø¥ë¥×¤Ë¤¹¤ë¡£
 

Âпô¤Î·×»»

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 6·î29Æü(·î)19»þ47ʬ16ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ¡¦Æ±¤¸Äì¤Ç¤Î²Ã¸º»»¤ÈÀ°¿ôÇÜ

̤¥µ¥Ý¡¼¥È
¡¦°Û¤Ê¤ëÄì¤Ç¤Î²Ã¸º»»¤ÈÀ°¿ôÇÜ¡¢¾è½ü»»
!Âпô¤Î·×»»

!¼«Á³¿ôn¤ò¡¢ÁÇ°ø¿ôʬ²ò¡¡n=2^a*3^b*5^c* ¡Ä ¤È¤¹¤ë¤È¡¢
!LOG(n)=LOG(2^a*3^b*5^c* ¡Ä )=a*LOG(2)+b*LOG(3)+c*LOG(5)+ ¡Ä ¤È¤Ê¤ë¡£
!¿¿¿ô¤¬Æ±¤¸ÁÇ¿ô¤Î¤â¤Î¤òƱÎà¹à¤È¤·¤Æ¤Þ¤È¤á¤ë¤³¤È¤¬¤Ç¤­¤ë¡£

OPTION ARITHMETIC RATIONAL

LET szLg=100 !°·¤¦Âпô¤ÎÈÏ°Ï¡¡¢¨É¬Íפ˱þ¤¸¤ÆÊѹ¹¤Î¤³¤È
LET cBASE=2 !²¾¤ÎÄì¡¡¢¨Àµ¤Î¼Â¿ô a¡â1 ¤ò¤È¤ë

!±é»»´ØÏ¢
SUB LogSet(n, a()) !a=LOG(n)¤È¤¹¤ë
   IF n<=0 OR INT(n)<>n THEN
      PRINT "ÈóÉé¤ÎÀ°¿ô¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£"; n
      STOP
   END IF

   MAT a=ZER

   LET x=n !ÁÇ°ø¿ôʬ²ò n=2^a*3^b*5^c* ¡Ä
   LET m=2
   DO WHILE x>1 !£±¤Þ¤Ç·«¤êÊÖ¤¹
      LET K=0
      DO WHILE MOD(x,m)=0 !m¤Ç³ä¤êÀÚ¤ì¤ë¤Ê¤é¡Êm¤Ï°ø¿ô¡Ë
         LET x=x/m !³ä¤êÀÚ¤ì¤ë¤Þ¤Ç¡Êm^K¤Î·Á¡Ë
         LET K=K+1
      LOOP

      LET a(m)=K !m^K¡¡¢¨ ¡Ä + K*LOG(m) + ¡Ä

      IF m>2 THEN !2,3,5,7,9,¡¦¡¦¡¦¤ÇÄ´¤Ù¤ë
         LET m=m+2
      ELSE
         LET m=m+1
      END if
   LOOP
END SUB
DIM w0(szLg),w1(szLg) !ºî¶ÈÍÑ
SUB LogSetQ(x,y, a()) !a=LOG(x/y)¡¢x:À°¿ô¡¢y:Àµ¤ÎÀ°¿ô ¤È¤¹¤ë
   IF y<=0 OR INT(y)<>y THEN
      PRINT "Àµ¤ÎÀ°¿ô¤òÀßÄꤷ¤Æ¤¯¤À¤µ¤¤¡£"; y
      STOP
   END IF
   CALL LogSet(x, w0) !LOG(x/y)=LOG(x)-LOG(y)
   CALL LogSet(y, w1)
   CALL LogSub(w0,w1, a)
END SUB
SUB LogSetN(n, a()) !a=n¤È¤¹¤ë
   MAT a=ZER
   LET a(cBASE)=n
END SUB

SUB LogAdd(a(),b(), c()) !²Ã»» c=a+b
   MAT c=a+b
END SUB
SUB LogSub(a(),b(), c()) !¸º»» c=a-b
   MAT c=a-b
END SUB
SUB LogMulN(a(),N, c()) !¾è»» c=a*N¡¡¢¨{Log(x)+Log(y)+ ¡Ä }*N
   MAT c=(N)*a
END SUB
SUB LogDivN(a(),N, c()) !½ü»» c=a/N¡¡¢¨{Log(x)+Log(y)+ ¡Ä }*N
   IF N=0 THEN
      PRINT "£°¤Ç¤Ï³ä¤ì¤Þ¤»¤ó¡£"
      STOP
   END IF
   MAT c=(1/N)*a
END SUB

!½ÐÎÏ´ØÏ¢
SUB LogPrint(a()) !LOG(x)+LOG(y)+ ¡Ä ·Á¼°¤Çɽ¼¨¤¹¤ë
   LET flg=0
   FOR i=1 TO UBOUND(a) !¾®¤µ¤¤½ç¤Ë
      LET Ai=a(i) !·¸¿ô
      IF Ai<>0 THEN
         IF flg=1 THEN PRINT " + "; !·Ñ³¤Ê¤é

         IF Ai<0 THEN
            PRINT "( ";Ai;") ";
         ELSE
            IF i=cBASE OR Ai<>1 THEN PRINT Ai; !·¸¿ô¤¬£±°Ê³°¤Ê¤é
         END IF

         IF i<>cBASE THEN !¿¿¿ô¤¬Äì°Ê³°¤Ê¤é
            IF Ai<>1 THEN PRINT "* "; !·¸¿ô¤¬£±°Ê³°¤Ê¤é
            PRINT "Log";STR$(cBASE);"(";i;")";
         END IF
         LET flg=1
      END IF
   NEXT i
   IF flg=0 THEN PRINT " 0";
   PRINT
END SUB
SUB LogPrintQ(a()) !m/n+LOG(x/y) ·Á¼°¤Çɽ¼¨¤¹¤ë
   CALL LogPack(a, K,x1,x2)

   IF K<>0 THEN PRINT K; !Í­Íý¿ô¤ÎÉôʬ

   !̵Íý¿ô¤ÎÉôʬ
   IF x1/x2=1 THEN !¿¿¿ô=1¤Î¾ì¹ç
      IF K=0 THEN PRINT "+ 0";
   ELSEIF x1=1 THEN !¿¿¿ô=1/x2¤Î¾ì¹ç
      PRINT "- Log";STR$(cBASE);"(";x2;")";
   ELSE
      PRINT "+ Log";STR$(cBASE);"(";x1/x2;")";
   END IF
   PRINT
END SUB

!Êä½õ¥ë¡¼¥Á¥ó
DIM b(szLg),c(szLg) !ºî¶ÈÍÑ
SUB LogYYY(a(),b(), K) !c=a-b^K¤òÄ´¤Ù¤ë
   LET K=0 !°ú¤¤¤¿²ó¿ô

   FOR i=1 TO UBOUND(b)
      IF b(i)<>0 THEN EXIT FOR !ºÇ¾®¤ÎÁÇ°ø¿ô¤òõ¤¹
   NEXT i
   IF i>UBOUND(a) OR a(i)=0 THEN EXIT SUB !¶¦Ä̤ÊÁÇ°ø¿ô¤¬¤Ê¤¤¾ì¹ç

   LET cSGN=1 !Éä¹æ
   IF a(i)*b(i)<0 THEN LET cSGN=-1

   MAT c=a
   DO
      IF cSGN>0 THEN MAT c=c-b ELSE MAT c=c+b

      FOR i=1 TO UBOUND(c)
         IF c(i)*a(i)<0 THEN EXIT DO !°ú¤­¤¹¤®¤«¤É¤¦¤«³Îǧ¤¹¤ë
      NEXT i

      LET K=K+1
   LOOP
   LET K=cSGN*K

   IF cSGN>0 THEN MAT c=c+b ELSE MAT c=c-b !°ú¤­Ìᤷ
END SUB
SUB LogPack(a(), K,nn,mm) !£±¤Ä¤Î¹à¤Ë¤Þ¤È¤á¤ë¡¡a*Log(x)+b*Log(y)+ ¡Ä =Log(x^a*y^b* ¡Ä )
   IF INT(cBASE)=cBASE THEN !À°¿ô¤Ê¤é
      CALL LogSet(cBASE, b) !Äì¤òÁÇ°ø¿ôʬ²ò¤¹¤ë
   ELSE
      CALL LogSetQ(NUMER(cBASE),DENOM(cBASE), b)
   END IF
   CALL LogYYY(a,b, K) !¿¿¿ô=Äì^K ¡©

   IF K=0 THEN
      CALL LogYYY(b,a, K) !Äì¤È¿¿¿ô¤ò¤Ò¤Ã¤¯¤êÊÖ¤¹¡£Äì=¿¿¿ô^K ¡©
      IF k<>0 THEN LET K=1/K
   END IF

   IF K<>0 THEN MAT a=c


   LET nn=1 !ʬ»Ò
   LET mm=1 !ʬÊì
   FOR i=1 TO UBOUND(a) !¿¿¿ô¤ò£±¤Ä¤Ë¤Þ¤È¤á¤ë
      IF a(i)<0 THEN !·¸¿ô¤¬Éé¤Ê¤é¡¢Ê¬Êì¤Ø
         LET mm=mm*i^ABS(a(i))
      ELSE
         LET nn=nn*i^a(i)
      END IF
   NEXT i


   IF nn<>1 AND mm=1 THEN !¿¿¿ô¤¬£±¤è¤êÂ礭¤ÊÀ°¿ô¤Ê¤é
      FOR i=1 TO UBOUND(b) !Äì
         IF b(i)<>0 THEN
            IF a(i)=0 THEN !¶¦ÄÌÁÇ°ø»Ò¤¬¤Ê¤±¤ì¤Ð
               LET K1=0
               EXIT FOR
            END IF
            LET K1=a(i)/b(i) !Äì=¿¿¿ô^K1 ¡©
         END IF
      NEXT i
      IF K1<>0 THEN
         LET K=K+K1
         LET nn=1
      END IF
   END IF

   !!!PRINT "K=";K; "nn=";nn; "mm=";mm !debug
END SUB
!------------------------------ ¤³¤³¤Þ¤Ç¤¬¥µ¥Ö¥ë¡¼¥Á¥ó

DIM T1(szLg),T2(szLg),T3(szLg),T4(szLg) !ºî¶ÈÍÑ


!¡üÎ㣱¡¡LOG(2/3)+LOG(12/25)-LOG(8/15) = LOG(3)-LOG(5) = LOG(3/5) ¤Î·×»»

LET cBASE=2 !Äì

CALL LogSetQ(2,3, T1) !T1=LOG(2/3)
CALL LogSetQ(12,25, T2) !T1=LOG(12/25)
CALL LogAdd(T1,T2, T1)
CALL LogSetQ(8,15, T2) !T1=LOG(8/15)
CALL LogSub(T1,T2, T1)

!!!MAT PRINT T1; !debug
CALL LogPrint(T1)
CALL LogPrintQ(T1)



!¡üÎ㣲¡¡LOG10(7/4)-LOG10(9)-2*LOG10(5/3)-LOG10(49)/2 = -2 ¤Î·×»»

LET cBASE=10 !Äì

CALL LogSetQ(7,4, T1) !T1=LOG(7/4)
CALL LogSet(9, T2) !T2=LOG(9)
CALL LogSub(T1,T2, T1)

CALL LogSetQ(5,3, T2) !T2=LOG(5/3)
CALL LogMulN(T2,2, T2)
CALL LogSub(T1,T2, T1)

CALL LogSet(49, T2) !T2=LOG(49)
CALL LogDivN(T2,2, T2)
CALL LogSub(T1,T2, T1)

!MAT PRINT T1; !debug
CALL LogPrint(T1)
CALL LogPrintQ(T1)



!¡üÎ㣳¡¡LOG27(1/9) = -2/3 ¤Î·×»»

!LET cBASE=9
LET cBASE=27

!CALL LogSetQ(1,3, T1)
CALL LogSetQ(1,9, T1)
!MAT PRINT T1; !debug
CALL LogPrint(T1)
CALL LogPrintQ(T1)


END
 

½Û´Ä¾®¿ô¤Î·×»»

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 7·î 2Æü(ÌÚ)10»þ50ʬ2ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ½Û´Ä¾®¿ô¤òʬ¿ô¤ËÊÑ´¹¤·¤Æ¡¢Ê¬¿ô¤É¤¦¤·¤Ç·×»»¤¹¤ë¡£·ë²Ì¤ò½Û´Ä¾®¿ô¤ËÌ᤹¡£
ÊÑ´¹¤¹¤ë´Ø¿ô¤ò¤Ä¤¯¤ì¤Ð¡¢Í­Íý¿ô¥â¡¼¥É¤Ç·×»»¤Ç¤­¤ë¡£
OPTION ARITHMETIC RATIONAL

LET MaxLevel=200 !½Û´ÄÀá¤ÎºÇÂç·å¿ô
DIM s(MaxLevel) !½Û´ÄÀá¤Î¸õÊä


!¡ü½Û´Ä¾®¿ô¤òʬ¿ô¤Ø

!É®»»
!¡¡x=0.1[23]
!¡¡100*x-x=12.3[23]-0.1[23]=12.2¡¡¡è99*x=122/10¡¡¡èx=61/495

!LET x$="2.2[234]" !2.2234234234¡Ä
!LET x$="0.0[90]" !0.0909090¡Ä
!LET x$="0.[142857]" !0.142857142857¡Ä
LET x$="0.1[23]" !0.1232323¡Ä

PRINT ExVAL(x$)



!¡ü 0.1[23] ¡à 0.[14] ¤Î·ë²Ì¤ò½Û´Ä¾®¿ô¤Çɽ¤»¡£¡¡Åú¤¨ 0.8[714285]

LET t=ExVAL("0.1[23]") / ExVAL("0.[14]")
PRINT t, ExSTR$(t)


FUNCTION ExVAL(x$) !¿ôÃͤòɽ¸½¤¹¤ëʸ»úÎó¤ò¿ôÃͤËÊÑ´¹¤¹¤ë
   LET L=LEN(x$) !ʸ»úÎóŤòÆÀ¤ë

   LET p=0 !Í­¸Â¾®¿ô¤Î·å¿ô
   LET k=0 !½Û´ÄÀá¤Î·å¿ô¡£Í­¸Â¾®¿ô¤Î¾ì¹ç¡¢£°
   LET A=0
   LET cSGN=1 !Éä¹æ
   LET flag=0 !¡ÖÀ°¿ô¡×¡¡¢¨¿ôÃͤη¿

   LET i=1 !¿ô»úÎó¤ÎÆɤ߹þ¤ß°ÌÃÖ
   DO WHILE i<=L !¾å°Ì¤Î·å¤«¤é½ç¤Ë
      LET t$=UCASE$(x$(i:i))
      IF t$="." THEN !¾®¿ôÅÀ¤Ê¤é
         IF flag<>0 THEN
            PRINT "¾®¿ôÅÀ¤Î°ÌÃÖ¤¬ÉÔÀµ¤Ç¤¹¡£"; x$
            STOP
         END IF
         LET flag=1 !¡ÖÍ­¸Â¾®¿ô¡×
      ELSEIF t$="+" THEN !¡ÜÉä¹æ¤Ê¤é
         IF i<>1 THEN
            PRINT "¡ÜÉä¹æ¤Î°ÌÃÖ¤¬ÉÔÀµ¤Ç¤¹¡£"; x$
            STOP
         END IF
      ELSEIF t$="-" THEN !¡ÝÉä¹æ¤Ê¤é
         IF i<>1 THEN
            PRINT "¡ÝÉä¹æ¤Î°ÌÃÖ¤¬ÉÔÀµ¤Ç¤¹¡£"; x$
            STOP
         END IF
         LET cSGN=-1
      ELSEIF t$="[" THEN !½Û´Ä¾®¿ô¤Ê¤é
         IF flag<>1 THEN !¾®¿ôÉô¤«¡©
            PRINT "½Û´Ä¾®¿ô¤Î³«»Ï°ÌÃÖ¤¬ÉÔÀµ¤Ç¤¹¡£"; x$
            STOP
         END IF
         LET flag=2 !¡Ö½Û´Ä¾®¿ô¡×
      ELSEIF t$="]" THEN
         IF i<>L THEN !±¦Ã¼¤«¡©
            PRINT "½Û´Ä¾®¿ô¤Î½ªÎ»°ÌÃÖ¤¬ÉÔÀµ¤Ç¤¹¡£"; x$
            STOP
         END IF
      ELSE
         LET A=A*10+VAL(t$) !¿¹à¼°(( ¡Ä ((a[1]*10+a[2])*10+a[3])*10 ¡Ä +a[i-2])*10+a[i-1])*10+a[i]¡¡¢¨º¸¥·¥Õ¥È
         IF flag=1 THEN LET p=p+1
         IF flag=2 THEN LET k=k+1
      END IF

      LET i=i+1 !¼¡¤Ø
   LOOP

   !PRINT A; flag;cSGN;p;k !debug
   IF flag<2 THEN !Í­¸Â¾®¿ô¡ÊÀ°¿ô¤â´Þ¤à¡Ë¤Î¾ì¹ç
      LET ExVAL=cSGN * A/10^p
   ELSE !½Û´Ä¾®¿ô¤Î¾ì¹ç
      LET B=INT(A/10^k)
      LET ExVAL=cSGN * (A-B)/(10^(k+p)-10^p)
   END IF
END FUNCTION

FUNCTION ExSTR$(x) !¿ôÃͼ°¤òɽ¼¨¤¹¤ë¤È¤­¤Îʸ»úÎó¤ËÊÑ´¹¤¹¤ë
   LET a=ABS(x)


   !À°¿ôÉô
   LET aa=INT(a) !¾®¿ôÉô¤òºï½ü¤¹¤ë

   LET b$="" !ÊÑ´¹¸å¤Î¿ô

   DO WHILE aa>=10
      LET b$=STR$(MOD(aa,10))&b$ !a=b[k]*10^k+b[k-1]*10^(k-1)+ ¡Ä +b[1]*10^1+b[0]*10^0¤è¤ê

      LET aa=INT(aa/10) !¼¡¤Î·å¤Ø¡¡¢¨±¦¥·¥Õ¥È
   LOOP
   LET b$=STR$(aa)&b$


   !¾®¿ôÉô
   LET aa=a-INT(a) !À°¿ôÉô¤òºï½ü¤¹¤ë

   LET k=1 !¾®¿ô·å

   DO UNTIL aa=0 !¾®¿ôÂ裱°Ì¤«¤é½ç¤Ë
      IF k=1 THEN !½é²ó¤Î¤ß
         LET b$=b$&"." !¾®¿ôÅÀ¤ò¤Ä¤±¤ë
         LET p=POS(b$,".")
      ELSE
         FOR i=1 TO k-1 !½Û´Ä¤·¤¿¤«³Îǧ¤¹¤ë
            IF s(i)=aa THEN !½Û´ÄÀá
               LET b$(i+p:i+p)="["&b$(i+p:i+p) !³«»Ïµ­¹æ¤òÁÞÆþ
               LET b$=b$&"]" !½ªÎ»µ­¹æ
               EXIT DO
            END IF
         NEXT i
      END IF
      LET s(k)=aa

      LET aa=aa*10 !º¸¥·¥Õ¥È
      LET b$=b$&STR$(INT(aa)) !a=S[-1]*10^(-1)+S[-2]*10^(-2)+ ¡Ä +S[-(k-1)]*10^(-(k-1))+S[-k]*10^(-k)¤è¤ê

      LET aa=aa-INT(aa) !À°¿ôÉôʬ¤òºï½ü¤·¤Æ¡¢¼¡¤Î·å¤Ø

      LET k=k+1
      IF k>MaxLevel THEN !½Û´Ä¾®¿ô¤Ë¤è¤ë¥ë¡¼¥×¤ò²óÈò¤¹¤ë
         PRINT "ÊÑ´¹¤òÂǤÁÀÚ¤ê¤Þ¤·¤¿¡£"
         EXIT DO
      END IF
   LOOP

   IF x<0 THEN LET ExSTR$="-"&b$ ELSE LET ExSTR$=b$ !¡Ä.¡Ä·Á¼°
END FUNCTION

END
 

´õ˾

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 7·î 2Æü(ÌÚ)17»þ08ʬ35ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ºÇ¶á¡¢ÉÑÈË¤Ë JWORD ¤Î¥¦¥£¥ó¥É¥¦¤¬¸½¤ì¡¢Î㤨´³¾Ä¤»¤º¤Ë¥Ö¥é¥¦¥¶¤òÊĤ¸¤Æ¤â¡¢
²¼¤ÎÍͤʣ²ËܤΥ¯¥Ã¥­¡¼¤¬¡¢ºî¤é¤ì¤Þ¤¹¡£
¤Ç¤­¤ì¤Ð¡¢ÀèÀ¸¤ÎÂç³ØÆâ¤Ë¡¢·Ç¼¨ÈĤòÀߤ±¤Æĺ¤¯»ö¤Ï¡¢½ÐÍè¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£

nec-pcuse@soft[?].txt
    jwd_c_APcommon, 9199_teacup, download.jword.jp/soft/
    1024, 4055316224, 30014381, 3363342720, 30014180, *

nec-pcuse@flt2[?].txt
    9199_teacup_9199_teacup_001, 1, download.jword.jp/pub/flt2/
    1024, 1083495936, 30014784, 3290842720, 30014180, *
 

Re: ´õ˾

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 7·î 2Æü(ÌÚ)20»þ50ʬ12ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.423[¸µµ­»ö¤Ø]

Ä̾ï¤ÎWeb¥Ú¡¼¥¸¤â´ÉÍý¤¬ÍưפǤʤ¤¤¿¤á³°Éô¤Î»ñ¸»¤ËÍê¤Ã¤Æ¤¤¤Þ¤¹¡£
·Ç¼¨Èij«ÀߤËɬÍפʾò·ï¤¬À°¤Ã¤Æ¤¤¤ë¤Î¤«¤É¤¦¤«¤â¤ï¤«¤ê¤Þ¤»¤ó¡£

¤È¤ê¤¢¤¨¤º¡¤·Ç¼¨ÈıÜÍ÷¤Ë Mozilla Firefox¤ò»È¤Ã¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
Mozilla Firefox¤ò·Ç¼¨ÈıÜÍ÷ÀìÍѤ˻ȤäƤ¤¤Þ¤¹¤¬¡¤²÷Ŭ¤Ç¤¹¡£
 

Re: ½Û´Ä¾®¿ô¤Î·×»»

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 7·î 3Æü(¶â)15»þ27ʬ2ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.422[¸µµ­»ö¤Ø]

¤ª¤ª¤²¤µ¤Ë¹Í¤¨¤º¤Ë¡¢¡¢¡¢
!Ìä 0.1[23] ¡à 0.[14] ¤Î·ë²Ì¤ò½Û´Ä¾®¿ô¤Çɽ¤»¡£¡¡Åú¤¨ 0.8[714285]

OPTION ARITHMETIC RATIONAL


!¡ü½Û´Ä¾®¿ô¤òʬ¿ô¤ËÊÑ´¹¤¹¤ëÉ®»»
!¡¡Í­¸Â¾®¿ô¡ÊÀ°¿ô¤â´Þ¤à¡Ë¤ÎÉôʬ
!¡¡¡¡½Û´ÄÀá¤Þ¤Ç¤ÎÉôʬ¡¡¢¨¾®¿ôÉôʬ¤Î·å¿ô¤ò¡ÖÍ­¸Â¾®¿ô¤Î·å¿ô¡×¤È¤¹¤ë¡£
!¡¡½Û´Ä¾®¿ô¤ÎÉôʬ
!¡¡¡¡Ê¬»Ò: ½Û´ÄÀá
!¡¡¡¡Ê¬Êì: repeat$("9",½Û´ÄÀá¤Î·å¿ô) & repeat$("0",Í­¸Â¾®¿ô¤Î·å¿ô)
!
!¡¡Îã. 12.345[6789] ¤Î¾ì¹ç¡¢12.345+6789/9999000 ¤È¤Ê¤ë¡£

LET a=0.1+23/990 !¾åµ­¤Ë½¾¤Ã¤Æ¡¢¼°¤òÁȤßΩ¤Æ¤ë
LET b=0.+14/99
PRINT a; b; a/b
PRINT USING "#.###############################": a/b


!¡ü̵¸ÂÅùÈæµé¿ô¤ÎϤò»È¤Ã¤Æʬ¿ô¤ËÊÑ´¹¤¹¤ë
!¡¡Îã. 12.345[6789] ¤Î¾ì¹ç¡¢12.345+0.0006789/(1-1/10^4) ¤È¤Ê¤ë¡£
!¡¡¡¡0.0006789: ºÇ½é¤Î½Û´ÄÀá¤ò¾®¿ôɽ¸½
!¡¡¡¡4: ½Û´ÄÀá¤Î·å¿ô
!¡¡¢è½Û´Ä¾®¿ô¤ÎÉôʬ¤Ï
!¡¡¡¡¡¡0.0006789
!¡¡¡¡ +0.00000006789
!¡¡¡¡ +0.000000000006789
!¡¡¡¡ + ¡¦¡¦¡¦ ¡¢¤¹¤Ê¤ï¤Á¡¢½é¹à0.0006789¡¤¸øÈæ1/10^4=0.0001¤Î̵¸ÂÅùÈæµé¿ô

LET a=0.1+0.023/(1-1/10^2)
LET b=0.+0.14/(1-1/10^2)
PRINT a; b; a/b
PRINT USING "#.###############################": a/b

END
 

Re: ´õ˾

 Åê¹Æ¼Ô¡§¤Ê¤«¤à¤é  Åê¹ÆÆü¡§2009ǯ 7·î 4Æü(ÅÚ)08»þ47ʬ17ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.424[¸µµ­»ö¤Ø]

;Ã̤Ǥ¹¤¬¡¢¡ÊWin¤ÎVer¤Ë¤è¤Ã¤Æ¤Ï¤ª»È¤¤¤Ë¤Ê¤ì¤Ê¤¤¤«¤â¤·¤ì¤Þ¤»¤ó¤¬¡Ë

Web¥Ö¥é¥¦¥¶¤òÊ£¿ô¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¤¯¤Ê¤¤¡ÊIE¤ò¥×¥é¥¤¥Þ¥ê¤Ç
¤Ä¤«¤Ã¤Æ¤¤¤Æ¤½¤Î¾¤Î¥Ö¥é¥¦¥¶¤òÆþ¤ì¤¿¤¯¤Ê¤¤¾ì¹ç¤Ê¤É¡Ë¤Ï Firefox ¤Î
PortableÈǤòÍøÍѤ¹¤ë¤È¤¤¤¦¼ê¤â¤¢¤ê¤Þ¤¹¡£

´ðËÜŪ¤Ë¡¢Å¬Åö¤Ê¥Õ¥©¥ë¥À¤òºî¤Ã¤Æ¤½¤³¤Ë¥×¥í¥°¥é¥à¤ò¥³¥Ô¡¼
¡Ê¥¤¥ó¥¹¥È¡¼¥é¤¬¤½¤Îºî¶È¤ò¹Ô¤Ã¤Æ¤¯¤ì¤Þ¤¹¤¬¡Ë¤¹¤ì¤Ð
¤½¤Î¥Õ¥©¥ë¥ÀÆâ¤Ç´°·ë¤·¤ÆÆ°ºî¤·¡¢ºï½ü¤¹¤ë¤È¤­¤â¥Õ¥©¥ë¥À
¤´¤È¾Ã¤¹¤À¤±¡¢¤È¤¤¤¦¤â¤Î¤Ç¤¹¡ÊPC¤Î³Æ¼ïÀßÄê¤ò±ø¤·¤Þ¤»¤ó¡Ë¡£

°Ê²¼¤´»²¹Í¡£¡ÊÁë¤ÎÅΤε­»ö¡Ë
http://www.forest.impress.co.jp/article/2008/06/20/firefoxportable3.html

¥À¥¦¥ó¥í¡¼¥É¤Ï¤³¤Á¤é¤«¤é¤Ç¤­¤Þ¤¹¡£
http://portableapps.com/apps/internet/firefox_portable/localization

Firefox¤ò»î¤¹¤À¤±¡¢¤È¤¤¤¦¾ì¹ç¤ËÊØÍø¤«¤â¤·¤ì¤Þ¤»¤ó¡£
 

Re: ´õ˾

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 7·î 4Æü(ÅÚ)19»þ13ʬ40ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.426[¸µµ­»ö¤Ø]

¤ªµ¤¸¯¤¤¡¢¤È¤Æ¤â¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£

¼Â¤Ï¡¢»ä¼«¿È¤Î°Ù¤Ç¤Ï¤Ê¤¯¡¢ºÇ¶á¡¢Åê¹Æ¼Ô¤¬¸º¾¯¤·¤Æ¤¤¤ë´¶¤¬Èó¾ï¤Ë¶¯¤¯¡¢¤½¤Î¸¶°ø¤Ë
¤Ê¤Ã¤Æ¤Ï¤·¤Ê¤¤¤«¤È¡¢¿´ÇÛ¤·¤Æ¤ª¤ê¤Þ¤·¤¿¡£¡Ö¤ª¤ª¤²¤µ¡×¤Ê¤è¤¦¤Ç¡¦¡¦¤¹¤Í¡£
 

ÇòÀÐÀèÀ¸¤Ø

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 7·î 6Æü(·î)03»þ18ʬ45ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ÇòÀÐÀèÀ¸¤Ø
¸æÀ¤Ïäˤʤê¤Þ¤¹¡£complex\ sin_2.BAS¡¡³°ÉôÎã³° ¤´ÊÖ»ö¤Î·ï¤Î ´Ä¶­ ¾ÜºÙ¤Ç¤¹¡£
¡Ö³ÈÂ礹¤ëÏȡפޤǤϡ¢¤«¤Ê¤ê¤ÊÉÑÅ٤ǡ¢¹Ô¤±¤ë¤Î¤Ç¤¹¤¬¡¢¤½¤ÎÀè¤Ç¡¢»ß¤Þ¤ê¤Þ¤¹¡£

¡ã¥·¥¹¥Æ¥à¤Î¥×¥í¥Ñ¥Æ¥£¡ä¡¡¤Î¥³¥Ô¡¼¡£
Á´ÈÌ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ã²¾ÁÛ¥á¥â¥ê¡ä
¥·¥¹¥Æ¥à :¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¥Ï¡¼¥É¥Ç¥£¥¹¥¯¡§¡¡C:\4417MB ¤Î¶õ¤­
¡¡¡¡¡¡Microsoft Windows 98¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ºÇ¾®¡§¡¡128 MB
¡¡¡¡¡¡Second Edition                     ¡¡¡¡¡¡¡¡¡¡ ºÇÂ硧¡¡ºÇÂçÃͤʤ·
¡¡¡¡¡¡4.10.2222 A
À½Â¤¤ª¤è¤Ó¥µ¥Ý¡¼¥È¸µ :
¡¡¡¡¡¡NEC
¡¡¡¡¡¡LaVie
¡¡¡¡¡¡GenuineIntel
¡¡¡¡¡¡x86 Family 6 Model 8 Stepping 1
¡¡¡¡¡¡255.0MB ¤Î RAM


¡ãÄɵ­¡ä
À躢¡¢³°ÉôÎã³°¤Î¤´Êó¹ð¤ò¡¢ÀèÀ¸¤Ë¤ªÁ÷¤ê¤·¤¿½ê¡¢¼¡¤ÎÍͤʤ´ÊÖ»ö¤ò夭¤Þ¤·¤¿¡£
¤´¶¨ÎÏ¡¢¤ª¤Í¤¬¤¤¤·¤Þ¤¹¡£

-------------------------
¤´Êó¹ð¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
complex\ sin_2.BAS ¤Ï¡¤DEFʸ¤Ç¤Î¡ÊBASIC¤Î¡ËÎã³°¤òÉÑÈˤ˵¯¤³¤µ¤»¤ë¥×¥í¥°¥é¥à¤Ç¤¹¡£
½½¿ÊBASIC¤ÏÎã³°¤¬µ¯¤³¤ë¤¿¤Ó¤´¤È¤ËÎã³°¤Ë´Ø·¸¤·¤¿¾ðÊó¤òưŪ¤Ë³ÎÊݤµ¤ì¤ë¥á¥â¥ê¾å¤ËÊݸ¤·¤Þ¤¹¡£
¤½¤Î¥á¥â¥ê¤ÏÉÔÍפˤʤë¤È²òÊü¤µ¤ì¤ë¤Î¤Ç¤¹¤¬¡¤¥á¥â¥ê¤ÎÃÇÊÒ²½¤Î¤¿¤á¤ËɬÍװʾå¤Î¡ÊWindows¤Î¡Ë²¾ÁÛ
¥á¥â¥ê¤ò¾ÃÈñ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£
Windows¤Î²¾ÁÛ¥á¥â¥ê¤Î³ÈÄ¥¤¬¤¦¤Þ¤¯¤¤¤«¤º¡¤Îã³°£°E¤È¤·¤ÆBASIC¤ËÌᤵ¤ì¤Æ¤¤¤ë¤è¤¦¤Ë»×¤¤¤Þ¤¹¡£
Windows¤Î²¾ÁÛ¥á¥â¥ê¤ÎÀßÄê¤Ë¤â¥Ç¥£¥¹¥¯¤Î»ÄÎ̤ˤâÌäÂ꤬¤Ê¤¤¤è¤¦¤Ç¤·¤¿¤é¡¤
¸¶°ø¤ÎÆÃÄê¤Ë¤ÏƱ¤¸¸½¾Ý¤òµ¯¤³¤¹´Ä¶­¤òÆÃÄꤹ¤ëɬÍפ¬¤¢¤ë¤Î¤Ç¡¤
OS¤Î¥Ð¡¼¥¸¥ç¥ó¾ðÊó¤È¤È¤â¤Ë·Ç¼¨ÈĤ˽ñ¤­¹þ¤ó¤Ç¤¤¤¿¤À¤±¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£
 

Re: ÇòÀÐÀèÀ¸¤Ø

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 7·î 6Æü(·î)10»þ36ʬ57ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.428[¸µµ­»ö¤Ø]

¡Ö³ÈÂ礹¤ëÏȡפޤǤÏÀµ¾ï¤ËÆ°ºî¤·¡¤¡Ö³ÈÂ礹¤ëÏȡפÎľ¸å¤ËÌäÂ꤬µ¯¤³¤ë¤Î¤Ç¤¢¤ì¤Ð¡¤
¥Ç¥£¥¹¥×¥ì¡¼¡¦¥É¥é¥¤¥Ð¤ÎÌäÂê¤Î²ÄǽÀ­¤â¤¢¤ë¤Î¤Ç¡¤Windows¤Î¥³¥ó¥È¥í¡¼¥ë¥Ñ¥Í¥ë¤Î¡Ö²èÌ̤Υץí¥Ñ¥Æ¥£¡×¤Î¡Ö¥È¥é¥Ö¥ë¥·¥å¡¼¥Æ¥£¥ó¥°¡×¤Ç¥Ï¡¼¥É¥¦¥§¥¢¥¢¥¯¥»¥é¥ì¡¼¥¿¤ÎÌÜÀ¹¤ê¤ò²¼¤²¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
 

Re: ÇòÀÐÀèÀ¸¤Ø

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 7·î 6Æü(·î)17»þ27ʬ8ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.429[¸µµ­»ö¤Ø]

¥¢¥¯¥»¥é¥ì¡¼¥¿¡¼¤ò¡¢»ß¤á¤ë¤È¡¢¾É¾õ¤¬¡¢¾Ã¤¨¤Þ¤·¤¿¡£¡¡¥Ç¥£¥¹¥×¥ì¥¤¥É¥é¥¤¥Ð¡¼¤Ï¡¢
RAGE MOBILITY PCI (ÆüËܸì)¡¡¥Ð¡¼¥¸¥ç¥ó¡§4.12.2083¡¡À½Â¤¸µ :ATI Tech. - Enhanced
¤Ç¤¹¤¬¡¢»ß¤á¤Æ¤·¤Þ¤¦¤È¡¢Â¾¤Ë»Ù¾ã¤¬¤¢¤ë¤¿¤á¡¢²¼¤ÎÍͤˤ·¤Æ¡¢¤·¤Î¤¤¤Ç¤¤¤Þ¤¹¡£
¡¡¤¹¤ß¤Þ¤»¤ó¡£¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£

¤·¤­¤¤ÃͤΡ¢710 ¤Ï¡¢¥®¥ê¥®¥ê°ìÇդʤΤǡ¢709 ¤Ë¤·¤Þ¤·¤¿¡£

FOR u= left TO right STEP (right-left)/px
   FOR v = bottom TO top STEP (top-bottom)/py
      LET Lambda=COMPLEX(u,v)
      LET z=0.5             ! ½é´üÃÍ
      FOR n = 1 TO 250
         IF ABS(i*z)< 710 THEN LET z=lambda*sin(z) ELSE EXIT FOR !·å¤¢¤Õ¤ìËÉ»ß
      NEXT n
      IF 250< n THEN PLOT POINTS: u,v
   NEXT v
NEXT u


¡ã¡ãÄɵ­¡ä¡ä
¤ä¤Ï¤ê¡¢¥¢¥¯¥»¥é¥ì¡¼¥¿¡¼¤ò¡¢»ß¤á¤Æ¤â¡¢ÉÑÅ٤Ͼ¯¤Ê¤¤¤Ç¤¹¤¬¡¢
¡ÖÎã³° 0E ¤¬¡¢0028:C0059CA9 ¤ÇȯÀ¸¤·¤Þ¤·¤¿¡£¡×¤Ç¡¢½ª¤Ã¤Æ¤·¤Þ¤¤¤Þ¤¹¡£
¾å¤Îº¹Âؤ¨Ê¸¤Ç¤Ï¡¢³Î¼Â¤ËÆ°¤¯¤Î¤Ç¤¹¤¬¡¦¡¦

WinXP ¤Ê¤É¤Ç¡¢²¿»ö¤â¤Ê¤±¤ì¤Ð¡¢¤³¤ÎÌäÂê¤Ï¡¢Win98SE °ÊÁ°¤Î¥Ð¥°¤Î¤è¤¦¤Ç¤â¤¢¤ê¡¢
ÄÉÀפϡ¢³ä°¦¤·¤Æ¤¯¤À¤µ¤¤¡£¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
 

Re: ½Û´Ä¾®¿ô¤Î·×»»

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ 7·î 6Æü(·î)20»þ22ʬ7ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.422[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Î FUNCTION ExSTR$(x) ¤Çʬ¿ô¤ò½Û´Ä¾®¿ô¤ËÊÑ´¹¤¹¤ë¥ë¡¼¥×¤òÇÒ¸«¤·¡¢¤³¤ì¤ò10¿Ê15·å¥â¡¼¥É¤Ç¤Ï¤Ç¤­¤Ê¤¤¤«¤È»×¤¤Î©¤Áºî¤Ã¤Æ¤ß¤Þ¤·¤¿¡£
·×»»²áÄø¤ÏÉ®»»¤ÈƱ¤¸¤Ç¤¹¡£Ê¬Êì¤òn¤È¤¹¤ì¤Ð¡¢n-1·å¤Þ¤Ç¤Ç³ä¤êÀÚ¤ì¤ë¤«Æ±¤¸Í¾¤ê¤¬¸½¤ì¤ë¤«¤Ç¤¹¡£
·×»»·ë²Ì¤Î·å¿ô¤ËÀ©¸Â¤Ï¤Ê¤¤¤Î¤Ç¤¹(¿¿Ãͤ¬µá¤Þ¤ê¤Þ¤¹)¤¬¡¢Ê¬Êì¤ÎÂ礭¤µ¤ÇÇÛÎós¤òÀë¸À¤·¤Æ¤¤¤ë¤¿¤á¡¢Ê¬Ê줬Â礭¤¹¤®¤ë¤È¥¨¥é¡¼¤Ë¤Ê¤ê¤Þ¤¹¡£
1000·å¥â¡¼¥É,Í­Íý¿ô¥â¡¼¥É¤Ç¤â¼Â¹Ô¤Ç¤­¤Þ¤¹¡£(2¿Ê¥â¡¼¥É¤Ç¤Ï¾®¿ô¤Ç¸íº¹¤¬½Ð¤Æ¤·¤Þ¤¦)

DECLARE EXTERNAL FUNCTION Ex2STR$ ! ʬ¿ô¤ò¾®¿ô,½Û´Ä¾®¿ô¤Îʸ»úÎó¤ËÊÑ´¹¤¹¤ë´Ø¿ô
DO
   READ IF MISSING THEN EXIT DO : x$
   PRINT x$ ; "  ÆþÎÏ¿ôÃÍ"
   CALL fraction(x$,a,b)  ! À°¿ô,Í­¸Â¾®¿ô,½Û´Ä¾®¿ô,ʬ¿ô¤Îʸ»úÎó(x$)¤ò´ûÌóʬ¿ô(a/b)¤ËÊÑ´¹
   IF a>=0 THEN LET m$=" " ELSE LET m$=""
   IF b=1 THEN LET f$=STR$(a) ELSE LET f$=STR$(a)&"/"&STR$(b)
   PRINT m$&f$ ; "  ʬ¿ôɽ¼¨"
   PRINT a/b ; " ¾®¿ô15·åɽ¼¨"
   PRINT m$&Ex2STR$(a,b) ; "  ¾®¿ô¿¿ÃÍ[½Û´ÄÀá]ɽ¼¨" ! ʬ¿ô(a/b)¤ò¾®¿ô,½Û´Ä¾®¿ô¤Îʸ»úÎó¤ËÊÑ´¹
   PRINT
LOOP

DATA "-18" , "47." , "-12.34" , "-.67" , "+972.[51]" , "-73.482[3058]"
DATA "0.000[217]" , "+6.0054[83]" , ".031[040]" , "-78/13" , "0/26" , "740.52/29.84"
DATA "634517/3637" , "24/56" , "-5/12" , "91/35" , "886240513930735/10485760"

END


EXTERNAL SUB fraction(x$,numer,denom) ! x$¤òʬ¿ônumer/denom¤ËÊÑ´¹
LET dec$=LTRIM$(RTRIM$(x$))
IF dec$(1:1)="-" THEN LET s=-1 ELSE LET s=1
IF dec$(1:1)="+" OR dec$(1:1)="-" THEN LET dec$=dec$(2:LEN(dec$))

LET sp=POS(dec$,"/")
IF sp>1 THEN ! ʬ¿ô
   LET numer=VAL(dec$(1:sp-1))
   LET denom=VAL(dec$(sp+1:LEN(dec$)))
   CALL reduce(numer,denom) ! Ìóʬ
   LET numer=s*numer
   EXIT SUB
END IF

LET dp=POS(dec$,".")
IF dp=0 OR dp=LEN(dec$) THEN ! À°¿ô
   LET numer=s*VAL(dec$)
   LET denom=1
   EXIT SUB
END IF

IF dp=1 THEN LET intp=0 ELSE LET intp=VAL(dec$(1:dp-1)) ! À°¿ôÉô
LET rp=POS(dec$,"[")
IF rp=0 THEN  ! Í­¸Â¾®¿ô
   LET dl=LEN(dec$)-dp
   LET denom=10^dl
   LET numer=intp*denom+VAL(dec$(dp+1:LEN(dec$)))
   CALL reduce(numer,denom)
   LET numer=s*numer
   EXIT SUB
END IF

IF rp=dp+1 THEN
   LET dconst=0  ! Îã"37.[61]"
   LET dconst_denom=1
   LET dl=0
ELSE
   LET dconst=VAL(dec$(dp+1:rp-1)) ! ¾®¿ôÄê¿ôÉô
   LET dl=rp-dp-1                  ! ¾®¿ôÄê¿ôÉô·å¿ô
   LET dconst_denom=10^dl
   CALL reduce(dconst,dconst_denom)
END IF
LET rl=LEN(dec$)-rp-1                 ! ½Û´ÄÀá·å¿ô
LET recur=VAL(dec$(rp+1:LEN(dec$)-1)) ! ½Û´ÄÀá
LET recur_denom=10^(LEN(dec$)-dp-2)*(1-1/10^rl)
CALL reduce(recur,recur_denom)

!PRINT intp;dconst;dconst_denom;intp+dconst/dconst_denom
!PRINT recur;recur_denom;recur/recur_denom

!!  intp/1 + dconst/dconst_denom + recur/recur_denom
LET numer=intp*dconst_denom+dconst
CALL reduce(numer,dconst_denom)
LET numer=numer*recur_denom+recur*dconst_denom
LET denom=dconst_denom*recur_denom
CALL reduce(numer,denom)
LET numer=s*numer

END SUB


EXTERNAL FUNCTION Ex2STR$(numer,denom) !ʬ¿ô¤ò¾®¿ô,½Û´Ä¾®¿ô¤Îʸ»úÎó¤ËÊÑ´¹
!¡ÖNo.422 ½Û´Ä¾®¿ô¤Î·×»»(»³ÃæϵÁ»á)¡×FUNCTION ExSTR$(x) »²¾È

IF SGN(numer/denom)=-1 THEN LET u$="-" ELSE LET u$=""
LET numer=ABS(numer)
LET denom=ABS(denom)
CALL reduce(numer,denom) ! Ìóʬ

!À°¿ôÉô
IF denom=1 THEN
   LET Ex2STR$=u$&STR$(numer)
   EXIT FUNCTION
END IF

DIM s(denom-1) ! ¾ê;¤ò³ÊǼ¤¹¤ëÇÛÎó
LET aa=INT(numer/denom) !¾®¿ôÉô¤òºï½ü¤¹¤ë
IF aa=0 THEN LET b$="." ELSE LET b$=STR$(aa)&"."

!¾®¿ôÉô
LET p=POS(b$,".")
LET numer=MOD(numer,denom) ! ¾ê;(¾¦=aa)
LET k=1 !¾®¿ô·å

DO UNTIL numer=0
   FOR i=1 TO k-1 !½Û´Ä¤·¤¿¤«³Îǧ¤¹¤ë
      IF s(i)=numer THEN
         LET b$(i+p:i+p)="["&b$(i+p:i+p) !³«»Ïµ­¹æ¤òÁÞÆþ
         LET b$=b$&"]" !½ªÎ»µ­¹æ
         EXIT DO
      END IF
   NEXT i
   LET s(k)=numer
   LET b$=b$&STR$(INT(10*numer/denom))

   LET numer=MOD(10*numer,denom)

   LET k=k+1
   IF k>denom THEN ! ÇÛÎós¤Îź»ú¥ª¡¼¥Ð¡¼¤ò²óÈò¤¹¤ë
      PRINT "ÊÑ´¹¤òÂǤÁÀÚ¤ê¤Þ¤·¤¿¡£"
      EXIT DO
   END IF
LOOP

LET Ex2STR$=u$&b$
END FUNCTION


EXTERNAL SUB reduce(p,q) ! Ìóʬ
!½½¿ÊBASICźÉÕ "\BASICw32\Math\GCDLOOP.BAS" »²¾È
REM ¸ß½üË¡¤Ë¤è¤ê¡¤ÆþÎϤµ¤ì¤¿2¿ô¤ÎºÇÂç¸øÌó¿ô¤òµá¤á¤ë ¢ª ¤½¤Î¸å,Ìóʬ
LET a=p
LET b=q
DO
   LET r=MOD(a,b)
   IF r=0 THEN EXIT DO
   LET a=b
   LET b=r
LOOP
LET p=p/b
LET q=q/b
END SUB
 

Re: ÇòÀÐÀèÀ¸¤Ø

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 7·î 7Æü(²Ð)10»þ04ʬ21ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.430[¸µµ­»ö¤Ø]

¹­¤¯¾ÉÎã¤ò½¸¤á¤ë¤³¤È¤Ç¡¤¸¶°ø¤¬Win98SE¤Ë¤¢¤ë¤Î¤«¡¤¤½¤ì¤È¤â¥Ó¥Ç¥ª¥É¥é¥¤¥Ð¤Ë¤¢¤ë¤Î¤«¡¤ÆÃÄê¤Ç¤­¤ë¤È»×¤¤¤Þ¤¹¡£¤½¤Î¤¿¤á¤Î·Ç¼¨ÈÄÍøÍѤǤ¹¡£
¡Ê¤½¤Î´ÑÅÀ¤ÇÂê̾¤¬ÉÔŬÀڤǤ¹¡Ë
 

ÌäÂê¤ò¡¢É½Ì̲½¤¹¤ë¥×¥í¥°¥é¥à¤Ç¤¹

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 7·î 7Æü(²Ð)15»þ31ʬ35ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.432[¸µµ­»ö¤Ø]

!¤¹¤ß¤Þ¤»¤ó¡£µ¤¤ò¤Ä¤±¤Þ¤¹¡£
!ÌäÂê¤ò¡¢É½Ì̲½¤¹¤ë¥×¥í¥°¥é¥à¤Ç¤¹¡£¥¢¥¯¥»¥é¥ì¡¼¥¿¡¼¤òÄä»ß¤·¤Æ¤â¡¢
!¡ÖÎã³° 0E ¤¬¡¢0028:C0059CA9 ¤ÇȯÀ¸¤·¤Þ¤·¤¿¡£¡×¡¡¤Þ¤Ç¡¢£±¡Á£±£²£°Éá£

DO
   WHEN EXCEPTION IN
      LET w=EXP(12345)
   USE
   END WHEN
   PRINT 12345
LOOP
END

!»ä¤Î´Ä¶­¡§Win98SE, Pentium-3, 500MHz, 256MB, 4GB¤Î¶õ¤­(HDD),
!¡¡¡¡¡¡¡¡¡¡¥Ç¥£¥¹¥×¥ì¥¤ ¥¢¥À¥×¥¿ RAGE MOBILITY PCI(ÆüËܸì)
 

Re: ÌäÂê¤ò¡¢É½Ì̲½¤¹¤ë¥×¥í¥°¥é¥à¤Ç¤¹

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 7·î 7Æü(²Ð)16»þ37ʬ27ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.433[¸µµ­»ö¤Ø]

PRINTʸ¤¬¤Ê¤¤¤È¤­¤ÏÀµ¾ï¤ËÆ°ºî¤·¤Þ¤¹¤«¡©

DO
    WHEN EXCEPTION IN
       LET w=EXP(12345)
    USE
    END WHEN
LOOP
END
 

Re: ÌäÂê¤ò¡¢É½Ì̲½¤¹¤ë¥×¥í¥°¥é¥à¤Ç¤¹

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 7·î 7Æü(²Ð)17»þ30ʬ10ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.434[¸µµ­»ö¤Ø]

¤Ï¤¤¡¢PRINT ʸ¤¬Ìµ¤±¤ì¤Ð¡¢£µÊ¬°Ê¾åÁö¤ì¤ë¤è¤¦¤Ç¤¹¡£¤¬¡¢¥á¥âÄ¢¤Ê¤É¤Ç¤â¡¢
²èÌÌ¥¢¥¯¥»¥¹¤¬¡¢½Å¤Ê¤ë¤È¡¢Ê¸Ãæ¤Ë¡¢PRINT ʸ¤¬Ìµ¤¯¤Æ¤â¡¢
¡ÖÎã³° 0E ¤¬¡¢0028:C0059CA9 ¤ÇȯÀ¸¤·¤Þ¤·¤¿¡£¡×¤Ç¡¢BASIC.EXE ¤Þ¤Ç½ªÎ»¤·¤Þ¤¹¡£

<Äɵ­>
¤É¤¦¤â¡¢°ìÄꤷ¤Æ¤¤¤Ê¤¤¤è¤¦¤Ç¤¹¡£PRINT ʸ¤¬Ìµ¤¤¾õÂ֤ǡ¢Â¾¤Î²èÌ̤⡢²¿¤â¤·¤Ê¤¤
¾õÂ֤Ǥ⡢·«ÊÖ¤·¤Æ¤¤¤ëÆâ¡¢£¹£°É䯤餤¤Ç¡¢Æ±Íͤˡ¢¡ÖÎã³° 0E ¤¬¡¢¡¦¡¦¡¦¡×¤Ë
¤Ê¤Ã¤Æ¤¤¤Þ¤·¤¿¡££Å£Ø£Ð¡Ê¡Ë¤ÎÎã³°¤ò¡¢»ß¤á¤Ê¤¤¸Â¤ê½ÐÍè¤Ê¤¤¤è¤¦¤Ê¡¢´¶¤¸¤Ç¤¹¡£

¤´»²¹Í¡¢Â¾¤Î´Ø¿ô¤Ê¤É¤Ï¡¢Á´¤¯°ÂÄê¤Ç¤¹¡£(sinh,cosh ¤Ï¡¢exp()¤ÈƱ¾É¾õ¡Ë
DO
   WHEN EXCEPTION IN
      LET w=LOG(-12345) !100000^12345 !1/0 ! EXP(12345)
   USE
   END WHEN
   PRINT 12345
LOOP

¢¨tanh(2e99)¡¢sinh(12345)¡¢cosh(12345)¡¢¤Î·ë²Ì¤Ç¤Ï¡¢tanh ¤À¤±¤¬°ÂÄê¤Ç¤·¤¿¡£
¡¡Ëô¡¢µöÍÆÆþÎϤ¬¡¢ÆÃÊ̤ËÂ礭¤¯¡¢1e99¤Þ¤Ç¡¢¥¨¥é¡¼¤Ë¤Ê¤ê¤Þ¤»¤ó¤¬¡¢¤Ê¤¼¤Ç¤¹¤«¡£
 

µåÂΤòÉÁ¤¯¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§9mm  Åê¹ÆÆü¡§2009ǯ 7·î 8Æü(¿å)02»þ34ʬ51ÉÃ
ÊÖ¿®¡¦°úÍÑ
  »°¼¡¸µºÂɸ¤Ë¤¿¤¯¤µ¤óºÂɸ¤ò¤È¤Ã¤ÆµåÂΤòºî¤ê¤¿¤¤¤ó¤Ç¤¹¤¬¡¢¤É¤ó¤ÊºÂɸ¤ò¤È¤ì¤ÐµåÂΤΤ褦¤Ë¸«¤¨¤ë¤ó¤Ç¤·¤ç¤¦¤«¡©
¤µ¤é¤Ë¤½¤ÎµåÂΤ¬¥Ð¥¦¥ó¥É¤·¤Æ¤¤¤ë¤è¤¦¤Ê¥×¥í¥°¥é¥à¤òºî¤ê¤¿¤¤¤ó¤Ç¤¹¤¬¡¢²Äǽ¤Ç¤·¤ç¤¦¤«¡©
¤Þ¤ÀBASIC¤ò½¬¤Ã¤¿¤Ð¤Ã¤«¤ê¤Ê¤Î¤Ç¤¢¤Þ¤êÆñ¤·¤¤¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡Ä

¤¼¤Ò¶µ¤¨¤Æ¤¯¤À¤µ¤¤¡£
 

Re: µåÂΤòÉÁ¤¯¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 7·î 8Æü(¿å)07»þ56ʬ27ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.436[¸µµ­»ö¤Ø]

µåÌ̤ÎÉÁ¤­Êý¤Ï¡¤¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤Î
SAMPLE\SPHERICA.BAS
¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
¥Ð¥¦¥ó¥É¤·¤Æ¤¤¤ë¤è¤¦¤Ë¸«¤»¤ë¤¿¤á¤Ë¤Ï¡¤
ÉÁ²èÃæ¤Ï
DRAW MODE HIDDEN
¤Î¾õÂ֤Ǹ«¤»¤Ê¤¤¤è¤¦¤Ë¤·¤Æ
ÉÁ²è¤¬½ª¤ï¤Ã¤¿¤é
DRAW MODE EXPLICIT
¤ò¼Â¹Ô¤·¤Þ¤¹¡£
¾ÜºÙ¤Ï¡¤
http://hp.vector.co.jp/authors/VA008683/QA6.htm
¤Ë¤¢¤ê¤Þ¤¹¡£
¤Þ¤¿¡¤ËèÅÙÉÁ¤¯¤ÈÃÙ¤¯¤Ê¤ë¤Î¤Ç¡¤
ASK PIXEL ARRAY
¤Ç²èÁÇ¥ì¥Ù¥ë¤Çµ­²±¤·¡¤
MAT PLOT CELLS
¤Ç°ÌÃÖ¤ò¤º¤é¤·¤ÆÉÁ¤¯¤³¤È¤Ë¤Ê¤ë¤È»×¤¤¤Þ¤¹¡£
 

Re: ÌäÂê¤ò¡¢É½Ì̲½¤¹¤ë¥×¥í¥°¥é¥à¤Ç¤¹

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 7·î 8Æü(¿å)08»þ10ʬ25ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.435[¸µµ­»ö¤Ø]

¥Ó¥Ç¥ª¥É¥é¥¤¥Ð¤¬FPUÎã³°¤Î´³¾Ä¤ò¼õ¤±¤Æ¤¤¤ë¤Î¤À¤í¤¦¤È»×¤¤¤Þ¤¹¡£

½½¿Ê¥â¡¼¥É¤À¤È¡¤Ä¶±Û´Ø¿ô¡¤ÌµÍý´Ø¿ô¤Î±é»»¤ËFPU¤ò»È¤¤¤Þ¤¹¡£
2¿Ê¥â¡¼¥É¤ÈÊ£ÁÇ¿ô¥â¡¼¥É¤Ç¤Ï¤¹¤Ù¤Æ¤Î±é»»¤òFPU¤Ç¹Ô¤¤¤Þ¤¹¡£
2¿Ê¥â¡¼¥É¤«Ê£ÁÇ¿ô¥â¡¼¥É¤Ç·å¤¢¤Õ¤ì¥¨¥é¡¼¤òµ¯¤³¤¹¤è¤¦¤Ê¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£

OPTION ARITHMETIC NATIVE
LET i=1
DO
   WHEN EXCEPTION IN
      LET a=2
      DO
         LET a=a*a
      LOOP
   USE
      PRINT i;"²óÌÜ"
   END WHEN
   LET i=i+1
LOOP
END

¤Ê¤ª¡¤NEC PC9801 Win95ÈÇ
http://www.geocities.jp/thinking_math_education/basicw95.htm
¤Ç¤â¥Æ¥¹¥È¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£¤³¤ÎÈǤÏFPUÎã³°¤òÍ޻ߤ·¤Æ¤¤¤Þ¤¹¡£
 

Re: µåÂΤòÉÁ¤¯¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 7·î 8Æü(¿å)08»þ59ʬ24ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.437[¸µµ­»ö¤Ø]

OPTION ARITHMETIC NATIVE
OPTION ANGLE DEGREES
LET theta0=-125
LET z0=10
REM z¼´¤Î¤Þ¤ï¤ê¤Ëtheta0Åٲ󞤷¤¿sphre¤ò¡¤
REM ÅÀ(0,0,z0)¤«¤é¸«¤¿¤è¤¦¤ËÉÁ¤¯¡£
DIM p(4,4)         ! ÅÀ 0,0,z0¤òÃæ¿´¤È¤¹¤ë¼Í±Æ
MAT p=IDN
LET p(3,4)=-1/z0
DIM rotx(4,4)      ! x¼´¤Î¤Þ¤ï¤ê¤Î-90¡ë²óž
MAT rotx=IDN
LET rotx(2,2)=COS(-90)
LET rotx(2,3)=SIN(-90)
LET rotx(3,2)=-SIN(-90)
LET rotx(3,3)=COS(-90)

ASK PIXEL SIZE (0,1;1,0) a,b
DIM sp(a,b)

SET COLOR mode "NATIVE"
SET WINDOW -2, 2, -2, 2

DRAW sphere0 WITH ROTATE(theta0)  * rotx
ASK PIXEL ARRAY (-2,2) sp
FOR t = 0 TO 360*3 STEP 15   ! µåÂΤò3²ó¥Ð¥¦¥ó¥É¤µ¤»¤ë
   SET DRAW mode hidden
   CLEAR
   DRAW sphere WITH SHIFT(0,SIN(t))
   SET DRAW mode explicit
NEXT t

PICTURE sphere
   MAT PLOT CELLS ,IN -2,2; 2,-2: sp
END PICTURE

END


! ñ°Ìµå¤òÉÁ¤¯
EXTERNAL PICTURE sphere0
OPTION ARITHMETIC NATIVE
OPTION ANGLE DEGREES

DIM sz(4,4),ry(4,4)
MAT READ sz
DATA 1,0,0,0
DATA 0,1,0,0
DATA 0,0,1,0
DATA 0,0,1,1
MAT READ ry
DATA  0, 0,-1, 0
DATA  0, 1, 0, 0
DATA  1, 0, 0, 0
DATA  0, 0, 0, 1
! µåÌ̤òÉÁ¤¯
SET AREA STYLE "SOLID"
FOR t=0 TO 180
   FOR p=0 TO 359
      LET ry(1,3)=-SIN(t)
      LET ry(3,1)=SIN(t)
      LET ry(1,1)=COS(t)
      LET ry(3,3)=COS(t)
      DRAW Trapezoid(t) WITH sz*ry*ROTATE(p)
   NEXT p
NEXT t

PICTURE Trapezoid(t)      ! t¤Ïŷĺ³Ñ
   DIM N(3)
   CALL makeNormal(N)
   IF N(3)>0 THEN     ! ³°Â¦¤¬¼êÁ°¤Ê¤éÌ̤òÉÁ¤¯
      CALL setBrightness(N)
      PLOT AREA: -PI/360, -SIN(t-0.5)*PI/360; PI/360,-SIN(t+0.5)*PI/360; PI/360,SIN(t+0.5)*PI/360; -PI/360,SIN(t-0.5)*PI/360
   END IF
END PICTURE

END PICTURE

! ÊÑ´¹¤µ¤ì¤¿ºÂɸ·Ï¤Ë¤ª¤±¤ëË¡Àþ¥Ù¥¯¥È¥ë¤òµá¤á¤ë
EXTERNAL SUB makeNormal(N())
OPTION ARITHMETIC NATIVE
DIM m(4,4),A(4),B(4),C(4)
MAT m=TRANSFORM
MAT READ A
DATA 0,0,0,1
MAT READ B
DATA 1,0,0,1
MAT READ C
DATA 1,1,0,1
MAT A=A*M
MAT B=B*M
MAT C=C*M
MAT A=(1/A(4))*A
MAT B=(1/B(4))*B
MAT C=(1/C(4))*C
MAT REDIM A(3)
MAT REDIM B(3)
MAT REDIM C(3)
MAT A=B-A
MAT B=C-B
MAT N=CROSS(A,B)
END SUB

EXTERNAL SUB setBrightness(N())
OPTION ARITHMETIC NATIVE
DIM A(3)
MAT READ A      ! ¸÷¸»¤Î¸þ¤­
DATA -4,5,3
LET s=DOT(A,N)/(SQR(DOT(A,A))*SQR(DOT(N,N)))
LET s=(0.8*s+1)/2
SET AREA COLOR COLORINDEX(s,s,s)
END SUB
 

Re: ÌäÂê¤ò¡¢É½Ì̲½¤¹¤ë¥×¥í¥°¥é¥à¤Ç¤¹

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 7·î 8Æü(¿å)09»þ34ʬ5ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.438[¸µµ­»ö¤Ø]

¤´¿ä»¡¤É¤¦¤ê¡¢£³£¶£°£°²óÌܤ°¤é¤¤¤Ç¡¢Æ±¾É¾õ¤Ë¤Ê¤ê¤Þ¤¹¡£
NEC PC9801 Win95ÈÇ ¤Ç¤Ï¡¢¥¢¥¯¥»¥é¥ì¡¼¥¿ºÇÂç¤Ç¤â¡¢²¿¤Î°Û¾ï¤â¤Ê¤¯¤Ê¤ê¤Þ¤·¤¿¡£
¤«¤È¤¤¤Ã¤Æ¡¢Windows¼«ÂÎ¤È°Û¤Ê¤ê ¡¢½½¿ÊBASIC ¤Î¥Ð¡¼¥¸¥ç¥ó¡¦¥Ð¥Ã¥¯¤Ï¡¢¤·¤¿¤¯
¤¢¤ê¤Þ¤»¤ó¤Î¤Ç¡¢Ê¸¤Î½ñ¤­Êý¤Ç¡¢Âн褷¤Æ¤¤¤­¤¿¤¤¤È»×¤Ã¤Æ¤¤¤Þ¤¹¡£¤¿¤¤¤Ø¤ó¤ÊÏ«ÎϤò
¤ª¤«¤±¤·¡¢¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
 

ÀèÀ¸¤Î¤¬¡¢¤à¤º¤«¤·¤¤¤È¤­¡¦¡¦

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 7·î 8Æü(¿å)10»þ07ʬ26ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.436[¸µµ­»ö¤Ø]

!¥«¥é¡¼¡¦¥Ü¡¼¥ë
!-------------------------------
OPTION ARITHMETIC NATIVE
OPTION ANGLE DEGREES
DIM rotx(4,4)
MAT rotx=IDN

SET WINDOW -10,10,-10,10

! £ø£ùÊ¿Ì̾å¤ÎÉÁÅÀ¤ò¡¢£ø¼´¤Ç²óž¤¹¤ë¹ÔÎó rotx
LET ar0=35
!(x,y,z,1)| 1,        0,        0, 0 |
!         | 0, cos(ar0), sin(ar0), 0 |
!         | 0,-sin(ar0), cos(ar0), 0 |
!         | 0,        0,        0, 1 |
LET rotx(2,2)=COS(ar0)
LET rotx(3,2)=-SIN(ar0)
LET rotx(2,3)=SIN(ar0)
LET rotx(3,3)=COS(ar0)

LET r=5 !¡¡È¾·Â£µ£í¤Î¥«¥é¡¼¡¦¥Ü¡¼¥ë
LET t0=TIME
DO
   LET t=TIME-t0
   SET DRAW mode hidden
   CLEAR
   LET y=5-4.9*t^2 !¡¡ÄºÅÀ¤¬£µ£í¤ÎÊüʪÀþ
   DRAW ball WITH SHIFT(0,y)
   SET DRAW mode explicit
   IF y< -4 THEN LET t0=t0+2*SQR((5+4)/4.9) !( 5m ¢ª -4m )»þ´Ö¤Î£²ÇܤÇÊ¿¹Ô°ÜÆ°¡£
LOOP

PICTURE ball
   FOR i=-r*0.9 TO r*0.9 STEP r*0.1
      SET AREA COLOR MOD(i-0.6, 0.2*r)*5
      DRAW disk WITH SCALE( SQR(r^2-i^2) )*rotx*SHIFT(0, SIN(ar0)*i)
   NEXT i
END PICTURE

END
 

¥µ¥ó¥×¥ë±ÜÍ÷¥Ä¡¼¥ë

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 7·î 8Æü(¿å)13»þ39ʬ57ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ! ¥µ¥ó¥×¥ë±ÜÍ÷¥Ä¡¼¥ë Ver.£¹
!----------------------------------------------------------
!¥Æ¥­¥¹¥È¡¦¥¦¥£¥ó¥É¥¦¤Î¡¢º¸¾å°ÌÃÖ(x0,y0)¤È¡¢Éý(xw,yw)¡£
CALL SetWindowPos( WinHandle("TEXT" ),0, 10,100,500,550, 0)

SUB SetWindowPos( handle, C2, x0,y0,xw,yw, nFLG ) !¡¡nFLG, 0=x0y0xwyw 1=x0y0 2=xwyw
   ASSIGN "user32.dll","SetWindowPos"
END SUB

!----------------------------------------------------------
SET BITMAP SIZE 501,501
LET V=5 ! ɽ¼¨Îó¿ô 3~5
SET WINDOW 0, V, 27,-6
SET AREA COLOR 5
DIM p$(5*V),wild$(5*V),names$(200)

!²¼¤Î DATA ʸ¤Ï¡¢³Æ¥Õ¥©¥ë¥À¡¼¤¬ÇÛ²¼¤Ë¸«¤¨¤ë¾ì½ê¡ÊBASIC.EXE ¤ÈƱ¤¸¾ì½ê¡Ë¤Ë
!¤³¤Î¥×¥í¥°¥é¥à¤òÃÖ¤¤¤Æµ¯Æ°¤¹¤ë¾ì¹ç¤ÎÎã¡£

DATA TEXTFILE\, TUTORIAL\, USERLIB\, COMM\
DATA COMPLEX\,  FRACTAL\, FUNCTION\, GUIDE\
DATA LIBRARY\, MATH\, MICROSFT\, "Q&A\"
DATA SAMPLE\, STATEMEN\, ".\", "C:\My Documents\*.txt"

FOR f=1 TO 25
   READ IF MISSING THEN EXIT FOR: w$
   FILE splitname(w$) p$(f), name$, ext$ !¡¡ext$¤Ï¸ìƬ¤Ë"."´Þ¤à¡£
   IF ext$="" THEN LET wild$(f)="*.*" ELSE LET wild$(f)=name$& ext$
NEXT f

LET w=13 !ºÇ½é¤Ë³«¤¯¥Õ¥©¥ë¥À¡¼¡¢£±¡Á¡©ÈÖÌÜ
CALL basfiles
OPEN #9 : TextWindow2
ERASE #9
CALL SetWindowPos( WinHandle("TEXTWINDOW2" ),0, 515, 0,509,172, 0)
PRINT #9 :"¥Õ¥©¥ë¥À¡¼¤ò¡¢Áª¤ó¤Ç"
PRINT #9 :"¥Õ¥¡¥¤¥ë̾¤ò¡¢º¸¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢ÆâÍÆɽ¼¨¤¹¤ë¡£"
PRINT #9 :"¢¨½Å¤Í¤ÆºÆÅÙ¡¢º¸¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢(.BAS ¤Ê¤é¤Ð¡¢)"
PRINT #9 :"¡¡BASIC ¤ò¡¢¿·¤·¤¯µ¯Æ°¡¢¼Â¹Ô¤Ç¤­¤Þ¤¹¡£ÊĤ¸¤ë¤È¡¢Â³¹Ô¡£"& CHR$(0)
DO
   MOUSE POLL mx,my,mlb,mrb
   IF mrb=1 THEN EXIT DO !±¦¥¯¥ê¥Ã¥¯
   IF mlb=1 THEN !º¸¥¯¥ê¥Ã¥¯
      IF -1< my THEN
         IF 0< my THEN LET b=INT(mx)*27+CEIL(my) ELSE LET b=bak+1
         IF b=< n THEN
            IF b<>bak THEN
               CALL sampdisp
            ELSEIF UCASE$(right$(names$(b),4))=".BAS" THEN
               execute "BASIC.EXE" WITH("/NR",p$(m)& names$(b))
            END IF
         END IF
      ELSEIF my< -1 THEN
         LET w=INT(my+6)*V+CEIL(mx)
         IF w< f THEN CALL basfiles
      END IF
      LET i=0
      DO
         WAIT DELAY .02
         MOUSE POLL mx,my,mlb,mrb
         IF mlb=0 AND mrb=0 THEN LET i=i+1 ELSE LET i=0
      LOOP UNTIL 5< i !¥Þ¥¦¥¹¥Ü¥¿¥ó¤¬Î¥¤ì¤ë¤Þ¤ÇÂԤġ£
   END IF
   WAIT DELAY 0 !¥¯¥í¥Ã¥¯¥¢¥Ã¥×¤ò²¡¤¨¤ë
LOOP
PLOT AREA:0,-1;V,-1;V,0;0,0
SET TEXT BACKGROUND "TRANSPARENT" ! background none
PLOT TEXT,AT V*.3,0 :"½ªÎ»¤·¤Þ¤·¤¿¡£"

SUB basfiles
   LET m=w
   CLEAR
   PLOT AREA:0,-1;V,-1;V,0;0,0
   SET TEXT BACKGROUND "TRANSPARENT" ! background none
   PLOT TEXT,AT V*.17,0 :"¥³¥³¤òº¸¥¯¥ê¥Ã¥¯¤¹¤ë¤È½çÁ÷¤ê¡£¡¡±¦¥¯¥ê¥Ã¥¯¤Ç¡¢½ªÎ»¡£"
   FOR i=0 TO 4
      FOR j=1 TO V
         LET w=i*V+j
         IF w=m THEN PLOT AREA:j-1,i-5;j,i-5;j,i-6;j-1,i-6
         IF wild$(w)="*.*" THEN LET w$=p$(w) ELSE LET w$=p$(w)& wild$(w)
         PLOT TEXT,AT j-1+0.03,i-5 :w$ !p$(w)& wild$(w)
      NEXT j
   NEXT i
   IF m>0 THEN LET n=files(p$(m)& wild$(m))
   IF n>0 THEN file list p$(m)& wild$(m), names$
   SET TEXT BACKGROUND "OPAQUE" ! background color 0
   FOR w=1 TO n
      PLOT TEXT,AT IP((w-1)/27)+0.03, MOD((w-1),27)+1 :"|"& names$(w)
   NEXT w
   LET bak=0
END SUB

SUB sampdisp
   LET x=IP((bak-1)/27)
   LET y=MOD((bak-1),27)
   SET LINE COLOR 0
   PLOT LINES:x,y; x+1-0.03,y; x+1-0.03,y+1; x,y+1; x,y
   LET x=IP((b-1)/27)
   LET y=MOD((b-1),27)
   SET LINE COLOR 2
   PLOT LINES:x,y; x+1-0.03,y; x+1-0.03,y+1; x,y+1; x,y
   PRINT
   PRINT "!*******************************"
   PRINT "!"& p$(m)& names$(b)
   PRINT "!*******************************"
   WHEN EXCEPTION IN
      OPEN #1: NAME p$(m)& names$(b),ACCESS INPUT
      FOR L=1 TO 500 ! ºÇÂçɽ¼¨¹Ô¿ô
         LINE INPUT #1,IF MISSING THEN EXIT FOR :w$
         FOR i=1 TO LEN(w$)
            IF w$(i:i)< " " AND w$(i:i)<>CHR$(9) THEN CAUSE EXCEPTION 1
         NEXT i
         PRINT w$
      NEXT L
   USE
      PRINT "¡ö¡ö¡ö¡ö¡ö¡ö¡ö ¥Æ¥­¥¹¥È¤Ç¤Ï¤Ê¤¤¡¢É½¼¨¤ÎÃæ»ß¡£"
   END WHEN
   CLOSE #1
   LET bak=b
END SUB

END
 

Re: µåÂΤòÉÁ¤¯¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§9mm  Åê¹ÆÆü¡§2009ǯ 7·î 8Æü(¿å)14»þ14ʬ57ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.439[¸µµ­»ö¤Ø]

¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£


ºî¤Ã¤Æ¤¤¤¿¤À¤­ËÜÅö¤Ë¿½¤·Ìõ¤Ê¤¤¤ó¤Ç¤¹¤¬¡¢µåÂΤÀ¤±¤ò½ñ¤­¤¿¤¤¤È¤­¤Ï¤É¤¦¤¹¤ì¤Ð¤¤¤¤¤ó¤Ç¤·¤ç¤¦¤«¡©
µåÌ̤ˤ»¤º¤Ë£´¤Ä¤ÎºÂɸ¤ò¤Ä¤Ê¤¤¤Ç¤Ê¤ë¤Ù¤¯µåÂΤ˸«¤¨¤ë¤è¤¦¤Ê¤â¤Î¤¬¤¤¤¤¤ó¤Ç¤¹¤¬¡Ä

¤½¤ì¤¬x¼´¼þ¤ê¤Ç²óž¤·¤Æ¤¤¤ë¤è¤¦¤Ê¥×¥í¥°¥é¥à¤È¤«ºî¤ì¤Þ¤¹¤«¤Í¡©

½é¿´¼ÔÍѤβÝÂê¤Ê¤ó¤Ç¤¢¤Þ¤ê¹âÅÙ¤Ê¥×¥í¥°¥é¥ß¥ó¥°¤ò¤¹¤ë¤È¡Ä(>_<)


²¿Å٤⿽¤·Ìõ¤Ê¤¤¤Ç¤¹£í(¡£¡£¡Ë£í
 

Re: µåÂΤòÉÁ¤¯¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 7·î 8Æü(¿å)18»þ19ʬ34ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.443[¸µµ­»ö¤Ø]

º¹¤·½Ð¤¬¤Þ¤·¤¤¤È¤Ï¡¢»×¤¤¤Þ¤¹¤¬¡¢ÀèÀ¸¤Ï¡¢¤¿¤¤¤Ø¤ó¿˻¤Ç¡¢¤´Ééô¤ÎÂ礭¤¤ºî¶È¤Ê¤É
¤¢¤ê¤Þ¤¹¤Î¤Ç¡¢¤Ç¤­¤ì¤Ð¡¢¤³¤ÎÀè¤Ï¡¢sample\ ¥Õ¥©¥ë¥À¡¼¤ÎÊý¤Ç¡¢Âн褵¤ì¤ë»ö¤ò´üÂÔ
¤¤¤¿¤·¤Þ¤¹¡£¤Ç¤·¤ã¤Ð¤ê¤Ç¡¢¤â¤¦¤·¤ï¤±¤Ê¤¤¤Ç¤¹¡£
 

Re: µåÂΤòÉÁ¤¯¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§9mm  Åê¹ÆÆü¡§2009ǯ 7·î 8Æü(¿å)18»þ37ʬ16ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.444[¸µµ­»ö¤Ø]

SAMPLE¥Õ¥©¥ë¥À¤Ï¤É¤³¤Ë¤¢¤ë¤ó¤Ç¤·¤ç¤¦¤«¡©

¤ï¤«¤é¤Ê¤¤¤ó¤Ç¤¹¤¬¡Ä
 

Re: µåÂΤòÉÁ¤¯¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 7·î 8Æü(¿å)18»þ50ʬ8ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.445[¸µµ­»ö¤Ø]

BASIC.EXE ¤ÎÍ­¤ë½ê¤ÈƱ¤¸¥Õ¥©¥ë¥À¡¼¤ËƱÊñ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
Âçʸ»ú¤Î¡¢SAMPLE ¤«¤â¤·¤ì¤Þ¤»¤ó¡£windows ¤Ï¡¢Âç¾®¤ò¶èÊ̤·¤Þ¤»¤ó¤Î¤Ç¡£
 

Re: µåÂΤòÉÁ¤¯¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§9mm  Åê¹ÆÆü¡§2009ǯ 7·î 8Æü(¿å)19»þ19ʬ4ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.446[¸µµ­»ö¤Ø]

¤¢¤ê¤Þ¤·¤¿¡£¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£

¤¿¤ÀµåÌ̤ˤ·¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤Ë¤Ï¤É¤¦¤·¤¿¤é¤¤¤¤¤ó¤Ç¤·¤ç¤¦¤«¡©

ÅÀ¤ò·ë¤ó¤ÇµåÂΤäݤ¯¸«¤»¤¿¤¤¤Î¤Ç¤¹¤¬¡¢¤½¤ì¤é¤·¤¤¥Õ¥©¥ë¥À¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó¡Ä¡£
²¿Å٤⿽¤·Ìõ¤Ê¤¤¤Ç¤¹¡£½é¿´¼Ô²á¤®¤Æ¿½¤·Ìõ¤Ê¤¤¤Ç¤¹¡£
 

Re: µåÂΤòÉÁ¤¯¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 7·î 8Æü(¿å)20»þ01ʬ52ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.443[¸µµ­»ö¤Ø]

9mm¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

>»°¼¡¸µºÂɸ¤Ë¤¿¤¯¤µ¤óºÂɸ¤ò¤È¤Ã¤ÆµåÂΤòºî¤ê¤¿¤¤¤ó¤Ç¤¹¤¬¡¢

>µåÌ̤ˤ»¤º¤Ë£´¤Ä¤ÎºÂɸ¤ò¤Ä¤Ê¤¤¤Ç¤Ê¤ë¤Ù¤¯µåÂΤ˸«¤¨¤ë¤è¤¦¤Ê¤â¤Î¤¬¤¤¤¤¤ó¤Ç¤¹¤¬¡Ä


°ìÈ̤ˣ³£Ä¥°¥é¥Õ¥£¥Ã¥¯¥¹¤Ç¤Ï¡¢Â¿ÌÌÂΤò½Å¤Í¤Þ¤¹¡£
¥µ¥Ã¥«¡¼¥Ü¡¼¥ë¤òÁÛÁü¤¹¤ë¤È¤è¤¤¤Ç¤·¤ç¤¦¡£
£¶³Ñ·Á¤È£µ³Ñ·Á¡£¡Êº£¤Î¥µ¥Ã¥«¡¼¥Ü¡¼¥ë¤Ï°ã¤¦¤«¤â¡ª¡©¡Ë

¥µ¥ó¥×¥ë¡¡http://www.urban.ne.jp/home/kz4ymnk/seminar/basic/3dmodel.html


¤Þ¤¿¡¢Ãϵå¤Î°ÞÅ٤ȷÐÅÙ¤ÇÂæ·Áʬ³ä¡ÊË̶ˡ¢Æî¶Ë¤Ï»°³Ñ·Á¡Ë¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£
°ìÈ̤ˤ褯¤ß¤ë¥á¥ë¥«¥È¥ë¿ÞË¡¤ÎÀ¤³¦ÃϿޤǤ¹¡£
¤³¤ì¤òÃϵ嵷¤Ë¥Þ¥Ã¥×¤¹¤ë¤³¤È¤òÁÛÁü¤·¤Æ¤¯¤À¤µ¤¤¡£

!·ÐÀþ¤È°ÞÀþ¤È»È¤Ã¤Æ¡¢µåÂΤò¥ï¥¤¥ä¡¼¥Õ¥ì¡¼¥à¤ÇÉÁ²è¤¹¤ë

SET WINDOW -2,2,-2,2

FOR t=0 TO 90 STEP 15 !³ÑÅÙ¤òÅùʬ³ä¤¹¤ë
   LET a=SIN(RAD(t)) !üÉնᡧ̩¡¢Ãæ±ûÉնᡧÁÂ
   LET b=1
   FOR i=0 TO 360 !·ÐÀþ¡¡¢¨ÂʱߤòÉÁ¤¯
      LET x=a*COS(RAD(i))
      LET y=b*SIN(RAD(i))
      PLOT LINES: x,y;
   NEXT i
   PLOT LINES
NEXT t

FOR i=-180 TO 180 STEP 10 !°ÞÀþ¡¡¢¨¿åÊ¿Àþ¤òÉÁ¤¯
   LET y=SIN(RAD(i)) !³ÑÅÙ¤òÅùʬ³ä¤¹¤ë
   LET x=SQR(1-y^2) !¶ËÉնᡧ̩¡¢£°ÅÙÉնᡧÁÂ
   PLOT LINES: -x,y; x,y
NEXT i
PLOT LINES

END


»ä¤«¤é¥µ¥ó¥×¥ë¤È¤·¤Æ¡¢Èþ½ÑŪ¼êË¡¡Ê¤Ê¤¼Ê¿Ì̤βèÁü¤¬Î©ÂΤˤߤ¨¤ë¤Î¤«¡©¡Ë¤Çɽ¼¨¤·¤¿¤â¤Î¤Ç¤¹¡£
¾åµ­¤È¹ç¤ï¤»¤Æ¹Í»¡¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
!Âʱߤò½Å¤Í¤ë¤ÈµåÂΤ˸«¤¨¤ë¡ª¡©

SET WINDOW -2,2,-2,2

LET b=1
FOR a=0 TO 1 STEP 0.25

   FOR i=0 TO 360 !ÂʱߤòÉÁ¤¯
      LET x=a*COS(RAD(i))
      LET y=b*SIN(RAD(i))
      PLOT LINES: x,y;
   NEXT i
   PLOT LINES

NEXT a

LET a=1
FOR b=0 TO 1 STEP 0.25

   FOR i=0 TO 360 !ÂʱߤòÉÁ¤¯
      LET x=a*COS(RAD(i))
      LET y=b*SIN(RAD(i))
      PLOT LINES: x,y;
   NEXT i
   PLOT LINES

NEXT b

END
 

Re: µåÂΤòÉÁ¤¯¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§9mm  Åê¹ÆÆü¡§2009ǯ 7·î 8Æü(¿å)21»þ29ʬ47ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.448[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£

¤³¤Î¿Þ·Á¤¬Æ°¤¤¤¿¤ê¤·¤Þ¤»¤ó¤«¤Í¡©

¤Ç¤­¤ì¤Ð¤³¤Î¥µ¥Ã¥«¡¼¥Ü¡¼¥ë¤Î¤è¤¦¤Ê¿Þ·Á¤¬Æ°¤¤¤¿¤é¤ª¤â¤·¤í¤¤¤È»×¤¦¤ó¤Ç¤¹¤¬¡¦¡¦
 

Re: µåÂΤòÉÁ¤¯¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 7·î 9Æü(ÌÚ)16»þ28ʬ37ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.443[¸µµ­»ö¤Ø]

9mm¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> µåÌ̤ˤ»¤º¤Ë£´¤Ä¤ÎºÂɸ¤ò¤Ä¤Ê¤¤¤Ç¤Ê¤ë¤Ù¤¯µåÂΤ˸«¤¨¤ë¤è¤¦¤Ê¤â¤Î¤¬¤¤¤¤¤ó¤Ç¤¹¤¬¡Ä
> ¤½¤ì¤¬x¼´¼þ¤ê¤Ç²óž¤·¤Æ¤¤¤ë¤è¤¦¤Ê¥×¥í¥°¥é¥à¤È¤«ºî¤ì¤Þ¤¹¤«¤Í¡©
> ½é¿´¼ÔÍѤβÝÂê¤Ê¤ó¤Ç¤¢¤Þ¤ê¹âÅÙ¤Ê¥×¥í¥°¥é¥ß¥ó¥°¤ò¤¹¤ë¤È¡Ä(>_<)

¤³¤Î¼ÁÌ䤬¤Ï¤Ã¤­¤ê¤·¤Þ¤»¤ó¤Î¤Ç¡¢Àµ³Î¤Ê²óÅú¤¬¤Ç¤­¤Þ¤»¤ó¤¬¡¢¡¢¡¢
!¥ï¥¤¥ä¡¼¥Õ¥ì¡¼¥à¤Ç¶ÊÌ̤òÉÁ¤¯¡¡SAMPLE\3DPLOT.BAS¤ò²þ½¤¡£

SUB rotx(x,y,z,a)
   LET y0=y*cos(a)-z*sin(a)
   LET z0=y*sin(a)+z*cos(a)
   LET y=y0
   LET z=z0
END SUB
SUB roty(x,y,z,a)
   LET x0=x*cos(a)+z*sin(a)
   LET z0=-x*sin(a)+z*cos(a)
   LET x=x0
   LET z=z0
END SUB
SUB rotz(x,y,z,a)
   LET x0=x*cos(a)-y*sin(a)
   LET y0=x*sin(a)+y*cos(a)
   LET x=x0
   LET y=y0
END SUB
SUB convert(x,y,z)
   CALL rotz(x,y,z,RAD(-30))
   CALL rotx(x,y,z,RAD(-70))
END SUB
SUB plotTo(x,y,z)
   LET x1=x
   LET y1=y
   LET z1=z
   CALL convert(x1,y1,z1)
   PLOT LINES:x1,y1;
END SUB
SUB PenUp
   PLOT LINES
END SUB
SUB PlotText(x,y,z,s$)
   CALL convert(x,y,z)
   PLOT TEXT ,AT x,y: s$
END SUB

!ÇÞÂÎÊÑ¿ôɽ¼¨
DEF fx(u,v)=COS(u)*SIN(v) !µå¡¡u=[0,2*PI],v=[0,PI]¡¡¢¨µåºÂɸ(r,¦È,¦Õ)
DEF fy(u,v)=SIN(u)*SIN(v)
DEF fz(u,v)=COS(v)

SET WINDOW -2,2,-2,2

FOR f=0 TO 360 !¥Õ¥ì¡¼¥à¡¦¥¢¥Ë¥á¡¼¥·¥ç¥ó
   SET DRAW mode hidden !¤Á¤é¤Ä¤­Ëɻߡʳ«»Ï¡Ë
   CLEAR

   ! ¼´¤òÉÁ¤¯
   CALL PlotTo(0,0,0)
   CALL PlotTo(2,0,0)
   CALL PlotTo(0,0,0)
   CALL PlotTo(0,2,0)
   CALL PlotTo(0,0,0)
   CALL PlotTo(0,0,2)
   CALL PenUp
   CALL PlotText(2,0,0,"x")
   CALL PlotText(0,2,0,"y")
   CALL PlotText(0,0,2,"z")

   ! ¶ÊÌ̤òÉÁ¤¯
   FOR u=0 TO 360 STEP 15
      FOR v=0 TO 180 STEP 15
         LET x=fx(RAD(u),RAD(v))
         LET y=fy(RAD(u),RAD(v))
         LET z=fz(RAD(u),RAD(v))
         CALL rotx(x,y,z,RAD(f))
         CALL PlotTo(x,y,z)
      NEXT v
      CALL PenUp
   NEXT u
   FOR v=0 TO 180 STEP 30
      FOR u=-1 TO 360 STEP 30
         LET x=fx(RAD(u),RAD(v))
         LET y=fy(RAD(u),RAD(v))
         LET z=fz(RAD(u),RAD(v))
         CALL rotx(x,y,z,RAD(f))
         CALL PlotTo(x,y,z)
      NEXT u
      call PenUp
   NEXT v

   SET DRAW mode explicit !¤Á¤é¤Ä¤­ËɻߡʽªÎ»¡Ë
   !WAIT DELAY 0.1
NEXT f

END
 

GIF ¥Õ¥¡¥¤¥ë

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 7·î10Æü(¶â)17»þ45ʬ47ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  !½½¿Ê BASIC ¤Î GIF ¥Õ¥¡¥¤¥ë¤¬¡¢²áµî¤Î ¥¤¥á¡¼¥¸¥ó¥° ¤Ê¤É¤Ç¡¢
!¡Ö¥É¥­¥å¥á¥ó¥È¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£¡×¤Ç¡¢Æɤá¤Ê¤¤»ö¤Ë¤Ä¤¤¤Æ¤Î¡¢»²¹Í¡£
!-------
! Private_¥Ñ¥ì¥Ã¥È ¤À¤±¤¬Í­¤Ã¤Æ Common_¥Ñ¥ì¥Ã¥È ¤Î̵¤¤¤Î¤¬¡¢¸¶°ø¤Ç¤·¤¿¡£
! Private ¤Ï¡¢Ìµ¤¯¤Æ¤â»Ù¾ã¤Ê¤¤¤Î¤Ç¡¢Common ¤ØžÁ÷¤¹¤ë¥×¥í¥°¥é¥à¤Ç¤¹¡£

OPTION CHARACTER BYTE
SET ECHO "OFF"
! LET file$="decGIForg.GIF" !¡¡ÆþÎÏ¥Õ¥¡¥¤¥ë̾¡£

!ÆþÎÏ¥Õ¥¡¥¤¥ë̾¤ò¡¢Á´¤¯½ñ¤«¤Ê¤¤¾ì¹ç¡¢¥Þ¥¦¥¹ÆþÎÏ¡£
!ÆþÎÏ¥Õ¥¡¥¤¥ë̾¤ò¡¢½ñ¤¯¾ì¹ç¡¢
!µ¯Æ°¤·¤¿¥Õ¥¡¥¤¥ë( BASIC.EXE¡¢Ëô¤Ï ¤³¤Î¥×¥í¥°¥é¥à¼«¿È) ¤ÎÍ­¤Ã¤¿½ê¤È¡¢
!Ʊ¤¸¥Õ¥©¥ë¥À¡¼¤¬¡¢( ¥«¥ì¥ó¥Èdir.) ¤Ë¤Ê¤ë¡£( ½ÐÎÏ¥Õ¥¡¥¤¥ë¶¦ )

ASK DIRECTORY s$
PRINT "¥«¥ì¥ó¥Èdir.¡§"& s$
IF file$="" THEN
   FILE GETNAME file$, "gif" ! ¥Þ¥¦¥¹¤Ç¡¢ÆþÎÏ¡£
   IF file$="" THEN
      PRINT "ÆþÎÏ¥Õ¥¡¥¤¥ë̾¤¬¡¢¤¢¤ê¤Þ¤»¤ó¡£"
      STOP
   END IF
END IF
PRINT "ÆþÎÏ¥Õ¥¡¥¤¥ë¡§"& file$& " (ÊѲ½¤·¤Þ¤»¤ó)"
OPEN #1: NAME file$, ACCESS INPUT
CALL readCI( 6+2+2+1+1+1 +1+2+2+2+2+1 )
IF db$(1:6)<>"GIF87a" THEN
   PRINT "Âоݣǣɣƥե¡¥¤¥ë¤Ç¤Ê¤¤¡£"
   STOP
END IF
LET sflg=ORD(db$(11:11))
IF bitand8( sflg,BVAL("80",16) )>0 THEN
   PRINT "Common_¥Ñ¥ì¥Ã¥È ¤Ï¡¢¤¹¤Ç¤Ë¤¢¤ê¤Þ¤¹¡£"
   STOP
END IF
LET pi$=db$(14:23)
LET pflg=ORD(pi$(10:10))
IF ORD( pi$(1:1) )<>BVAL("2C",16) OR bitand8( pflg,BVAL("80",16) )=0 THEN
   PRINT "½½¿Ê BASIC ¤Î £Ç£É£Æ¥Õ¥¡¥¤¥ë¤Ç¤Ê¤¤¡£"
   STOP
END IF
FILE splitname(file$) path$, name$, ext$ !¡¡ext$¤Ï¸ìƬ¤Ë"."´Þ¤à¡£
PRINT "½ÐÎÏ¥Õ¥¡¥¤¥ë¡§"& path$& name$& "##"& ext$
PRINT "Ok¡©[Enter]"
CHARACTER INPUT k$
IF k$<>CHR$(13) THEN
   PRINT "Ãæ»ß"
   STOP
END IF
PRINT "½èÍýÃæ"
!----
OPEN #2: NAME path$& name$& "##"& ext$
ERASE #2
!----
PRINT "£±¡ËGIF_¼±ÊÌʸ»ú¡¢¥¹¥¯¥ê¡¼¥ó¾ðÊó¡¢"
PRINT "¡¡¡¡ common_¥Ñ¥ì¥Ã¥È¾ðÊó¡Ê½¤Àµ)¡¢¤ÎžÁ÷¡£"
LET j= bitor8( bitand8(sflg,BVAL("70",16)), bitand8(pflg,BVAL("87",16)) )
LET db$(11:11)=CHR$(j)
PRINT #2: db$(1:13);
!----
PRINT "£²¡Ëprivate_¥Ñ¥ì¥Ã¥È¡¢¤«¤é"
PRINT "¡¡¡¡ common_¥Ñ¥ì¥Ã¥È¡¢¤Ø žÁ÷¡£"
CALL readCI( 3*2^(MOD(pflg,8)+1) )
PRINT #2: db$;
!----
PRINT "£³¡Ë²èÁü¾ðÊó¡Ê½¤Àµ)¡¢¤ÎžÁ÷¡£"
LET pi$(10:10)=CHR$(0)
PRINT #2: pi$;
PRINT "¡¡¡¡ private_¥Ñ¥ì¥Ã¥È¡¢¤Îºï½ü¡£"
!----
PRINT "£´¡Ë²èÁü¥Ç¡¼¥¿ ¡Á GIF ½ªÃ¼¥Ö¥í¥Ã¥¯¡¢¤ÎžÁ÷Ãæ¡£"
CALL readCI( 1000000 )
PRINT #2: db$;
!----
CLOSE #2
CLOSE #1
PRINT "½ªÎ»"

!-------read binary cx bytes
SUB readCI(cx) !¡¡cx=bytes size
   LET db$=""
   FOR i=1 TO cx
      CHARACTER INPUT #1,IF MISSING THEN EXIT SUB :w9$
      LET db$=db$& w9$
   NEXT i
END SUB

!-------
FUNCTION bitand8(a,b)
   LET b9$="00000000"
   LET b8$=right$("0000000"& BSTR$(a,2),8)
   LET b7$=right$("0000000"& BSTR$(b,2),8)
   FOR b9=1 TO 8
      IF b8$(b9:b9)="1" AND b7$(b9:b9)="1" THEN LET b9$(b9:b9)="1"
   NEXT b9
   LET bitand8=BVAL(b9$,2)
END FUNCTION

FUNCTION bitor8(a,b)
   LET b9$="00000000"
   LET b8$=right$("0000000"& BSTR$(a,2),8)
   LET b7$=right$("0000000"& BSTR$(b,2),8)
   FOR b9=1 TO 8
      IF b8$(b9:b9)="1" OR b7$(b9:b9)="1" THEN LET b9$(b9:b9)="1"
   NEXT b9
   LET bitor8=BVAL(b9$,2)
END FUNCTION

END
!-------
!http://www.nikkeibp.co.jp/archives/251/251739.html
!LZW°µ½Ì¥¢¥ë¥´¥ê¥º¥àÆõö¡¢¹ñÆâ¤Ç¤Ï2004ǯ6·î20Æü¤Ë¼º¸ú ¡Ä
!¡¡¡ÄGIF²èÁü¥Õ¥¡¥¤¥ë¤òɽ¼¨¡¦À¸À®¤¹¤ë¥½¥Õ¥È¤Î³«È¯¤¬¼«Í³¤Ë¡Ä¤Ê¤ë¡£
 

£î¿ÊË¡¤Ç¤Î½Û´Ä¾®¿ô¤Î·×»»

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 7·î11Æü(ÅÚ)10»þ48ʬ41ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ¿Ê¿ôÊÑ´¹¤Ï¡¢£î¿Ê¢Î10¿Ê¤ò¥Ù¡¼¥¹¤Ë·×»»¤·¤Þ¤¹¡£
³Æ¿ÊË¡¤Ç¤Î¿ô»ú¤Ï¡¢0123456789ABCDEFGHIJKL ¡Ä XYZ ¡Ä ¤Ç¤¹¡£¡Êɽ¼¨¤Ï36¿ÊË¡¤Þ¤Ç¡Ë
!£î¿ÊË¡¤Ç¤ÎÀ°¿ô¡¢¾®¿ô¡ÊÍ­¸Â¾®¿ô¡¢½Û´Ä¾®¿ô¡Ë¡¢Ê¬¿ô¤Î·×»»

OPTION ARITHMETIC RATIONAL

FUNCTION ExBVAL(x$,RADIX) !(RADIX)¿ÊË¡¤Î¿ôÃͤòɽ¸½¤¹¤ëʸ»úÎó¤ò10¿ÊË¡¿ôÃͤËÊÑ´¹¤¹¤ë
   IF RADIX<1 OR RADIX<>INT(RADIX) THEN
      PRINT "´ð¿ô¤Ï£²°Ê¾å¤ÎÀ°¿ô¤ò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡£"; RADIX
      STOP
   END IF

   CALL dec2frac(x$,RADIX, m,n) !¾®¿ô¤òʬ¿ô¤Ø
   LET ExBVAL=m/n
END FUNCTION

FUNCTION ExVAL(x$) !¿ôÃͤòɽ¸½¤¹¤ëʸ»úÎó¤ò10¿ÊË¡¿ôÃͤËÊÑ´¹¤¹¤ë
   LET ExVAL=ExBVAL(x$,10)
END FUNCTION

!²¼°Ì¤Î¥ë¡¼¥Á¥ó
FUNCTION VAL1(x$,N) !N¿ÊË¡¤Î¿ôÃÍ  ¢¨ASCII¥³¡¼¥Éɽ¤«¤é
   IF x$>"9" THEN
      LET t=ORD(x$)-ORD("A")+10
   ELSE
      LET t=ORD(x$)-ORD("0") !¢¨t=VAL(x$)¤Ç¤â²Ä
   END IF
   IF t<0 OR t>=N THEN !0¡ÁN-1¤ÎÈϰϤ«¤É¤¦¤«³Îǧ¤¹¤ë
      PRINT x$;"¤ÏÈϰϳ°¤ÎÃͤǤ¹¡£"
      STOP
   END IF
   LET VAL1=t
END FUNCTION
SUB dec2frac(x$,RADIX, m,n) !(RADIX)¿Ê¿ô¿ôÃͤòɽ¸½¤¹¤ëʸ»úÎó¤ò10¿Êˡʬ¿ô¡Êm/n¡Ë¤ËÊÑ´¹¤¹¤ë
   LET L=LEN(x$) !ʸ»úÎóŤòÆÀ¤ë

   LET p=0 !Í­¸Â¾®¿ô¤Î·å¿ô
   LET k=0 !½Û´ÄÀá¤Î·å¿ô¡£Í­¸Â¾®¿ô¤Î¾ì¹ç¡¢£°
   LET A=0
   LET cSGN=1 !²¾¿ô¤ÎÉä¹æ
   LET cSGN2=1 !»Ø¿ôÉô¤ÎÉä¹æ
   LET flag=0 !¡ÖÀ°¿ô¡×  ¢¨¿ôÃͤη¿
   !½ñ¼°  À°¿ô¡¢¾®¿ô: ¡Þ9{.}{E¡Þ9} | ¡Þ{9}.9{E¡Þ9}
   !      ʬ¿ô: ¡Þ9/9¡¢½Û´Ä¾®¿ô: ¡Þ{9}.{9}[9]

   LET i=1 !¿ô»úÎó¤ÎÆɤ߹þ¤ß°ÌÃÖ
   DO WHILE i<=L !¾å°Ì¤Î·å¤«¤é½ç¤Ë
      LET t$=UCASE$(x$(i:i))
      IF t$="." THEN !¾®¿ôÅÀ¤Ê¤é
         IF flag<>0 THEN
            PRINT "¾®¿ôÅÀ¤Î°ÌÃÖ¤¬ÉÔÀµ¤Ç¤¹¡£"; x$
            STOP
         END IF
         LET flag=1 !¡ÖÍ­¸Â¾®¿ô¡×
      ELSEIF t$="+" THEN !¡ÜÉä¹æ¤Ê¤é
         IF i<>1 THEN
            PRINT "¡ÜÉä¹æ¤Î°ÌÃÖ¤¬ÉÔÀµ¤Ç¤¹¡£"; x$
            STOP
         END IF
      ELSEIF t$="-" THEN !¡ÝÉä¹æ¤Ê¤é
         IF i<>1 THEN
            PRINT "¡ÝÉä¹æ¤Î°ÌÃÖ¤¬ÉÔÀµ¤Ç¤¹¡£"; x$
            STOP
         END IF
         LET cSGN=-1
      ELSEIF (RADIX<14 AND t$="E") OR t$="@" THEN !»Ø¿ôÉô¤Ê¤é  ¢¨14¿ÊË¡°Ê¾å¤Ï¡¢E.E@E¡ÊE.E*E^E¤Î°Õ¡Ë
         IF flag>1 THEN !ÉâÆ°¾®¿ôÅÀ¿ô¤«¡©
            PRINT "²¾¿ô¤Ï 9{.}|{9}.9 ·Á¼°¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£"; x$
            STOP
         END IF

         IF i+1<=L THEN !»Ø¿ôÉô¤ÎÉä¹æ¤òÆÀ¤ë
            LET t$=UCASE$(x$(i+1:i+1))
            IF t$="+" THEN !¡ÜÉä¹æ¤Ê¤é
               LET i=i+1
            ELSEIF t$="-" THEN !¡ÝÉä¹æ¤Ê¤é
               LET cSGN2=-1
               LET i=i+1
            END IF
         END IF
         IF i=L THEN !±¦Ã¼¤«¡©
            PRINT "»Ø¿ô¤¬¤¢¤ê¤Þ¤»¤ó¡£"; x$
            STOP
         END IF
         LET flag=2 !¡Ö»Ø¿ôÉô¤¢¤ê¡×
         LET B=A !save it as fraction
         LET A=0 !exponent
      ELSEIF t$="/" THEN !ʬ¿ô¤Ê¤é
         IF flag<>0 THEN !À°¿ô¤«¡©
            PRINT "ʬ»Ò¤ÏÀ°¿ô¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£"; x$
            STOP
         END IF
         LET flag=3 !¡Öʬ¿ô¡×
         LET B=A !save it as numerator
         LET A=0 !denominator
      ELSEIF t$="[" THEN !½Û´Ä¾®¿ô¤Ê¤é
         IF flag<>1 THEN !¾®¿ôÉô¤«¡©
            PRINT "½Û´Ä¾®¿ô¤Î³«»Ï°ÌÃÖ¤¬ÉÔÀµ¤Ç¤¹¡£"; x$
            STOP
         END IF
         LET flag=4 !¡Ö½Û´Ä¾®¿ô¡×
      ELSEIF t$="]" THEN
         IF i<>L THEN !±¦Ã¼¤«¡©
            PRINT "½Û´Ä¾®¿ô¤Î½ªÎ»°ÌÃÖ¤¬ÉÔÀµ¤Ç¤¹¡£"; x$
            STOP
         END IF
      ELSE
         LET A=A*RADIX+VAL1(t$,RADIX) !¿¹à¼°(( ¡Ä ((a[1]*RADIX+a[2])*RADIX+a[3])*RADIX ¡Ä +a[i-2])*RADIX+a[i-1])*RADIX+a[i]  ¢¨º¸¥·¥Õ¥È
         IF flag=1 THEN LET p=p+1
         IF flag=4 THEN LET k=k+1
      END IF

      LET i=i+1 !¼¡¤Ø
   LOOP

   !PRINT A;B; flag;cSGN;cSGN2;p;k !debug
   IF flag<2 THEN !Í­¸Â¾®¿ô¡ÊÀ°¿ô¤â´Þ¤à¡Ë¤Î¾ì¹ç
      LET m=cSGN * A
      LET n=RADIX^p
   ELSEIF flag=2 THEN !»Ø¿ôÉô¤¢¤ê¾®¿ô¤Î¾ì¹ç
      IF cSGN2*A< p THEN
         LET m=cSGN * B
         LET n=RADIX^(p-cSGN2*A)
      ELSE
         LET m=cSGN * B*RADIX^(cSGN2*A-p)
         LET n=1
      END IF
   ELSEIF flag=3 THEN !ʬ¿ô¤Î¾ì¹ç
      IF A=0 THEN
         PRINT "£°¤Ç³ä¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£"; x$
         STOP
      END IF
      LET m=cSGN * B
      LET n=A
   ELSE !½Û´Ä¾®¿ô¤Î¾ì¹ç
      LET B=INT(A/RADIX^k)
      LET m=cSGN * (A-B)
      LET n=(RADIX^(k+p)-RADIX^p)
   END IF

   LET B=GCD(m,n) !ºÇÂç¸øÌó¿ô¤Çʬ»Ò¤ÈʬÊì¤òÌóʬ¤¹¤ë
   LET m=m/B
   LET n=n/B
END SUB
FUNCTION GCD(a,b) !ºÇÂç¸øÌó¿ô¤òµá¤á¤ë
   DO UNTIL b=0
      LET r=MOD(a,b)
      LET a=b
      LET b=r
   LOOP
   LET GCD=a
END FUNCTION


LET Precision=1000 !½Û´ÄÀá¤ÎºÇÂç·å¿ô¡¡¢¨É¬Íפ˱þ¤¸¤ÆÊѹ¹¤Î¤³¤È
DIM s(Precision) !½Û´ÄÀá¤Î¸õÊä

FUNCTION ExBSTR$(x,RADIX) !10¿ÊË¡¿ôÃͼ°¤ò(RADIX)¿ÊË¡¤Ç¾®¿ôɽ¼¨¤¹¤ë¤È¤­¤Îʸ»úÎó¤ËÊÑ´¹¤¹¤ë
   IF RADIX<1 OR RADIX<>INT(RADIX) THEN
      PRINT "´ð¿ô¤Ï£²°Ê¾å¤ÎÀ°¿ô¤ò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡£"; RADIX
      STOP
   END IF

   CALL dec2frac(STR$(x),10, m,n) !¾®¿ô¤òʬ¿ô¤Ø
   LET b$=frac2dec$(m,n,RADIX) !ʬ¿ô¤ò¾®¿ô¤Ø
   IF RADIX<>10 THEN LET b$=b$&"("&STR$(RADIX)&")" !¿ÊË¡(RADIX)¤ò¤Ä¤±¤ë
   LET ExBSTR$=b$
END FUNCTION

FUNCTION ExSTR$(x) !10¿ÊË¡¿ôÃͼ°¤ò¾®¿ôɽ¼¨¤¹¤ë¤È¤­¤Îʸ»úÎó¤ËÊÑ´¹¤¹¤ë
   LET ExSTR$=ExBSTR$(x,10) !»Ø¿ô¤Ä¤­¾®¿ô¤Èʬ¿ô¤Ï¡¢STR$¤ò»È¤¦

   !!!LET b$=ExBSTR$(x,10)
   !!!IF POS(b$,"[")>0 THEN LET ExSTR$=b$ ELSE LET ExSTR$=STR$(x) !½Û´Ä¾®¿ô¤Î¤ßºÎÍѤ¹¤ë
END FUNCTION

!²¼°Ì¤Î¥ë¡¼¥Á¥ó
FUNCTION STR1$(x) !N¿ÊË¡¤Î¿ô»úµ­¹æ  ¢¨ASCII¥³¡¼¥Éɽ¤«¤é
   IF x>9 THEN
      LET STR1$=CHR$(x-10+ORD("A")) !ABCD¡ÄXYZ  ¢¨N88·Ï¤ÏASC("A")
   ELSE
      LET STR1$=CHR$(x+ORD("0")) !0123¡Ä789  ¢¨STR$(x)¤Ç¤â²Ä
   END IF
END FUNCTION

¤Ä¤Å¤¯
 

Re: £î¿ÊË¡¤Ç¤Î½Û´Ä¾®¿ô¤Î·×»»

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 7·î11Æü(ÅÚ)10»þ50ʬ12ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.453[¸µµ­»ö¤Ø]

¤Ä¤Å¤­
FUNCTION frac2dec$(m,n,RADIX) !10¿Êˡʬ¿ô¡Êm/n¡Ë¤ò(RADIX)¿Ê¿ô¤Ç¾®¿ôɽ¼¨¤¹¤ë¤È¤­¤Îʸ»úÎó¤ËÊÑ´¹¤¹¤ë
   IF SGN(m)*SGN(n)<0 THEN LET cSGN$="-" ELSE LET cSGN$="" !Éä¹æ¤òÆÀ¤ë

   LET aa=ABS(m)
   LET b=ABS(n)

   LET t=GCD(aa,b) !ºÇÂç¸øÌó¿ô¤Çʬ»Ò¤ÈʬÊì¤òÌóʬ¤¹¤ë
   LET aa=aa/t
   LET b=b/t
   !!!PRINT aa;b;t !debug


   !À°¿ôÉô
   LET a=INT(aa/b) !¾®¿ôÉô¤òºï½ü¤¹¤ë

   LET b$="" !ÊÑ´¹¸å¤Î¿ô

   DO WHILE a>=RADIX !a=b[k]*RADIX^k+b[k-1]*RADIX^(k-1)+ ¡Ä +b[1]*RADIX^1+b[0]*RADIX^0¤è¤ê
      LET b$=STR1$(MOD(a,RADIX))&b$ !°ì¤Î°Ì¤«¤éµá¤Þ¤ë

      LET a=INT(a/RADIX) !¼¡¤Î·å¤Ø  ¢¨±¦¥·¥Õ¥È
   LOOP
   LET b$=STR1$(a)&b$


   !¾®¿ôÉô
   LET aa=MOD(aa,b) !À°¿ôÉô¤òºï½ü¤¹¤ë

   LET k=0 !¾®¿ôÉô¤Î·å¿ô

   DO UNTIL aa=0 !¾®¿ôÂ裱°Ì¤«¤é½ç¤Ë
      LET k=k+1
      IF k>MIN(b,Precision) THEN !½Û´Ä¾®¿ô¤Ë¤è¤ë¥ë¡¼¥×¤ò²óÈò¤¹¤ë
         PRINT "ÊÑ´¹¤òÂǤÁÀÚ¤ê¤Þ¤·¤¿¡£"
         EXIT DO
      END IF

      IF k=1 THEN !½é²ó¤Î¤ß
         LET b$=b$&"." !¾®¿ôÅÀ¤ò¤Ä¤±¤ë
         LET p=LEN(b$) !°ÌÃÖ¤òµ­Ï¿¤·¤Æ¤ª¤¯
      ELSE
         FOR i=1 TO k-1 !½Û´Ä¤·¤¿¤«¤É¤¦¤«³Îǧ¤¹¤ë
            IF s(i)=aa THEN EXIT DO !½Û´ÄÀá¤Ê¤é¡¢½ªÎ»¡ª
         NEXT i
      END IF
      LET s(k)=aa !¾®¿ôÂè£ë°Ì°Ê¹ß¡Ê̤Ÿ³«¤Î¾®¿ôÉô¡Ë¤Î¿ô¤òµ­Ï¿¤¹¤ë

      LET aa=aa*RADIX !º¸¥·¥Õ¥È¤·¤Æ¡¢¾¦¤òµá¤á¤ë
      LET a=INT(aa/b)
      LET b$=b$&STR1$(a) !a=S[-1]*RADIX^(-1)+S[-2]*RADIX^(-2)+ ¡Ä +S[-(k-1)]*RADIX^(-(k-1))+S[-k]*RADIX^(-k)¤è¤ê

      LET aa=MOD(aa,b) !¾ê;¤òµá¤á¤Æ¡¢¼¡¤Î·å¤Ø
   LOOP

   IF aa=0 THEN !Í­¸Â¾®¿ô¡ÊÀ°¿ô¤â´Þ¤à¡Ë¤Ê¤é
      LET p=k !Í­¸Â¾®¿ô¤Î·å¿ô
      LET k=0 !½Û´ÄÀá¤Î·å¿ô
   ELSE !½Û´Ä¾®¿ô¤Ê¤é
      LET b$(i+p:i+p)="["&b$(i+p:i+p) !³«»Ïµ­¹æ¤òÁÞÆþ
      LET b$=b$&"]" !½ªÎ»µ­¹æ

      LET p=i-1 !Í­¸Â¾®¿ô¤Î·å¿ô
      LET k=k-i !½Û´ÄÀá¤Î·å¿ô
   END IF

   LET frac2dec$=cSGN$&b$ !-9.9[9] ·Á¼°
END FUNCTION
!------------------------------ ¤³¤³¤Þ¤Ç¤¬¥µ¥Ö¥ë¡¼¥Á¥ó



!¡ü 0.[13](4)¤ò10¿ÊË¡¤Îʬ¿ô¤Çɽ¸½¤¹¤ë  Åú¤¨ 7/15

!¢¨ÅùÈæ¿ôÎó¤ÎÏ  ½é¹à 0.13(4)=1/4^1+3/4^2¡¢¸øÈæ 0.01(4)=1/4^2
!  LET a = 0. + (1/4^1+3/4^2)/(1-1/4^2)
!  PRINT a

PRINT ExBVAL("0.[13]",4)




!¡ü 1/7¤ò3¿ÊË¡¤Î¾®¿ô¡Ê½Û´Ä¤¹¤ë¡Ë¤Çɽ¸½¤¹¤ë  Åú¤¨ 0.[010212](3)

PRINT ExBSTR$(1/7,3)




!¡ü 0.1[23] ¡à 0.[14] ¤Î·ë²Ì¤ò½Û´Ä¾®¿ô¤Çɽ¤»¡£  Åú¤¨ 0.8[714285]

!É®»»
!  x=0.1[23]¤È¤¹¤ë¤È
!  100*x-x=12.3[23]-0.1[23]=12.2  ¡è99*x=122/10  ¡èx=61/495

LET t=ExVAL("0.1[23]") / ExVAL("0.[14]")
PRINT t, ExSTR$(t)




!¡ü 3/7 ¤ò¾®¿ô¤Çɽ¤·¤¿¤È¤­¡¢¾®¿ôÂ裸£°£°°Ì¤Î¿ô»ú¤òµá¤á¤è¡£  Åú¤¨ 2

LET x$=ExSTR$(3/7) !0.[428571]
LET y$=x$(POS(x$,"[")+1:POS(x$,"]")-1) !½Û´ÄÀá¤òÀÚ¤ê½Ð¤¹
LET x=MOD(800,LEN(y$)) !800/6=133 ;¤ê 2
PRINT y$(x:x)



END


10¿Ê15·å¥â¡¼¥É¤Î¾ì¹ç

ÀèƬ¤Î OPTION ARITHMETIC RATIONAL ¤ò¥³¥á¥ó¥È¥¢¥¦¥È¤·¤Æ¡¢
·×»»Éôʬ¤Î¥×¥í¥°¥é¥à¤Ï°Ê²¼¤Î¤â¤Î¤ËÃÖ¤­´¹¤¨¤Æ¡¢¡Ê¾®¿ô¢Îʬ¿ô¤Î¥ë¡¼¥Á¥ó¤òľÀܸƤӽФ¹¡Ë
10¿Ê15·å¥â¡¼¥É¤Ç¼Â¹Ô¤·¤Þ¤¹¡£
!¡ü 0.[13](4)¤ò10¿ÊË¡¤Îʬ¿ô¤Çɽ¸½¤¹¤ë  Åú¤¨ 7/15

!¢¨ÅùÈæ¿ôÎó¤ÎÏ  ½é¹à 0.13(4)=1/4^1+3/4^2¡¢¸øÈæ 0.01(4)=1/4^2
!  LET a = 0. + (1/4^1+3/4^2)/(1-1/4^2)
!  PRINT a

CALL dec2frac("0.[13]",4, m,n) !¾®¿ô¤òʬ¿ô¤Ø
PRINT m;"/";n




!¡ü 1/7¤ò3¿ÊË¡¤Î¾®¿ô¡Ê½Û´Ä¤¹¤ë¡Ë¤Çɽ¸½¤¹¤ë  Åú¤¨ 0.[010212](3)

PRINT frac2dec$(1,7, 3) !ʬ¿ô¤ò¾®¿ô¤Ø




!¡ü 0.1[23] ¡à 0.[14] ¤Î·ë²Ì¤ò½Û´Ä¾®¿ô¤Çɽ¤»¡£  Åú¤¨ 0.8[714285]

!É®»»
!  x=0.1[23]¤È¤¹¤ë¤È
!  100*x-x=12.3[23]-0.1[23]=12.2  ¡è99*x=122/10  ¡èx=61/495

CALL dec2frac("0.1[23]",10, m,n)
CALL dec2frac("0.[14]",10, x,y)
PRINT frac2dec$(m*y,n*x,10) !(m/n)¡à(x/y)=(m*y)¡à(n*x)




!¡ü 3/7 ¤ò¾®¿ô¤Çɽ¤·¤¿¤È¤­¡¢¾®¿ôÂ裸£°£°°Ì¤Î¿ô»ú¤òµá¤á¤è¡£  Åú¤¨ 2

LET x$=frac2dec$(3,7,10)
LET y$=x$(POS(x$,"[")+1:POS(x$,"]")-1) !½Û´ÄÀá¤òÀÚ¤ê½Ð¤¹
LET x=MOD(800,LEN(y$)) !800/6=133 ;¤ê 2
PRINT y$(x:x)
 

GIF ¥Õ¥¡¥¤¥ë¤Î²òÀϥġ¼¥ë

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 7·î13Æü(·î)02»þ17ʬ25ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ! GIF ¥Õ¥¡¥¤¥ë¤Î²òÀϥġ¼¥ë
!-------
OPTION CHARACTER BYTE
!
FILE GETNAME file$, "gif"
IF file$="" THEN
   PRINT "ÆþÎÏ¥Õ¥¡¥¤¥ë̾¤¬¡¢¤¢¤ê¤Þ¤»¤ó¡£"
   STOP
END IF
PRINT "ÆþÎÏ¥Õ¥¡¥¤¥ë¡§"& file$
!
OPEN #1: NAME file$, ACCESS INPUT
PRINT "---------"
CALL gif_head
DO
   CALL blocks_main
LOOP UNTIL b1$=CHR$(BVAL("3B",16))
PRINT "GIF ½ªÃ¼¥Ö¥í¥Ã¥¯"
CALL dump(b1$,16,"block label")
PRINT "---------"
CLOSE #1
IF c_p$>"" OR p_p$="" OR im$>"" OR ap$>"" OR co$>"" OR tx$>"" THEN STOP
PRINT "½½¿ÊBASIC ½ÐÎϤΠGIF ¥Õ¥¡¥¤¥ë¤Î¤è¤¦¤Ç¤¹¡£"

!----
SUB gif_head
   LET h$=""
   CALL readb( h$,13 )
   IF h$(1:3)="GIF" THEN PRINT "GIF ¥Ø¥Ã¥À¡¼" ELSE CALL error
   LET Xsw=   ORD(h$( 8: 8))*256+ORD(h$(7:7))
   LET Ysw=   ORD(h$(10:10))*256+ORD(h$(9:9))
   LET sflg=  ORD(h$(11:11)) ! ¥¹¥¯¥ê¡¼¥ó¾ðÊó¤Î¥Õ¥é¥°
   LET aspect=ORD(h$(13:13))
   LET b$=right$("0000000"& BSTR$(sflg,2) ,8)
   LET colpix=2^(BVAL(b$(2:4),2)+1)
   LET compal=2^(BVAL(b$(6:8),2)+1)
   CALL dumpASC(h$(1:6),8) ! GIF¼±ÊÌʸ»ú
   CALL dump(h$( 7: 8),16,"screen X_width "& STR$(Xsw))
   CALL dump(h$( 9:10),16,"screen Y_width "& STR$(Ysw))
   CALL dump(h$(11:11),16,"flags "& b$ )
   PRINT TAB(12);b$(1:1);":common_palette on=1/off=0"
   PRINT TAB(10);b$(2:4);":colors/pixel 2^(";b$(2:4);"b+1)= ";STR$(colpix)
   PRINT TAB(12);b$(5:5);":sort on=1/off=0  ÉÑÅ٤什ç( outer use)"
   PRINT TAB(10);b$(6:8);":common_palette colors 2^(";b$(6:8);"b+1)= ";STR$(compal)
   CALL dump(h$(12:12),16,"back_ground color_code")
   IF aspect=0 THEN LET b$=".." ELSE LET b$=STR$(aspect)
   CALL dump(h$(13:13),16,"¥¢¥¹¥Ú¥¯¥ÈÈæ pixel H:V=("& b$& "+15):64 =1:1( 00)" )
   CALL palette("common_¥Ñ¥ì¥Ã¥È", c_p$, sflg)
END SUB

!----
SUB blocks_main
   LET b1$=""
   CALL readb( b1$, 1)
   IF     b1$=CHR$(BVAL("21",16)) THEN !Äɲåǡ¼¥¿¡¦¥Ö¥í¥Ã¥¯
      CALL option_block
   ELSEIF b1$=CHR$(BVAL("2C",16)) THEN !²èÁü¥Ö¥í¥Ã¥¯
      CALL picture_block
   ELSEIF b1$=CHR$(BVAL("3B",16)) THEN !GIF ½ªÃ¼¥Ö¥í¥Ã¥¯
   ELSE
      CALL error
   END IF
END SUB

!---Äɲåǡ¼¥¿¡¦¥Ö¥í¥Ã¥¯¡£
SUB option_block
   PRINT "Äɲåǡ¼¥¿¡¦¥Ö¥í¥Ã¥¯"
   CALL readb( b1$,1) ! w9$= readb_last_byte
   IF     w9$=CHR$(BVAL("F9",16)) THEN
      LET im$=b1$
      CALL dump(im$,16,"¥¤¥á¡¼¥¸¥³¥ó¥È¥í¡¼¥ë¡¦¥Ö¥í¥Ã¥¯")
      CALL blocksNP1(im$)
      LET iflg=ORD(im$(4:4)) ! ¥Õ¥é¥°
      LET imtm=ORD(im$(6:6))*256+ORD(im$(5:5))
      LET tcol=ORD(im$(7:7))
      LET b$=right$("0000000"& BSTR$(iflg,2),8)
      CALL dump(im$(4:4),16,"flags "& b$ )
      PRINT TAB(10);b$(1:3);":blank"
      PRINT TAB(10);b$(4:6);":"
      PRINT TAB(14);"000=none( OR )"
      PRINT TAB(14);"001= OR( same as 000)"
      PRINT TAB(14);"010=remove all before( paint screen_BG before)"
      PRINT TAB(14);"011=remove last picture before"
      PRINT TAB(12);b$(7:7);":user click on=1/off=0"
      PRINT TAB(12);b$(8:8);":Æ©²áGIF¤ÎÆ©ÌÀ¿§¤Î¥¹¥¤¥Ã¥Á on=1/off=0"
      CALL dump(im$(5:6),16,"¥¢¥Ë¥á¡¼¥·¥ç¥óGIF¤Î¥Õ¥ì¡¼¥àɽ¼¨»þ´Ö(10msñ°Ì) "& STR$(imtm) )
      CALL dump(im$(7:7),16,"Æ©²áGIF¤ÎÆ©ÌÀ¿§ "& STR$(tcol) )
      CALL blocks(im$)
   ELSEIF w9$=CHR$(BVAL("FE",16)) THEN
      LET co$=b1$
      CALL dump(co$,16,"¥³¥á¥ó¥È¡¦¥Ö¥í¥Ã¥¯")
      CALL blocksASC(co$,100)
   ELSEIF w9$=CHR$(BVAL("FF",16)) THEN
      LET ap$=b1$
      CALL dump(ap$,16,"¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¡¦¥Ö¥í¥Ã¥¯")
      CALL blocksASC(ap$,1)
      IF ap$(4:11)="NETSCAPE" THEN
         CALL blocksNP1(ap$)
         CALL dump(ap$(16:16),16,"constant 1")
         LET rept=ORD(ap$(18:18))*256+ORD(ap$(17:17))
         CALL dump(ap$(17:18),16,"animation repeat number "& STR$(rept)& " (0=endless)" )
      END IF
      CALL blocksASC(ap$,100)
   ELSEIF w9$=CHR$(BVAL("01",16)) THEN
      LET tx$=b1$
      CALL dump(tx$,16,"¥Æ¥­¥¹¥È¡¦¥¤¥á¡¼¥¸¡¦¥Ö¥í¥Ã¥¯")
      CALL blocksASC(tx$,100)
   ELSE
      CALL error
   END IF
END SUB

SUB blocksNP1(d$)
   CALL readb(d$,1)             ! w9$= readb_last_byte ! =block Size
   CALL dump(w9$,16,"block size")
   IF w9$=CHR$(0) THEN EXIT SUB ! block End
   CALL readb(d$,ORD(w9$))      ! block data
END SUB

SUB blocks(d$)
   DO
      CALL readb(d$,1)             ! w9$= readb_last_byte ! =block Size
      CALL dump(w9$,16,"block size")
      IF w9$=CHR$(0) THEN EXIT SUB ! block End
      LET s=LEN(d$)
      CALL readb(d$,ORD(w9$))      ! block data
      CALL dump(d$(s+1:LEN(d$)),16,"")
   LOOP
END SUB

SUB blocksASC(d$,n) !n=¥Ö¥í¥Ã¥¯¿ô¤Î¾å¸Â
   FOR n=1 TO n
      CALL readb(d$,1)             ! w9$= readb_last_byte ! =block Size
      CALL dump(w9$,16,"block size")
      IF w9$=CHR$(0) THEN EXIT SUB ! block End
      LET s=LEN(d$)
      CALL readb(d$,ORD(w9$))      ! block data
      CALL dumpASC(d$(s+1:LEN(d$)),8)
   NEXT n
END SUB

SUB readb(d$,cx) !cx=bytes size
   FOR i=1 TO cx
      CHARACTER INPUT #1,IF MISSING THEN EXIT FOR :w9$
      LET d$=d$& w9$
   NEXT i
   IF i<=cx THEN CALL error
END SUB

SUB picture_block
   PRINT "²èÁü¥Ö¥í¥Ã¥¯"
   LET pi$=b1$
   CALL readb( pi$,9) ! w9$= readb_last_byte
   CALL dump(pi$(1:1),16,"block label")
   LET Xp0=ORD(pi$(3:3))*256+ORD(pi$(2:2))
   LET Yp0=ORD(pi$(5:5))*256+ORD(pi$(4:4))
   LET Xpw=ORD(pi$(7:7))*256+ORD(pi$(6:6))
   LET Ypw=ORD(pi$(9:9))*256+ORD(pi$(8:8))
   CALL dump(pi$(2:3),16,"picture.X0_position left "& STR$(Xp0))
   CALL dump(pi$(4:5),16,"picture.Y0_position top "& STR$(Yp0))
   CALL dump(pi$(6:7),16,"picture.X_width "& STR$(Xpw))
   CALL dump(pi$(8:9),16,"picture.Y_width "& STR$(Ypw))
   LET pflg=ORD(pi$(10:10)) ! ²èÁü¾ðÊó¤Î¥Õ¥é¥°
   LET b$=right$("0000000"& BSTR$(pflg,2),8)
   LET pripal=2^(BVAL(b$(6:8),2)+1)
   CALL dump(pi$(10:10),16,"flags "& b$ )
   PRINT TAB(12);b$(1:1);":private_palette on=1/off=0"
   PRINT TAB(12);b$(2:2);":interrace on=1/off=0, 1~step8 5~step8 3~step4 2~step2"
   PRINT TAB(12);b$(3:3);":sort on=1/off=0  ÉÑÅ٤什ç( outer use)"
   PRINT TAB(11);b$(4:5);":blank"
   PRINT TAB(10);b$(6:8);":private_palette colors 2^(";b$(6:8);"b+1)= ";STR$(pripal)
   CALL palette("private_¥Ñ¥ì¥Ã¥È", p_p$, pflg)
   !---
   PRINT "²èÁü¥Ç¡¼¥¿"
   LET pda$=""
   CALL readb( pda$,1)
   CALL dump(pda$,16,"ºÇ¾®¥Ç¡¼¥¿¡¦¥Ó¥Ã¥ÈĹ")
   !--- LZW ¥Ç¡¼¥¿¡Êsize:data, size:data, ¡Ä 0 ¡Ë
   CALL blocks(pda$)
END SUB

SUB palette(n$, p$, pf)
   PRINT n$;
   LET p$=""
   IF INT(pf/128)>0 THEN ! pf AND 0x80
      PRINT
      CALL readb(p$, 3*2^(MOD(pf,8)+1)) ! pf AND 0x07
      CALL dump(p$,3,"R G B")
   ELSE
      PRINT "¤Ï¡¢Í­¤ê¤Þ¤»¤ó¡£"
   END IF
END SUB

SUB error
   beep
   PRINT "File Error Stop"
   STOP
END SUB

!-------
FUNCTION bitand8(a,b)
   LET b9$="00000000"
   LET b8$=right$("0000000"& BSTR$(a,2),8)
   LET b7$=right$("0000000"& BSTR$(b,2),8)
   FOR b9=1 TO 8
      IF b8$(b9:b9)="1" AND b7$(b9:b9)="1" THEN LET b9$(b9:b9)="1"
   NEXT b9
   LET bitand8=BVAL(b9$,2)
END FUNCTION

FUNCTION bitor8(a,b)
   LET b9$="00000000"
   LET b8$=right$("0000000"& BSTR$(a,2),8)
   LET b7$=right$("0000000"& BSTR$(b,2),8)
   FOR b9=1 TO 8
      IF b8$(b9:b9)="1" OR b7$(b9:b9)="1" THEN LET b9$(b9:b9)="1"
   NEXT b9
   LET bitor8=BVAL(b9$,2)
END FUNCTION

!-------
SUB dump(d$,m,t$)
   FOR j=1 TO LEN(d$) STEP m
      LET ww$=right$("000"& BSTR$(adr,16),4)& " "
      FOR i=j TO MIN(j+m-1, LEN(d$))
         LET ww$=ww$& " "& right$("0"& BSTR$( ORD(d$(i:i)),16),2)
         LET adr=adr+1
      NEXT i
      IF t$>"" AND j<=m THEN LET ww$=ww$& " ;"& t$
      PRINT ww$ !¹Ôñ°Ì¡¢¥Æ¥­¥¹¥È²èÌ̤Υԥ«¤Ä¤­¸º¾¯¡¢¹â®¡£
   NEXT j
END SUB

SUB dumpASC(d$,m)
   FOR j=1 TO LEN(d$) STEP m
      LET ww$=right$("000"& BSTR$(adr,16),4)& " "
      FOR i=j TO MIN(j+m-1, LEN(d$))
         LET ww$=ww$& " "& right$("0"& BSTR$( ORD(d$(i:i)),16),2)
         LET adr=adr+1
      NEXT i
      LET ww$=ww$& REPEAT$(" ",3*m+6-LEN(ww$))& ";"""
      FOR i=j TO MIN(j+m-1, LEN(d$))
         IF " "<=d$(i:i) THEN LET ww$=ww$& d$(i:i) ELSE LET ww$=ww$& "."
      NEXT i
      LET ww$=ww$& """"
      PRINT ww$
   NEXT j
END SUB

END
 

ÏÀÍý¼°¤Î·×»»

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 7·î15Æü(¿å)16»þ08ʬ13ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ¡Ü¡¢¡¦±é»»»Ò¤Ï¡¢OR¡¢AND´Ø¿ô¤Çµ­½Ò¤¹¤ë¡£
³ÆÊÑ¿ô¤Ë¿¿ÍýÃÍɽ¤Î¥Ó¥Ã¥È¥Ñ¥¿¡¼¥ó¤òÀßÄꤷ¤Æ¡¢¼°¤ò·×»»¤·¤Æ¿¿ÍýÃÍɽ¤òÆÀ¤ë¡£
!ÏÀÍý¼°¤Î·×»»

DEF AND3(a,b,c)=AND(AND(a,b),c) !£³ÊÑ¿ô°Ê¾å¤Î¾ì¹ç
DEF AND4(a,b,c,d)=AND(AND(a,b),AND(c,d))
DEF OR3(a,b,c)=OR(OR(a,b),c)
DEF OR4(a,b,c,d)=OR(OR(a,b),OR(c,d))

LET C1=NT(0) !1¡¡¢¨¡Ý£±¤Î¥Ó¥Ã¥È¥Ñ¥¿¡¼¥ó
!------------------------------ ¤³¤³¤Þ¤Ç¤¬¥Þ¥¯¥í¤ÎÄêµÁ

LET N=3 !ÊÑ¿ô¤Î¿ô¡¡¢¨£±¡Á£µ

LET A=BOOL(N,1) !£Î¸Ä¤ÎÊÑ¿ô¤Î£±ÈÖÌÜ
LET B=BOOL(N,2)
LET C=BOOL(N,3)
!LET D=BOOL(N,4)
!LET E=BOOL(N,5)

LET nA=NT(A) !A' Ê丵
LET nB=NT(B)
LET nC=NT(C)
!LET nD=NT(D)
!LET nE=NT(E)


!¡üÏÀÍý¼°¤Î¿¿ÍýÃÍɽ¤ò¤Ä¤¯¤ë

PRINT BitPTN$(N, A); ":A"
PRINT BitPTN$(N, B); ":B"
PRINT BitPTN$(N, C); ":C"

LET f=OR3(AND3(A,B,C), AND3(A,nB,C), AND3(A,B,nC))
PRINT BitPTN$(N, f); ":ABC+AB'C+ABC'"
PRINT


!¡üÏÀÍý¼°¤ò¼ç²Ãˡɸ½àŸ³«¡¢¼ç¾èˡɸ½àŸ³«¤¹¤ë

LET f=OR(A,AND(B,C))
!PRINT BitPTN$(N, f); ":A+BC"

CALL PrintPDCF(N,f)
CALL PrintPCCF(N,f)
PRINT


!¡ü¥¯¥ï¥¤¥ó¡¦¥Þ¥¯¥é¥¹¥­¡¼Ë¡¡ÊQuine-McCluskey algorithm¡Ë¤Ç¼°¤ò´Êñ²½¤¹¤ë

!¥¹¥Æ¥Ã¥×£°¡¡ÏÀÍý¼°¤Î¿¿ÍýÃÍɽ¤ò¤Ä¤¯¤ë

LET f=OR4(AND3(nA,B,C),AND3(A,nB,C),AND3(A,B,nC),AND3(A,B,C))
!PRINT BitPTN$(N, f); ":A'BC+AB'C+ABC'+ABC"


!¥¹¥Æ¥Ã¥×£±¡¡ÏÀÍý¼°¤òºÇ¾®¹à¤Çµ­½Ò¤¹¤ë¡Ê¼ç²Ãˡɸ½àŸ³«¡Ë

DIM Term$(2^N) !ºÇ¾®¹à¤Î¥Ó¥Ã¥È¥Ñ¥¿¡¼¥ó
LET CntOfTerm=0 !ºÇ¾®¹à¤Î¿ô
FOR i=0 TO 2^N-1 !¿¿ÍýÃÍɽ¤ò£²¿ÊË¡¤Î¿ô¤È¤ß¤Ê¤·¤Æ¾®¤µ¤¤½ç¤Ë
   IF Bit(f,i)=1 THEN !ºÇ¾®¹à¤Ê¤é
      LET CntOfTerm=CntOfTerm+1
      LET Term$(CntOfTerm)=right$(REPEAT$("0",N-1)&BSTR$(i,2),N) !¥Ó¥Ã¥È¥Ñ¥¿¡¼¥ó¤Ï¡¢¡ÄDCBA½ç
   END IF
NEXT i
!FOR i=1 TO CntOfTerm !debug
!   PRINT Term$(i)
!NEXT i

IF CntOfTerm=0 THEN !¤¹¤Ù¤Æ£°¤Ê¤é¡¢½ªÎ»¡ª
   PRINT "0"
   STOP
ELSEIF CntOfTerm=2^N THEN !¤¹¤Ù¤Æ¤Î£±¤Ê¤é¡¢½ªÎ»¡ª
   PRINT "1"
   STOP
END IF


!¥¹¥Æ¥Ã¥×£²¡¡AB+AB'=A¤ò»È¤Ã¤Æ¡¢ºÇ¾®¹à¤ÎÊÑ¿ô¤ò¸º¤é¤¹

DIM wTerm$(100) !ºî¶ÈÍѤ˥³¥Ô¡¼¤¹¤ë
FOR i=1 TO CntOfTerm
   LET wTerm$(i)=Term$(i)
NEXT i
LET wCntOfTerm=CntOfTerm

DIM Term9$(2^N) !¼ç¹à¤Î¥Ó¥Ã¥È¥Ñ¥¿¡¼¥ó
LET CntOfTerm9=0 !¼ç¹à¤Î¿ô

DO
   DIM CHK(100) !°µ½Ì¤Î̵ͭ
   MAT CHK=ZER

   LET CntOfCompTRM=0 !°µ½Ì¤µ¤ì¤¿¹à¤Î¿ô

   FOR i=1 TO wCntOfTerm-1 !¤¹¤Ù¤Æ¤ÎÁȹ礻¤Ç¹Íθ¤¹¤ë
      FOR j=i+1 TO wCntOfTerm

         LET CntOf1=0 !¡Ö£±¡×¤Î¿ô
         FOR k=1 TO N !¥Ó¥Ã¥Èñ°Ì¤ÎÇÓ¾ŪÏÀÍýϤòµá¤á¤ë
            LET t1$=wTerm$(i)(k:k)
            LET t2$=wTerm$(j)(k:k)
            IF (t1$="1" AND t2$="0") OR (t1$="0" AND t2$="1") THEN !¡Ö£±¡×¤È¤¹¤ë
               LET CntOf1=CntOf1+1
               LET PosOf1=k !¾Ãµî¤µ¤ì¤ëÊÑ¿ô¤Î°ÌÃÖ
            ELSEIF (t1$="0" AND t2$="0") OR (t1$="1" AND t2$="1") THEN !¡Ö£°¡×¤È¤¹¤ë
            !skip it
            ELSEIF (t1$="-" AND t2$="-") THEN !¥Þ¥¹¥¯¡¦¥Ó¥Ã¥È¤Ê¤é
            !skip it
            ELSE !ÊÒÊý¤¬¥Þ¥¹¥¯¡¦¥Ó¥Ã¥È¤Ê¤é¡¢¸õÊä¤Ç¤Ï¤Ê¤¤¡ª
               LET CntOf1=N
               EXIT FOR
            END IF
         NEXT k

         IF CntOf1=1 THEN !AB+AB'=A¡Ê¥Ï¥ß¥ó¥°µ÷Î¥¤¬£±¡Ë¤è¤ê¡¢¾Ãµî¤¹¤ë
            LET t$=wTerm$(i) !¥Ó¥Ã¥È¥Ñ¥¿¡¼¥ó
            LET t$(PosOf1:PosOf1)="-" !¤½¤ÎÊÑ¿ô¤ò¾Ãµî¤¹¤ë

            LET CHK(i)=1 !°µ½Ì¤¢¤ê
            LET CHK(j)=1

            DIM CompTRM$(100)
            FOR k=1 TO CntOfCompTRM !Ʊ¤¸¹à¤¬¤¢¤ë¤«³Îǧ¤¹¤ë
               IF t$=CompTRM$(k) THEN EXIT FOR
            NEXT k
            IF k>CntOfCompTRM THEN !¤Ê¤±¤é¤Ð¡¢¿·µ¬¤ËÅÐÏ¿¤¹¤ë
               LET CntOfCompTRM=CntOfCompTRM+1
               LET CompTRM$(CntOfCompTRM)=t$

               !PRINT i;j; t$ !debug
            END IF
         END IF

      NEXT j
   NEXT i

   LET Cnt=0 !º£²ó°µ½Ì¤Ç¤­¤Ê¤«¤Ã¤¿¹à¤Î¿ô
   FOR i=1 TO wCntOfTerm !°µ½Ì¤µ¤ì¤Ê¤¤¤â¤Î¤Ï¡¢¼ç¹à¤È¤Ê¤ë
      IF CHK(i)=0 THEN
         LET Cnt=Cnt+1

         LET CntOfTerm9=CntOfTerm9+1 !¼ç¹à¤È¤·¤Æµ­Ï¿¤¹¤ë
         LET Term9$(CntOfTerm9)=wTerm$(i)
      END IF
   NEXT i

   IF Cnt=wCntOfTerm THEN EXIT DO !¤¹¤Ù¤Æ°µ½Ì¤Ç¤­¤Ê¤±¤ì¤Ð¡¢½ªÎ»¡ª


   FOR i=1 TO CntOfCompTRM !¼¡¤Ø
      LET wTerm$(i)=CompTRM$(i) !copy it
   NEXT i
   LET wCntOfTerm=CntOfCompTRM

LOOP


!¥¹¥Æ¥Ã¥×£³¡¡¼ç¹àɽ¤ò»È¤Ã¤Æ¾éĹ¤Ê¼ç¹à¤òºï½ü¤¹¤ë

!¥¹¥Æ¥Ã¥×£³¡Ý£±¡¡¼ç¹àɽ¤ò¤Ä¤¯¤ë

DIM TT(CntOfTerm9,CntOfTerm) !¼ç¹àɽ¡Ê¿Þ¡Ë¡¡¢¨TT(¼ç¹à,ºÇ¾®¹à)
MAT TT=ZER

FOR i=1 TO CntOfTerm9 !ºÇ¾®¹à¤òÊñ´Þ¤¹¤ë¼ç¹à¤Ë¥Á¥§¥Ã¥¯¤òÆþ¤ì¤ë
   FOR j=1 TO CntOfTerm
      FOR k=1 TO N
         LET t$=Term9$(i)(k:k)
         IF t$<>"-" THEN !¥Þ¥¹¥¯¡¦¥Ó¥Ã¥È°Ê³°¤¬ÉÔ°ìÃפʤ顢½ªÎ»¡ª
            IF t$<>Term$(j)(k:k) THEN EXIT FOR
         END IF
      NEXT k
      IF k>N THEN LET TT(i,j)=1 !¤¹¤Ù¤Æ¤Î¥Ó¥Ã¥È¤¬°ìÃפ¹¤ì¤Ð¡¢Êñ´Þ¤¹¤ë
   NEXT j
NEXT i
!MAT PRINT TT; !debug


!¥¹¥Æ¥Ã¥×£³¡Ý£²¡¡¼ç¹àɽ¤«¤éɬ¿Ü¹à¤òõ¤¹

DIM CHK2(CntOfTerm9) !ɬ¿Ü¹à¤È¤·¤Æ¥Á¥§¥Ã¥¯¤¹¤ë
MAT CHK2=ZER

MAT CHK=ZER
FOR j=1 TO CntOfTerm !¼ç¹àɽ¤«¤éɬ¿Ü¹à¤òõ¤¹
   LET Cnt=0
   FOR i=1 TO CntOfTerm9 !Îó¤ÇÁöºº¤·¤Æ¡¢¡Ö£±¡×¤¬£±¤Ä¤ÎÎó¤ò¸«¤Ä¤±¤ë
      IF TT(i,j)=1 THEN
         LET Cnt=Cnt+1
         LET PosOf1=i !¹Ô°ÌÃÖ
      END IF
   NEXT i
   IF Cnt=1 THEN !£±¤Ä¤Î¤â¤Î¤Ï¡¢É¬¿Ü¹à¤È¤¹¤ë
      LET CHK2(PosOf1)=1
      FOR k=1 TO CntOfTerm !ɬ¿Ü¹à¤À¤±¤ÇºÇ¾®¹à¤òÊñ´Þ¤¹¤ë¤«¡Ê¾éĹÀ­¡Ë
         LET CHK(k)=OR(CHK(k),TT(PosOf1,k))
      NEXT k
   END IF
NEXT j
!MAT PRINT CHK; !debug
!MAT PRINT CHK2;


¤Ä¤Å¤¯
 

Re: ÏÀÍý¼°¤Î·×»»

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 7·î15Æü(¿å)16»þ09ʬ38ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.456[¸µµ­»ö¤Ø]

¤Ä¤Å¤­
!¥¹¥Æ¥Ã¥×£³¡Ý£³¡¡É¬¿Ü¹à¤ÈÁªÂò¹à¤ÎÁȤ߹ç¤ï¤»¤Ç²áÉÔ­¤Ê¤¯¹à¤òÁª¤Ö

DO
   FOR j=1 TO CntOfTerm !Êñ´Þ¤µ¤ì¤Æ¤¤¤Ê¤¤²Õ½ê¤òõ¤¹
      IF CHK(j)=0 THEN EXIT FOR
   NEXT j
   IF j>CntOfTerm THEN EXIT DO !ɬ¿Ü¹à¡ÜÁªÂò¹à¤ÇºÇ¾®¹à¤òÊñ´Þ¤¹¤ë¤Ê¤é¡¢½ªÎ»¡ª

   FOR i=1 TO CntOfTerm9 !¤½¤Î²Õ½ê¤òÁªÂò¹à¤ÇËä¤á¤ë
      IF TT(i,j)=1 THEN !¹Ô°ÌÃÖ
         LET CHK(j)=2
         LET CHK2(i)=2 !ÁªÂò¹à¤Ë²Ã¤¨¤ë
         EXIT FOR
      END IF
   NEXT i
   !MAT PRINT CHK; !debug
   !MAT PRINT CHK2;
LOOP



!·ë²Ì¤òɽ¼¨¤¹¤ë

FOR i=1 TO CntOfTerm9
   IF CHK2(i)>0 THEN !ɬ¿Ü¹à¤Þ¤¿¤ÏÁªÂò¹à¤Ê¤é
      PRINT "+";
      FOR k=0 TO N-1 !ÊÑ¿ô¤Ø
         SELECT CASE Term9$(i)(N-k:N-k) !¥Ó¥Ã¥È¥Ñ¥¿¡¼¥ó¤òÆÀ¤ë¡¡¢¨¡ÄDCBA½ç
         CASE "0"
            PRINT CHR$(k+ORD("A"));"'"; !ÈÝÄê
         CASE "1"
            PRINT CHR$(k+ORD("A"));
         CASE ELSE !"-"
         END SELECT
      NEXT k
   END IF
NEXT i
PRINT


END


EXTERNAL FUNCTION BOOL(N,i) !¿¿ÍýÃÍɽ¤Ç¤ÎÊÑ¿ôA¡ÁZ¤Î¥Ó¥Ã¥È¥Ñ¥¿¡¼¥ó¡Ê2^N ·å¡Ë¤òµá¤á¤ë
LET t$=REPEAT$("1",2^(i-1))&REPEAT$("0",2^(i-1)) !11¡Ä100¡Ä0
LET BOOL=BVAL(REPEAT$(t$,2^(N-i)),2) !A,B,C,¡Ä
END FUNCTION


!½ÐÎÏ´ØÏ¢
EXTERNAL SUB PrintPDCF(N,f) !¿¿ÍýÃÍɽ¤ò¼ç²Ãˡɸ½à·Á¡ÊÁª¸Àɸ½à·Á¡Ë¤Ç½ÐÎϤ¹¤ë
FOR i=0 TO 2^N-1
   IF Bit(f,i)=1 THEN !ºÇ¾®¹à
      PRINT "+";
      FOR x=0 TO N-1
         PRINT CHR$(x+ORD("A")); !ÊÑ¿ô̾
         IF Bit(i,x)=0 THEN PRINT "'"; !ÈÝÄêµ­¹æ
      NEXT x
   END IF
NEXT i
PRINT
END SUB

EXTERNAL SUB PrintPCCF(N,f) !¿¿ÍýÃÍɽ¤ò¼ç¾èˡɸ½à·Á¡ÊÏ¢¸Àɸ½à·Á¡Ë¤Ç½ÐÎϤ¹¤ë
FOR i=0 TO 2^N-1
   IF Bit(f,i)=0 THEN !ºÇÂç¹à
      PRINT "(";
      FOR x=0 TO N-1
         PRINT "+";
         PRINT CHR$(x+ORD("A")); !ÊÑ¿ô̾
         IF Bit(i,x)=1 THEN PRINT "'"; !ÈÝÄêµ­¹æ
      NEXT x
      PRINT ")";
   END IF
NEXT i
PRINT
END SUB


!Êä½õ¥ë¡¼¥Á¥ó
EXTERNAL FUNCTION Bit(x,m) !m¥Ó¥Ã¥ÈÌܤòÆÀ¤ë¡¡0,1
LET Bit=MOD(INT(x/2^m),2)
END FUNCTION

EXTERNAL FUNCTION BitPTN$(N,a) !¥Ó¥Ã¥È¥Ñ¥¿¡¼¥ó¡Ê2^N ·å¡Ë¤òµá¤á¤ë
IF a>=0 THEN
   LET a$=REPEAT$("0",2^N-1)&BSTR$(a,2)
ELSE
   LET a$=BSTR$(a+2^32,2)
END IF
LET BitPTN$=right$(a$,2^N)
END FUNCTION


!ÏÀÍý±é»»
EXTERNAL FUNCTION AND(a,b) !À°¿ôa,b¤Î¥Ó¥Ã¥Èñ°Ì¤Ç¤ÎÏÀÍýÀѤòµá¤á¤ë
LET c=0
FOR i=0 TO 31
   LET aa=MOD(a,2)
   LET a=(a-aa)/2
   LET bb=MOD(b,2)
   LET b=(b-bb)/2
   LET c=c+MIN(aa,bb)*2^i
NEXT i
IF c>=2^31 THEN LET c=c-2^32
LET AND=c
END FUNCTION

EXTERNAL FUNCTION OR(a,b) !À°¿ôa,b¤Î¥Ó¥Ã¥Èñ°Ì¤Ç¤ÎÏÀÍýϤòµá¤á¤ë
LET c=0
FOR i=0 TO 31
   LET aa=MOD(a,2)
   LET a=(a-aa)/2
   LET bb=MOD(b,2)
   LET b=(b-bb)/2
   LET c=c+MAX(aa,bb)*2^i
NEXT i
IF c>=2^31 THEN LET c=c-2^32
LET OR=c
END FUNCTION

EXTERNAL FUNCTION NT(a) !À°¿ôa¤Î¥Ó¥Ã¥Èñ°Ì¤Ç¤ÎÏÀÍýÈÝÄê¤òµá¤á¤ë¡¡¢¨NOT¤ÏͽÌó¸ì¤Î¤¿¤á
LET NT=-1-a
END FUNCTION
 

GIF ¥¢¥Ë¥á¡Ý¥·¥ç¥ó ¤òºî¤ë¡£

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 7·î16Æü(ÌÚ)03»þ59ʬ38ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ! GIF Animation ¤òºî¤ë¡£
!-------

OPTION CHARACTER BYTE
SET ECHO "OFF"

LET ofile$="DecAnima.GIF" ! ºï½ü¤¹¤ë¤È¡¢¥À¥¤¥¢¥í¥°¡¦¥Ü¥Ã¥¯¥¹ÆþÎÏ¡£
ASK DIRECTORY s$
IF ofile$>"" THEN PRINT "¥«¥ì¥ó¥È DIR¡§"& s$ ELSE file getname ofile$, "gif"
PRINT "½ÐÎÏ¥Õ¥¡¥¤¥ë¡§"& ofile$
IF ofile$>"" THEN PRINT "¾å½ñ¤­¡£Ëô¤ÏºîÀ®¤µ¤ì¤Þ¤¹¡£¡Ä"& "Ok¡©[Enter]"
IF ofile$>"" THEN CHARACTER INPUT k$
IF ofile$="" OR k$<>CHR$(13) THEN
   PRINT "Ãæ»ß"
   STOP
END IF

!-------
!http://www.nikkeibp.co.jp/archives/251/251739.html
!LZW°µ½Ì¥¢¥ë¥´¥ê¥º¥àÆõö¡¢¹ñÆâ¤Ç¤Ï2004ǯ6·î20Æü¤Ë¼º¸ú ¡Ä
!¡¡¡ÄGIF²èÁü¥Õ¥¡¥¤¥ë¤òɽ¼¨¡¦À¸À®¤¹¤ë¥½¥Õ¥È¤Î³«È¯¤¬¼«Í³¤Ë¡Ä¤Ê¤ë¡£

!-----------
! ¼Í±ÆÊÑ´¹ ( SAMPLE\TRANSFO9.BAS ¤«¤é¡¢ÇÒ¼Ú¡Ë
DIM T(4,4),m(501,501)
MAT T=IDN

PICTURE House
   SET AREA COLOR 15
   PLOT AREA:    0, 1;   0,  0;   2,  0;   2,  1 !ÊÉ
   SET AREA COLOR 2
   PLOT AREA:  -0.6,1;  2.6, 1;   2,  2;   0,  2 !²°º¬
   SET AREA COLOR 10
   PLOT AREA:  0.1, 0; 0.1,0.8; 0.5,0.8; 0.5,  0 !¥É¥¢
   SET AREA COLOR 5
   PLOT AREA: 1.4,0.4; 1.9,0.4; 1.9,0.8; 1.4,0.8 !Áë
   SET AREA COLOR 12
   PLOT AREA:  1.7, 2; 1.7,2.3; 1.5,2.3; 1.5,  2 !±ìÆÍ
END PICTURE

SET WINDOW -5,5,-5,5
ASK PIXEL SIZE (-1.1,4.3 ; 4.6,-.5) Xw,Yw
MAT m=ZER(Xw,Yw)
!screen& picture.xw =Xw
!screen& picture.yw =Yw
LET obits0=4 !¡Ê 2= 2¿§~4¿§, 3= 8¿§, 4=16¿§, ¡Ä 8=256¿§)
!
CALL gif_header
CALL applica_blk(0) !repeat number, 0=end less
!
LET N000=2^obits0 !encoder colors max.  ¡ÄͽÌóÅÐÏ¿ÈÖ¹æºÇÂçÃÍ+1
LET t_max= 2000   ! ɽ¼¨¤Îthead ¤è¤êÂ礭¤¤ÄøÅ٤ˡ¢¾®¤µ¤¤¤È¼­½ñ¥¯¥ê¥¢¡¼ÉÑÅÙÁý¡£
DIM dic_0(0 TO t_max, 0 TO N000-1), dic_1(0 TO t_max, 0 TO N000-1) !µÕ°ú¤­¼­½ñ
!
FOR i9=-PI TO 0*PI+.01 STEP PI/2
   LET a=(1+COS(i9))/2
   LET T(1,4)= .1*a
   LET T(2,4)=-.1*a
   SET DRAW mode hidden
   CLEAR
   DRAW axes
   SET AREA COLOR 6 !Æ©²á¿§¤Ë»ÈÍÑ
   PLOT AREA: -1.1,-.5; 4.6,-.5; 4.6,4.3; -1.1,4.3
   DRAW House WITH T*ROTATE(-PI/20*a)*SCALE(1.72)
   ASK PIXEL ARRAY (-1.1,4.3) m
   SET DRAW mode explicit
   !----
   READ dly
   DATA 140,20,100
   !CALL img_ctl_blk( dly,BVAL("00001000",2), 6) !Æ©²á¤µ¤»¤Ê¤¤¡¢Á´É½¼¨
   CALL img_ctl_blk( dly,BVAL("00001001",2), 6) !ɽ¼¨»þ´Ö(x10ms),iflg,Æ©²á¿§
   CALL picture_blk
   CALL picture_data
   !----
NEXT i9
CALL gif_terminater

!---------
!²èÁüÇÛÎó m(1~Xw,1~Yw) !! Ãí°Õ x,y ¤Î½ç mat read m(y,x)
SUB inppix             !! ask pixel array(x0,y0) m(x,y)
   LET lx=lx+1
   IF Xw< lx THEN
      LET lx=1
      LET ly=ly+1
   END IF
   IF ly<=Yw THEN LET bx=m(lx,ly) ! data on bx
END SUB

SUB picture_data
   PRINT #1: CHR$(obits0); !ºÇ¾®¥Ç¡¼¥¿¡¼¥Ó¥Ã¥ÈĹ ¡ÄͽÌóÅÐÏ¿ÈÖ¹æ¤ÎºÇÂç¥Ó¥Ã¥ÈĹ
   LET blkfull=255         !block size max.(~~255)
   LET bitfull=12          !  LZW bits max.(~~ 12)
   CALL LZW_encoder
   CALL outcode       !flush registered dic.number on ax
   LET ax=N000+1      !code end
   CALL outcode
   CALL out_flush
   PRINT #1: CHR$(0); !block size 0 (end)
END SUB

SUB LZW_encoder
   LET lx=1 -1 !²èÁüÇÛÎó m(1~Xw,1~Yw)
   LET ly=1
   CALL inppix             !data on bx
   LET pdata$=""           !clear output bytes buffer
   LET oacc$=""            !clear output bits buffer
   LET owidth=obits0+1     !starting bit width
   DO
      LET ax=N000          !reset code
      CALL outcode
      MAT dic_0=ZER        !clear dic.number
      MAT dic_1=ZER        !clear dic.chain
      LET thead=1          !reset make_table pointer
      LET dicnum=N000+2    !reset dictionary new number
      LET owidth=obits0+1  !starting bit width
      DO
         LET di=0                  !top table
         LET dic_0(di,bx)=bx
         DO
            LET ax=dic_0(di,bx)    !---latch last chained register
            IF dic_1(di,bx)>0 THEN LET di=dic_1(di,bx) ELSE CALL make_table
            CALL inppix            ! next bx
            IF Yw< ly THEN EXIT SUB
         LOOP UNTIL dic_0(di,bx)=0 !---until no register
         LET dic_0(di,bx)=dicnum   ! new register, bx=tail
         CALL outcode              !write last register
         LET owidth=LEN( BSTR$(dicnum,2) ) ! remake owidth
         LET dicnum=dicnum+1
      LOOP UNTIL dicnum>2^bitfull-1 OR thead>t_max !bits full or dic.full
   LOOP
END SUB

SUB make_table
   LET dic_1(di,bx)=thead !chained table pointer
   LET di=thead           !new table head
   LET thead=thead+1
END SUB

SUB outcode
   LET oacc$=right$("00000000000"& BSTR$(ax,2),owidth)& oacc$
   DO WHILE LEN(oacc$)>=8
      LET pdata$=pdata$& CHR$(BVAL(right$(oacc$,8),2))
      LET oacc$=oacc$(1:LEN(oacc$)-8)
      IF LEN(pdata$)=blkfull THEN CALL bw_sub
   LOOP
END SUB

SUB bw_sub
   PRINT #1: CHR$(LEN(pdata$)); pdata$;
   LET pdata$=""
   PRINT "thead=";thead;" dicnum=";dicnum  !--monitor
END SUB

SUB out_flush
   IF oacc$<>"" THEN LET pdata$=pdata$& CHR$(BVAL(oacc$,2) )
   LET oacc$=""
   IF pdata$>"" THEN CALL bw_sub
   PRINT "------"  !--monitor
END SUB

!=============
SUB gif_header
   PRINT "½èÍýÃæ"
   OPEN #1: NAME ofile$
   ERASE #1
   PRINT #1: "GIF89a";
   CALL prt_2dw( Xw,Yw )
   ! ---sflg---
   !  1: common-palet-ON
   !xxx: colors_bits/pixel 2^(xxxb+1)
   !  0: sort-OFF
   !xxx: colors_bits/common-palet 2^(xxxb+1)
   LET sflg=BVAL("10000000",2)+(obits0-1)*16+(obits0-1)
   PRINT #1: CHR$(sflg);
   PRINT #1: CHR$(0); ! back ground color
   PRINT #1: CHR$(0); ! ¥¢¥¹¥Ú¥¯¥ÈÈæ if n=0 then 1:1 else H:V=(n+15):64
   ! common_palette
   FOR i=0 TO 2^obits0-1
      ASK COLOR MIX(i) r,g,b
      PRINT #1: CHR$(r*255);CHR$(g*255);CHR$(b*255); ! R G B
   NEXT i
END SUB

SUB applica_blk(rp)
   CALL prt_BVAL16("21,FF") ! ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¡¦¥Ö¥í¥Ã¥¯
   PRINT #1: CHR$(11);            !block size
   PRINT #1: "NETSCAPE2.0";       !¥¢¥×¥ê¥±¡¼¥·¥ç¥ó̾(8) ¥Ð¡¼¥¸¥ç¥ó(3)
   PRINT #1: CHR$(3);             !block size
   PRINT #1: CHR$(1);             !constant 1
   PRINT #1: CHR$(MOD(rp,256));CHR$(IP(rp/256)); !repeat number  0=endless
   PRINT #1: CHR$(0);             !block size 0 (end)
END SUB

SUB img_ctl_blk( Dtm,iflg,tco )
   CALL prt_BVAL16("21,F9") ! ¥¤¥á¡¼¥¸¥³¥ó¥È¥í¡¼¥ë¡¦¥Ö¥í¥Ã¥¯
   PRINT #1: CHR$(4);       !block size
   ! ---iflg---
   !000:blank
   !010: 000=none( OR )
   !     001= OR( same as 000)
   !     010=remove all before( paint screen-BG before)
   !     011=remove last picture before
   !  0:user click-OFF
   !  0:Æ©²áGIF¤ÎÆ©ÌÀ¿§¤Î¥¹¥¤¥Ã¥Á 1=ON 0=OFF
   PRINT #1: CHR$(iflg);
   PRINT #1: CHR$(MOD(Dtm,256));CHR$(IP(Dtm/256)); !ɽ¼¨»þ´Ö(x10ms)
   PRINT #1: CHR$(tco);  !Æ©²áGIF¤ÎÆ©ÌÀ¿§
   PRINT #1: CHR$(0);    !block size 0 (end)
END SUB

SUB picture_blk
   CALL prt_BVAL16("2C") ! ²èÁü¡¦¥Ö¥í¥Ã¥¯
   CALL prt_2dw( 0,0 )   !picture.x0=0,y0=0
   CALL prt_2dw( Xw,Yw ) !picture.xw,yw =screen.xw,yw
   ! ---pflg---
   !  0:private-palet-OFF
   !  0:interrace-OFF
   !  0:sort-OFF
   ! 00:blank
   !xxx:private-palette-bits 2^(xxxb+1)
   LET pflg=BVAL("00000000",2)
   PRINT #1: CHR$(pflg);
END SUB

SUB gif_terminater
   PRINT #1: CHR$(BVAL("3B",16));
   CLOSE #1
   PRINT "½ªÎ»"
END SUB

!-----------
SUB prt_2dw( dw1,dw2 )
   PRINT #1: CHR$(MOD(dw1,256));CHR$(IP(dw1/256));
   PRINT #1: CHR$(MOD(dw2,256));CHR$(IP(dw2/256));
END SUB

SUB prt_BVAL16(h$)
   FOR i=1 TO LEN(h$) STEP 3
      PRINT #1: CHR$(BVAL(h$(i:i+1),16));
   NEXT i
END SUB

END
 

Re: ¥»¥ó¥¿¡¼»î¸³ÄøÅÙ¤Î¥×¥í¥°¥é¥à±é½¬

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 7·î20Æü(·î)07»þ23ʬ26ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.413[¸µµ­»ö¤Ø]

!ÌäÂ꣱¡¡¼«Á³¿ôn¤ËÂФ·¤Æ¡¢¤½¤ÎÌó¿ô¤ÎϤòµá¤á¤ë
!60¤Î¾ì¹ç
PRINT 1+2+3+4+5+6+10+12+15+20+30+60


!¡ü¼ÂºÝ¤Ëµá¤á¤Æ¡¢¤½¤ÎϤò·×»»¤¹¤ë
LET n=60 !µá¤á¤ë¿ô

LET s=0 !ÏÂ
LET c=0 !¸Ä¿ô

FOR f=1 TO SQR(n) !¸Ä¿ô¤ÎȾʬ¤Þ¤Ç
   IF MOD(n,f)=0 THEN !³ä¤êÀÚ¤ì¤ë¤Ê¤é
      IF n/f=f THEN !¾¦¤È³ä¤Ã¤¿¿ô¤¬Æ±¤¸¤È¤­¡¢£±¤Ä
      !PRINT f
         LET s=s+f
         LET c=c+1
      ELSE !¾¦¤È³ä¤Ã¤¿¿ô¤¬°Û¤Ê¤ë¤È¤­¡¢¥Ú¥¢¤Çµá¤Þ¤ë
      !PRINT f; n/f
         LET s=s+f+n/f
         LET c=c+2
      END IF
   END IF
NEXT f

PRINT "ÏÂ=";s, "¸Ä¿ô=";c



!¡üÁÇ°ø¿ôʬ²ò
!¡¡n=p^a*q^b*r^c* ¡Ä ¡¢ÁÇ¿ôp,q,r,¡Ä¡¢À°¿ôa,b,c,¡Ä ¤Ê¤é
!¡¡ÏÂ (p^0+p^1+p^2+ ¡Ä +p^a)*(q^0+q^1+q^2+ ¡Ä +q^b)*(r^0+r^1+r^2+ ¡Ä +r^c)* ¡Ä
!¡¡¸Ä¿ô (a+1)*(b+1)*(c+1)* ¡Ä

!60=2^2*3^1*5^1 ¤è¤ê
PRINT (2^0+2^1+2^2)*(3^0+3^1)*(5^0+5^1) !ÏÂ
PRINT (2+1)*(1+1)*(1+1) !¸Ä¿ô

!¤Þ¤¿¡¢¥«¥Ã¥³¤ÎÃæ¤ÏÅùÈæ¿ôÎó¤è¤ê¡¡¢¨ÏÂSn=a*(1-r^n)/(1-r)¡¢½é¹àa¡¢¸øÈær¡¢¹à¿ôn
LET t1=1*(1-2^3)/(1-2) !2^0+2^1+2^2
LET t2=1*(1-3^2)/(1-3) !3^0+3^1
LET t3=1*(1-5^2)/(1-5) !5^0+5^1
PRINT t1*t2*t3



!¡üÁÇ°ø¿ôʬ²ò¤Î¥×¥í¥°¥é¥à¤Ë¾åµ­¤Î»»½ÐÊýË¡¤òÁȹþ¤à
LET n=60 !µá¤á¤ë¿ô

LET s=1 !ÏÂ
LET c=1 !¸Ä¿ô

LET f=2
DO UNTIL f>SQR(n)
   LET k=0
   DO WHILE MOD(n,f)=0 !³ä¤êÀÚ¤ì¤ë¤Ê¤é
   !PRINT f;
      LET k=k+1 !¸Ä¿ô
      LET n=n/f
   LOOP
   LET s=s * 1*(1-f^(k+1))/(1-f) !ÅùÈæ¿ôÎó¤ÎÏ ¦²[i=0,k+1]f^i
   LET c=c * (k+1) !0,1,2,¡Ä,k

   LET f=f+1 !¼¡¤Ø
LOOP
IF n>1 THEN !»Ä¤ê¤Î°ø¿ô
!PRINT n
   LET s=s * 1*(1-n^(1+1))/(1-n)
   LET c=c * (1+1)
END IF

PRINT "ÏÂ=";s, "¸Ä¿ô=";c



!ÌäÂꣲ¡¡¼«Á³¿ôn¤ËÂФ·¤Æ¡¢¤½¤ÎÌó¿ô¤ÎµÕ¿ô¤ÎϤòµá¤á¤ë
!60¤Î¾ì¹ç
PRINT 1/1+1/2+1/3+1/4+1/5+1/6+1/10+1/12+1/15+1/20+1/30+1/60 !Âê°Õ¤è¤ê

PRINT (60+30+20+15+12+10+6+5+4+3+2+1)/60 !ÄÌʬ¤¹¤ë¤È¡¢Ìó¿ô¤ÎÏ¡ี¤Î¿ô



!ÌäÂꣳ¡¡¼«Á³¿ôn¤ËÂФ·¤Æ¡¢¤½¤ÎÌó¿ô¤ÎÀѤòµá¤á¤ë
!60¤Î¾ì¹ç
PRINT 1*2*3*4*5*6*10*12*15*20*30*60


!¡üÁÇ°ø¿ôʬ²ò
!¡¡n=p^a*q^b*r^c* ¡Ä ¡¢ÁÇ¿ôp,q,r,¡Ä¡¢À°¿ôa,b,c,¡Ä ¤Ê¤é
!¡¡ÀÑ SQR( n^{(a+1)*(b+1)*(c+1)* ¡Ä } )
!¡¡ÀÑ p^{a*(a+1)*(b+1)*(c+1)* ¡Ä /2} * q^{b*(a+1)*(b+1)*(c+1)* ¡Ä /2} * r^{c*(a+1)*(b+1)*(c+1)* ¡Ä /2} * ¡Ä

!60=2^2*3^1*5^1 ¤è¤ê
PRINT SQR(60^12) !SQR(¸µ¤Î¿ô^Ìó¿ô¤Î¸Ä¿ô)

LET t1=2*(2+1)*(1+1)*(1+1)/2
LET t2=1*(2+1)*(1+1)*(1+1)/2
LET t3=1*(2+1)*(1+1)*(1+1)/2
PRINT 2^t1 * 3^t2 * 5^t3


END
 

LZW ¥¨¥ó¥³¡¼¥À¡¼¤È¡¢¥Ç¥³¡¼¥À¡¼

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 7·î21Æü(²Ð)18»þ32ʬ53ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.458[¸µµ­»ö¤Ø]

! LZW ¥¨¥ó¥³¡¼¥À¡¼¤È¡¢¥Ç¥³¡¼¥À¡¼
!-----------
OPTION CHARACTER byte
DIM m(501,501)
LET obits0=2             !¡Ê 2= 2¿§~4¿§, 3= 8¿§, 4=16¿§, ¡Ä 8=256¿§)
LET N000=2^obits0        ! ¿§¿ô¡ÊͽÌó¤ÎÅÐÏ¿ÈÖ¹æºÇÂç+1¡Ë
!
LET t_max= 1000  !¡á»È¤ï¤ì¤¿¿§¿ô£ø¼­½ñ¤Ø¤ÎÅÐϿʸ»ú¤ÎŤµ¡£(ÉÔ¾Ü)¡ÚµÕ°ú¤­¼­½ñ¡Û
!                ! ¡¡¾®¤µ¤¤¤È¼­½ñ¥¯¥ê¥¢¡¼ÉÑÅÙÁý¤·¡¢°µ½Ì½ÐÎÏ¥µ¥¤¥º¤Ï¡¢°­²½¤¹¤ë¤¬¡¢
!                !¡¡¤½¤Îʬ¡¢Éü¸µÂ¦¤â¡¢¼­½ñ¤Î¥á¥â¥ê¡¼¾ÃÈñ¤Ï¡¢¸º¤ë¡£
DIM dic_0(0 TO t_max, 0 TO N000-1), dic_1(0 TO t_max, 0 TO N000-1) !encoder ¼­½ñ
!
LET blkfull=255          ! block size max.(~~255)
LET bitfull=12           ! LZW bits max.(~~ 12)
DIM dic$(0 TO 2^bitfull) ! decoder ¼­½ñ¡¢¼ýǼ¤Ï¡¢¿·µ¬¤ÎÅÐÏ¿ÈÖ¹æºÇÂç¤Þ¤Ç¡£
!
!------------------- ¥Æ¥¹¥È¸¶²è¤ÎºîÀ® -----------------------------------
LET Xw=4
LET Yw=3
MAT m=ZER(Yw,Xw)
MAT READ m
!MAT m=BVAL("03",16)*CON(Yw,Xw)
!     £´¿§(2bits) ²£:£´ ½Ä:£³ ¤Î¡¢¥Æ¥¹¥È¡¦¥Ñ¥¿¡¼¥ó
DATA  0,1,2,3
DATA  0,1,2,3
DATA  0,1,2,3
!
PRINT "******************* ¸¶²è¥Ñ¥¿¡¼¥ó"; Xw;"x";Yw
FOR j=1 TO Yw
   LET ww$=""
   FOR i=1 TO Xw
      LET ww$=ww$& right$("0"& BSTR$(m(j,i),16),2)& " "
   NEXT i
   PRINT ww$
NEXT j
!
CALL picture_data !¡¡¾åµ­¥Ñ¥¿¡¼¥ó¤ò ¼ÂºÝ¤Ë¡¢Encode ¤¹¤ë¡£¸¶²è¢ª LZW$
CALL decomp_data  !¡¡¾å¤ÎEncode ½ÐÎϤò ¼ÂºÝ¤Ë¡¢Decode ¤¹¤ë¡£LZW$¢ª ¸¶²è

!------------------------------------------------------------------------
!¾å¤Î¥Ñ¥¿¡¼¥ó¤ÎÎã
! 02              !¡¡ºÇ¾®¥Ç¡¼¥¿¡¼¥Ó¥Ã¥ÈĹ¡¡¡Ä ͽÌóÅÐÏ¿ÈÖ¹æ(0~n-1) ¤Î¥Ó¥Ã¥ÈĹ
! 05              !¡¡block size¡Ê¥Ð¥¤¥È¡Ë
! 44 34 86 3A 05  !¡ÄLZW compression bit stream
! 00              !¡¡block end 0
!
!Éü¸µÂ¦ LZW_decoder ÆþÎϤϡ¢²¼¤ÎÍͤËʤ٤ơ¢º¸ ¢« ±¦ ¤Ø¸þ¤«¤Ã¤ÆÆɤ߼è¤ë¡£
!³«»Ï¤Ï¡¢¼­½ñ ½é´ü²½¥³¡¼¥É(n+0) ¤Î¥Ó¥Ã¥ÈĹ¤Ç¡¢»Ï¤á¤ë°Ù¤Ë¡¢£±¥Ó¥Ã¥ÈŤ¤=3

!0~n-1= (0,1,2,3)¡§Í½ÌóÅÐÏ¿Èֹ桡¢«ºÇ¾®¥Ç¡¼¥¿¡¼¥Ó¥Ã¥ÈĹ=2 ¤Î°ÕÌ£¡£
!¡¡n+0= 4        ¡§ÆþÎϳ«»Ï¥Ó¥Ã¥ÈŤò¡¢½é´üÃÍ=3 ¤ËÌ᤹¡£¼­½ñ¤Î¥¯¥ê¥¢
!¡¡n+1= 5        ¡§½èÍý¤Î½ªÎ»
!¡¡n+2= 6        ¡§¼­½ñ¡¢¥¹¥¿¡¼¥È¤Î¿·µ¬ÅÐÏ¿ÈÖ¹æ
!(ÅÐÏ¿ÈÖ¹æ) ¤«¤é¼­½ñ¤òÆɤó¤À»þ¤Ï¡¢¼¡¤ÎÈֹ桢
!(ÅÐÏ¿ÈÖ¹æ+1) ¤ÎÀèƬ£±data ¤â¸å¤ËÉղ乤롣
!                                 <--------
!                     05       3A       86       34       44
!               00000101 00111010 10000110 00110100 01000100
!         0000 0101 0011 1010 1000 0110 0011 010 001 000 100
!LZW12V           5    3    A    8    6    3   2   1   0   4
!ÅÐÏ¿ÈÖ ¹æ              D    C    B    A    9   8   7   6
!--------------------------------------------------------------
!Éü¸µdata      (n+1)   3    0    2    0    3   2   1   0  (n+0)
!           code end        1    3    1                  reset
!                           2
!------------------------------------------------------------------------
! LZW12V¥³¡¼¥É¤Î·åÉý¤Ï¡¢Ä¾Á°¤ÎÅÐÏ¿ÈÖ¹æ¤ÈƱ¤¸Éý¤ÇϢư¡¢12bit¤Þ¤ÇÁýÂ礹¤ë¡£
!------------------------------------------------------------------------
!¸¶ »Ï  |        |Encorder|        |GIF    |Decorder
!¥Ç¡¼¥¿|¥Ð¥Ã¥Õ¥¡|¼­½ñÆâÍÆ|ÅÐÏ¿ÈÖ¹æ|LZW12V |¼­½ñÆâÍÆ ¡ÄÉü¸µ¥Ç¡¼¥¿¤Ç¤â¤¢¤ë
!                         110b     100b    ¡Ä½é´ü²½¥³¡¼¥É4(n)
!0      0
!1      01       01       110b     000b    0
!2      12       12       111b     001b    1
!3      23       23       1000b    010b    2
!0      30       30       1001b    0011b   3
!1      01
!2      012      012      1010b    0110b   01
!3      23
!0      230      230      1011b    1000b   23
!1      01
!2      012
!3      0123     0123     1100b    1010b   012
!       3                 1101b    0011b   3
!                                  0101b   ¡Ä½ªÎ»¥³¡¼¥É5(n+1)
!ºÇ¾®¥Ç¡¼¥¿¡¼¥Ó¥Ã¥ÈŤÎÈϰϤϣ²¡Á£¸¤Ç¡¢£±¤Ï̵¤¯£²¿§£´¿§¤Î¶èÊÌ̵¤·¡£
!LZW_encoder ¤Ï ºÇ¾®¥Ç¡¼¥¿¡¼¥Ó¥Ã¥ÈŤÎÃͤÀ¤±¤¬ »ÙÇÛŪ¤Ç¡¢£²¿§¤Ç¤â¡¢
!LZW ¥³¡¼¥É¤Ï¡¢£²¥Ó¥Ã¥È£±²èÁÇ(0,1,2,3) ¤Ç½èÍý¡¢(,,2,3) ¤Ï¡¢¶õÀÊ¡£


!------------------- ¸¶²è¤«¤é¡¢²èÁü¥Ç¡¼¥¿ LZW$ ¤ÎºîÀ®¡£------------------
!²èÁüÇÛÎó m(1~Yw,1~Xw) !! Ãí°Õ x,y ¤Î½ç mat read m(y,x)
SUB inppix             !! ask pixel array(x0,y0) m(x,y)
   LET lx=lx+1
   IF Xw< lx THEN
      LET lx=1
      LET ly=ly+1
   END IF
   IF ly<=Yw THEN LET bx=m(ly,lx) ! data on bx
END SUB

SUB picture_data
   PRINT "******************* °µ½Ì( LZW ¥¨¥ó¥³¡¼¥É )"
   LET LZW$=CHR$(obits0)
   CALL prthex(CHR$(obits0),"ºÇ¾®¥Ç¡¼¥¿¡¼¥Ó¥Ã¥ÈĹ") !ͽÌóÅÐÏ¿ÈÖ¹æºÇÂç¤Î¥Ó¥Ã¥ÈĹ
   !---
   CALL LZW_encoder
   CALL outcode            !flush last chained dic.number on ax
   LET ax=N000+1
   CALL outcode            !code end
   CALL out_flush
   !---
   LET LZW$=LZW$& CHR$(0)  !block end
   CALL prthex(CHR$(0),"block size") !¥â¥Ë¥¿¡¼
END SUB

SUB LZW_encoder
   LET lx=1 -1 !²èÁüÇÛÎó start pointer
   LET ly=1
   CALL inppix             !data on bx
   LET pdata$=""           !clear output byte buffer
   LET oacc$=""            !clear output bit buffer
   LET owidth=obits0+1     !starting bit width
   DO
      LET ax=N000          !reset code
      CALL outcode
      MAT dic_0=ZER        !clear dic.number
      MAT dic_1=ZER        !clear dic.chain
      LET thead=1          !reset make_table pointer
      LET dicnum=N000+2    !reset new dic.number
      LET owidth=obits0+1  !starting bit width
      DO
         LET di=0                  !top table
         LET dic_0(di,bx)=bx       !bx as reserved dic.number
         DO
            LET ax=dic_0(di,bx)    !---latch last chained dic.number
            IF dic_1(di,bx)>0 THEN LET di=dic_1(di,bx) ELSE CALL make_table
            CALL inppix            ! next bx
            IF Yw< ly THEN EXIT SUB
         LOOP UNTIL dic_0(di,bx)=0 !---until no dic.number
         LET dic_0(di,bx)=dicnum   ! new dic.number, bx as tail& next top
         CALL outcode              ! write ax, last chained dic.number
         LET owidth=LEN( BSTR$(dicnum,2) ) ! remake owidth
         LET dicnum=dicnum+1
      LOOP UNTIL dicnum>2^bitfull-1 OR thead>t_max !bits full or dic.full
   LOOP
END SUB

SUB make_table
   LET dic_1(di,bx)=thead !chained table pointer
   LET di=thead           !new table head
   LET thead=thead+1
END SUB

SUB outcode
   LET oacc$=right$("00000000000"& BSTR$(ax,2),owidth)& oacc$
   DO WHILE LEN(oacc$)>=8
      LET pdata$=pdata$& CHR$(BVAL(right$(oacc$,8),2))
      LET oacc$=oacc$(1:LEN(oacc$)-8)
      IF blkfull=LEN(pdata$) THEN CALL bw_sub
   LOOP
END SUB

SUB bw_sub
   LET LZW$=LZW$& CHR$(LEN(pdata$))& pdata$
   CALL prthex( CHR$(LEN(pdata$)),"block size")      !¥â¥Ë¥¿¡¼
   CALL prthex( pdata$,"LZW compression bit stream") !¥â¥Ë¥¿¡¼
   LET pdata$=""
END SUB

SUB out_flush
   IF oacc$<>"" THEN LET pdata$=pdata$& CHR$(BVAL(oacc$,2) )
   LET oacc$=""
   IF pdata$>"" THEN CALL bw_sub
END SUB

!---------------- ¥â¥Ë¥¿¡¼¶¦Ḁ̈ѡ¼¥Ä
SUB prthex(d$,w$)
   LET ww$=""
   FOR ii=1 TO LEN(d$)
      LET ww$=ww$& right$("0"& BSTR$(ORD(d$(ii:ii)),16),2)& " "
   NEXT ii
   IF w$>"" THEN LET ww$=ww$& "; "& w$
   PRINT ww$
END SUB


!------------------- ²èÁü¥Ç¡¼¥¿ LZW$ ¤«¤é¡¢¸¶²è¤ØÌ᤹¡£------------------
SUB decomp_data
   PRINT "******************* Éü¸µ( LZW ¥Ç¥³¡¼¥É )"
   LET obits0=ORD(LZW$(1:1))
   CALL prthex(CHR$(obits0),"ºÇ¾®¥Ç¡¼¥¿¡¼¥Ó¥Ã¥ÈĹ") !¥â¥Ë¥¿¡¼
   LET N000=2^obits0
   LET li=2                               !start input pointer
   LET blkend=0                           !clear input block pointer
   LET iacc$=""                           !clear input bit buffer
   LET pdata$=""                          !clear output byte buffer
   CALL LZW_decoder
   FOR i=1 TO LEN(pdata$) STEP Xw
      CALL prthex(pdata$(i:i+Xw-1),"")    !¥â¥Ë¥¿¡¼
   NEXT i
   !--- check block_end
   CALL prthex( LZW$(li:li),"block size") !¥â¥Ë¥¿¡¼
END SUB

SUB LZW_decoder
   DO
      LET dicnum=N000+2-1                   !start dic.number-1
      DO
         LET iwidth=LEN( BSTR$(dicnum,2) )  !remake iwidth
         IF  bitfull< iwidth THEN LET iwidth=bitfull !to handle BAD encode
         LET dicnum=dicnum+1
         CALL inpcode                       !data on bx
         IF bx=-1 OR bx=N000+1 THEN
            EXIT SUB
         ELSEIF bx=N000 THEN
            EXIT DO
         ELSE
            IF bx< N000 THEN
               LET dic$(dicnum)=CHR$(bx)
            ELSE
               LET dic$(dicnum)=dic$(bx)
               LET dic$(dicnum)=dic$(dicnum)& dic$(bx+1)(1:1)
            END IF
            LET pdata$=pdata$& dic$(dicnum)
         END IF
      LOOP
   LOOP
END SUB

SUB inpcode
   LET bx=-1
   DO WHILE LEN(iacc$)< iwidth
      IF blkend<=li THEN
         LET blksize=ORD(LZW$(li:li))
         CALL prthex(CHR$(blksize),"block size") !¥â¥Ë¥¿¡¼
         IF blksize=0 THEN EXIT SUB
         LET li=li+1
         LET blkend=li+blksize
      END IF
      LET iacc$=right$("0000000"& BSTR$(ORD(LZW$(li:li)),2),8)& iacc$
      LET li=li+1
   LOOP
   LET bx=BVAL(right$(iacc$,iwidth),2)
   LET iacc$=iacc$(1:LEN(iacc$)-iwidth)
END SUB

END
 

½¤Àµ¥á¥â

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 7·î22Æü(¿å)21»þ24ʬ21ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.460[¸µµ­»ö¤Ø]

LZW_decoder Æâ¤ËÂ礭¤Ê¥Ð¥°¤¬¡¢Í­¤ê¤Þ¤·¤¿¡£¤¹¤ß¤Þ¤»¤ó¡¢Á´¥ê¥¹¥È¸ò´¹¤·¤Æ²¼¤µ¤¤¡£
IF bx=999 ¡Á¡¢LET bx=999¡¡¡¡¡ÊÄûÀµ¡Ë¢ªIF bx=-1 ¡Á¡¢LET bx=-1

¡ãÄɵ­¡ä
°ìÈ̤ΠGIF ¥Õ¥¡¥¤¥ë¤ÎÃæ¤Ë¤Ï¡¢12bitÉý¤ÎÅÐÏ¿Èֹ椬¡¢(0~4095)¤ò±Û¤¨¤Æ¡¢ 2^12(4096)
13bit ¤Þ¤Ç¹Ô¤¯¤â¤Î¤¬¡¢¾¯¤Ê¤¤¤Ç¤¹¤¬¡¢Í­¤ê¤Þ¤·¤¿¡£
¡Ê¸å³¤ÎÉä¹æ¤¬¡¢13bit ¤Î
¡¡¥ê¥»¥Ã¥È¡¦¥³¡¼¥É¤Ë¤Ê¤Ã¤Æ¡¢´Ö¤Ë¹ç¤ï¤Ê¤¤½ê¤ò¡¢ÌµÍý¤Ë¡¢12bit¤Ç¡¢¥Ç¥³¡¼¥É¤µ¤»¤ë¡£¡Ë

  IF  bitfull< iwidth THEN LET iwidth=bitfull !to handle BAD encode

LZW_decoder Ãæ¡¢¤³¤Î¹Ô¤ÎÄɲäϡ¢¤½¤ÎÂкö¤Ç¤¹¡£¤½¤ÎÂå¤ï¤ê¡¢
LZW_decoder ¤Î»ý¤Ä½ÀÆð¤Ç¡¢Ç¤°Õ¤Î bitÉý¤Ø¤Î Äɽ¾À­¤¬¼º¤ï¤ì¡¢bitfull=12 ¤Ç¤Ê¤¤¤È¡¢
12bit ¤Î¥Ç¥³¡¼¥É¤¬¡¢½ÐÍè¤Þ¤»¤ó¡£
¾åµ­¤ÎÍͤÊ(ÉÔÀµ?)¥¨¥ó¥³¡¼¥ÉÂбþ¡¢¤¬¡¡Ìµ¤±¤ì¤Ð¡¢bitfull=15 ¤Ç¤â¡¢¤½¤ì°Ê¾å¤Ç¤â¡¢
¥¨¥ó¥³¡¼¥À¡¼¤Ë½¾Â°¤·¤Æ¡¢12bit ¤â·óÍѤǡ¢¥Ç¥³¡¼¥É½ÐÍè¤Þ¤¹¡£
 

Re: ¥»¥ó¥¿¡¼»î¸³ÄøÅÙ¤Î¥×¥í¥°¥é¥à±é½¬

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 7·î23Æü(ÌÚ)11»þ11ʬ48ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.459[¸µµ­»ö¤Ø]

¼«Á³¿ôn¤ò£²¤Ä°Ê¾å¤ÎϢ³¤¹¤ë¼«Á³¿ô¤ÎϤËʬ²ò¤¹¤ë
!¡ü¿ôÎó¤Ë¤è¤ë¥¢¥×¥í¡¼¥Á

!Îã. n=9¤Î¾ì¹ç
!¡¡1+2+3+4+5+ ¡Ä +9¡¡£´¤Ç¾ò·ï¤òËþ¤¿¤µ¤Ê¤¤
!¡¡¡¡2+3+4+5+ ¡Ä +9¡¡£´¤Ç¾ò·ï¤òËþ¤¿¤¹
!¡¡¡¡¡¡3+4+5+ ¡Ä +9¡¡£µ¤Ç¾ò·ï¤òËþ¤¿¤µ¤Ê¤¤
!¡¡¡¡¡¡¡¡4+5+ ¡Ä +9¡¡£µ¤Ç¾ò·ï¤òËþ¤¿¤¹
!¡¡¡¡¡¡¡¡¡¡¡§
!¡¡¡¡¡¡¡¡¡¡¡¡ 7+8+9¡¡£¸¤Ç¾ò·ï¤òËþ¤¿¤µ¤Ê¤¤
!¡¡¡¡¡¡¡¡¡¡¡¡¡¡ 8+9¡¡£¹¤Ç¾ò·ï¤òËþ¤¿¤µ¤Ê¤¤
!¹â¡¹n¤Þ¤Ç¤ÎϤòµá¤á¤Æ¡¢¸µ¤Î¿ô¤ËÅù¤·¤¯¤Ê¤ë¤«³Îǧ¤¹¤ë

LET n=9 !µá¤á¤ë¿ô

FOR a=1 TO n-1 !½é¹à
   LET s=0
   FOR m=a TO n !¹â¡¹£î¤Þ¤Ç¤ÎÏÂ
      LET s=s+m

      IF s=n THEN !Åù¤·¤¤¤Ê¤é
         FOR k=a TO m !·ë²Ì¤òɽ¼¨¤¹¤ë
            PRINT "+";k;
         NEXT k
         PRINT "=";s !¸¡»»
      END IF

      IF s>=n THEN EXIT FOR !¤³¤ì°Ê¹ß¤Ï¾ò·ï¤òËþ¤¿¤µ¤Ê¤¤¤Î¤Ç¡¢¼¡¤Ø
   NEXT m
NEXT a


!¡üÊ̲ò

LET n=9 !µá¤á¤ë¿ô

FOR a=1 TO n-1 !½é¹à
   LET d=1 !½é¹àa¡¢¸øº¹d¤ÎÅùº¹¿ôÎó¤ÎÂèm¹à¤Þ¤Ç¤ÎÏÂ
   FOR m=1 TO n !¹â¡¹£î¹à¤Þ¤Ç
      LET s=m*(2*a+(m-1)*d)/2 !Ϥθø¼°

      IF s=n THEN !Åù¤·¤¤¤Ê¤é
         FOR k=1 TO m !·ë²Ì¤òɽ¼¨¤¹¤ë
            PRINT "+";a+(k-1)*d; !°ìÈ̹à¤Î¸ø¼°
         NEXT k
         PRINT "=";s !¸¡»»
      END IF

      IF s>=n THEN EXIT FOR !¤³¤ì°Ê¹ß¤Ï¾ò·ï¤òËþ¤¿¤µ¤Ê¤¤¤Î¤Ç¡¢¼¡¤Ø
   NEXT m
NEXT a



!¡ü£²¼¡ÊýÄø¼°¤Î²ò¤Ë¤è¤ë¥¢¥×¥í¡¼¥Á

!Îã. n=9¤Î¾ì¹ç
!¡¡¡¡1+2+3+4+5+ ¡Ä +t¡¡a=1¡¢t=3.772¡Ä
!¡¡1+¡¡2+3+4+5+ ¡Ä +t¡¡a=2¡¢t=4
!¡¡1+2+¡¡3+4+5+ ¡Ä +t¡¡a=3¡¢t=4.424¡Ä
!¡¡1+2+3+¡¡4+5+ ¡Ä +t¡¡a=4¡¢t=5
!¡¡¡¡¡¡¡¡¡¡¡§
!¡¡1+2+3+4+5+6+ 7+8+t¡¡a=7¡¢t=7.262¡Ä
!¡¡1+2+3+4+5+6+7+ 8+t¡¡a=8¡¢t=8.116¡Ä
!1¡Ák¤Þ¤Ç¤ÎϤÏk*(k+1)/2¤è¤ê¡¢a,a+1,¡Ä,t¤Þ¤Ç¤ÎϤϡ¢t*(t+1)/2-(a-1)*a/2¤È¤Ê¤ë¡£
!¤³¤ì¤¬n¤ÈÅù¤·¤¤¡£a¤ò¸ÇÄꤹ¤ë¤È¡¢£²¼¡ÊýÄø¼° t^2+t-(2*n+(a-1)*a)=0 ¤Î²ò¤È¤Ê¤ë¡£

LET n=9 !µá¤á¤ë¿ô

FOR a=1 TO n-1 !a¤ò¸ÇÄꤹ¤ë
   LET D=1*1-4*1*(-(2*n+(a-1)*a)) !ȽÊ̼°
   IF D>=0 THEN !¼Â¿ô²ò¤Ê¤é
      LET t=(-1+SQR(D))/2 !£±¤ÄÌܤβò
      !PRINT a;t !debug
      IF t>0 AND INT(t)=t THEN !t¤Ï¼«Á³¿ô¤Ê¤é
         FOR k=a TO t !·ë²Ì¤òɽ¼¨¤¹¤ë
            PRINT "+";k;
         NEXT k
         PRINT "=";t*(t+1)/2-(a-1)*a/2 !¸¡»»
      END IF

      LET t=(-1-SQR(D))/2 !£²¤ÄÌܤβò¡¡¢¨¤³¤Á¤é¤¬¾ò·ï¤òËþ¤¿¤¹¤³¤È¤Ï¤Ê¤¤
      !PRINT a;t !debug
      IF t>0 AND INT(t)=t THEN
         FOR k=a TO t
            PRINT "+";k;
         NEXT k
         PRINT "=";t*(t+1)/2-(a-1)*a/2
      END IF
   END IF
NEXT a



!¡üÌó¿ô¤Ë¤è¤ë¥¢¥×¥í¡¼¥Á

!Îã. n=9¤Î¾ì¹ç
!¡¡Ìó¿ô¤Ï1,3,9¡££±¤ò½ü¤¯´ñ¿ô¤ÎÌó¿ô¤ËÃåÌܤ¹¤ë¡£
!¡¡¤¿¤È¤¨¤Ð¡¢£î¤¬£³¤Ç³ä¤êÀÚ¤ì¤ë¤³¤È¤è¤ê¡¢£³Åùʬ¤Ç¤­¤ë¡£¤¹¤Ê¤ï¤Á¡¢n=9=3+3+3¤È¤Ê¤ë¡£
!¡¡£³¤Î¤È¤­¡¢n=3+(3)+3=(3-1)+£³+(3+1)=2+£³+4 ¤È¿¿¤óÃæ¤Î£³¤ò´ð½à¤Ë¡¢ÊÑ·Á¤¹¤ë¡£
!¡¡£¹¤Î¤È¤­¡¢n=1+1+1+1+(1)+1+1+1+1
!¡¡¡¡¡¡¡¡¡¡¡¡ =(1-4)+(1-3)+(1-2)+(1-1)+£±+(1+1)+(1+2)+(1+3)+(1+4)
!¡¡¡¡¡¡¡¡¡¡¡¡ =(-3)+(-2)+(-1)+0+£±+2+3+4+5
!¡¡¡¡¡¡¡¡¡¡¡¡ =4+5

LET n=9 !µá¤á¤ë¿ô

FOR f=2 TO n !£±¤ò½ü¤¯Ìó¿ô¤ò¤ß¤Ä¤±¤ë
   IF MOD(n,f)=0 THEN

      IF MOD(f,2)=1 THEN !´ñ¿ô¤ËÃåÌܤ¹¤ë
         LET c=INT(f/2)+1 !¿¿¤óÃæ¤Î°ÌÃÖ¤òÆÀ¤Æ¡¢¤½¤ì¤ò´ð½à¤ËÊÑ·Á¤¹¤ë

         LET s=0 !Á껦Éôʬ¤ÎÈϰϤòÆÀ¤ë
         FOR i=1 TO f
            LET k=n/f + (i-c) !fÅùʬ¡Þ1,2,3,¡Ä
            !PRINT i;k !debug
            LET s=s+k
            IF s>0 THEN PRINT "+";k;
         NEXT i
         PRINT "=";s !¸¡»»
      END IF

   END IF
NEXT f


!¡üÊ̲ò¡¡´ñ¿ô¤¬Ï¢Â³¤¹¤ë£²¤Ä¤Î¼«Á³¿ô¤ÎϤÇɽ¤µ¤ì¤ë

!Îã. n=9¤Î¾ì¹ç
!¡¡Ìó¿ô¤Ï1,3,9¡££±¤ò½ü¤¯´ñ¿ô¤ÎÌó¿ô¤ËÃåÌܤ¹¤ë¡£
!¡¡¤¿¤È¤¨¤Ð¡¢£î¤¬£³¤Ç³ä¤êÀÚ¤ì¤ë¤³¤È¤è¤ê¡¢£³¤ÏÇÜ¿ô¤È¤Ê¤ë¡£¤¹¤Ê¤ï¤Á¡¢n=£³*3=£³+£³+£³¡£
!¡¡¤³¤Î£³¤òϢ³¤¹¤ë£²¤Ä¤Î¼«Á³¿ô¤ÎϤÇɽ¤¹¤È¡¢3=£±+£²¡£
!¡¡»Ä¤ê¤Î£³¤â¡¢¤³¤ì¤ò´ð½à¤Ë£±¡Ý1,2,3,¡Ä¡¢£²¡Ü1,2,3,¡Ä¤ÎϤÇɽ¤¹¡£
!¡¡£³¤Î¤È¤­¡¢n=3*3=3+3+3=(1+2)+(0+3)+(-1+4)=-1+0+1+2+3+4=2+3+4 ¤ÈÊÑ·Á¤¹¤ë¡£
!¡¡£¹¤Î¤È¤­¡¢n=9*1=9=(4+5)

LET n=9 !µá¤á¤ë¿ô

FOR f=2 TO n !Ìó¿ô¤ò¤ß¤Ä¤±¤ë
   IF MOD(n,f)=0 THEN

      IF MOD(f,2)=1 THEN !´ñ¿ô¤ËÃåÌܤ¹¤ë
         LET c=(f-1)/2 !Ϣ³¤¹¤ë£²¤Ä¤Î¼«Á³¿ôc,c+1¤ÎϤˤ¹¤ë

         LET s=0 !Á껦Éôʬ¤ÎÈϰϤòÆÀ¤ë
         FOR k=c-n/f+1 TO c+n/f !ÊÑ·Á¤·¤¿¼°¤ò·×»»¤¹¤ë
         !PRINT k !debug
            LET s=s+k
            IF s>0 THEN PRINT "+";k;
         NEXT k
         PRINT "=";s !¸¡»»
      END IF

   END IF
NEXT f


END
 

GIF ¥Õ¥¡¥¤¥ë¤Î²òÀϥġ¼¥ë Ver.2¡Ê²èÁüÉÕ¡Ë

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 7·î31Æü(¶â)00»þ29ʬ15ÉÃ
ÊÖ¿®¡¦°úÍÑ
  !Page-2 ¤Î»Ï¤á
!------------------- ²èÁü¥Ç¡¼¥¿ LZW$ ¤«¤é¡¢¸¶²è¤ò¸«¤ë¡£------------------
SUB decomp_data
   PRINT "******************* Éü¸µ( LZW ¥Ç¥³¡¼¥É )"
   LET obits0=ORD(LZW$(1:1))
   CALL prthex(CHR$(obits0),"ºÇ¾®¥Ç¡¼¥¿¡¼¥Ó¥Ã¥ÈĹ") !¥â¥Ë¥¿¡¼
   LET N000=2^obits0
   LET li=2                               !start input pointer
   LET blkend=0                           !clear input block pointer
   LET iacc$=""                           !clear input bit buffer
   LET pdata$=""                          !clear output byte buffer
   CALL LZW_decoder
   PRINT "Last_code LEN(LZW$) LEN(pdata$)=";bx;LEN(LZW$);LEN(pdata$) !¥â¥Ë¥¿¡¼
   !---
   IF tmod=3 THEN MAT m3=m
   LET ii=1
   IF interl=0 THEN
      CALL intlace( 0, 1) ! start_raster, step !---NO interlace
   ELSE
      CALL intlace( 0, 8) ! start_raster, step !---0~7step8
      WAIT DELAY .5
      CALL intlace( 4, 8) ! start_raster, step !---4~7step8
      WAIT DELAY .5
      CALL intlace( 2, 4) ! start_raster, step !---2~3step4
      WAIT DELAY .5
      CALL intlace( 1, 2) ! start_raster, step !---1~1step2
   END IF
   IF tmod=2 THEN MAT m=ncp(256)*CON ! 256= ¥·¥¹¥Æ¥àÇØ·Ê¿§
   IF tmod=3 THEN MAT m=m3
   !--- check block_end
   CALL prthex( LZW$(li:li),"block size") !¥â¥Ë¥¿¡¼
   PRINT "******************* Éü¸µ½ª¤ê"
END SUB

SUB intlace( ss, stp)
   FOR j=Yp0 TO Yp0+Ypw-1
      IF MOD(j-Yp0, stp) >=ss THEN
         IF MOD(j-Yp0, stp) >ss THEN LET ii=ii-Xpw
         FOR i=Xp0 TO Xp0+Xpw-1
            WHEN EXCEPTION IN
               LET col=ORD(pdata$(ii:ii))
               IF t_on<>1 OR tcol<>col THEN LET m(i,j)=ncp(col)
               LET ii=ii+1
            USE
            END WHEN
         NEXT i
      END IF
   NEXT j
   MAT PLOT CELLS,IN 0,0; Xsw-1,Ysw-1 :m
END SUB

!-------------
SUB LZW_decoder
   DO
      LET dicnum=N000+2-1                   !start dic.number-1
      DO
         LET iwidth=LEN( BSTR$(dicnum,2) )  !remake iwidth
         IF  bitfull< iwidth THEN LET iwidth=bitfull !to handle BAD file
         LET dicnum=dicnum+1
         CALL inpcode                       !data on bx
         IF bx=-1 OR bx=N000+1 THEN
            EXIT SUB
         ELSEIF bx=N000 THEN
            EXIT DO
         ELSE
            IF bx< N000 THEN
               LET dic$(dicnum)=CHR$(bx)
            ELSE
               LET dic$(dicnum)=dic$(bx)
               LET dic$(dicnum)=dic$(dicnum)& dic$(bx+1)(1:1)
            END IF
            LET pdata$=pdata$& dic$(dicnum)
         END IF
      LOOP
   LOOP
END SUB

SUB inpcode
   LET bx=-1
   DO WHILE LEN(iacc$)< iwidth
      IF blkend<=li THEN
         LET blksize=ORD(LZW$(li:li))
         CALL prthex(CHR$(blksize),"block size") !¥â¥Ë¥¿¡¼
         IF blksize=0 THEN EXIT SUB
         LET li=li+1
         LET blkend=li+blksize
      END IF
      LET iacc$=right$("0000000"& BSTR$(ORD(LZW$(li:li)),2),8)& iacc$
      LET li=li+1
   LOOP
   LET bx=BVAL(right$(iacc$,iwidth),2)
   LET iacc$=iacc$(1:LEN(iacc$)-iwidth)
END SUB

SUB prthex(d$,w$)
   LET ww$=""
   FOR ii=1 TO LEN(d$)
      LET ww$=ww$& right$("0"& BSTR$(ORD(d$(ii:ii)),16),2)& " "
   NEXT ii
   IF w$>"" THEN LET ww$=ww$& "; "& w$
   PRINT ww$
END SUB

END
 

GIF ¥Õ¥¡¥¤¥ë¤Î²òÀϥġ¼¥ë Ver.2¡Ê²èÁüÉÕ¡Ë

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 7·î31Æü(¶â)00»þ31ʬ57ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.463[¸µµ­»ö¤Ø]

! GIF ¥Õ¥¡¥¤¥ë¤Î²òÀϥġ¼¥ë Ver.2¡Ê²èÁüÉÕ¡Ë
!-------
! ¥ê¥¹¥Èº¸Ã¼¥¢¥É¥ì¥¹¤ò£µ·å¤Ë¤·¤¿¡£¥ê¥¹¥ÈÃí¼á¤òÂçÉý½¤Àµ¡£Éü¸µ²èÁü¤â¡¢
! ɽ¼¨¤¹¤ëÍͤˤ·¤¿¡£IE6 ¤Ï¡¢¥¹¥¯¥ê¡¼¥óÇØ·Ê¿§¤ò̵»ë¤·¤Æ¡¢¥Ö¥é¥¦¥¶ÇØ·Ê
! ¤Î¤ß¤ò¡¢ÂåÍѤ¹¤ë¤è¤¦¤Ê¤Î¤Ç¡¢£Ç£É£Æ»ÅÍͤ«¤é³°¤ì¤ë¤¬¡¢¤½¤ì¤Ë¹ç¤»¤¿¡£
! Disposal Method 0,1,2,3 ¡¢¥¤¥ó¥¿¥ì¡¼¥¹²èÁü¤Ê¤É¤¬¡¢¥â¥Ë¥¿¡¼½ÐÍè¤ë¡£
!
OPTION CHARACTER BYTE
LET bitfull=12           ! LZW max.bits (~~ 12)
DIM dic$(0 TO 2^bitfull) ! decoder ¼­½ñ
!
FILE GETNAME file$, "gif"
IF file$="" THEN
   PRINT "ÆþÎÏ¥Õ¥¡¥¤¥ë̾¤¬¡¢¤¢¤ê¤Þ¤»¤ó¡£"
   STOP
END IF
!
PRINT "ÆþÎÏ¥Õ¥¡¥¤¥ë¡§"& file$
OPEN #1: NAME file$, ACCESS INPUT
PRINT "---------"
SET COLOR mode "native"
DIM ncp(0 TO 256)              ! native color palette
LET ncp(256)=BVAL("eeeedd",16) ! 256= ¥·¥¹¥Æ¥àÇØ·Ê¿§ BGR
SET AREA COLOR ncp(256)
PLOT AREA: 0,0;1,0;1,1;0,1
CALL gif_head
LET i=MAX( Xsw,Ysw )
SET WINDOW -.1*i,1.1*i, 1.1*i,-.1*i
SET LINE STYLE 3
PLOT LINES:-1,-1;Xsw+.5,-1;Xsw+.5,Ysw+.5;-1,Ysw+.5;-1,-1
DIM m(0 TO Xsw-1,0 TO Ysw-1), m3(0 TO Xsw-1,0 TO Ysw-1)
MAT m=ncp(256)*CON
DO
   CALL blocks_main
LOOP UNTIL b1$=CHR$(BVAL("3B",16))
PRINT "GIF ½ªÃ¼¥Ö¥í¥Ã¥¯"
CALL dump(b1$,2,"block label")
PRINT "---------"
CLOSE #1

!----
SUB gif_head
   LET h$=""
   CALL readb( h$,13 )
   IF h$(1:3)="GIF" THEN PRINT "GIF ¥Ø¥Ã¥À¡¼" ELSE CALL error
   LET Xsw= ORD(h$( 8: 8))*256+ORD(h$(7:7))
   LET Ysw= ORD(h$(10:10))*256+ORD(h$(9:9))
   LET sflg=ORD(h$(11:11)) ! ¥¹¥¯¥ê¡¼¥ó¾ðÊó¤Î¥Õ¥é¥°
   LET BGco=ORD(h$(12:12))
   LET aspect=ORD(h$(13:13))
   LET b$=right$("0000000"& BSTR$(sflg,2) ,8)
   LET colpix=2^(BVAL(b$(2:4),2)+1)
   LET compal=2^(BVAL(b$(6:8),2)+1)
   CALL dump(h$( 1: 6),6,"Asc") ! GIF¼±ÊÌʸ»ú
   CALL dump(h$( 7: 8),2,"screen X_width= "& STR$(Xsw))
   CALL dump(h$( 9:10),2,"screen Y_width= "& STR$(Ysw))
   CALL dump(h$(11:11),2,"flags= "& b$ )
   PRINT TAB(13);b$(1:1);":common_palette on=1/off=0"
   PRINT TAB(11);b$(2:4);":colors/pixel 2^(";b$(2:4);"b+1)= ";STR$(colpix)
   PRINT TAB(13);b$(5:5);":sort on=1/off=0 ¥Ñ¥ì¥Ã¥È¤Î¡¢½ÅÍ×ÅÙ ¿§½ç¥½¡¼¥È"
   PRINT TAB(11);b$(6:8);":common_palette colors 2^(";b$(6:8);"b+1)= ";STR$(compal)
   CALL dump(h$(12:12),2,"back_ground color= "& STR$(BGco))
   IF aspect=0 THEN LET b$=".." ELSE LET b$=STR$(aspect)
   CALL dump(h$(13:13),2,"¥¢¥¹¥Ú¥¯¥ÈÈæ H:V=, 0 ¤Ï 1:1 ¤½¤Î¾("& b$& "+15):64" )
   CALL palette("common_¥Ñ¥ì¥Ã¥È", c_p$, sflg)
END SUB

!----
SUB blocks_main
   LET b1$=""
   CALL readb( b1$, 1)
   IF     b1$=CHR$(BVAL("21",16)) THEN !Äɲåǡ¼¥¿¡¦¥Ö¥í¥Ã¥¯
      CALL option_block
   ELSEIF b1$=CHR$(BVAL("2C",16)) THEN !²èÁü¥Ö¥í¥Ã¥¯
      CALL picture_block
   ELSEIF b1$=CHR$(BVAL("3B",16)) THEN !GIF ½ªÃ¼¥Ö¥í¥Ã¥¯
   ELSE
      CALL error
   END IF
END SUB

!---Äɲåǡ¼¥¿¡¦¥Ö¥í¥Ã¥¯¡£
SUB option_block
   PRINT "Äɲåǡ¼¥¿¡¦¥Ö¥í¥Ã¥¯"
   CALL readb( b1$,1)        ! w9$= readb_last_byte
   IF w9$=CHR$(BVAL("F9",16)) THEN
      LET im$=b1$
      CALL dump(im$,2,"¥¤¥á¡¼¥¸¥³¥ó¥È¥í¡¼¥ë¡¦¥Ö¥í¥Ã¥¯")
      CALL blocks(im$,0,"",1) ! non print (data, byte/¹Ô, Ãí¼á, Í×µáblocks)
      LET iflg=ORD(im$(4:4)) ! ¥Õ¥é¥°
      LET imtm=ORD(im$(6:6))*256+ORD(im$(5:5))
      LET tcol=ORD(im$(7:7))
      LET b$=right$("0000000"& BSTR$(iflg,2),8)
      LET t_on=VAL(b$(8:8))
      LET tmod=BVAL(b$(4:6),2)
      CALL dump(im$(4:4),2,"flags= "& b$ )
      PRINT TAB(11);b$(1:3);":blank"
      PRINT TAB(11);b$(4:6);":"
      PRINT TAB(15);"000= ÉÁ²è¸å¡¢¤½¤Î¤Þ¤Þ¡¢¼¡¤ÎÇطʤØÅϤ¹"
      PRINT TAB(15);"001= ÉÁ²è¸å¡¢¤½¤Î¤Þ¤Þ¡¢¼¡¤ÎÇطʤØÅϤ¹"
      PRINT TAB(15);"010= ÉÁ²è¸å¡¢back_ground color ¤È¼èÂØ¡¢¼¡¤ÎÇطʤØÅϤ¹"
      PRINT TAB(15);"011= ÉÁ²è¸å¡¢ÉÁ²èÁ°¤Î²èÁü¤ò¡¢¼¡¤ÎÇطʤØÅϤ¹"
      PRINT TAB(13);b$(7:7);":user click on=1/off=0"
      PRINT TAB(13);b$(8:8);":Æ©ÌÀ¿§¤Î¥¹¥¤¥Ã¥Á on=1/off=0"
      CALL dump(im$(5:6),2,"¥Õ¥ì¡¼¥àɽ¼¨»þ´Ö= "& STR$(imtm)& " x10ms" )
      CALL dump(im$(7:7),2,"Æ©ÌÀ¿§= "& STR$(tcol) )
      CALL blocks(im$,16,"",999) ! (data, byte/¹Ô, Ãí¼á, Í×µáblocks)
   ELSEIF w9$=CHR$(BVAL("FE",16)) THEN
      LET co$=b1$
      CALL dump(co$,2,"¥³¥á¥ó¥È¡¦¥Ö¥í¥Ã¥¯")
      CALL blocks(co$,8,"Asc",999) ! (data, byte/¹Ô, Ãí¼á, Í×µáblocks)
   ELSEIF w9$=CHR$(BVAL("FF",16)) THEN
      LET ap$=b1$
      CALL dump(ap$,2,"¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¡¦¥Ö¥í¥Ã¥¯")
      CALL blocks(ap$,8,"Asc",1) ! (data, byte/¹Ô, Ãí¼á, Í×µáblocks)
      IF ap$(4:11)="NETSCAPE" THEN
         CALL blocks(ap$,0,"",1) ! non print (data, byte/¹Ô, Ãí¼á, Í×µáblocks)
         CALL dump(ap$(16:16),2,"extension code= 01~07 next data type")
         IF MOD(ORD(ap$(16:16)),8)=1 THEN
            LET rept=ORD(ap$(18:18))*256+ORD(ap$(17:17))
            CALL dump(ap$(17:18),2,"·«ÊÖ¤·²ó¿ô= "& STR$(rept)& " (0=endless)")
         ELSE
            CALL dump(ap$(17:LEN(ap$)),2,"02= 32bit buffering size, 03~07= ?")
         END IF
      END IF
      CALL blocks(ap$,8,"Asc",999) ! (data, byte/¹Ô, Ãí¼á, Í×µáblocks)
   ELSEIF w9$=CHR$(BVAL("01",16)) THEN
      LET tx$=b1$
      CALL dump(tx$,2,"¥Æ¥­¥¹¥È¡¦¥¤¥á¡¼¥¸¡¦¥Ö¥í¥Ã¥¯")
      CALL blocks(d$,8,"Asc",999) ! (data, byte/¹Ô, Ãí¼á, Í×µáblocks)
   ELSE
      CALL error
   END IF
END SUB

!-------
SUB blocks(d$,m,t$,n)     ! d$=data, m=byte/¹Ô, t$=Ãí¼á, n=Í×µáblocks
   FOR n=1 TO n
      CALL readb(d$,1)             ! w9$= readb_last_byte ! =block Size
      CALL dump(w9$,1,"block size")
      IF w9$=CHR$(0) THEN EXIT SUB ! block End
      LET s=LEN(d$)
      CALL readb(d$,ORD(w9$))      ! block data
      IF 0< m THEN CALL dump(d$(s+1:LEN(d$)),m,t$)
   NEXT n
END SUB

SUB readb(d$,cx) !cx=bytes size
   FOR i=1 TO cx
      CHARACTER INPUT #1,IF MISSING THEN EXIT FOR :w9$
      LET d$=d$& w9$
   NEXT i
   IF i<=cx THEN CALL error
END SUB

SUB dump(d$,m,t$)   ! t$="comment" ¢ª;comment  t$="Asc" ¢ª;"ascii.dump"
   FOR j=1 TO LEN(d$) STEP m
      LET ww$=right$("0000"& BSTR$(adr,16),5)& " "
      FOR i=j TO MIN(j+m-1, LEN(d$))
         LET ww$=ww$& " "& right$("0"& BSTR$( ORD(d$(i:i)),16),2)
         LET adr=adr+1
      NEXT i
      IF t$>"" THEN
         LET ww$=ww$& REPEAT$(" ",6+3*m-LEN(ww$))
         IF t$="Asc" THEN                                ! ascii.dump
            LET ww$=ww$& " ;"""
            FOR i=j TO MIN(j+m-1, LEN(d$))
               IF " "<=d$(i:i) THEN LET ww$=ww$& d$(i:i) ELSE LET ww$=ww$& "."
            NEXT i
            LET ww$=ww$& """"
         ELSE
            IF m=3 THEN LET ww$=ww$& " ;"& STR$(IP(j/3)) ! ¥Ñ¥ì¥Ã¥È¿§ÈÖ¹æ
            IF j=1 THEN LET ww$=ww$& " ;"& t$            ! comment
         END IF
      END IF
      PRINT ww$ ! ¹Ôñ°Ì¡¢¥Æ¥­¥¹¥È²èÌ̤Υԥ«¤Ä¤­¸º¾¯¡¢¹â®¡£
   NEXT j
END SUB

!-------
SUB picture_block
   PRINT "²èÁü¥Ö¥í¥Ã¥¯"
   LET pi$=b1$
   CALL readb( pi$,9)
   CALL dump(pi$(1:1),2,"block label")
   LET Xp0=ORD(pi$(3:3))*256+ORD(pi$(2:2))
   LET Yp0=ORD(pi$(5:5))*256+ORD(pi$(4:4))
   LET Xpw=ORD(pi$(7:7))*256+ORD(pi$(6:6))
   LET Ypw=ORD(pi$(9:9))*256+ORD(pi$(8:8))
   CALL dump(pi$(2:3),2,"picture.X0_position left= "& STR$(Xp0))
   CALL dump(pi$(4:5),2,"picture.Y0_position top= "& STR$(Yp0))
   CALL dump(pi$(6:7),2,"picture.X_width= "& STR$(Xpw))
   CALL dump(pi$(8:9),2,"picture.Y_width= "& STR$(Ypw))
   LET pflg=ORD(pi$(10:10)) ! ²èÁü¾ðÊó¤Î¥Õ¥é¥°
   LET b$=right$("0000000"& BSTR$(pflg,2),8)
   CALL dump(pi$(10:10),2,"flags= "& b$ )
   LET interl=VAL(b$(2:2))
   LET pripal=2^(BVAL(b$(6:8),2)+1)
   PRINT TAB(13);b$(1:1);":private_palette on=1/off=0"
   PRINT TAB(13);b$(2:2);":interlace on=1/off=0, 1~step8 5~step8 3~step4 2~step2"
   PRINT TAB(13);b$(3:3);":sort on=1/off=0 ¥Ñ¥ì¥Ã¥È¤Î¡¢½ÅÍ×ÅÙ ¿§½ç¥½¡¼¥È"
   PRINT TAB(12);b$(4:5);":blank"
   PRINT TAB(11);b$(6:8);":private_palette colors 2^(";b$(6:8);"b+1)= ";STR$(pripal)
   CALL palette("private_¥Ñ¥ì¥Ã¥È", p_p$, pflg)
   !---
   PRINT "²èÁü¥Ç¡¼¥¿"
   LET LZW$=""
   CALL readb( LZW$,1)
   CALL dump(LZW$,1,"ºÇ¾®¥Ç¡¼¥¿¡¦¥Ó¥Ã¥ÈĹ")
   !--- LZW ¥Ç¡¼¥¿¡Êsize:data, size:data, ¡Ä 0 ¡Ë
   CALL blocks(LZW$,16,"",9999) ! (data, byte/¹Ô, Ãí¼á, Í×µáblocks)
   CALL decomp_data
END SUB

SUB palette(n$, p$, pf)
   PRINT n$;
   LET p$=""
   IF IP(pf/128)>0 THEN ! pf AND 0x80
      PRINT
      CALL readb(p$, 3*2^(MOD(pf,8)+1)) ! pf AND 0x07
      CALL dump(p$,3,"R G B")
      CALL palette10(n$, p$, pf)
   ELSE
      LET ww$=" ̵¤·¡£"
      IF n$(1:1)="p" AND c_p$>"" THEN
         LET ww$=ww$& "¢ª common_¥Ñ¥ì¥Ã¥È »ÈÍÑ¡£"
         IF bk_p$(1:1)<>"c" THEN CALL palette10("common", c_p$, sflg)
      END IF
      PRINT ww$
   END IF
END SUB

SUB palette10(n$, p$, pf)
   FOR i=1 TO 3*2^(MOD(pf,8)+1) STEP 3
      LET ncp(IP(i/3))= ORD(p$(i:i))+256*ORD(p$(i+1:i+1))+65536*ORD(p$(i+2:i+2))
   NEXT i
   LET bk_p$=n$
END SUB

SUB error
   beep
   PRINT "File Error Stop"
   STOP
END SUB

!
Page-2 ¤Ø³¤¯
 

ËÜǯÅٷıþÂç³ØÆþ»îÌäÂê¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§ËÌÀÝ»°ÂÀϺ  Åê¹ÆÆü¡§2009ǯ 8·î 2Æü(Æü)01»þ52ʬ57ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ËÜǯÅÙÂç³ØÆþ»î¥×¥í¥°¥é¥ß¥ó¥°¤ÎÌäÂê
¡¡·Ä±þ¡¦´Ä¶­¾ðÊó
¥Õ¥£¥Ü¥Ê¥Ã¥Á¿ôÎó¤ÎºÇ½é¤Î£²£°¹à¤ò½ÐÎϤ¹¤ëÌäÂê¤Ç
ÌÏÈϲòÅú¤È¤Ï°Û¤Ê¤ë
150 let b=a-b
160 let a=a+b
¤È¤·¤Æ¤â¡¢Àµ¤·¤¤½ÐÎϤ¬ÆÀ¤é¤ì¤Þ¤¹¡£
ÌäÂêʸ¤Ë¤Ï¡¢¡Ö¤â¤Ã¤È¤âŬÀڤʤâ¤Î¤òÁª¤Ó¡¦¡¦¡¦¡×¤È
½ñ¤«¤ì¤Æ¤¤¤ë¤Î¤Ç¡¢¤³¤ì¤ÏÉÔÀµ²ò¤Ê¤Î¤Ç¤·¤ç¤¦¤«¡©
¤ß¤Ê¤µ¤Þ¤Î¤´°Õ¸«¤ò¤ªÊ¹¤«¤»¤¯¤À¤µ¤¤¡£
¿ô¸¦¡¢²¢Ê¸¼Ò¤ÎÀµ²ò¤Ï¡¢¼¡¤Ç¤¹¡£
100 LET a=1
110 LET b=0
120 LET n=0
130 IF n=20 THEN GOTO 190
140 LET n=n+1
150 LET b=a+b
160 LET a=b-a
170 PRINT b
180 GOTO 130
190 END
 

Re: ËÜǯÅٷıþÂç³ØÆþ»îÌäÂê¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 8·î 2Æü(Æü)15»þ03ʬ48ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.465[¸µµ­»ö¤Ø]

ËÌÀÝ»°ÂÀϺ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£


ÌÏÈϲòÅú¤ÎÊÑ¿ôa,b¤Î°ÕÌ£¤ò¹Í¤¨¤Æ¤ß¤Þ¤¹¡£

Â裱¹à¤ÈÂ裲¹à¤âÁ²²½¼°¤ËµÛ¼ý¤·¤Æ²ò¼á¤¹¤ë¤È
a[1]=a[-1]+a[0]                         =1+0          =1
a[2]=      a[0]+a[1]                    =  0+1        =1
a[3]=           a[1]+a[2]               =    1+1      =2
a[4]=                a[2]+a[3]          =      1+2    =3
a[5]=                     a[3]+a[4]     =        2+3  =5
                                ¨¢   ¨£¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¥
            °ìÈ̲½¤¹¤ë¤È¡¢  ¸Å¤¤b¢­   ¢­
                                a  + b  ¢ª b
a[6]=                          a[4]+a[5]=          3+5=8
¡¡¡¡¡¡¡§
¡¡¡¡¡¡¡§

¤³¤ì¤ò¥×¥í¥°¥é¥à¤Ë¤¹¤ë¤È
100 LET a=1 !¸Å¤¤b
110 LET b=0 !A[0]
120 LET n=0 !¹à
130 IF n=20 THEN GOTO 190 !Â裲£°¹à¤Þ¤Ç
140 LET n=n+1
150 LET b=a+b !=a[n-2]+a[n-1]=A[n]¡Ê=¸Å¤¤b+b¡Ë
160 LET a=b-a !a=b-a=A[n]-a[n-1]=a[n-2]=¸Å¤¤b
170 PRINT n; a; b !Âè£î¹à¤òɽ¼¨¤¹¤ë
180 GOTO 130
190 END


a-b¤¬¡¢ÁªÂò»è¤Ë¤Ï¤¢¤ë¤è¤¦¤Ç¤¹¤Î¤Ç¡¢·×»»¼ê½ç¡Ê¥¢¥ë¥´¥ê¥º¥à¡Ë¤¬ÀâÌÀ¤Ç¤­¤ì¤Ð
Àµ²ò¤È¸À¤¨¤ë¤È»×¤¤¤Þ¤¹¡£


ÌäÂêʸ
¡¡http://www.yozemi.ac.jp/nyushi/sokuho/recent/keio/kankyo/index.html Æâ¡Ö¿ô³Ø V¡×¤òÁªÂò
 

Re: ËÜǯÅٷıþÂç³ØÆþ»îÌäÂê¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 8·î 2Æü(Æü)16»þ10ʬ59ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.465[¸µµ­»ö¤Ø]

!Ʊ¤¸½ÐÎϤÎÆÀ¤é¤ì¤ëÊýË¡¤Ï¡¢¾ï¤Ë¡¢Ì¤ÃΤÊÊýË¡¤â¡¢´Þ¤ó¤Ç¤¤¤ë¤Ï¤º¤Ç¡¢
!¤½¤ì¤òõ¤»¤ë»ö¤Ï¡¢¤È¤Æ¤âÂçÀڤʻö¤À¤È¡¢»×¤¤¤Þ¤¹¡£(¸Ä¿ÍŪ¤Ë¤Ï ¤½¤ì¤¬³Ú¤·¤ß)
!ºÎÅÀ¦¤ÎÍøÊؤòÍ¥À褵¤ì¤ëÊÀ³²¤Ï¡¢»ÅÊý¤¬¤Ê¤¤¤Ç¤¹¤Í¡¦¡¦¡¦µ¤¤Ë¤Ê¤ë¤Î¤Ï¡¢
!ÌÏÈϲòÅú¤¬¡¢for~next ¤ò¡¢¤Ê¤¼»ÈÍѤ·¤Ê¤«¤Ã¤¿¤Î¤«¡©£²¹Ôʬ¤¬ÌµÂÌ¡£
!¤Ä¤¤¤Ç¤Ë¡£»ä¼«¿È¡¢¤³¤ó¤ÊÈÖ¹æ¹ç¤»¤Î»î¸³¤µ¤ì¤¿¤é¡¢£°ÅÀ¤Ë¤Ê¤ê¤½¤¦¡£(¾Ð¤¨¤Þ¤»¤ó)

LET a=1
LET b=0
FOR n=1 TO 20
   LET b=a+b
   LET a=b-a
   PRINT b
NEXT n
 

Re: ¥»¥ó¥¿¡¼»î¸³ÄøÅÙ¤Î¥×¥í¥°¥é¥à±é½¬

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 8·î 3Æü(·î)10»þ49ʬ9ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.462[¸µµ­»ö¤Ø]

½ÐÎϤµ¤ì¤ë¿ôÎó¤Ë¿´Åö¤¿¤ê¤¬¡¢¡¢¡¢¤¢¤ë¤È»×¤¤¤Þ¤¹¡ª¡©
!¥æ¡¼¥¯¥ê¥Ã¥É¤Î¸ß½üË¡¤Ç¡¢4181¤È6765¤È¤ÎºÇÂç¸øÌó¿ô¤òµá¤á¤ë

LET a=4181 !¢¨a< b
LET b=6765

PRINT b

DO WHILE a<>b !a=b¤Ê¤é½ªÎ»
   IF a>b THEN
      LET a=a-b !¡Öa-b¤Èb¤È¤ÎºÇÂç¸øÌó¿ô¤òµá¤á¤ë¡×¤ËÃÖ¤­´¹¤¨¤ë
      PRINT b !trace
   ELSE
      LET b=b-a
      PRINT a !trace
   END IF
LOOP

PRINT a !ºÇÂç¸øÌó¿ô




!¤½¤Î£²¡¡¾ê;¤ò»È¤Ã¤¿¾ì¹ç

LET a=4181 !¢¨b¤ò½ÐÎϤ¹¤ë¤¿¤á¤Ë¤Ï¡¢a< b¤È¤¹¤ë
LET b=6765

DO UNTIL b=0
   LET t=b
   LET b=MOD(a,b)
   LET a=t
   PRINT a !trace
LOOP

PRINT a !ºÇÂç¸øÌó¿ô


END
 

½¤Àµ¥á¥â

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 8·î 4Æü(²Ð)09»þ07ʬ27ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.464[¸µµ­»ö¤Ø]

Â礭¤Ê GIF ¥Õ¥¡¥¤¥ë¤Î½èÍý®ÅÙ¤¬¡¢¤¢¤Þ¤ê¤ËÃÙ¤¤¤Î¤Ç¡Ê229KB ¤Ç18ʬ¤¯¤é¤¤¡Ë
°ì³ç½èÍý¤ò»ß¤á¡¢Ê¸»úÎóÊÑ¿ô LZW$ ¡¢pdata$ ¤ÎŤµ¤¬¡¢Â礭¤¯¤Ê¤é¤Ê¤¤¤è¤¦¡¢
ºÙÀÚ¤ì¤Ë½èÍý¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£·ë²Ì¤Ï¡Ê229KB ¤Ç3ʬ30Éáˤˤʤä¿¡£È¿ÌÌ¡¢
£±¥Õ¥ì¡¼¥àʬ¤¬¡¢¥»¥Ã¥È¤Ë¤Ê¤Ã¤Æ¤¤¤¿ LZW$ ¤È pdata$ ¤Ï¡¢ÃÇÊҤΥǡ¼¥¿¤¬
ή¤ì¤ë¤À¤±¤Ç¡¢Êݸ¤µ¤ì¤Ê¤¯¤Ê¤Ã¤¿¡£¤Þ¤¿¡¢¥·¡¼¥±¥ó¥¹¤¬¡¢ÈÑ»¨¤Ç¤ß¤Ë¤¯¤¤¡£
¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë»ö¤¬Ìµ¤¤¤Î¤Ç¡¢¤É¤ó¤Ê¤ËÂ礭¤Ê GIF ¤Ç¤â¡¢½èÍý®ÅÙ¤¬¡¢
Íî¤Á¤Æ¤¤¤«¤Ê¤¤ÍøÅÀ¤Ï¤¢¤ê¤Þ¤¹¤¬¡¦¡¦
¾å½ñ¤­Êѹ¹¤¹¤ë¤Ë¤Ï¡¢Îɤ·°­¤·¤¬¤¢¤ë¤¿¤á¡¢¤´´õ˾¤ÎÊý¤Ï¡¢²¼µ­¡£
( ľÀܥƥ­¥¹¥È¤Î¥ê¥ó¥¯¤Ç¡¢Ê¸»ú²½¤±¤·¤½¤¦¤Ç¤¹¡£¥·¥Õ¥ÈJIS ¼êÆ°ÀÚ´¹¤ª´ê¤¤)
http://homepage2.nifty.com/neutro/asm/GIFana21.BAS
 

Re: ËÜǯÅٷıþÂç³ØÆþ»îÌäÂê¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 8·î 5Æü(¿å)15»þ11ʬ14ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.466[¸µµ­»ö¤Ø]

¼ÁÌä¤Ø¤Î²óÅú¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¤¬¡¢
ÌÏÈϲòÅú¤Î¼êË¡¤òȯŸ¤µ¤ì¤ë¤È¡¢¹à¤ò£²¿ô¤ÎÁȤǵá¤á¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
100 LET a=1 !´ñ¿ô¤Î¹à: a[-1]
110 LET b=0 !¶ö¿ô¤Î¹à: a[0]
120 LET n=0 !ÁÈ
130 IF n=10 THEN GOTO 190 !£±£°ÁȤޤÇ
140 LET n=n+1
150 LET a=a+b !=a[k-1]+a[k]=a[k+1]
160 LET b=b+a !=b+(a+b)=2*b+a=2*a[k]+a[k-1]=a[k]+(a[k-1]+a[k])=a[k]+a[k+1]=a[k+2]
170 PRINT a; b !£²¿ô
180 GOTO 130
190 END
 

Re: Ê£ÁÇ¿ô¥â¡¼¥É¤Î»È¤¤Êý¡£

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 8·î10Æü(·î)11»þ13ʬ37ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.471[¸µµ­»ö¤Ø]

SQR´Ø¿ô¤Ï¡¤ÊгѤ¬¡Ý¦Ð/2¤è¤êÂç¤Ç¦Ð/2°Ê²¼¤Ç¤¢¤ëÊ¿Êýº¬¤òÊÖ¤¹¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
¼¡¤Î¤è¤¦¤ËÊ¿Êýº¬´Ø¿ôsqrt¤òÄêµÁ¤¹¤ì¤Ð¡¤ÊгѤ¬0°Ê¾å¦Ð̤Ëþ¤Ç¤¢¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£
FUNCTION sqrt(x)
   LET x=SQR(x)
   IF x<>0 AND ARG(x)<0 THEN
      LET x=x*(-1)
   END IF
   LET sqrt=x
END FUNCTION
! °Ê²¼¡¤»ÈÍÑÎã
LET x=COMPLEX(-1/2,-SQR(3)/2)
PRINT SQR(x),sqrt(x)
END
Ê£ÁÇ´Ø¿ô¤Î¾ÜºÙ¤Ï¡¤¥Ø¥ë¥×¤ÎÊ£ÁÇ´Ø¿ô¤Î¥Ú¡¼¥¸¤ò¸«¤Æ¤¯¤À¤µ¤¤¡£
 

Re: Ê£ÁÇ¿ô¥â¡¼¥É¤Î»È¤¤Êý¡£

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 8·î10Æü(·î)16»þ04ʬ43ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.471[¸µµ­»ö¤Ø]

Âç·§¡¡Àµ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£


Ê£ÁÇ¿ô¤ÎÊ¿Êýº¬

i¤òµõ¿ôñ°Ì¤È¤¹¤ë¡£Ê£ÁÇ¿ôz=x+y*i¤ÎÊ¿Êýº¬a+b*i¤ò¹Í¤¨¤ë¡£

(a+b*i)^2=z¤è¤ê¡¢(a^2-b^2)+2*a*b*i=x+y*i¤È¤Ê¤ë¡£
¤·¤¿¤¬¤Ã¤Æ¡¢Ï¢Î©ÊýÄø¼° a^2-b^2=x¡¢2*a*b=y ¤ò²ò¤±¤Ð¤è¤¤¡£

¡¡²ò¤¯²áÄø¤Ï¾Êά

SQR(x+y*i)=¡Þ{ SQR((SQR(x^2+y^2)+x)/2) + i*SGN(y)*SQR((SQR(x^2+y^2)-x)/2) }



£³ÈÖÌܤμ°¤Î¾ì¹ç¡¢
W=1 / SQR(x+y*i)
¡¡¾å¼°¤òÂåÆþ¤¹¤ë
 =1 / ¡Þ{ SQR((SQR(x^2+y^2)+x)/2) + i*SGN(y)*SQR((SQR(x^2+y^2)-x)/2) }
¡¡¶¦Ìò¤Ê¿ô¤ò¤«¤±¤ÆʬÊì¤òÍ­Íý²½¤¹¤ë
 =¡Þ{ SQR((SQR(x^2+y^2)+x)/2) - i*SGN(y)*SQR((SQR(x^2+y^2)-x)/2) } / {(SQR(x^2+y^2)+x)/2 + (SQR(x^2+y^2)-x)/2}
¡¡À°Íý¤¹¤ë
 =¡Þ{ SQR((SQR(x^2+y^2)+x)/2) - i*SGN(y)*SQR((SQR(x^2+y^2)-x)/2) } / SQR(x^2+y^2)

 

FACT,PERM,COMB´Ø¿ô¤Î¥Ð¥°

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ 8·î12Æü(¿å)22»þ27ʬ59ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ³¬¾è,½çÎó,Áȹ礻¤ÎÁȹþ¤ß´Ø¿ôFACT(x),PERM(n,r),COMB(n,r)¤ËÉÔ¶ñ¹ç¤òȯ¸«¤·¤¿¤Î¤ÇÊó¹ð¤·¤Þ¤¹¡£

(1) FACT(x)¤ò2¿Ê¥â¡¼¥É,Ê£ÁÇ¿ô¥â¡¼¥É¤Ç¼Â¹Ô¤·¤¿¾ì¹ç¡¢x¤¬¾®¿ô¤Î¤È¤­Îã³°¤È¤Ê¤é¤º¸í¤Ã¤¿ÃͤòÊÖ¤¹¡£
100 OPTION ARITHMETIC NATIVE
110 FOR x=-1 TO 4
120    WHEN EXCEPTION IN
130       PRINT x;FACT(x) ! À°¿ô¤Ç¤ÏÌäÂê¤Ê¤¤
140    USE
150    END WHEN
160 NEXT x
170 PRINT
180 FOR x=-1 TO 4.0001 STEP 0.1
190    WHEN EXCEPTION IN
200       PRINT x;FACT(x) ! x<-0.5¤Ç¤ÏÎã³°¤¬È¯À¸
210    USE
220    END WHEN
230 NEXT x
240 END
¾åµ­¥×¥í¥°¥é¥à¤ò10¿Ê15·å,1000·å,Í­Íý¿ô¤Î³Æ¥â¡¼¥É¤Ç¼Â¹Ô¤·¤¿¾ì¹ç¡¢x¤¬¾®¿ô¤Î¤È¤­¤ÏÎã³°¤¬È¯À¸¤¹¤ë¡£


(2) PERM(n,r);COMB(n,r)¤ò2¿Ê¥â¡¼¥É,Ê£ÁÇ¿ô¥â¡¼¥É¤Ç¼Â¹Ô¤·¤¿¾ì¹ç¡¢r¤¬¾®¿ô¤Î¤È¤­Îã³°¤È¤Ê¤é¤ºr¤òÀ°¿ô¤Ë´Ý¤á¤ÆÆÀ¤¿ÃͤòÊÖ¤¹¡£
400 OPTION ARITHMETIC NATIVE
410 LET n=6
420 FOR r=-2 TO 3.0001 STEP 0.1
430    WHEN EXCEPTION IN
440       PRINT n;r;" ---> ";PERM(n,r);COMB(n,r) ! r<-0.5¤Ç¤ÏÎã³°¤¬È¯À¸
450    USE
460    END WHEN
470 NEXT r
480 END
¾åµ­¥×¥í¥°¥é¥à¤ò10¿Ê15·å,1000·å,Í­Íý¿ô¤Î³Æ¥â¡¼¥É¤Ç¼Â¹Ô¤·¤¿¾ì¹ç¡¢r¤¬¾®¿ô¤Î¤È¤­¤ÏÎã³°¤¬È¯À¸¤¹¤ë¡£


(3) PERM(n,r),COMB(n,r)¤Çn¤¬Éé¿ô,¾®¿ô¤Î¤È¤­Îã³°¤È¤Ê¤é¤º¸í¤Ã¤¿ÃͤòÊÖ¤¹¡£
600 LET r=3
610 FOR n=-4 TO 5 STEP 0.2
620    WHEN EXCEPTION IN
630       PRINT n;r;" ===> ";PERM(n,r);COMB(n,r)
640    USE
650    END WHEN
660 NEXT n
670 END
 

Re: FACT,PERM,COMB´Ø¿ô¤Î¥Ð¥°

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 8·î13Æü(ÌÚ)07»þ45ʬ46ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.475[¸µµ­»ö¤Ø]

¤´Êó¹ð¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
FACT¡¤PERM¡¤COMB¤Î³ÆÁȹþ´Ø¿ô¤Ïµ¬³Ê³°¤Îµ¡Ç½¤Ê¤Î¤Ç¡¤¡ÖÄêµÁ°è³°¤Î°ú¿ô¤ËÂФ¹¤ëÆ°ºî¤ÏÉÔÄê¡×¤¬»ÅÍͤǤ¹¡£¡Ê»ÅÍͤÏ̤³ÎÄê¤È¤â¤¤¤¨¤Þ¤¹¡£¡Ë
¤Ê¤ª¡¤PERM(n,r)¤ÎÄêµÁ°è¤Ï¡¤r¤¬Àµ¤ÎÀ°¿ô¤Ç¤¹¡£n¤ÏÉé¿ô¤ä¾®¿ô¤Ç¤â¤«¤Þ¤¤¤Þ¤»¤ó¡£
PERM(n,r)¡án(n-1)(n-2)¡Ä(n-r+1)¡¡¤ÇÄêµÁ¤µ¤ì¤Þ¤¹¡£
COMB(n,r)¤Ï¡¤n¤¬ÉéÀ°¿ô¤Þ¤¿¤Ïr¤è¤êÂ礭¤¤À°¿ô¤Î¤È¤­0¤Ë¤Ê¤ê¤Þ¤¹¡£
¤Ê¤ª¡¤COMB(n,r)=PERM(n,r)/FACT(r)¤ÇÄêµÁ¤¹¤ë¤ÈÅÔ¹ç¤Î¤è¤¤¤³¤È¤â¤¢¤ë¤Î¤Ç¤¹¤¬¡¤ÆâÉô¤Î½èÍý¤ÎÅÔ¹ç¤Ç¤½¤¦¤Ê¤é¤Ê¤¤¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£
 

Re: FACT,PERM,COMB´Ø¿ô¤Î¥Ð¥°

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ 8·î13Æü(ÌÚ)19»þ25ʬ32ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.476[¸µµ­»ö¤Ø]

¤´²óÅú¤¤¤¿¤À¤­¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
WHEN¡ÁEND WHEN¤ÎÃæ¤ÇFACT´Ø¿ô¤ò»È¤Ã¤¿¤È¤³¤í¡¢10¿Ê¥â¡¼¥É¤È£²¿Ê¥â¡¼¥É¤Ç¤Þ¤Ã¤¿¤¯°ã¤¦·ë²Ì¤¬½Ð¤¿¤Î¤Ç¡¢¤³¤ì¤Ï¥Ð¥°¤Ç¤¢¤í¤¦¤È»×¤Ã¤Æ¤·¤Þ¤¤¤Þ¤·¤¿¡£
¤É¤Î¿ôÃͥ⡼¥É¤Ç¤âƱ¤¸µóÆ°¤ò¤¹¤ë¥×¥í¥°¥é¥à¤Ë¤¹¤ë¤Ë¤Ï¡¢¤³¤ì¤é¤Î´Ø¿ô¤ò»È¤¦Á°¤Ë°ú¿ô¤ÎȽÄê¤ò¤¹¤ëifʸ¤òÆþ¤ì¤ëɬÍפ¬¤¢¤ë¤è¤¦¤Ç¤¹¤Í¡£
¾Ü¤·¤¯¤´ÀâÌÀ¤·¤Æ¤¤¤¿¤À¤­Íý²ò¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤·¤¿¡£¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
 

¸¡¾Ú¤Î¤ª´ê¤¤

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ 8·î14Æü(¶â)11»þ17ʬ50ÉÃ
ÊÖ¿®¡¦°úÍÑ
  52Ëç¤Î¥È¥é¥ó¥×¤ò¤è¤¯¥·¥ã¥Ã¥Õ¥ë¤·¤¿¸å¡¢£±¡Á£±£°¤Î¿ô»ú¤ò°ì¤Ä·è¤á¤ë¡£
¤½¤Î¿ô»ú¤Ë½¾¤¤¡¢¤Þ¤º¥Ç¥Ã¥¯¤Î¥È¥Ã¥×¤«¤é¤½¤ÎËç¿ô¤À¤±¥Æ¡¼¥Ö¥ë¤Ë°ìË示¤Ä¥Æ¡¼¥Ö¥ë¤Øɽ¸þ¤­¤Ë½Å¤Í¤Æ¤¤¤¯¡£¤½¤·¤ÆºÇ¸å¤Ë½Ð¤·¤¿¥«¡¼¥É¤Î¿ô»ú¤Ë½¾¤¤¡Ê¤¿¤À¤·³¨ »¥¤Ï¿ô»ú£µ¤È¤¹¤ë¡£¡Ë¼ê¸µ¤Î¥Ñ¥±¥Ã¥È¤«¤éºÆ¤Ó¥«¡¼¥É¤òºÇ¸å¤Ë¥«¡¼¥É¤¬½Ð¤»¤Ê¤¯¤Ê¤ë¤Þ¤Ç¥Æ¡¼¥Ö¥ë¤Ø½Å¤Í¤Æ¤¤¤¯¤³¤È¤ò·«¤êÊÖ¤·¤Æ¤¤¤¯¤È¤¹¤ë¡£¤³¤ÎºÇ¸å¤Î¥«¡¼¥É ¤ËÅö¤¿¤ë¤â¤Î¡Ê¥Æ¡¼¥Ö¥ë¤Ëɽ¸þ¤­¤Ë½Å¤Í¤¿¥«¡¼¥É¤Î¥È¥Ã¥×¤Î¥«¡¼¥É¡Ë¤¬¡¢ºÇ½é¤ËÁªÂò¤·¤¿¿ô»ú¤Î£±¡Á£±£°¤Ë´Ø¤ï¤é¤º¾ï¤Ë°ìÄê¤Î¥«¡¼¥É¤Ë¤Ê¤ë¤È¤¤¤¦³ÎΨ¤¬ £µ¡¿£¶¡ÊÌ󣸣³¡ó¡Ë¤È¤¤¤¦Ë¡Â§¡Ê¥¯¥ë¥¹¥«¥ë¸¶Íý¡Ë¤¬À®¤êΩ¤Ä½ñ¤«¤ì¤Æ¤¤¤ë½ñʪ¤òÆɤߤޤ·¤¿¡£
¤³¤Î¤³¤È¤ò¥³¥ó¥Ô¥å¡¼¥¿¤Ç¥½¥Õ¥ÈŪ¤Ë¼Â¾Ú¤·¤Æ失¤Þ¤»¤ó¤«¡©
 

Re: ¸¡¾Ú¤Î¤ª´ê¤¤

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 8·î14Æü(¶â)13»þ39ʬ2ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.478[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£
!¥¯¥ë¥¹¥«¥ë¡¦¥«¥¦¥ó¥È¡ÊKruskal count¡Ë

LET N=52 !¥«¡¼¥É¤ÎËç¿ô

LET mk$="SCHD" !¥«¡¼¥É¤Î¥Þ¡¼¥¯
LET nm$="A234567890JQK" !¥«¡¼¥É¤ÎÈÖ¹æ

DEF s2n(s)=MOD(s-1,13)+1 !Ï¢ÈÖ¤ò¥«¡¼¥É¤ÎÈÖ¹æ¤Ø
DEF s2m(s)=INT((s-1)/13)+1 !Ï¢ÈÖ¤ò¥«¡¼¥É¤Î¥Þ¡¼¥¯¤Ø


DIM c(N) !¥«¡¼¥É¤ÎʤÓ

SUB card_initialize(c(),N) !¥«¡¼¥É¤òÀ°Î󤹤ë
   FOR i=1 TO N
      LET c(i)=i
      !!!PRINT i;s2m(i);s2n(i)
   NEXT i
END SUB

RANDOMIZE
SUB shuffle_randomize(c(),N) !¥é¥ó¥À¥à¤Ë¥·¥ã¥Ã¥Õ¥ë¤¹¤ë
   FOR i=N TO 2 STEP -1
      LET j=INT(RND*(i-1))+1 !£±¡Ái-1
      swap c(i),c(j)
   NEXT i
END SUB
!------------------------------ ¤³¤³¤Þ¤Ç¤¬¥µ¥Ö¥ë¡¼¥Á¥ó

CALL card_initialize(c,N)
CALL shuffle_randomize(c,N)
MAT PRINT c;

FOR r=1 TO 10 !¹¥¤­¤Ê¿ô»ú

   LET p=r !¤½¤Î¿ô»ú¤ÎËç¿ôʬ¡¢¥È¥é¥ó¥×¤ò¾å¤«¤é½ç¤Ëɽ¸þ¤­¤Ë¤·¤Æ´ù¤Î¾å¤Ë½Å¤Í¤ÆÇÛ¤ë¡Ê½çÈÖ¤òÊø¤µ¤Ê¤¤¤¿¤á¡Ë

   DO WHILE p<=N !¼ê»ý¤Á¤Î¥È¥é¥ó¥×¤Î»Ä¤ê¤¬¤Ê¤±¤ì¤Ð¡¢½ªÎ»¡£
      PRINT c(p); !ɽ¸þ¤­¤Î°ìÈÖ¾å¤Î¥È¥é¥ó¥×¤Î¿ô»ú

      LET t=s2n(c(p)) !£±¡Á£±£³
      IF t>10 THEN LET t=5 !³¨»¥¤Ï¤¹¤Ù¤Æ£µ¤È¤¹¤ë

      LET p=p+t !¼¡¤Ø
   LOOP
   PRINT

NEXT r !´ù¤Î¾å¤Îɽ¸þ¤­¤Î¥È¥é¥ó¥×¤òÁ´¤Æ¼è¤ê¾å¤²¤Æ΢¸þ¤­¤Ë¤·¡¢¼ê»ý¤Á¤Î¥È¥é¥ó¥×¤Î¾å¤ËÌ᤹

END
 

¤ªÎé

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ 8·î15Æü(ÅÚ)08»þ11ʬ9ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¨ºÂ¤Î¸¡¾Ú¤Î¥×¥í¥°¥é¥à²¿ÅÙ¤âÆ°¤«¤·¤Æ¤ß¤Þ¤·¤¿¡£
»×¤Ã¤¿¤è¤êƱ°ì¤Î¥«¡¼¥É¤Ëé¤êÃ夯¤â¤Î¤Ê¤ó¤Ç¤¹¤Í¡£¤³¤ì¤Ï¥Þ¥¸¥Ã¥¯¤Ë½½Ê¬ÍøÍѤǤ­¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£
¤³¤Îˡ§¤òÍøÍѤ¹¤ë¼ê½ç¤ò¹½À®¤·¤¿¤¤¤È»×¤¤¤Þ¤¹¡£
¤¤¤Ä¤â»³Ã椵¤ó¤ÎÏÓÁ°¤Ë¤Ï´¶¿´¤µ¤»¤é¤ì¤Þ¤¹¡£¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
 

do while ¡Á loop until

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 8·î15Æü(ÅÚ)13»þ18ʬ58ÉÃ
ÊÖ¿®¡¦°úÍÑ
  !¼¡¤ÎÍͤˡ¢do while ¤È¡¢loop until ξÊý½ñ¤¤¤Æ¤â¡¢´üÂԤɤ¦¤ê¤Ë ¤Ê¤ê¤Þ¤¹¡£¤¬¡¢
!help ¤Ë¤Ï¡¢ÊÒÊý¤ÎÎ㤷¤«Ãµ¤»¤Þ¤»¤ó¡¢»È¤Ã¤Æ¤è¤¤¤Ç¤·¤ç¤¦¤«¡£

DEF f(x,y)=SQR(x*y)

CALL while_until( 1,  6 )
CALL while_until( 0, 100)

SUB while_until( x, y)
   PRINT "  x   y  f(x,y)"
   DO WHILE f(x,y)< 20
      PRINT USING "### ###  ##.###":x,y,f(x,y)
      LET x=x+1
      LET y=y-1
   LOOP UNTIL y<=x
END SUB

END
 

Re: do while ¡Á loop until

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 8·î16Æü(Æü)07»þ36ʬ49ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.481[¸µµ­»ö¤Ø]

Full BASICµ¬³Ê¤Ï¡¤doʸ¤«loopʸ¤Î°ìÊý¤Ë¤·¤«¡Ö½Ð¸ý¾ò·ï¡×¤ò½ñ¤±¤Ê¤¤¤È¤¤¤¦¤è¤¦¤Êµ¬Äê¤ò´Þ¤ß¤Þ¤»¤ó¡£
¤Ê¤Î¤Ç¡¤doʸ¤Èloopʸ¤ÎξÊý¤ËWHILE¤Þ¤¿¤ÏUNTIL¤ò½ñ¤¤¤Æ¤âµ¬³Ê³°¤Î¥×¥í¥°¥é¥à¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
¤Ä¤¤¤Ç¤Ë¸À¤¦¤È¡¤¤³¤ì¤Ë¤µ¤é¤ËEXIT DOʸ¤òÄɲ乤뤳¤È¤â¤Ç¤­¤Þ¤¹¡£
 

Re: do while ¡Á loop until

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ 8·î16Æü(Æü)09»þ28ʬ45ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.481[¸µµ­»ö¤Ø]

ÇòÀÐÀèÀ¸¤â½ñ¤«¤ì¤Æ¤Þ¤¹¤¬,JISµ¬³Ê¤òÆɤà¤È¶Ø»ß¤Ï¤·¤Æ¤¤¤Ê¤¤¤Ç¤¹¤Í¡£
"WHILE ÏÀÍý¼°"¤ä"UNTIL ÏÀÍý¼°"¤ò½Ð¸ý¾ò·ï¤È¸Æ¤Ö¤é¤·¤¤¤Ç¤¹¤¬,do¹Ô¤Èloop¹Ô¤Î½Ð¸ý¾ò·ï¤ÏÆÈΩ¤·¤Æ¤¤¤ë¤è¤¦¤Ç¤¹¡£

------------------------------------------------------------------------------------------
8.3¡¡·«ÊÖ¤·¹½Â¤

8.3.4¡¡°ÕÌ£
(1) ½Ð¸ý¾ò·ï¤Ï,µ¡Ç½¸ìWHILE¤Ë³¤¯ÏÀÍý¼°¤ÎÃͤ¬µ¶¤Ç¤¢¤ë¤«,Ëô¤Ïµ¡Ç½¸ìUNTIL¤Ë³¤¯ÏÀÍý¼°¤ÎÃͤ¬
    ¿¿¤Ç¤¢¤ì¤Ð,·«ÊÖ¤·¶è¤«¤é½Ð¤ë¤³¤È¤ò»Ø¼¨¤¹¤ë¡£
(2) ¥×¥í¥°¥é¥à¤Î¼Â¹Ô¤¬do¹Ô¤Ë㤷¤¿»þ,do¹Ô¤ÎÃæ¤Ë½Ð¸ý¾ò·ï¤¬¤¢¤ì¤Ð,¤½¤ì¤¬É¾²Á¤µ¤ì¤ë¡£½Ð¸ý¾ò·ï
    ¤¬¤Ê¤¤¤È¤­,Ëô¤Ï½Ð¸ý¾ò·ï¤¬·«ÊÖ¤·¶è¤«¤é½Ð¤ë¤³¤È¤ò»Ø¼¨¤·¤Ê¤¤¤È¤­¤Ë¤Ï,¼¡¤Î¹Ô¤«¤é¼Â¹Ô¤ò³¤±¤ë¡£
    ½Ð¸ý¾ò·ï¤¬·«ÊÖ¤·¶è¤«¤é½Ð¤ë¤³¤È¤ò»Ø¼¨¤¹¤ë¤È¤­¤Ë¤Ï,Âбþ¤¹¤ëloop¹Ô¤Î¼¡¤Î¹Ô¤«¤é¼Â¹Ô¤ò³¤±¤ë¡£
    ¡¡¥×¥í¥°¥é¥à¤Î¼Â¹Ô¤¬loop¹Ô¤Ë㤷¤¿»þ,loop¹Ô¤ÎÃæ¤Ë½Ð¸ý¾ò·ï¤¬¤¢¤ì¤Ð,¤½¤ì¤¬É¾²Á¤µ¤ì¤ë¡£½Ð¸ý
    ¾ò·ï¤¬¤Ê¤¤¤È¤­,Ëô¤Ï½Ð¸ý¾ò·ï¤¬·«ÊÖ¤·¶è¤«¤é½Ð¤ë¤³¤È¤ò»Ø¼¨¤·¤Ê¤¤¤È¤­¤Ë¤Ï,Âбþ¤¹¤ëdo¹Ô¤«¤é
    ¼Â¹Ô¤ò³¤±¤ë¡£½Ð¸ý¾ò·ï¤¬·«ÊÖ¤·¶è¤«¤é½Ð¤ë¤³¤È¤ò»Ø¼¨¤¹¤ë¤È¤­¤Ë¤Ï,loop¹Ô¤Î¼¡¤Î¹Ô¤«¤é¼Â¹Ô¤ò³
    ¤±¤ë¡£
------------------------------------------------------------------------------------------

²¼µ­¤Î¡ÖJIS¸¡º÷¡×¤Î¥Ú¡¼¥¸¤«¤éµ¬³Ê¤Î±ÜÍ÷¤¬²Äǽ¤Ç¤¹¡£

http://www.jisc.go.jp/app/JPS/JPSO0020.html

¡ÖJISµ¬³Ê̾¾Î¤«¤éJIS¤ò¸¡º÷¡×¤Ë¡ÖBASIC¡×¤ÈÆþÎÏ¡£("basic"¤ÏÉÔ²Ä)
 

do while ¡Á loop until

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 8·î16Æü(Æü)11»þ02ʬ43ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ÇòÀÐÀèÀ¸¡¢¹ÓÅĤµ¤ó ¤¿¤¤¤Ø¤ó»þ´Ö¤Î¤«¤«¤ëÄ´ºº¤ò¡¢¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£  

Åú¤¨¤¬ÃΤꤿ¤¤

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ 8·î18Æü(²Ð)18»þ04ʬ28ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¡ãÌäÂê¡ä
À°¿ô£î¤¬Í¿¤¨¤é¤ì¤¿¤È¤­¡¢£°¡Á£î¤Î´Ö¤ÎÁ´¤Æ¤Î¿ô¤ò½ñ¤¯¤Î¤ËɬÍפȤµ¤ì¤ë¡Ö£±¡×¤Î¿ô¤òÊÖ¤¹´Ø¿ô¤ò£æ(n)¤È¤¹¤ë¡£¡ÊÎã¡¡f(13)=6 )
f(1)=1¤Ç¤¢¤ë¤¬¡¢°ìÈ̤Ëf(n)=n
¤È¤Ê¤ë¤è¤¦¤Ê¡¢£²ÈÖÌܤËÂ礭¤¤£î¤òµá¤á¤è¡£
¤Ê¤ëÌäÂê¤ÎÅú¤¨¤òÃΤë¥×¥í¥°¥é¥à¤ò¤ª¶µ¤¨¤¯¤À¤µ¤¤¡£
 

Re: Åú¤¨¤¬ÃΤꤿ¤¤

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 8·î18Æü(²Ð)20»þ22ʬ41ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.485[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> f(1)=1¤Ç¤¢¤ë¤¬¡¢°ìÈ̤Ëf(n)=n¤È¤Ê¤ë¤è¤¦¤Ê¡¢£²ÈÖÌܤËÂ礭¤¤£î¤òµá¤á¤è¡£

!n=13¤Î¾ì¹ç
!0,1,2,3,4,5,6,7,8,9,10,11,12,13¤è¤ê¡¢¡Ö£±¡×¤Î¿ô¤Ï£¶¸Ä¤È¤Ê¤ë¡£
!¡èf(13)=6

OPTION ARITHMETIC NATIVE

LET fn=0 !£±¤Î¿ô

FOR n=0 TO 2^31-1 !ÈÏ°Ï

   LET t=n !£°¡Á£î¤òɽ¸½¤¹¤ë

   DO WHILE t>0 !³Æ·å¤¬£±¤Î¿ô¤ò¤«¤¾¤¨¤ë
      IF MOD(t,10)=1 THEN LET fn=fn+1
      LET t=INT(t/10)
   LOOP

   IF fn=n THEN PRINT "f(";n;")=";fn !f(n)=n¤Î¤Ê¤é

NEXT n

END


¼Â¹Ô·ë²Ì
f( 0 )= 0
f( 1 )= 1
f( 199981 )= 199981 ¢« ¤³¤ì¡©
f( 199982 )= 199982
f( 199983 )= 199983
f( 199984 )= 199984
f( 199985 )= 199985
f( 199986 )= 199986
f( 199987 )= 199987
f( 199988 )= 199988
f( 199989 )= 199989
f( 199990 )= 199990
f( 200000 )= 200000
f( 200001 )= 200001
f( 1599981 )= 1599981
f( 1599982 )= 1599982
f( 1599983 )= 1599983
f( 1599984 )= 1599984
¡¡¡§
¡¡¡§
 

¥Ø¡Á¤Ê¤ë¤Û¤É¡ª¡ª

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ 8·î18Æü(²Ð)21»þ04ʬ4ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¼Â¸³Åª¤Ë£±£°£°£°°Ì¤Þ¤ÇÄ´¤Ù¤Æ¤¤¤¿¤¬¡¢¤Ê¤«¤Ê¤«¸«¤Ä¤«¤é¤º¤ª¼ê¾å¤²¾õÂ֤Ǥ·¤¿¡£
¤³¤ó¤Ê¤³¤È¤ò¤·¤Æ¸«¤Ä¤±½Ð¤¹¤³¤È¤ÏÅú¤¨¤Î£±£¹£¹£¹£¸£±¤ò¤ß¤Æ¤È¤Æ¤âÉÔ²Äǽ¤Ç¤¢¤ë¤³¤È¤¬Ê¬¤«¤ê¤Þ¤·¤¿¡£
¤³¤ó¤Ê¤Ë¤â¼¡¤Î¿ô¤¬Î¥¤ì¤Æ¤¤¤ë¤Î¤¬ÉԻ׵ĤǤ¹¡£
¤³¤ì¤Ï·×»»µ¡¤¬¤Ê¤±¤ì¤Ðʬ¤«¤é¤Ê¤¤¡Êµ¤¤Å¤«¤Ê¤¤¡Ë¤³¤È¤Ê¤ó¤Ç¤·¤ç¤¦¤Í¡£
¤Ç¤â郎¤³¤ó¤ÊÌäÂê¤ò¹Í¤¨½Ð¤¹¤Î¤«¡Êµ¤¤Å¤¯¡ËÉԻ׵ĤǤ¹¡£
 

ÄÉ¿­

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ 8·î19Æü(¿å)07»þ59ʬ5ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¤³¤Î¥×¥í¥°¥é¥à¤òĹ»þ´ÖÆ°¤«¤·¤Æ¤¤¤¿¤é¡¢¼¡¤Î¤³¤È¤¬È½ÌÀ¤·¤Þ¤·¤¿¡£
£±¤«¤é£±£±£±£±£±£±£±£±£±£±¤Þ¤Ç¤Î¿ô»ú¤òÁ´¤Æ½ñ¤­Ï¢¤Í¤¿¤È¤¹¤ë¤È¡¢
¡Ö£±¡×¤ò£±£±£±£±£±£±£±£±£±£±²ó½ñ¤¯¤³¤È¤Ë¤Ê¤ë¡£
¡Ê¤À¤«¤é¤Ê¤ó¤Ê¤ó¤Í¤ó¡¦¡¦¡¦¤È¤¤¤¦À¼¤¬Ê¹¤³¤¨¤Æ¤­¤½¤¦¤Ç¤¹¤¬¡Ë
 

Re: Åú¤¨¤¬ÃΤꤿ¤¤

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 8·î20Æü(ÌÚ)10»þ17ʬ38ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.486[¸µµ­»ö¤Ø]

¡ü³Æ·å¤Ç¤ÎÄ´ººÈϰϤϤ¢¤ë¤«¡©

Á°½Ð¤Î¥×¥í¥°¥é¥à¤Ç¤Ï¡¢¤¹¤Ù¤Æ¤Î¿ô¤ò¸¡¾Ú¤·¤Æ¤¤¤ë¤¬¡¢¼¡¤Î¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¤³¤È¤Ç¡¢
¤½¤Î·ë²Ì¤Î¿ä¬¤è¤ê¡¢ÈϰϤ¬¸ÂÄê¤Ç¤­¤½¤¦¤À¡£
OPTION ARITHMETIC NATIVE

LET fn=0 !£±¤Î¿ô

FOR k=1 TO 12 !ÈÏ°Ï

   LET n=10^k-1 !9,99,999,9999,¡Ä
   PRINT "f(";n;")=";

   FOR i=INT(n/10)+1 TO n !£°¡Á£î¤òɽ¸½¤¹¤ë

      LET t=i !³Æ·å¤Î£±¤Î¿ô¤ò¤«¤¾¤¨¤ë
      DO WHILE t>0
         IF MOD(t,10)=1 THEN LET fn=fn+1
         LET t=INT(t/10)
      LOOP

   NEXT i

   PRINT fn !·ë²Ì¤òɽ¼¨¤¹¤ë

NEXT k

END

¼Â¹Ô·ë²Ì
f( 9 )= 1
f( 99 )= 20
f( 999 )= 300
f( 9999 )= 4000
f( 99999 )= 50000
f( 999999 )= 600000
f( 9999999 )= 7000000
f( 99999999 )= 80000000
¡¡¡§
¡¡¡§
¤¿¤È¤¨¤Ð¡¢£³·å¤Ïf( 999 )= 300 ¤è¤ê¡¢n=100¡Á300¤ÎÈϰϤòÄ´¤Ù¤ì¤Ð¤è¤¤¤³¤È¤Ë¤Ê¤ë¡£
¡Ê¾ÚÌÀ¡Ë
£±·å¤Î¾ì¹ç¡¢¼«ÌÀ¡£
£²·å¤Î¾ì¹ç¡¢°ì¤Î°Ì¤¬£±¤Ï¡¢10Ä̤ꡣ½½¤Î°Ì¤¬£±¤Ï¡¢10Ä̤ꡣ2*10=20Ä̤ꡣ
£ë·å¤Î¾ì¹ç¡¢£±¤Ä¤Î·å¤ò£±¤Ë¸ÇÄꤷ¤¿¤È¤­¡¢»Ä¤ê¤Î·å¤Î¾ì¹ç¤Î¿ô¤Ï¡¢10^(k-1)Ä̤ꡣ
¤³¤ì¤¬k·å¤¢¤ë¤Î¤Ç¡¢k*10^(k-1)Ä̤ê¤È¤Ê¤ë¡£
¡Ê¾ÚÌÀ½ª¤ê¡Ë
¤·¤¿¤¬¤Ã¤Æ¡¢£°¡Á10^k-1¡Êk¤Ï·å¿ô¡Ë¤Ç¤Ï¡¢¡Ö£±¡×¤Î¿ô¤Ï f(10^k-1)=k*10^(k-1) ¤È¤Ê¤ë¡£

¤Þ¤¿¡¢f(10^10-1)=10^10¤«¤é¡¢f(10,000,000,000)=10,000,000,001¤È¤Ê¤ë¡£
¤³¤ì¤è¤ê¡¢n=10^10°Ê¹ß¤Ïf(n)>n¤¬Í½ÁÛ¤µ¤ì¤ë¡£


¡¡£°¡Á10^10¤ÎÈϰϤǸ«¤Ä¤«¤ë1,111,111,110¤Ï¡¢¡ÖºÇÂç¤Î¿ô¡©¡×
¤Ê¤é

¡¡¡¡> f(1)=1¤Ç¤¢¤ë¤¬¡¢°ìÈ̤Ëf(n)=n¤È¤Ê¤ë¤è¤¦¤Ê¡¢£²ÈÖÌܤËÂ礭¤¤£î¤òµá¤á¤è¡£
¤Ï¡¢
¡¡535,200,001
 

´ª°ã¤¤¤Ç¤·¤¿

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ 8·î20Æü(ÌÚ)12»þ14ʬ40ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ºÇÂ礬£±¡¤£±£±£±¡¤£±£±£±¡¤£±£±£°¤Ç¤·¤¿¡£
¼¡¤Î£±¡¤£±£±£±¡¤£±£±£±¡¤£±£±£±¤Ç¤Î¡Ö£±¡×¤Î¸Ä¿ô¤Ï
£±¡¤£±£±£±¡¤£±£±£±¡¤£±£²£°¡Ê¸Ä¡Ë¤Ë¤Ê¤ë¤ó¤Ç¤·¤¿¡£
¤Á¤Ê¤ß¤ËÅÓÃ棱£³¡¤£±£¹£¹¡¤£¹£¹£¸¤ä£±£±£·¡¤£´£¶£³¡¤£¸£²£µ¤Ê¤É¤¬Á°¸å¤Î£î¤Ë²¿¤Î´ØÏ¢¤â̵¤¯²ò¤ÎÃæ¤Ë´Þ¤Þ¤ì¤Æ¤¯¤ë¤Î¤¬ÌÌÇò¤¤¤Ç¤¹¡£
 

Re: Åú¤¨¤¬ÃΤꤿ¤¤

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ 8·î21Æü(¶â)12»þ03ʬ41ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.489[¸µµ­»ö¤Ø]

p¿ÊË¡¤Ë¤Ä¤¤¤Æ¤â10¿ÊË¡¤ÈƱÍͤΤ³¤È¤¬¸À¤¨¤½¤¦¤Ç¤¹¡£
¡Ø³Æ¿ôÃͤòp¿ÊË¡¤Çɽ¸½¤·¤¿¤È¤­,f(n)=n¤È¤Ê¤ëºÇÂç¤În¤Ï n=p^(p-1)+p^(p-2)+¡Ä+p^2+p¡Ù
¤Ä¤Þ¤ê¡ÖËö°Ì¤¬0¤Ç¾¤Î·å¤¬1¤Ç¤¢¤ëp·å¤Î¿ô¡×¤È¤¤¤¦¤³¤È¤Ç¤¹¡£p=4¤Ê¤é¤Ðn=1110
»³ÃæϵÁ¤µ¤ó¤ÎÅê¹Æµ­»ö¤Ë¤¢¤ë"10"¤ò"p"¤ËÃÖ¤­´¹¤¨¤ì¤Ð,¤Û¤È¤ó¤É¤Î¾ì¹çp¿ÊË¡¤Ë°ìÈ̲½¤Ç¤­¤½¤¦¤Ç¤¹¡£

OPTION ARITHMETIC NATIVE
DECLARE FUNCTION change
DIM sum1(2 TO 10),max_n(2 TO 10)
MAT sum1=ZER
PRINT USING "##### ############(=>#########)":"p¿ÊË¡","f(n)=nºÇÂçÃÍ","10¿Ê¿ô"
FOR n=1 TO 7^7
   FOR p=2 TO 7  ! p=8°Ê¾å¤Ï¸Ä¡¹¤Ë·×»»¤·¤Ê¤¤¤È»þ´Ö¤¬¤«¤«¤ë
      LET x=n
      DO
         IF MOD(x,p)=1 THEN LET sum1(p)=sum1(p)+1
         LET x=INT(x/p)
      LOOP UNTIL x=0
      IF sum1(p)=n THEN LET max_n(p)=n ! f(n)=n
   NEXT p
NEXT n
FOR p=2 TO 10
   PRINT USING "  ## ###########  (=##########)":p,change(max_n(p),p),max_n(p)
NEXT p
!
FUNCTION change(x,p) ! 10¿Ê¿ô¤òp¿Ê¿ô¤ËÊÑ´¹
   LET s,k=0
   DO
      LET s=MOD(x,p)*10^k+s
      LET k=k+1
      LET x=INT(x/p)
   LOOP UNTIL x=0
   LET change=s
END FUNCTION
END
 

¥Ð¥°¡©INT´Ø¿ô

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 8·î23Æü(Æü)19»þ12ʬ28ÉÃ
ÊÖ¿®¡¦°úÍÑ
  10¿Ê¥â¡¼¥É¤È£²¿Ê¥â¡¼¥É¤ÇÃͤ¬°Û¤Ê¤ê¤Þ¤¹¡£
¤³¤ì¤é¤ÏÍ­¸ú·å¿ô¤Ë¤è¤ë·×»»¸íº¹¤Ç¤·¤ç¤¦¤«¡©
!LET p=10 !Î㣱
!LET n=1000
!LET p=5 !Î㣲
!LET n=625
LET p=7 !Î㣳
LET n=49
LET x1=LOG(n)/LOG(p) !À°¿ôÉôʬ¤¬°Û¤Ê¤ë
LET x2=INT(LOG(n)/LOG(p)) !
PRINT x1; x2; INT(x1)
END
 

Re: ¥Ð¥°¡©INT´Ø¿ô

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ 8·î24Æü(·î)07»þ37ʬ8ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.492[¸µµ­»ö¤Ø]

²¼¤Î¥×¥í¥°¥é¥à¤ò[¥ª¥×¥·¥ç¥ó][¿ôÃÍ][ɽ¼¨·å¿ô¤ò¿¤¯]¤Ë¥Á¥§¥Ã¥¯¤ò¤¤¤ì¤Æ¼Â¹Ô¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£

¥Ø¥ë¥×¤Î[Áàºî][¥ª¥×¥·¥ç¥ó¥á¥Ë¥å¡¼][¿ôÃÍ]¤Ë¤è¤ë¤È¡¢¼ÂºÝ¤Ë·×»»¤µ¤ì¤ë¿ôÃͤÈɽ¼¨¤µ¤ì¤ë¿ôÃͤÎÀºÅ٤˰㤤¤¬¤¢¤ë¤è¤¦¤Ç¤¹¡£
Î㣱¤Ç¤Ï¡¢2¿Ê¥â¡¼¥É¤Çx1¤Ï19·åÌÜ¤Þ¤Ç¤Ï 2.999999999999999555 ¤ÎÃͤò»ý¤Á¤Þ¤¹¤¬Ä̾ïɽ¼¨¤Ç¤Ï15·å¤Ë´Ý¤á¤é¤ì 3 ¤Èɽ¼¨¤µ¤ì¤Þ¤¹¡£
Î㣲Î㣳¤Ï¡Ö10¿Ê15·å¥â¡¼¥É¤Ç¤Ï¿ôÃͼ°¤È¤½¤ÎÃͤòÂåÆþ¤·¤¿ÊÑ¿ô¤È¤Ç¤ÏÀºÅÙ¤¬°Û¤Ê¤ë¡×¤³¤È¤Ëµ¯°ø¤¹¤ë¤È»×¤ï¤ì¤Þ¤¹¡£
¤¿¤È¤¨¤Ð¼¡¤Î¾®¥×¥í¥°¥é¥à¤Ç¤â¡¢10¿Ê¥â¡¼¥É¤Ç¤Ï a/7 ¤È b ¤Ï°Û¤Ê¤ëÃͤˤʤê¤Þ¤¹¡£
   10 LET a=1
   20 LET b=a/7
   30 PRINT a/7 ; b
   40 END


OPTION ARITHMETIC DECIMAL
!LET p=10 !Î㣱
!LET n=1000
!LET p=5 !Î㣲
!LET n=625
LET p=7 !Î㣳
LET n=49
LET x1=LOG(n)/LOG(p) !À°¿ôÉôʬ¤¬°Û¤Ê¤ë
LET x2=INT(LOG(n)/LOG(p)) !
PRINT "LOG(n)/LOG(p) =";LOG(n)/LOG(p)
PRINT "x1 =";x1
PRINT "INT(LOG(n)/LOG(p)) =";INT(LOG(n)/LOG(p))
PRINT "INT(x1) =";INT(x1)
PRINT "x2 =";x2
PRINT
CALL binary(STR$(p),STR$(n))
PRINT
CALL thousand(STR$(p),STR$(n))
END

EXTERNAL SUB binary(p$,n$)
OPTION ARITHMETIC NATIVE
LET p=VAL(p$)
LET n=VAL(n$)
LET x1=LOG(n)/LOG(p) !À°¿ôÉôʬ¤¬°Û¤Ê¤ë
LET x2=INT(LOG(n)/LOG(p)) !
PRINT "LOG(n)/LOG(p) =";LOG(n)/LOG(p)
PRINT "x1 =";x1
PRINT "INT(LOG(n)/LOG(p)) =";INT(LOG(n)/LOG(p))
PRINT "INT(x1) =";INT(x1)
PRINT "x2 =";x2
END SUB

EXTERNAL SUB thousand(p$,n$)
OPTION ARITHMETIC DECIMAL_HIGH
LET p=VAL(p$)
LET n=VAL(n$)
LET x1=LOG(n)/LOG(p) !À°¿ôÉôʬ¤¬°Û¤Ê¤ë
LET x2=INT(LOG(n)/LOG(p)) !
PRINT "LOG(n)/LOG(p) =";LOG(n)/LOG(p)
PRINT "x1 =";x1
PRINT "INT(LOG(n)/LOG(p)) =";INT(LOG(n)/LOG(p))
PRINT "INT(x1) =";INT(x1)
PRINT "x2 =";x2
END SUB
 

Re: ¥Ð¥°¡©INT´Ø¿ô

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 8·î24Æü(·î)13»þ42ʬ56ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.493[¸µµ­»ö¤Ø]

¼«Á³¿ô£î¤Î£ð¿Êˡɽµ­¤Ç¤Î·å¿ô¤òµá¤á¤ë¥×¥í¥°¥é¥à¤ò¤Ä¤¯¤ë¤È¤­¤Ëµ¤¤Å¤­¤Þ¤·¤¿¡£
»×¤ï¤ÌÍî¤È¤··ê¤Ç¤¹¡£Ä¾ÀÜ¡¢¿Ê¿ôÊÑ´¹¤·¤Æ·å¿ô¤òµá¤á¤ë¤³¤È¤Ë¤·¤Þ¤¹¡£
¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
LET STR1$="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" !p¿ÊË¡¤Î¿ô»ú
FUNCTION ExBSTR$(n,p) !ÈóÉé¤ÎÀ°¿ôn¤òp¿ÊË¡¤Çɽµ­¤¹¤ë
   LET s$=""
   DO
      LET nn=INT(n/p)
      LET t=n-nn*p !MOD(n,p)
      LET s$=STR1$(t+1:t+1)&s$ !²¼¤Î°Ì¤«¤é
      LET n=nn
   LOOP UNTIL n=0
   LET ExBSTR$=s$
END FUNCTION


LET p=5 !¿Ê¿ô

FOR n=1 TO p^p !¼«Á³¿ô

   LET x=INT(LOG(n)/LOG(p))+1 !·å¿ô
   LET x2=INT(LOG2(n)/LOG2(p))+1
   LET x10=INT(LOG10(n)/LOG10(p))+1
   LET k=g(n,p) !¿Ê¿ôÊÑ´¹¤Ë¤è¤ë
   IF k<>x OR k<>x2 OR k<>x10 THEN PRINT n; STR$(p);"#";ExBSTR$(n,p), k; x; x2; x10

NEXT n


FUNCTION g(n,p) !¼«Á³¿ôn¤Îp¿ÊË¡¤Ç¤Î·å¿ô¡¡¢¨p^c=n
   LET t=1
   LET c=0 !·å¿ô
   DO
      LET t=t*p
      LET c=c+1
   LOOP WHILE t<=n
   LET g=c
END FUNCTION

END
 

Re: Åú¤¨¤¬ÃΤꤿ¤¤

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 8·î24Æü(·î)16»þ03ʬ16ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.491[¸µµ­»ö¤Ø]

¡Ö¾ì¹ç¤Î¿ô¡×¤ò»»½Ð¤¹¤ë¤³¤È¤Ç¡¢f(n)¤ÎÃͤòºÆµ¢½èÍý¤Çµá¤á¤Þ¤¹¡£
ľÀܵá¤á¤ë¤Î¤Ç¡¢¸Ä¡¹¤Î¡ÊÂ礭¤Ê¡ËÃͤòÆÀ¤ë¾ì¹ç¤Ï¤³¤Á¤é¤ÎÊý¤¬Áᤤ¤Ç¤¹¡£
Á°½Ð¤Î¤è¤¦¤Ë£°¤«¤é½ç¤Ëµá¤á¤ë¾ì¹ç¤Ï¡¢£°¡Á£î¤òËè²ó·×»»¤¹¤ë¤³¤È¤Ë¤Ê¤ë¤Î¤ÇÃÙ¤¯¤Ê¤ê¤Þ¤¹¡£
!Îã¡¡f(123)¤Î¾ì¹ç
!100¤È23¤Ëʬ²ò¤¹¤ë
!¡¡3·å¤Î¿ô¡ÊºÇ¾å°Ì·å=1¡Ë
!¡¡¡¡1xx·Á¼°¤Î¿ô = k·åÌܤË(23+1)=24¡¢(k-1)¡Á1·åÌܤËf(_99)=20
!¡¡Ã¼¿ô23
!¡¡¡¡f(23)
!¡¡¢Í
!¡¡¡¡20¤È3¤Ëʬ²ò¤¹¤ë
!¡¡¡¡¡¡2·å¤Î¿ô¡ÊºÇ¾å°Ì·å=2¡Ë
!¡¡¡¡¡¡¡¡1x·Á¼°¤Î¿ô = k·åÌܤË10^(2-1)=10¡¢(k-1)¡Á1·åÌܤËf(_9)=1
!¡¡¡¡¡¡¡¡2x·Á¼°¤Î¿ô = k¡Á1·åÌܤËf(_9)=1
!¡¡¡¡¡¡Ã¼¿ô3
!¡¡¡¡¡¡¡¡f(3)
!¡¡¡¡¡¡¢Í
!¡¡¡¡¡¡¡¡3¤È0¤Ëʬ²ò¤¹¤ë
!¡¡¡¡¡¡¡¡¡¡1·å¤Î¿ô¡ÊºÇ¾å°Ì·å=3¡Ë
!¡¡¡¡¡¡¡¡¡¡¡¡1·Á¼°¤Î¿ô = 1·åÌܤË10^(1-1)=1¡¢(1-1)·åÌܤËf(_)=0
!¡¡¡¡¡¡¡¡¡¡¡¡2·Á¼°¤Î¿ô = 1·åÌܤËf(_)=0
!¡¡¡¡¡¡¡¡¡¡¡¡3·Á¼°¤Î¿ô = 1·åÌܤËf(_)=0
!¡¡¡¡¡¡¡¡¡¡Ã¼¿ô0
!¡¡¡¡¡¡¡¡¡¡¡¡f(0)=0
!¡è(24+20) + (10+1 +1) + (1+0 +0 +0) +0 = 57

FUNCTION f(n$,p) !£°¡Á£î¤Þ¤Ç¤òÎóµ­¤·¤¿¤È¤­¤Î¡Ö£±¡×¤Î¿ô¡¡¢¨n$¤ÏÈóÉé¤Îp¿ÊË¡¤Î¿ôÃÍ
   local k,m,t$
   IF ExBVAL(n$,p)=0 THEN
      LET f=0
   ELSE
      LET k=LEN(n$) !·å¿ô
      LET m=VAL1(n$(1:1)) !ºÇ¾å°Ì·å¤ËÃåÌܤ¹¤ë
      LET t$=n$(2:LEN(n$)) !ü¿ô
      !PRINT n;k;m;t$ !debug

      IF m=1 THEN !(1xxx¡Äx)¤Î¾ì¹ç
         LET w=ExBVAL(t$,p)+1
      ELSE !(2xxx¡Äx)¡¢¡Ä¡¢(9xxx¡Äx)¤Î¾ì¹ç
         LET w=p^(k-1)
      END IF
      LET f=( w + f(REPEAT$(STR1$(p:p),k-1),p)*m ) + f(t$,p) !k·å + f(ü¿ô)
   END IF
END FUNCTION

LET STR1$="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" !p¿ÊË¡¤Î¿ô»ú
DEF VAL1(x$)=POS(STR1$,x$)-1

FUNCTION ExBVAL(n$,p) !n$¤òÈóÉé¤Îp¿ÊË¡¤Î¿ôÃͤȤ·¤¿ÃÍ
   LET s=0
   FOR i=1 TO LEN(n$)
      LET s=s*p+VAL1(n$(i:i))
   NEXT i
   LET ExBVAL=s
END FUNCTION

FUNCTION ExBSTR$(n,p) !ÈóÉé¤ÎÀ°¿ôn¤òp¿ÊË¡¤Çɽµ­¤¹¤ë
   LET s$=""
   DO
      LET nn=INT(n/p)
      LET t=n-nn*p !MOD(n,p)
      LET s$=STR1$(t+1:t+1)&s$ !²¼¤Î°Ì¤«¤é
      LET n=nn
   LOOP UNTIL n=0
   LET ExBSTR$=s$
END FUNCTION

!------------------------------ ¤³¤³¤Þ¤Ç¤¬¥µ¥Ö¥ë¡¼¥Á¥ó


PRINT f("1111111110",10) !10¿ÊË¡

PRINT ExBVAL("111110",6); f("111110",6) !£¶¿ÊË¡


LET p=4 !£´¿ÊË¡
FOR n=0 TO p^p
   LET w$=ExBSTR$(n,p)
   IF f(w$,p)=n THEN PRINT "f(";n;")=";n, STR$(p);"#";w$
NEXT n

END
 

Re: ¥»¥ó¥¿¡¼»î¸³ÄøÅÙ¤Î¥×¥í¥°¥é¥à±é½¬

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 8·î25Æü(²Ð)20»þ27ʬ52ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.468[¸µµ­»ö¤Ø]

!£²°Ê¾å¤ÎÀ°¿ô£î¤ËÂФ·¤Æ¡¢¤½¤ÎÁÇ°ø¿ô¤ÎϤòµá¤á¤ë¡£
!Îã¡¡6=2*3¤è¤ê¡¢2+3=5
!¡¡¡¡8=2^3¤è¤ê¡¢2+2+2=6
!2¤«¤é30¤Þ¤Ç¤ÎÀ°¿ô¤Ç¤Ï¡¢
!¡¡2,3,4,5,5,7,6,6,7, 11,7,13,9,8,8,17,8,19,9, 10,13,23,9,10,15,9,11,29,10
!¤È¤Ê¤ë¡£

LET N=30 !£²¡Á£Î¤ÎÈÏ°Ï

DIM sf(N) !ÁÇ°ø¿ô¤ÎÏÂ
MAT sf=ZER

LET j=2 !ÁÇ°ø¿ô£²
DO WHILE j<=N
   FOR i=j TO N STEP j !2,4,6,8,¡Ä¡¢4,8,12,16,¡Ä¡¢8,16,24,32,¡Ä¡¢¡Ä¡¡ÇÜ¿ô
      LET sf(i)=sf(i)+2 !ÁÇ°ø¿ô¤ò²Ã»»¤·¤Æ¤¤¤¯
   NEXT i
   LET j=j*2 !2,4,8,16,¡Ä¡¡¤Ù¤­¾è
LOOP

FOR k=3 TO N STEP 2 !£³°Ê¾å¤ÎÁÇ°ø¿ô
   IF sf(k)=0 THEN !¡Ö¥¨¥é¥È¥¹¥Æ¥Í¥¹¤Î¤Õ¤ë¤¤¡×¤ÈƱ¤¸¤ÇÁÇ°ø¿ô¤È¤Ê¤ë

      LET j=k
      DO WHILE j<=N !¹â¡¹SQR(N)¤Þ¤Ç
         FOR i=j TO N STEP j !j*m¡¢m=1,2,3,¡Ä
            LET sf(i)=sf(i)+k
         NEXT i
         LET j=j*k !k^m¡¢m=1,2,3,¡Ä
      LOOP

   END IF
NEXT k


FOR i=2 TO N !·ë²Ì¤òɽ¼¨¤¹¤ë
   PRINT i;":"; sf(i)
NEXT i


END


¡ü¡ÖÁÇ°ø¿ôʬ²ò¡Ê¼°¤òɽ¼¨¤¹¤ë¡Ë¡×¤ò²þ½¤¤¹¤ë¾ì¹ç
LET N=120 !Àµ¤ÎÀ°¿ô

LET s=0 !ÁÇ°ø¿ô¤ÎÏ <----- ÄɲÃ

PRINT N;":"; !<----- Êѹ¹

LET x=N
LET f=2 !³ä¤ë¿ô
DO WHILE x>=f*f !SQR(N)¡æf
   LET xx=INT(x/f)
   IF x-xx*f=0 THEN !³ä¤êÀÚ¤ì¤ì¤Ð
      LET x=xx
      PRINT f;"+"; !<----- Êѹ¹
      LET s=s+f !<----- ÄɲÃ
   ELSE !³ä¤êÀÚ¤ì¤Ê¤±¤ì¤Ð¡¢¼¡¤Ø
      LET f=f+1
   END IF
LOOP
PRINT x;

LET s=s+x !<----- ÄɲÃ
PRINT "="; s !·ë²Ì¤òɽ¼¨¤¹¤ë <----- ÄɲÃ

END
 

matrix ¤Î¡¡¡¡»È¤¤Êý¡¡¡©¡©

 Åê¹Æ¼Ô¡§Í¿ºä¡¡¡¡¾ºÊ¿  Åê¹ÆÆü¡§2009ǯ 8·î28Æü(¶â)11»þ12ʬ37ÉÃ
ÊÖ¿®¡¦°úÍÑ
  full  basic  ¤ò¡¡»ÈÍѤ·¤Æ¡¡Í­¸ÂÍ×ÁÇË¡¤Ç¡¡¡¡¹½Â¤²òÀÏ¥½¥Õ¥È¤ò¡¡ºîÀ®¤·¤Æ¤¤¤Þ¤¹
Â絬ÌϤΡ¡matrix ÍѤˡ¡¡¡²¾ÁÛ¥á¥â¥ê¡½¤ò¡¡¡¡Áý¤ä¤½¤¦¤È
basic 729   w32 ¤Î¡¡basic ¹½À®ÀßÄê¤Î¡¡¡¡FRAME  ¤Î¡¡²¼¤Ë
RetrainVirtualMemory=0   ¤È¡¡¡¡µ­Æþ¤·¤Æ
°Ê²¼¤Î¡¡¡¡¥×¥í¥°¥é¥à¤ò¡¡¡¡ºîÀ®¤·¤Þ¤·¤¿

dim  tk(a,a) , atk(a,a)
a=20000

°Ê¾å¤Î¡¡¡¡¥×¥í¥°¥é¥à¤ò¡¡run  ¤µ¤»¤ë¤È
£³£°£°¡¡ÉÃÄøÅ٤ǡ¡¡¡matrix  ¤Î¡¡¾ì½ê¤¬¡¡¡¡³ÎÄꤵ¤ì¤ë¤è¤¦¤Ç¤¹

¤·¤«¤·
¤³¤Î¡¡matrix ¤ò¡¡¡¡»ÈÍѤ·¤è¤¦¤È

dim tk(a,a),atk(a,a)
a=20000
for i=1 to a
  for  j=1  to a
      tk(i,j)=0.0
      atk(i,j)=0.0
  next j
next i

¤È¤·¤Æ¡¡run  ¤µ¤»¤ë¤È

EXTYE 2001  Åº¤¨»ú¤¬¡¡Èϰϳ°¤È
¥¨¥é¡½¡¡¤¬¡¡¤Ç¤Þ¤¹

¤½¤³¤Ç
¤³¤Î¡¡¥¨¥é¡½¤¬¡¡¡¡½Ð¤Ê¤¤¤è¤¦¤Ë
tk(a,a)    atk(a,a)  matrix  ¤ò¡¡¡¡»ÈÍѤ¹¤ë¤Ë¤Ï
¤É¤ÎÍͤˡ¡¡¡¤¹¤ì¤Ð¡¡¡¡¤è¤¤¤Î¤Ç¤·¤ç¤¦¤«


¤¼¤Ò¡¡¡¡¶µ¤¨¤Æ²¼¤µ¤¤

Í¿ºä¡¡¡¡¾ºÊ¿
 

Re: matrix ¤Î¡¡¡¡»È¤¤Êý¡¡¡©¡©

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 8·î28Æü(¶â)12»þ17ʬ29ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.497[¸µµ­»ö¤Ø]

Í¿ºä¡¡¡¡¾ºÊ¿¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£
BASIC¤Ç¤Ï¡¤ÊÑ¿ô¤ÎÃͤòÊѤ¨¤¿¤È¤­¡¤¤½¤ÎÊÑ¿ô¤¬Í¿¤¨¤¿¸ú²Ì¤ò²áµî¤Ë¤µ¤«¤Î¤Ü¤Ã¤ÆŬÍѤ¹¤ë¤³¤È¤Ï¤¢¤ê¤Þ¤»¤ó¡£
Æȼ«³ÈÄ¥¹½Ê¸¤ÎDIMʸ¤Ï¼Â¹Ô»þ¤ËÇÛÎó¤ÎÂ礭¤µ¤ò·èÄꤷ¤Þ¤¹¡£
10 LET a=10
20 DIM m(a,a)
¤Î¤è¤¦¤Ë¡¤ÊÑ¿ôÃͤòÍ¿¤¨¤Æ¤«¤éDIMʸ¤ò¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£
¤Ê¤ª¡¤Full BASIC¤Î¥×¥í¥°¥é¥à¤È¤·¤Æ½ñ¤­¤¿¤¤¤È¤­¤Ï¡¤DIMʸ¤ËÊÑ¿ô¤ò´Þ¤á¤º
10 DIM a(10,10)
¤Î¤è¤¦¤Ë¿ôÃÍÄê¿ô¤ÇÇÛÎó¤ÎÂ礭¤µ¤òÀë¸À¤·¤Æ¤¯¤À¤µ¤¤¡£
 

»ÈÍѤǤ­¤ë¡¡RAM memory ¿ô

 Åê¹Æ¼Ô¡§Í¿ºä¡¡¡¡¾ºÊ¿  Åê¹ÆÆü¡§2009ǯ 8·î28Æü(¶â)19»þ46ʬ12ÉÃ
ÊÖ¿®¡¦°úÍÑ
  Í­¸ÂÍ×ÁÇË¡¤Ç¡¡¡¡¹½Â¤²òÀÏ¥½¥Õ¥È¤ò¡¡¡¡ºîÀ®Ãæ¤Î¡¡¡¡Í¿ºä¡¡¾ºÊ¿¡¡¡¡¤Ç¤¹
µ¿Ì䤬¡¡¡¡Í­¤ê¤Þ¤¹

512 MB¡¡memory ¤Ç

dim  a(40000000)
end

¾å¤Î¡¡¥×¥í¥°¥é¥à¤¬¡¡¡¡²Äǽ¤Ç¤¹
¤Ä¤Þ¤ê
£µ£±£²¡¡MB  ¤Ç¡¡40000000  ¸Ä¤Î
matrix  ¤¬¡¡¡¡»ÈÍѤǤ­¤Þ¤¹


º£
[ FRAME ]
¤Î¡¡¡¡²¼¤Ë
virtualmemory=16
¤È
½ñ¤¯¤È

option arithmetic  native
dim  a(90000000)
end

¤¬¡¡¡¡²Äǽ¤Ç¤¹
¤Ä¤Þ¤ê
90000000 ¤Î¡¡matrix  ¤¬¡¡¡¡²Äǽ¤Ç¤¹

¤·¤«¤·
¤½¤Î¡¡³ä¹ç

90000000/40000000=2.25

¤Ä¤Þ¤ê
memory  ¤ò¡¡¡¡Â¿¤¯»ÈÍѤ·¤Æ¤â
¼ÂºÝ¤Ï
512MB x 2.25 = 1.2 GRAM  ÄøÅÙ¤·¤«
»ÈÍѤ·¤Æ¤¤¤Þ¤»¤ó

»ä¤Î¡¡¥Ñ¥½¥³¥ó¤Ï¡¡£³G¡¡RAM¡¡¡¡¤Ê¤Î¤Ç
ñ½ã¡¡·×»»¤Ç¤Ï

dim a(270000000)

¤¬¡¡¡¡²Äǽ¤Ê¤Ï¤º¤Ç¤¹

¤É¤ÎÍͤˡ¡¡¡¤¹¤ì¤Ð¡¡¡¡Îɤ¤¤Î¤Ç¤·¤ç¤¦¤«

²ò¤±¤ë
̤Ãοô¤Î¡¡¡¡ÊýÄø¼°¤Î
Â礭¤µ¤¬¡¡¡¡ÊѤï¤ë¤Î¤Ç
Èó¾ï¤Ë¡¡¡¡½ÅÍפǤ¹

¤¼¤Ò
¶µ¤¨¤Æ²¼¤µ¤¤
 

9100¸Ä¤Î¡¡Ì¤Ãοô¤Î¡¡ÊýÄø¼°¤Î¡¡²ò

 Åê¹Æ¼Ô¡§Í¿ºä¡¡¡¡¾ºÊ¿  Åê¹ÆÆü¡§2009ǯ 8·î29Æü(ÅÚ)06»þ15ʬ32ÉÃ
ÊÖ¿®¡¦°úÍÑ
  Í­¸ÂÍ×ÁÇË¡¤Ç¡¡¡¡¹½Â¤²òÀÏ¥½¥Õ¥È¤ò¡¡ºîÀ®¤·¤Æ¤¤¤ë¡¡¡¡Í¿ºä¡¡¾ºÊ¿¤Ç¤¹

¡¡¡¡option arithmetic native
       a(90000000)
    end

¤Î¡¡90000000 matrix  ¤¬¡¡¡¡»ÈÍѤǤ­¤ë¤Î¤Ç
»ä¤Î¡¡¡¡¥½¥Õ¥È¡¡¤Ë¡¡±þÍѤ·¤Æ¤ß¤Þ¤·¤¿
°ì±þ¡¡À®¸ù¡¡¤·¤Þ¤·¤¿

²£¡¡15¥ß¥ê
¹â¤µ¡¡145 ¥ß¥ê
¤Î¡¡Å´ÈǤò¡¡¡¡1¥ß¥ê¡¡¡¡¤Î¡¡»°³Ñ·Á¤Ë
¶èÀÚ¤ë¤È
ÀÜÅÀ¿ô¡¡¡¡£´£µ£²£¶¡¡ÅÀ
Í×ÁÇ¿ô¡¡¡¡£¸£·£°£°¡¡¸Ä
¤Ë¤Ê¤ê¤Þ¤¹

¤³¤ì¤Ï
a(4526x2,4526x2)  ¤Î¡¡matrix ¤¬¡¡¡¡¤Ò¤Ã¤è¤¦¤Ç¤¹
¤¹¤Ê¤ï¤Á
£´£µ£²£¶£ø£²¡¡¸Ä¤Î¡¡¡¡Ì¤Ãοô¤Î¡¡Ï¢Î©ÊýÄø¼°¤ò
gauss¡¡¤Î¡¡Áݤ­¤À¤·Êý¤Ç¡¡¡¡²ò¤­¤Þ¤¹¤¬
full  basic  ¤Ç¤Ï¡¡¡¡94»þ´Ö¤«¤«¤ê¤Þ¤¹

¤Þ¤À
ºÇ¸å¤Þ¤Ç¤Ï¡¡¡¡·×»»¤µ¤»¤Þ¤»¤ó

»ä¤Î¡¡¡¡°Âʪ¤Î¡¡¡¡¥Ñ¥½¥³¥ó¤Ç
cpu  ¤ò¡¡100%
»ÈÍѤ·¤Æ¡¡¡¡93»þ´Ö¡¡¡¡²ÔÆ°¤µ¤»¤ë¤È
¸Î¾ã¡¡¡¡¤¹¤ë¤«¤â¤·¤ì¤Þ¤»¤ó
 

9100 ̤Ãοô¡¡ÄûÀµ

 Åê¹Æ¼Ô¡§Í¿ºä¡¡¡¡¾ºÊ¿  Åê¹ÆÆü¡§2009ǯ 8·î29Æü(ÅÚ)06»þ29ʬ3ÉÃ
ÊÖ¿®¡¦°úÍÑ
  £¹£±£°£°¸Ä¤Î¡¡¡¡Ì¤ÃοôÊýÄø¼°¡¡¤Ë¡¡´Ø¤·¤Æ
Åê¹Æ¤·¤¿¡¡¡¡Í¿ºä¡¡¡¡¤Ç¤¹

ÄûÀµ¤¬¡¡¡¡Í­¤ê¤Þ¤¹

²£¡¡15¥ß¥ê¡¡¤È¡¡¸À¤¤¤Þ¤·¤¿¤¬
Àµ¤·¤¯¤Ï

²£¡¡30¥ß¥ê
¹â¤µ¡¡¡¡£±£´£µ¡¡¥ß¥ê

¤Ç¤¹

¤³¤Î¡¡·×»»¤ò¡¡turbo C++  ¤Ç¡¡¤¹¤ë¤È
·×»»»þ´Ö¤Ï¡¡¡¡Ìó¡¡2»þ´Ö¤Î¡¡Í½Äê¤Ç¤¹

¤·¤«¤·
C++¡¡¤Ï¡¡¥°¥é¥Ò¥Ã¥¯¤¬¡¡¡¡Æñ¤·¤¯
¤Þ¤À
»ä¤Ï¡¡¡¡¤Ç¤­¤Þ¤»¤ó
 

Re: matrix ¤Î¡¡¡¡»È¤¤Êý¡¡¡©¡©

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 8·î29Æü(ÅÚ)07»þ54ʬ26ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.497[¸µµ­»ö¤Ø]

Í¿ºä¡¡¡¡¾ºÊ¿¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

ľÀܤβóÅú¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¤¬¡¢

Í­¸ÂÍ×ÁÇË¡¤Ï¡¢£²£°Ç¯Á°¤ÏÈÆÍѵ¡¤ÇFORTRAN¤Ë¤è¤ë¥×¥í¥°¥é¥à¤À¤È»×¤¤¤Þ¤¹¤¬¡¢
Åö»þ¤³¤Î¥×¥í¥°¥é¥àÄøÅÙ¤ÎÌäÂê¡Ê̤Ãοô¤Î¿ô¡¢½èÍý®Å١ˤ¬²ò·è¤µ¤ì¤Æ¤¤¤¿¤Ê¤é¡¢
Åö»þ¤ÎÈÆÍѵ¡¤È¸½ºß¤Î¥Ñ¥½¥³¥ó¤ÎÀ­Ç½¤òÈæ³Ó¤¹¤ë¤È¡¢¼¡¤Îµ¿Ì䤬¤¢¤ê¤Þ¤¹¡£

¡Ö¸½ºß¤Î¥Ñ¥½¥³¥ó¤Ç¤Ï¤Û¤ó¤È¤¦¤Ë°·¤¨¤Ê¤¤¤Î¤Ç¤·¤ç¤¦¤«¡ª¡©¡×


¼ÂÍÑÀ­¤Ï¸¡¾Ú¤·¤Æ¤ß¤Ê¤¤¤È¤ï¤«¤ê¤Þ¤»¤ó¤¬¡¢
¸¡Æ¤°Æ
¡¦Åö»þ¤Îʸ¸¥¤ò¤ß¤ë

¡¦¡Ö̤Ãοô¤Î¸Ä¿ô¤Î£³¾è¤ËÈæÎ㤹¤ë·×»»»þ´Ö¤¬¤«¤«¤ë¡×¤è¤¦¤Ç¤¹¤Î¤Ç¡¢
¡¡Ï¢Î©ÊýÄø¼°¤Î̤Ãοô¤ò¸º¤é¤¹¼êË¡¤ò»È¤¦¡¡¢ª´Ô¸µË¡

¡¦ÇÛÎóa()¡ÊÀþ·Á¥ê¥¹¥È¡Ë¤Ï¡¢¥×¥í¥°¥é¥à¸À¸ì¤¬¤Ä¤¯¤Ã¤¿¥á¥â¥ê¥â¥Ç¥ë¤Ê¤Î¤Ç¡¢
¡¡Â¾¤ÎÅù²Á¥â¥Ç¥ë¤òƳÆþ¤¹¤ë¡¡¢ª¥é¥ó¥À¥à¥Õ¥¡¥¤¥ë

¡¡¡¡a(20000)¤Ê¤é
¡¡¡¡FILE00¡¢FILE01¡¢¡Á¡¢FILE19¤Î£²£°¸Ä¤Î¥Õ¥¡¥¤¥ë¤Ç¡¢³Æ¥ì¥³¡¼¥É¿ô¤Ï£±£°£°£°¸Ä¤òÍÑ°Õ¤·¤Æ¡¢
¡¡¡¡a(i)¤òFILExx¤È¥ì¥³¡¼¥Éyy¤ËÂбþ¤µ¤»¤ë

¡¡¡¡LET A(10000)=A(1000)+A(1) ¤ò·×»»¤µ¤»¤ë¾ì¹ç¡¢
¡¡¡¡£Ã£Ð£Õ¤ÏA(1)¡ÁA(20000)¤¹¤Ù¤Æ¤¬É¬ÍפǤϤʤ¤¤Ï¤º¤Ç¤¹¡£
 

¥Ñ¥½¥³¥ó¡¡¤Ë¡¡´Ø¤·¤Æ

 Åê¹Æ¼Ô¡§Í¿ºä¡¡¡¡¾ºÊ¿  Åê¹ÆÆü¡§2009ǯ 8·î29Æü(ÅÚ)16»þ09ʬ45ÉÃ
ÊÖ¿®¡¦°úÍÑ
  °ÊÁ°¡¡¡¡Í­¸ÂÍ×ÁÇË¡¤ò¡¡¡¡¤¹¤ë¤Î¤Ç¤È
Îɤ¤¡¡¥Ñ¥½¥³¥ó¤ò¡¡¡¡Ãµ¤·¤Æ¤¤¤Þ¤¹¤È
¥¢¥á¥ê¥«¤Î¡¡¡¡¥³¥ó¥Ô¥å¡½¥¿´ë¶È¤Î¡¡ÆüËܻټҤˡ¡¡¡Ê¹¤¤¤¿¤È¤³¤í
Ãæ¸Å¤Î¡¡¡¡°Â¤¤Êª¤Ç¡¡¡¡200Ëü±ß¡¡¤È¡¡ÊÖ»ö¤¬¡¡¡¡Í­¤ê¤Þ¤·¤¿

»ä¤Î¡¡¡¡½êÍ­¤¹¤ë¡¡¡¡¿ôËü±ß¤Î¡¡¡¡¥Ñ¥½¥³¥ó¤Ç¤Ï
¿ôÆü´Ö¡¡·×»»¤µ¤»¤ë¡¡¡¡full basic ¤Ç¤Î¡¡Í­¸ÂÍ×ÁÇË¡¤Ï¡¡¡¡ÌµÍý¤«¤â¤·¤ì¤Þ¤»¤ó


¤À¤«¤é
²ò·èË¡¤È¤·¤Æ
·×»»¤Ï¡¡¡¡turbo C++  ¤Ç
¿ô»þ´Ö¡¡¤Ç¡¡¹â®·×»»¤µ¤·¤Æ
¤½¤Î·×»»·ë²Ì¤ò
full  basic  ¤Î
¥³¥ó¥Ô¥å¡½¥¿¡½¥°¥é¥Ò¥Ã¥¯¤Ç
ɽ¸½¤Ç¤­¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡¡¡¡¡©¡©¡©
 

Re: »ÈÍѤǤ­¤ë¡¡RAM memory ¿ô

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 8·î30Æü(Æü)13»þ35ʬ23ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.499[¸µµ­»ö¤Ø]

Í¿ºä¡¡¡¡¾ºÊ¿¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

>»ä¤Î¥Ñ¥½¥³¥ó¤Ï£³GRAM¤Ê¤Î¤Çñ½ã·×»»¤Ç¤Ïdim a(270000000)¤¬²Äǽ¤Ê¤Ï¤º¤Ç¤¹

32bit XP/Vista ¤Ç¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï²¾ÁÛ¤Ç2GB¤Þ¤Ç¤·¤«ÍøÍѤǤ­¤Ê¤«¤Ã¤¿¤È»×¤¤¤Þ¤¹¡£

¤·¤¿¤¬¤Ã¤Æ¡¢²¾¤Ë½½¿ÊBASICËÜÂΡÊEXE¥³¡¼¥É¡¢´Ø¿ô/¥µ¥×¥ë¡¼¥Á¥ó¤Î¥¹¥¿¥Ã¥¯¡¢¥°¥é¥Õ¥£¥Ã¥¯¥¹²èÌ̤ʤɡˤ¬
£°¥Ð¥¤¥È¤À¤È¤·¤Æ¤â¹â¡¹£²£Ç£Â¤È¤Ê¤ê¤Þ¤¹¡£¡¡No.253[¸µµ­»ö¤Ø]


>full basic ¤Ç¤Ï94»þ´Ö¤«¤«¤ê¤Þ¤¹
>¤³¤Î·×»»¤òturbo C++ ¤Ç¤¹¤ë¤È·×»»»þ´Ö¤ÏÌó2»þ´Ö¤ÎͽÄê¤Ç¤¹

¡Ö¥×¥í¥°¥é¥à¤Î¼Â¹Ô¡×¤Î¼ÂÁõ¤Î°ã¤¤¤Ç¤·¤ç¤¦¤«¡£
¤¤¤ï¤æ¤ë¡¢¡Ö¥¤¥ó¥¿¥×¥ê¥¿Êý¼°¤È¥³¥ó¥Ñ¥¤¥éÊý¼°¡×¡¢¤Þ¤¿¡¢¥³¥ó¥Ñ¥¤¥é¤É¤¦¤·¤Ç¤â¡Ö¼°¤ÎºÇŬ²½¡×¤Ç
10¡Á50ÇܤνèÍý®ÅÙ¤¬°ã¤¤¤Þ¤¹¡£


>·×»»¤Ïturbo C++¤Ç¿ô»þ´Ö¤Ç¹â®·×»»¤µ¤·¤Æ¤½¤Î·×»»·ë²Ì¤òfull basic¤Î¥³¥ó¥Ô¥å¡½¥¿¡½¥°¥é¥Ò¥Ã¥¯¤Çɽ¸½¤Ç¤­¤Ê¤¤¤Ç¤·¤ç¤¦¤«

TurboC++¤Ç¤Î·×»»·ë²Ì¤ÎCSV¥Õ¥¡¥¤¥ë¤ò¤Ä¤¯¤ê¡¢¤³¤ì¤ò½½¿ÊBASIC¤ÇÆɤ߹þ¤ó¤Ç¥°¥é¥Õ¥£¥Ã¥¯¥¹¤Ë
¤¹¤ë¤È¤¤¤¤¤Ç¤·¤ç¤¦¡£

»²¹Í¥µ¥¤¥È
¡ÖFull BASIC¤È½½¿ÊBASIC¤Î Q&A¡×Æâ¡¡¡Ö¹ÔÎó¥Ç¡¼¥¿¤Îɽ·×»»¥½¥Õ¥È¤È¤ÎÏ¢·È¡×
¡¡http://hp.vector.co.jp/authors/VA008683/SpreadSheet.htm
 

Vine5.¤Çʸ»ú²½¤±

 Åê¹Æ¼Ô¡§Åç¼1243  Åê¹ÆÆü¡§2009ǯ 8·î30Æü(Æü)20»þ16ʬ16ÉÃ
ÊÖ¿®¡¦°úÍÑ
  Linux_Vine¤ÎºÇ¿·ÈÇ¡ÖVine5.0¡×¤Ë½½¿ÊBASIC¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¤È¤³¤í¡¢Vine4.0¤ÇÀ¸¤¸¤¿¥á¥Ë¥å¡¼Ê¸»ú²½¤±¤ÈƱ¤¸¸½¾Ý¤¬½Ð¤Þ¤·¤¿¡£
BASIC¤òüËö¤«¤éµ¯Æ°¤·¤¿¾ì¹ç¤Î¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤Ï²¼µ­¤ÎÄ̤ê¤Ç¡¢Vine4.0¤Î»þ¤ÈÁ´¤¯Æ±¤¸¤Ç¤·¤¿¡£

[@localhost basic]$ ./BASIC
Qt: missing charset ISO8859-1
Qt: missing charset JISX0208.1983-0
Qt: missing charset JISX0201.1976-0

Vine4.0¤ÎÂкöÍѤȤ·¤Æ¡¢ÇòÀÐÀèÀ¸¤¬¡ÖVine4ini.tar.gz¡×¤òºîÀ®¤·¥À¥¦¥ó¥í¡¼¥É¥Ú¡¼¥¸¤Ë·ÇºÜ¤·¤Æ¤¯¤À¤µ¤Ã¤¿¤Î¤Ç¤¹¤¬¡¢º£¤Ïºï½ü¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
¤³¤ì¤ò»ÈÍѤ¹¤ì¤ÐVine5.0¤Îʸ»ú²½¤±¤â¼£¤ë¤È»×¤¤¤Þ¤¹¡£ºÆÅÙ¡ÖVine4ini.tar.gz¡×¤ò¥À¥¦¥ó¥í¡¼¥É¥Ú¡¼¥¸¤Ë·ÇºÜ¤·¤Æ失¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£
 

Re: Vine5.¤Çʸ»ú²½¤±

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 8·î31Æü(·î)09»þ32ʬ35ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.505[¸µµ­»ö¤Ø]

¥á¥Ë¥å¡¼¥Õ¥©¥ó¥ÈÀßÄê²èÌ̤ϡ¤ALT-O¤Ë³¤±¤ÆM¤òÂǤƤÐɽ¼¨¤Ç¤­¤Þ¤¹¡£
Script¤Ë jisx0208 ¤ò´Þ¤à¥Õ¥©¥ó¥È¤òÁªÂò¤·¤Æʸ»ú²½¤±¤ò¤Ê¤¯¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¤«¡©
 

Re: Vine5.¤Çʸ»ú²½¤±

 Åê¹Æ¼Ô¡§Åç¼1243  Åê¹ÆÆü¡§2009ǯ 8·î31Æü(·î)16»þ50ʬ37ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.506[¸µµ­»ö¤Ø]

ÇòÀС¡ÏÂÉפµ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¥á¥Ë¥å¡¼¥Õ¥©¥ó¥ÈÀßÄê²èÌ̤ϡ¤ALT-O¤Ë³¤±¤ÆM¤òÂǤƤÐɽ¼¨¤Ç¤­¤Þ¤¹¡£
> Script¤Ë jisx0208 ¤ò´Þ¤à¥Õ¥©¥ó¥È¤òÁªÂò¤·¤Æʸ»ú²½¤±¤ò¤Ê¤¯¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¤«¡©

ÇòÀÐÀèÀ¸¡¢¤´²óÅú¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£

¥­¡¼¡ÖAlt+O¡×¤Ë³¤¤¤Æ¡ÖM¡×¤ò¥×¥Ã¥·¥å¤·¤Æ¥á¥Ë¥å¡¼¤Î¥Õ¥©¥ó¥ÈÁªÂò¥À¥¤¥¢¥í¥°¡Ê±Ñʸ»úɽ
¼¨¡Ë¤ò½Ð¤·²¼µ­¼ïÎà¤òÁªÂò¤·¤Æ¤ß¤Þ¤·¤¿¤¬¡¢¤¤¤º¤ì¤âNG¤Ç¤¹¡£

Fixed[jis]  script[jisx0208,1983-0] -->·ë²ÌNG
Fixed[misc] script[jisx0208,1983-0] -->·ë²ÌNG
VLpgothic   script[jisx0208,1983-0] -->·ë²ÌNG

BASIC¥¨¥Ç¥£¥¿¡¼²èÌ̤ò¥¢¥¯¥Æ¥£¥Ö¤Ë¤·¤ÆȾ³Ñ/Á´³Ñ¥­¡¼¤ò¥×¥Ã¥·¥å¤·¤Æ¤â¡¢Scim-Anthy¤ÎÆüËÜ
¸ìÊÑ´¹¥Ä¡¼¥ë¥Ð¡¼¤¬É½¼¨¤µ¤ì¤Ê¤¤¡Ê¾¤Î¥¢¥×¥ê¤Ç¤Ï½Ð¤Þ¤¹¡Ë¤Î¤ÇVine5.0¤Î¥¤¥ó¥¹¥È¡¼¥ëCD1Ëç
¤Î¾ì¹ç¡¢Qt´ØÏ¢¤Î¥Ñ¥Ã¥±¡¼¥¸¤¬ÉÔ­¤·¤Æ¤¤¤ë¤Î¤«¤âÃΤì¤Þ¤»¤ó¡£
Qt-designer¤Î¥Ñ¥Ã¥±¡¼¥¸¤ò¥¦¥§¥Ö¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¡¢¸ú²Ì¤¬Í­¤ë¤«»î¤·¤Æ¤ß¤Þ¤¹¡£
 

Re: Vine5.¤Çʸ»ú²½¤±

 Åê¹Æ¼Ô¡§Åç¼1243  Åê¹ÆÆü¡§2009ǯ 8·î31Æü(·î)20»þ10ʬ0ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.507[¸µµ­»ö¤Ø]

Åç¼1243¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> BASIC¥¨¥Ç¥£¥¿¡¼²èÌ̤ò¥¢¥¯¥Æ¥£¥Ö¤Ë¤·¤ÆȾ³Ñ/Á´³Ñ¥­¡¼¤ò¥×¥Ã¥·¥å¤·¤Æ¤â¡¢Scim-Anthy¤ÎÆüËÜ
> ¸ìÊÑ´¹¥Ä¡¼¥ë¥Ð¡¼¤¬É½¼¨¤µ¤ì¤Ê¤¤¡Ê¾¤Î¥¢¥×¥ê¤Ç¤Ï½Ð¤Þ¤¹¡Ë¤Î¤ÇVine5.0¤Î¥¤¥ó¥¹¥È¡¼¥ëCD1Ëç
> ¤Î¾ì¹ç¡¢Qt´ØÏ¢¤Î¥Ñ¥Ã¥±¡¼¥¸¤¬ÉÔ­¤·¤Æ¤¤¤ë¤Î¤«¤âÃΤì¤Þ¤»¤ó¡£
> Qt-designer¤Î¥Ñ¥Ã¥±¡¼¥¸¤ò¥¦¥§¥Ö¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¡¢¸ú²Ì¤¬Í­¤ë¤«»î¤·¤Æ¤ß¤Þ¤¹¡£

Åö¤Æ¤º¤Ã¤Ý¤¦¤Ç¡¢qt-designer¥Ñ¥Ã¥±¡¼¥¸°ì¼°¤Èscim-bridge-qt¥Ñ¥Ã¥±¡¼¥¸¤ò¥¤¥ó¥¹¥È¡¼¥ë
¤·¤ÆÍͻҤߤޤ·¤¿¤¬¡¢BASIC¤Îʸ»ú²½¤±¤Ë¤Ï¸ú²Ì̵¤·¤Ç¤·¤¿¡£
 

Re: Vine5.¤Çʸ»ú²½¤±

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 8·î31Æü(·î)21»þ30ʬ31ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.507[¸µµ­»ö¤Ø]

ini¥Õ¥¡¥¤¥ë¤ÎÊÔ½¸¤Ï¡¤É½¼¨²Äǽ¤Ê¥Õ¥©¥ó¥È¤¬¸«¤Ä¤«¤é¤Ê¤±¤ì¤Ð°ÕÌ£¤¬¤Ê¤¤¤Ç¤¹¡£
Linux¤Ç¤Îʸ»ú²½¤±¤Î¸¶°ø¤Ï¿Íͤǡ¤Âкö¤â·è¤á¤Æ¤¬¤Ê¤¤¤Î¤¬¼ÂÂ֤Ǥ¹¡£
http://www.geocities.jp/thinking_math_education/Linux.htm
¤ËÂбþÎã¤ò·ÇºÜ¤·¤Æ¤¤¤Þ¤¹¤¬¡¤Æ±¤¸Linux¤Ç¤â¥Ð¡¼¥¸¥ç¥ó¤¬°ã¤¦¤È¤Þ¤Ã¤¿¤¯°Û¤Ê¤ë¤³¤È¤¬ÄÁ¤·¤¯¤¢¤ê¤Þ¤»¤ó¡£
 

Re: Vine5.¤Çʸ»ú²½¤±

 Åê¹Æ¼Ô¡§Åç¼1243  Åê¹ÆÆü¡§2009ǯ 9·î 1Æü(²Ð)07»þ05ʬ19ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.509[¸µµ­»ö¤Ø]

ÇòÀС¡ÏÂÉפµ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ini¥Õ¥¡¥¤¥ë¤ÎÊÔ½¸¤Ï¡¤É½¼¨²Äǽ¤Ê¥Õ¥©¥ó¥È¤¬¸«¤Ä¤«¤é¤Ê¤±¤ì¤Ð°ÕÌ£¤¬¤Ê¤¤¤Ç¤¹¡£
> Linux¤Ç¤Îʸ»ú²½¤±¤Î¸¶°ø¤Ï¿Íͤǡ¤Âкö¤â·è¤á¤Æ¤¬¤Ê¤¤¤Î¤¬¼ÂÂ֤Ǥ¹¡£
> http://www.geocities.jp/thinking_math_education/Linux.htm
> ¤ËÂбþÎã¤ò·ÇºÜ¤·¤Æ¤¤¤Þ¤¹¤¬¡¤Æ±¤¸Linux¤Ç¤â¥Ð¡¼¥¸¥ç¥ó¤¬°ã¤¦¤È¤Þ¤Ã¤¿¤¯°Û¤Ê¤ë¤³¤È¤¬ÄÁ¤·¤¯¤¢¤ê¤Þ¤»¤ó¡£

ÇòÀÐÀèÀ¸¡¢½Å¤Í¤Æ¤Î¤´²óÅú¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
¾åµ­URL¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ëÂкöÎã¤ò¹Ô¤Ã¤Æ¡¢·ë²ÌOK¤Ë¤Ê¤ê¤Þ¤·¤¿¤é¡¢¤³¤³¤Ë¤´Êó¹ðÃפ·¤Þ¤¹¡£
¾°¡¢¤½¤ì¤Þ¤Ç¤Î´Ö¡¢Vine5.0¾å¤Ç¤Ï±Ñ¸ìÈǤò»È¤ï¤»¤Æĺ¤¯¤³¤È¤Ë¤·¤Þ¤·¤¿¡£
 

Full BASIC¹â®²½¤Î»î¤ß

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 9·î 1Æü(²Ð)09»þ32ʬ21ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  2¿Ê±é»»¤òÁªÂò¤·¤¿¤È¤­¤ÎFull BASIC¼Â¹Ô¤Î¹â®²½¤Î»î¤ß¤ò»Ï¤á¤Þ¤·¤¿¡£
Full BASIC¤Î¥×¥í¥°¥é¥à¤òLazarus¤Î³ÈÄ¥Pascal¸ì¤ËËÝÌõ¤·¡¤FPC+Lazarus
¤òÍøÍѤ·¤Æ¹â®¼Â¹Ô¤·¤Þ¤¹¡£
¸½¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¤Îã³°½èÍý¤ËRETRY¡¤CONTINUE¤¬»È¤¨¤Ê¤¤¤Ê¤É¤ÎÀ©Ì󤬤¢¤ê¤Þ¤¹¤¬¡¤Ã±½ã¤Ê¿ôÃͱ黻¤Ï½½¿ÊBASIC¤è¤ê2Çܶ¯¡¤Â®¤¯¤Ê¤ê¤Þ¤¹¡£
http://sourceforge.jp/projects/decimalbasic/
BASICAcc¤ò¥À¥¦¥ó¥í¡¼¥É¤·¤Æ¤¯¤À¤µ¤¤¡£

ÊÌÅÓ¡¤FPC¡ÜLazarus¤âɬÍפǤ¹¡£
http://snapshots.lazarus.shikami.org/
 

NOT AND OR

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 9·î 1Æü(²Ð)21»þ53ʬ0ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¿ôÃͤΠNOT AND OR ¡¢¸ìƬ 0x ¤Ç¤Î16¿Ê¿ôɽµ­ ¢ª personal extension ¤Î´õ˾¤Ç¤¹¡£
±ï¤Î²¼¤Î·×»»µ¡¤Ë¤Ï¡¢ºÇ½ªÅª¤ÊÌ¿Îá¤È¥Ç¡¼¥¿·Á¼°¡Ä ¤Î¤Ï¤º¤Ç¤¹¤¬¡¢
»ÈÍѤ·¤Ê¤¤¤è¤¦¤ËÅØÎϤ¹¤ëÊÊ ¤¬¤Ä¤¤¤Æ¡¢¿¶¤êÊÖ¤ë»þ¡¢³Ø½¬¥Æ¡¼¥Þ¤Ë À§¤«Èݤ«¡¢
¼«Ê¬¤Î¿Èʬ¤Ç¹Í¤¨¤ë»ö¤Ç¤Ï¤Ê¤¤¤±¤ì¤É¤â¡¢µ¿Ì䤫¤é¤ÎÄó°Æ¤Ç¤¹¡£
BASIC ¤À¤«¤é¡Ö¤³¤Î¤Þ¤Þ¤Ç¤¤¤¤¡×¤ÎÀ¼¤â¶¯¤¯Ê¹¤³¤¨¤ë¤¬¡¦¡¦¡¦
 

Re: NOT AND OR

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 9·î 2Æü(¿å)07»þ29ʬ20ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.512[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¿ôÃͤΠNOT AND OR ¡¢¸ìƬ 0x ¤Ç¤Î16¿Ê¿ôɽµ­ ¢ª personal extension ¤Î´õ˾¤Ç¤¹¡£
> ±ï¤Î²¼¤Î·×»»µ¡¤Ë¤Ï¡¢ºÇ½ªÅª¤ÊÌ¿Îá¤È¥Ç¡¼¥¿·Á¼°¡Ä ¤Î¤Ï¤º¤Ç¤¹¤¬¡¢
> »ÈÍѤ·¤Ê¤¤¤è¤¦¤ËÅØÎϤ¹¤ëÊÊ ¤¬¤Ä¤¤¤Æ¡¢¿¶¤êÊÖ¤ë»þ¡¢³Ø½¬¥Æ¡¼¥Þ¤Ë À§¤«Èݤ«¡¢
> ¼«Ê¬¤Î¿Èʬ¤Ç¹Í¤¨¤ë»ö¤Ç¤Ï¤Ê¤¤¤±¤ì¤É¤â¡¢µ¿Ì䤫¤é¤ÎÄó°Æ¤Ç¤¹¡£
> BASIC ¤À¤«¤é¡Ö¤³¤Î¤Þ¤Þ¤Ç¤¤¤¤¡×¤ÎÀ¼¤â¶¯¤¯Ê¹¤³¤¨¤ë¤¬¡¦¡¦¡¦

ºî¤ë¤Î¤Ï´Êñ¤Ç¤¹¤¬¡¤Ã±¤Ë¸ß´¹À­¤ò»¤Ê¤¤¡¤½é¿´¼Ô¤òÏǤ魯¤À¤±¤Î³ÈÄ¥¤Ë¤Ê¤ë¤È»×¤¤¤Þ¤¹¡£
A=B AND B=C
¤Ê¤É¤È¤¤¤¦ÂåÆþʸ¤ÏÀ¤¤ÎÃ椫¤é¾Ã¤¨¤Æ¤Û¤·¤¤¤Ç¤¹¡£
¡Ê¤³¤Îʸ¤Ï¡¤Microsoft ¸ß´¹¥â¡¼¥É¤Ç¼Â¹Ô¤Ç¤­¤Þ¤¹¡Ë
 

Re: NOT AND OR

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 9·î 2Æü(¿å)10»þ01ʬ26ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.513[¸µµ­»ö¤Ø]

¥Ó¥Ã¥È¤ÎÃê½Ð¤¬¡¢LET A= B AND 0x30 ¤È½ñ¤±¤ì¤Ð¡¦¡¦¤È¤¤¤Ä¤â»×¤¦¤Î¤Ç¤¹¤¬¡¢
¤ä¤Ï¤ê¡¢¤½¤¦¤Ç¤¹¤Í¡¦¡¦
¾å¤Îʸ¤Ï¡¢LET A= MOD(IP(B/16),4)*16 ¤Ê¤É¤Ç¡¢ÃÖ¤­´¹¤¨¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£
¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
 

Re: NOT AND OR

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 9·î 2Æü(¿å)16»þ17ʬ39ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.514[¸µµ­»ö¤Ø]

Windows¸ÂÄê¤Ç¤¹¤¬¡¤
http://hp.vector.co.jp/authors/VA008683/BitOp.htm
¤ò»È¤¨¤Ð¡¤
LET A = AND( B, BVAL("30",16) )
¤¢¤ë¤¤¤Ï¡¤
LET A = AND(B, BVAL"00110000",2))
¤È½ñ¤¯¤³¤È¤¬²Äǽ¤Ç¤¹¡£
¤³¤ì¤é¤Î´Ø¿ô¤ÏFull BASIC¤ÎÌ¿Îá¤À¤±¤ÇÄêµÁ¤¹¤ë¤³¤È¤â²Äǽ¤Ê¤Î¤Ç¡¤
¸ß´¹À­¤ò»¤Ê¤¦¤³¤È¤Ï¤¢¤ê¤Þ¤»¤ó¡£

http://sourceforge.jp/projects/decimalbasic/

 

Re: NOT AND OR

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 9·î 2Æü(¿å)16»þ54ʬ22ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.515[¸µµ­»ö¤Ø]

BITOP.DLL¤ò»ÈÍѤ¹¤ëÅê¹Æ¥×¥í¥°¥é¥à¤¬¡¢Ë¬Ìä¼Ô¤â ¤½¤Î¤Þ¤Þ¼Â¹Ô¤Ç¤­¤ë¤è¤¦¤Ë¡¢
ŬÅö¤Ê¥Õ¥©¥ë¥À¡¼¤Ëɸ½à¼ÂÁõ¤·¤Æ¤¤¤¿¤À¤±¤ì¤Ð¡¢¤¢¤ê¤¬¤¿¤¤¤Î¤Ç¤¹¤¬¡¢¸½¾õ¤Ç¤Ï¡¢
¤½¤Î»ÈÍѤËÄñ¹³¤¬¤¢¤ê¤Þ¤¹¡£
 

ʤÌÌ»»¤Ï¤É¤¦²ò¤¯¤Î¤«¡©

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ 9·î 2Æü(¿å)19»þ47ʬ39ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¼¡¤ÎʤÌÌ»»

¡¡¡¡£Ï£Î£Å
¡¡¡¡£Ô£×£Ï
¡Ü£Æ£Ï£Õ£Ò
___________
£Ó£Å£Ö£Å£Î

¤ò¥×¥í¥°¥é¥à¤Ç²ò¤±¤Þ¤¹¤«¡©
 

Re: ʤÌÌ»»¤Ï¤É¤¦²ò¤¯¤Î¤«¡©

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 9·î 2Æü(¿å)22»þ44ʬ9ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.517[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

!¤³¤ó¤Ê¤â¤Î¤Ç¤Ï¡¢¤À¤á¤Ç¤¹¤«¡£
!----------------------------------------------
LET NN$="ZERO  ONE   TWO   THREE FOUR  FIVE  SIX   SEVEN EIGHT NINE  TEN"

DEF num(I$)= (POS( NN$, UCASE$(I$) )-1)/6
DEF num$(I)= mid$( NN$, I*6+1, 5 )

PRINT numb$("ONE+TWO+FOUR")
PRINT numb$("-One-Two-Three")
PRINT numb$("Two+Seven")
PRINT numb$(" - one + two - seven + ten ")
PRINT numb$("- one+ two- seven+ ten ")
PRINT numb$(" -one +two -seven +ten ")

FUNCTION numb$(w$)
   LET n=0
   LET i=1
   DO WHILE i<=LEN(w$)
      LET p$=""
      DO WHILE w$(i:i)="+" OR w$(i:i)="-" OR w$(i:i)=" "
         LET p$=p$& w$(i:i)
         LET i=i+1
      LOOP
      LET n$=""
      DO WHILE w$(i:i)<>"+" AND w$(i:i)<>"-" AND w$(i:i)<>" "
         LET n$=n$& w$(i:i)
         LET i=i+1
      LOOP UNTIL LEN(w$)< i
      LET j=num(n$)
      IF POS(p$,"-")<>0 THEN LET j=-j
      LET n=n+j
   LOOP
   IF n< 0 THEN LET p$="-" ELSE LET p$=""
   LET numb$= p$& num$(ABS(n))
END FUNCTION

END


¡ÖÄɵ­¡×¡¡Ê¤ÌÌ»»¤Î»ö¤òÎɤ¯ÃΤé¤Ê¤¯¤Æ¡¢¤³¤ì¤Ï¡¢°ã¤¤¤Þ¤¹¤Í¡£¤¹¤ß¤Þ¤»¤ó¡£
¡¡¡¡¡¡¡¡¡¡ºï½ü¤Ï¡¢¤Ç¤­¤Ê¤¤¤Î¤Ç¡¢¤³¤Î¤Þ¤Þ¡¢»Ä¤·¤Þ¤¹¡£»³Ã椵¤ó½õ¤±¤Æ¡ª

!¡ÖÄɵ­¡×¤¢¤é¤Ã¤Ý¤¤¤Ç¤¹¤¬¡¢¤³¤ì¤Ç¹ç¤Ã¤Æ¤Þ¤¹¤«¡£

OPTION ARITHMETIC NATIVE
DIM n0(0 TO 9),nn(0 TO 9)
MAT READ n0
DATA 0,1,2,3,4,5,6,7,8,9

CALL perm(n0,0)
PRINT "½ªÎ»"

SUB perm(n0(),j)
   local i
   IF j<=9 THEN
      FOR i=0 TO 9-j
         LET nn(j)=n0(i)
         swap n0(i),n0(9-j)
         CALL perm(n0,j+1)
         swap n0(i),n0(9-j)
      NEXT i
   ELSE
      CALL check
   END IF
END SUB

SUB check
!MAT PRINT USING REPEAT$("# ",10):nn
   LET E=nn(0)
   LET O=nn(1)
   LET R=nn(2)
   LET N=nn(3)
   LET W=nn(4)
   LET U=nn(5)
   LET T=nn(6)
   LET V=nn(7)
   LET F=nn(8)
   LET S=nn(9)
   LET yy0= E+O+R
   IF N= MOD( yy0,10) THEN
      LET cy0= IP( yy0/10) !carry
      !---
      LET yy1= N+W+U +cy0
      IF E=MOD( yy1,10) THEN
         LET cy1= IP( yy1/10) !carry
         !---
         LET yy2= 2*O+T +cy1
         IF V=MOD( yy2,10) THEN
            LET cy2= IP( yy2/10) !carry
            !---
            LET yy3= F +cy2
            IF E=MOD( yy3,10) AND S=IP( yy3/10) THEN
            !---
               PRINT "       O  N  E"
               PRINT "       T  W  O"
               PRINT " +  F  O  U  R"
               PRINT "¨¡¨¡¨¡¨¡¨¡¨¡¨¡"
               PRINT " S  E  V  E  N"
               PRINT
               PRINT "      ";O ;N ;E
               PRINT "      ";T ;W ;O
               PRINT " + ";F ;O ;U ;R
               PRINT "¨¡¨¡¨¡¨¡¨¡¨¡¨¡"
               PRINT    S ;E ;V ;E ;N
               PRINT
            END IF
         END IF
      END IF
   END IF
END SUB

END
 

Re: ʤÌÌ»»¤Ï¤É¤¦²ò¤¯¤Î¤«¡©

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 9·î 3Æü(ÌÚ)06»þ39ʬ9ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.517[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

£±£°¸Ä¡ÊONETWFURSV¡Ë¤ÎÊÑ¿ô¤Ë£±£°¸Ä¡Ê£°¡Á£¹¡Ë¤Î¿ô»ú¤ò³ä¤êÅö¤Æ¤ë¤Î¤Ç¡¢
¡Ö£±£°¸Ä¤Î¿ô»ú¤ò»È¤Ã¤Æ¤Ç¤­¤ë½çÎó¡×¤òÀ¸À®¤·¤Æ¡¢¼°¤ò³Îǧ¤¹¤ì¤Ð¤è¤¤¤Ç¤·¤ç¤¦¡£
¾ì¹ç¤Î¿ô¤Ï¡¢comb(10,10)*10!=10!Ä̤ꡣ
!ʤÌÌ»»¡¡¢¨£±£°¸Ä¤ÎÊÑ¿ô¤Î¾ì¹ç

LET t0=TIME

PUBLIC NUMERIC ANSWER_COUNT !²òÅú¿ô
LET ANSWER_COUNT=0

DIM a(10) !°Û¤Ê¤ëʸ»ú¡¡¢¨ONETWFURSV¤Î½ç
FOR i=1 TO 10 !£°¡Á£¹
   LET a(i)=i-1
NEXT i

CALL perm(a,1)

PRINT "·×»»»þ´Ö=";TIME-t0

END


EXTERNAL SUB perm(a(), i) !£î¸Ä¤Î¿ô»ú¤ò»È¤Ã¤Æ¤Ç¤­¤ë½çÎó¡Ê¼­½ñ¼°¤Ç¤Ê¤¤¡Ë
LET N=UBOUND(a) !ʸ»ú¿ô
IF i<N THEN
   FOR j=i TO N
      LET t=a(i) !swap a(i),a(j)
      LET a(i)=a(j)
      LET a(j)=t

      CALL perm(a,i+1)

      LET t=a(i) !swap a(i),a(j)
      LET a(i)=a(j)
      LET a(j)=t
   NEXT j

ELSE !¤¹¤Ù¤Æ¤¬³ÎÄꤷ¤¿¤é¡¢¼°¤ò¸¡¾Ú¤¹¤ë
!!!MAT PRINT a; !debug

   IF a(1)>0 AND a(4)>0 AND a(6)>0 AND a(9)>0 THEN !ºÇ¾å°Ì·å¤Ï£°¤Ç¤Ê¤¤

      LET ONE  =                      a(1)*100+a(2)*10+a(3)
      LET TWO  =                      a(4)*100+a(5)*10+a(1)
      LET FOUR =           a(6)*1000+ a(1)*100+a(7)*10+a(8)
      LET SEVEN=a(9)*10000+a(3)*1000+a(10)*100+a(3)*10+a(2)

      IF ONE+TWO+FOUR=SEVEN THEN !¼°¤¬À®Î©¤¹¤ë¤Ê¤é

         LET ANSWER_COUNT=ANSWER_COUNT+1 !²òÅú¿ô
         PRINT ANSWER_COUNT

         PRINT USING "    ONE   ####":ONE !·ë²Ì¤Îɽ¼¨
         PRINT USING "    TWO   ####":TWO
         PRINT USING "¡Ü FOUR   ####":FOUR
         PRINT "-------"
         PRINT USING "  SEVEN  #####":SEVEN
         PRINT

      END IF

   END IF

END IF
END SUB


¼Â¹Ô·ë²Ì
 1
    ONE    350
    TWO    673
¡Ü FOUR   9382
-------
  SEVEN  10405

 2
    ONE    350
    TWO    683
¡Ü FOUR   9372
-------
  SEVEN  10405

 3
    ONE    530
    TWO    625
¡Ü FOUR   9548
-------
  SEVEN  10703

 4
    ONE    530
    TWO    645
¡Ü FOUR   9528
-------
  SEVEN  10703

 5
    ONE    630
    TWO    526
¡Ü FOUR   9647
-------
  SEVEN  10803

 6
    ONE    630
    TWO    546
¡Ü FOUR   9627
-------
  SEVEN  10803

 7
    ONE    940
    TWO    729
¡Ü FOUR   8935
-------
  SEVEN  10604

 8
    ONE    940
    TWO    739
¡Ü FOUR   8925
-------
  SEVEN  10604

¤Þ¤¿¡¢

¡¡  SEND
¡¡+ MORE
¡¡-----
¡¡ MONEY

¤Î¾ì¹ç¤Ï¡¢£¸¸Ä¤ÎÊÑ¿ô¡ÊSENDMORY¡Ë¤Ë£±£°¸Ä¤Î¿ô»ú¤ò³ä¤êÅö¤Æ¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£

¡Ö£±£°¸Ä¤«¤é£¸¸Ä¤òÁª¤ÖÁȹ礻¡×¤Ç¿ô»ú¤òÁªÂò¤·¤Æ¡¢¡Ö¤½¤Î¿ô»ú¤ò»È¤Ã¤Æ¤Ç¤­¤ë½çÎó¡×¤Ç¤Î¸¡¾Ú¡£comb(10,8)*8!Ä̤ꡣ

¾åµ­¥×¥í¥°¥é¥à¤Ï¡¢¤½¤Î¥Æ¥ó¥×¥ì¡¼¥È¤Ë¤Ê¤ë¤È»×¤¤¤Þ¤¹¤Î¤Ç²þ½¤¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£

»²¹Í
¡¡¥Õ¥©¥ë¥À SAMPLE Æâ PERMUTAT.BAS¡¢COMBINAT.BAS
 

Re: NOT AND OR

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 9·î 3Æü(ÌÚ)07»þ44ʬ56ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.516[¸µµ­»ö¤Ø]

BITOP.DLL¤Ï¡¤»È¤ï¤º¤Ë¤¹¤à¤Î¤Ê¤é¡¤¸ø³«¤¹¤ë¥×¥í¥°¥é¥à¤Ë¤Ï»È¤ï¤Ê¤¤¤Û¤¦¤¬¤¤¤¤¤È»×¤¤¤Þ¤¹¡£
¡Ê¤À¤«¤é¡¤É¸½àÁõÈ÷¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¡¥¡¥¡¥¡¥¡Ë
 

ʸ»úÎó¤Î¡¡Ê¬²ò¡¡¡¡¿ôÃͲ½

 Åê¹Æ¼Ô¡§Í¿ºä¡¡¡¡¾ºÊ¿  Åê¹ÆÆü¡§2009ǯ 9·î 3Æü(ÌÚ)09»þ24ʬ49ÉÃ
ÊÖ¿®¡¦°úÍÑ
  turbo c++  ¤ò¡¡¡¡»ÈÍѤ·¤¿¡¡¡¡Í­¸ÂÍ×ÁÇË¡¤Î¡¡¥×¥í¥°¥é¥à¤Î¡¡·×»»·ë²Ì¤ò
full  basic  ¤Î¡¡¡¡¥°¥é¥Ò¥Ã¥¯¤Ç¡¡¡¡É½¤½¤¦¤È¡¡¡¡¹Í¤¨¤Æ¤¤¤Þ¤¹

turbo c++ ¤Î¡¡·×»»·ë²Ì¤ò
Î㤨¤Ð

¡¡¡¡1    0.000     0.45

¤È¤¹¤ë¤È
full  basic  ¤Ç¤Ï

      print  a$(n)

¤Ç

¡¡¡¡¡¡1   0.00   0.45

  ¤È¡¡¡¡Ê¸»úÎó¤Ç¡¡¡¡¸½¤ì¤Þ¤¹

¤³¤ì¤Ç¤Ï¡¡¡¡full  basic  ¥×¥í¥°¥é¥à¤¬¡¡¡¡¥°¥é¥Ò¥Ã¥¯¤ò¡¡ÉÁ¤¯°Ù¤Ë

¿ôÃͤò¡¡¡¡Æɤ߹þ¤á¤Ê¤¤¤Î¤Ç

¤³¤ì¤ò

1

0.00

0.45

¤È¡¡¡¡Ê¬²ò¤·¤Æ
ʸ»ú¤Ç¤Ï¤Ê¤¯¡¡¡¡¿ôÃͤˡ¡¡¡ÊÑ´¹¤Ç¤­¤Þ¤¹¤«¡¡¡¡¡©¡©

¤¼¤Ò
¶µ¤¨¤Æ²¼¤µ¤¤

¤è¤í¤·¤¯
 

Re: ʤÌÌ»»¤Ï¤É¤¦²ò¤¯¤Î¤«¡©

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ 9·î 3Æü(ÌÚ)10»þ08ʬ25ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.517[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£


Åê¹Æ¤·¤è¤¦¤È¤·¤¿¤é¤¹¤Ç¤Ë»³ÃæϵÁ¤µ¤ó¤ÎÅê¹Æ¤¬¤¢¤ê¡¢»÷¤¿¤è¤¦¤Ê¤â¤Î¤Ç¤¹¤¬¤»¤Ã¤«¤¯ºî¤Ã¤¿¤Î¤Ç¸ø³«¤·¤Þ¤¹¡£
²òË¡¤Ï¡¢Ê¸»ú¤Ë¿ô¤ò¤·¤é¤ß¤Ä¤Ö¤·¤ËÆþ¤ì¤Æ¤¤¤­·×»»¤òËþ¤¿¤¹¤«¸¡¾Ú¤¹¤ëÊýË¡¤Ç¤¹¡£
GAI¤µ¤ó¤¬ÏÀÍýŪ¤Ë¿ôÃͤòµá¤á¤ëÊýË¡¤ò˾¤ó¤Ç¤¤¤ë¤Î¤Ç¤¢¤ì¤Ð¡¢¤³¤ÎÊýË¡¤Ç¤Ï¤À¤á¤Ç¤¹¤Í¡£
GAI¤µ¤ó¤ÎÄ󼨤µ¤ì¤¿ÌäÂê¤ÏÊ£¿ô¤Î²òÅú¤¬¤¢¤ë¤Î¤Ç¡¢¼Â¹Ô¤´¤È¤ËÄ´ºº¤Î³«»Ï¤¹¤ëÅÀ¤ò¥é¥ó¥À¥à¤Ë¤·¤Þ¤·¤¿¡£
(»³Ã椵¤ó¤Î¥×¥í¥°¥é¥à¤È¤Ï°ã¤¤¡¢¤Ò¤È¤Ä¤Î²ò¤òȯ¸«¤·¤¿»þÅÀ¤Ç½ªÎ»¤·¤Þ¤¹)

¾¤ÎʤÌÌ»»¤Ë¤â±þÍѤǤ­¤ë¤è¤¦¤Ë¤·¤Þ¤·¤¿¡£
¼¡¤Î3²Õ½ê¤òÊѹ¹¤¹¤ë¤À¤±¤Ç¼Â¹Ô¤Ç¤­¤ë¤È»×¤¤¤Þ¤¹¡£
£±¡¥ÊÑ¿ô k ¤ÎÃÍ¡ÊLET k=4 ! ñ¸ì¤Î¸Ä¿ô¡Ë
£²¡¥³Æñ¸ì¤ÎDATA¡ÊDATA "ONE","TWO","FOUR","SEVEN"¡Ë
£³¡¥IFʸ¤ÇȽÄꤹ¤ë·×»»¼°
    ¡ÊIF h0=0 AND change("ONE")+change("TWO")+change("FOUR")=change("SEVEN") THEN¡Ë

  SEND+MORE=MONEY ¤Ç»î¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£


OPTION ARITHMETIC NATIVE
DECLARE EXTERNAL SUB perm,charac,headset
DECLARE EXTERNAL FUNCTION random
PUBLIC NUMERIC k,num(10),head(30),check(0 TO 9)
PUBLIC STRING word$(30),c$(10)
LET k=4 ! ñ¸ì¤Î¸Ä¿ô
!LET k=3
FOR i=1 TO k
   READ word$(i)
NEXT i
DATA "ONE","TWO","FOUR","SEVEN"
!DATA "SEND","MORE","MONEY"
CALL charac(word$)
CALL headset
RANDOMIZE
MAT check=ZER
FOR i=1 TO 10
   LET num(i)=random
NEXT i
!
CALL perm(num,1)
END
!
!
REM 1¡Án¤Î½çÎó¤ò¼­½ñ¼°½ç½ø¤ÇÀ¸À®¤¹¤ë¡£
!½½¿ÊBASICźÉÕ"\BASICw32\SAMPLE\PERMUTAT.BAS"»²¾È
EXTERNAL SUB perm(a(),n)
OPTION ARITHMETIC NATIVE
DECLARE FUNCTION change
IF n=10 THEN
   LET h0=0
   FOR ii=1 TO k
      IF num(head(ii))=0 THEN
         LET h0=1 ! ÀèƬʸ»ú¤¬ 0
         EXIT FOR
      END IF
   NEXT ii
   IF h0=0 AND change("ONE")+change("TWO")+change("FOUR")=change("SEVEN") THEN
   !IF h0=0 AND change("SEND")+change("MORE")=change("MONEY") THEN
      FOR ii=1 TO k
         PRINT word$(ii);" =";change(word$(ii))
      NEXT ii
      FOR ii=1 TO 10
         PRINT c$(ii);"=";STR$(num(ii));" ";
      NEXT ii
      PRINT
      STOP
   END IF
ELSE
   FOR i=n TO 10
      LET t=a(i)
      FOR j=i-1 TO n STEP -1
         LET a(j+1)=a(j)
      NEXT j
      LET a(n)=t
      CALL perm(a,n+1)
      LET t=a(n)
      FOR j=n TO i-1
         LET a(j)=a(j+1)
      NEXT j
      LET a(i)=t
   NEXT i
END IF
FUNCTION change(w$)
   LET l=LEN(w$)
   LET s=0
   FOR i=1 TO l
      FOR j=1 TO 10
         IF c$(j)=w$(i:i) THEN
            LET s=s+10^(l-i)*num(j)
            EXIT FOR
         END IF
      NEXT j
   NEXT i
   LET change=s
END FUNCTION
END SUB
!
EXTERNAL SUB charac(a$())
OPTION ARITHMETIC NATIVE
LET s=SIZE(a$)
LET c=1
LET c$(1)=a$(1)(1:1)
FOR i=1 TO s
   FOR j=1 TO LEN(a$(i))
      LET cc=0
      FOR kk=1 TO c
         IF a$(i)(j:j)<>c$(kk) THEN LET cc=cc+1
      NEXT kk
      IF cc=c THEN
         LET c=c+1
         LET c$(c)=a$(i)(j:j)
         IF c=10 THEN EXIT SUB
      END IF
   NEXT j
NEXT i
END SUB
!
EXTERNAL SUB headset
OPTION ARITHMETIC NATIVE
FOR i=1 TO k
   FOR j=1 TO 10
      IF word$(i)(1:1)=c$(j) THEN LET head(i)=j !ÀèƬʸ»ú
   NEXT j
NEXT i
END SUB
!
EXTERNAL FUNCTION random
OPTION ARITHMETIC NATIVE
LET r=INT(10*RND)
IF check(r)=0 THEN
   LET random=r
   LET check(r)=1
ELSE
   LET random=random
END IF
END FUNCTION
 

Re: ʸ»úÎó¤Î¡¡Ê¬²ò¡¡¡¡¿ôÃͲ½

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 9·î 3Æü(ÌÚ)10»þ13ʬ7ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.521[¸µµ­»ö¤Ø]

Í¿ºä¡¡¡¡¾ºÊ¿¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¥«¥ó¥Þ¤¬¤Ê¤¤¾ì¹ç¤Ï¡¢£±¹Ôʬ¤Îʸ»úÎó¤È¤·¤Æǧ¼±¤µ¤ì¤ë¤È»×¤¤¤Þ¤¹¡£
¤·¤¿¤¬¤Ã¤Æ¡¢

   1,  0.00,   0.45

¤Î¤è¤¦¤Ë¡¢¥«¥ó¥Þ¤Ç¶èÀÚ¤é¤ì¤¿¿ô»úÎó¤Ï¿ôÃͤȤ·¤ÆÆɤ߹þ¤Þ¤ì¤Þ¤¹¡£¡Ê²¼µ­¥×¥í¥°¥é¥à¤ÎTEST.TXT¤ÎÆâÍÆ¡Ë
¤³¤ì¤¬¤¤¤ï¤æ¤ëCSV¥Õ¥¡¥¤¥ë¤Ç¤¹¡£
OPEN #1: NAME "TEST.TXT"
DO
   INPUT #1, IF MISSING THEN EXIT DO: a,b,c
   PRINT a;b;c
LOOP
CLOSE #1

END

Îã
  1  0.00,   0.45
¤Ê¤é
  INPUT #1, IF MISSING THEN EXIT DO: a$,b
¤È¤Ê¤ë¡£a$="1  0.00"¡¢b=0.45
 

Re: ʤÌÌ»»¤Ï¤É¤¦²ò¤¯¤Î¤«¡©

 Åê¹Æ¼Ô¡§Åç¼1243  Åê¹ÆÆü¡§2009ǯ 9·î 3Æü(ÌÚ)15»þ01ʬ57ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.522[¸µµ­»ö¤Ø]

¹ÓÅĹÀÆ󤵤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£
>
>
> Åê¹Æ¤·¤è¤¦¤È¤·¤¿¤é¤¹¤Ç¤Ë»³ÃæϵÁ¤µ¤ó¤ÎÅê¹Æ¤¬¤¢¤ê¡¢»÷¤¿¤è¤¦¤Ê¤â¤Î¤Ç¤¹¤¬¤»¤Ã¤«¤¯ºî¤Ã¤¿¤Î¤Ç¸ø³«¤·¤Þ¤¹¡£

¹ÓÅĤµ¤ó¤ÎºîÀ®¤µ¤ì¤¿¥×¥í¥°¥é¥à¤ò¡¢¡Ö¥³¥Ô¡¼Å½¤êÉÕ¤±¡×¤ÇFedora10 Linux¾å¤ÎBASIC-6.5.9¤Ç
Áö¤é¤»¤¿¤é¡¢BASICËÜÂΤ¬¥¯¥é¥Ã¥·¥å¡Ê²¿ÅٹԤäƤâ¥À¥á¡Ë¤·¤Æ¤·¤Þ¤¤¤Þ¤·¤¿¤Î¤Ç¤´Êó¹ðÃפ·¤Þ
¤¹¡£
¥Ñ¥½¥³¥ó¤ÎRAM¤Ï512MB¤Ç¤¹¤¬¡¢¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¤Î¤Ç¤·¤ç¤¦¤«¡£
 

C++ ¤Î¡¡·×»»·ë²Ì¤ò¡¡full basic wo¡¡computer graphic

 Åê¹Æ¼Ô¡§Í¿ºä¡¡¡¡¾ºÊ¿  Åê¹ÆÆü¡§2009ǯ 9·î 3Æü(ÌÚ)15»þ47ʬ58ÉÃ
ÊÖ¿®¡¦°úÍÑ
  Í­¸ÂÍ×ÁÇË¡¤Î¡¡¡¡¥×¥í¥°¥é¥à¤ò¡¡¡¡ºîÀ®¤·¤Æ¤¤¤Þ¤¹¤¬
·×»»¤Ï¡¡¡¡60 ÇܤΡ¡¡¡Â®Å٤Ρ¡¹â®¤Î¡¡turbo C++  ¤Ç¡¡¡¡·×»»¤µ¤»
¤½¤Î¡¡deta file  ¤ò¡¡¡¡full  basic  ¤Ë¡¡¡¡°Ü¤·
computer graphic  ¤µ¤»¤ë»ö¤Ë
¤Û¤Ü¡¡¡¡À®¸ù¤·¤Þ¤·¤¿

¤È¤Æ¤â
´Êñ¤Ç¤¹

C++ Builder  Åù¤Ï¡¡¡¡¤Ò¤Ã¤è¤¦¡¡¡¡¤Ê¤¤¤«¤â¡¡¡¡ÃΤì¤Þ¤»¤ó
 

Re: ʤÌÌ»»¤Ï¤É¤¦²ò¤¯¤Î¤«¡©

 Åê¹Æ¼Ô¡§Åç¼1243  Åê¹ÆÆü¡§2009ǯ 9·î 3Æü(ÌÚ)17»þ38ʬ1ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.524[¸µµ­»ö¤Ø]

¹ÓÅĹÀÆ󤵤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¹ÓÅĤµ¤ó¤ÎºîÀ®¤µ¤ì¤¿¥×¥í¥°¥é¥à¤ò¡¢¡Ö¥³¥Ô¡¼Å½¤êÉÕ¤±¡×¤ÇFedora10 Linux¾å¤ÎBASIC-6.5.9¤Ç
> Áö¤é¤»¤¿¤é¡¢BASICËÜÂΤ¬¥¯¥é¥Ã¥·¥å¡Ê²¿ÅٹԤäƤâ¥À¥á¡Ë¤·¤Æ¤·¤Þ¤¤¤Þ¤·¤¿¤Î¤Ç¤´Êó¹ðÃפ·¤Þ
> ¤¹¡£
> ¥Ñ¥½¥³¥ó¤ÎRAM¤Ï512MB¤Ç¤¹¤¬¡¢¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¤Î¤Ç¤·¤ç¤¦¤«¡£

Ʊ°ì¥Ñ¥½¥³¥ó¤ÎWindowsXP¾å¤ÎBASIC-7.2.9¤Ç¼Â¹Ô¤·¤¿¤é¥×¥í¥°¥é¥à¤Ï°Û¾ï¤Ê¤¯Áö¤ê¤Þ¤·¤¿¡£
¤³¤Î·ë²Ì¤«¤é¡¢Linux¦¤ÎÌäÂê(OS¤ÎÌäÂ꤫BASIC-6.5.9¤ÎÌäÂ꤫¤ÏÉÔÌÀ¡Ë¤Ç°Û¾ï¤¬½Ð¤Æ¤·¤Þ¤¦¤è¤¦¤Ç¤¹¡£
°Ê¾å¡¢¤´Êó¹ð¤Ç¤¹¡£
 

Re: ʤÌÌ»»¤Ï¤É¤¦²ò¤¯¤Î¤«¡©

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 9·î 3Æü(ÌÚ)20»þ58ʬ3ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.526[¸µµ­»ö¤Ø]

OPTION ARITHMETIC NATIVE
¤À¤È¤Þ¤º¤¤¤ß¤¿¤¤¤Ç¤¹¡£
Ä´¤Ù¤Æ¤ß¤Þ¤¹¡£

http://sourceforge.jp/projects/decimalbasic/

 

Re: ʤÌÌ»»¤Ï¤É¤¦²ò¤¯¤Î¤«¡©

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ 9·î 3Æü(ÌÚ)23»þ03ʬ29ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.524[¸µµ­»ö¤Ø]

Åç¼1243¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¹ÓÅĤµ¤ó¤ÎºîÀ®¤µ¤ì¤¿¥×¥í¥°¥é¥à¤ò¡¢¡Ö¥³¥Ô¡¼Å½¤êÉÕ¤±¡×¤ÇFedora10 Linux¾å¤ÎBASIC-6.5.9¤Ç
> Áö¤é¤»¤¿¤é¡¢BASICËÜÂΤ¬¥¯¥é¥Ã¥·¥å¡Ê²¿ÅٹԤäƤâ¥À¥á¡Ë¤·¤Æ¤·¤Þ¤¤¤Þ¤·¤¿¤Î¤Ç¤´Êó¹ðÃפ·¤Þ
> ¤¹¡£
> ¥Ñ¥½¥³¥ó¤ÎRAM¤Ï512MB¤Ç¤¹¤¬¡¢¥á¥â¥ê¤¬Â­¤ê¤Ê¤¤¤Î¤Ç¤·¤ç¤¦¤«¡£

¤½¤ì¤Ï¿½¤·Ìõ¤Ê¤¤¤³¤È¤ò¤·¤Þ¤·¤¿¡£
»ä¤ÏLinux¤Ï¤Þ¤Ã¤¿¤¯ÃΤé¤Ê¤¤¤Î¤Ç¤¹¤¬¡¢WindowsVista¾å¤Ç½½¿ÊBASIC Ver.7.3.3¤Ç¤ÏÌäÂê¤Ê¤¯¼Â¹Ô¤Ç¤­¤Þ¤·¤¿¡£

¡¡²ÄǽÀ­¤È¤·¤Æ¤Ï¡¢¼Â¤ÏºÇ½é¤ËÅê¹Æ¤·¤¿¤È¤­¤Ëæ»ú¤¬¤¢¤ê¤Þ¤·¤¿¡£10ʬ¸å¤Ë¤Ï½¤Àµ¤·¤ÆºÆÅê¹Æ¤·¤¿¤Î¤Ç¤¹¤¬¡¢Åç¼1243¤µ¤ó¤¬ºÇ½é¤ÎÅê¹Æµ­»ö¤Ç¼Â¹Ô¤µ¤ì¤¿¤Î¤«¤â¤·¤ì¤Þ¤»¤ó¡£
½¤Àµ²Õ½ê¤Ï³°ÉôÉû¥×¥í¥°¥é¥à¤ÎÀë¸Àʸ¤Ç¤¹¡£

  ¸í) DECLARE EXTERNAL SUB perm,chara,headset
  Àµ) DECLARE EXTERNAL SUB perm,charac,headset

¤¿¤À¤·¡¢¥Ø¥ë¥×¤Ë¤è¤ë¤È³°ÉôÉû¥×¥í¥°¥é¥à¤ÎÀë¸À¤Ïɬ¿Ü¤Î¤â¤Î¤Ç¤Ï¤Ê¤¤¤é¤·¤¯¡¢ºÇ½é¤Î¸í¤Ã¤¿µ­»ö¤Ç¤âWindows¤Ç¤ÏÌäÂê¤Ê¤¯¼Â¹Ô¤Ç¤­¤Þ¤·¤¿¡£

¡¡¤Þ¤¿¡¢512MB¤¢¤ì¤Ð¡Ö¥á¥â¥ê¡¼ÉÔ­¡×¤È¤¤¤¦¤³¤È¤â¹Í¤¨¤Ë¤¯¤¤¤Ç¤¹¤è¤Í¡£
´Ø¿ôchange¤Ï³Î¤«¤ËÉÑÈˤ˸ƤӽФµ¤ì¤Þ¤¹¤¬¡¢ºÇÂç¤Ç¤â 4*10! ²ó¤Ç¤¹¡£¤·¤«¤âÀèƬʸ»úO,T,F,S¤Î¤¤¤º¤ì¤«¤¬0¤Î¤È¤­¤Ï¸Æ¤Ó½Ð¤µ¤Ê¤¤¤Î¤Ç¥á¥â¥ê¡¼¤¬ÉÔ­¤¹¤ë¤È¤Ï»×¤¨¤Þ¤»¤ó¡£

¡¡¤¢¤ë¤¤¤Ï¡¢½½¿ÊBASIC¤ÎÆȼ«³ÈÄ¥¤Ç¤¢¤ë¡Ö¼ç¥×¥í¥°¥é¥àÆâ¤ÇÊÑ¿ô¤ÎPUBLICÀë¸À¡×¤òÍøÍѤ·¤Æ¤¤¤Þ¤¹¤¬¡¢¤³¤Îµ¡Ç½¤¬Linux¤Ç¤Ï¾å¼ê¤¯Æ¯¤«¤Ê¤¤¤Î¤Ç¤·¤ç¤¦¤«¡©

¤´¤á¤ó¤Ê¤µ¤¤¡¢¤Þ¤Ã¤¿¤¯¤ï¤«¤ê¤Þ¤»¤ó¡£
 

Re: ʤÌÌ»»¤Ï¤É¤¦²ò¤¯¤Î¤«¡©

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 9·î 4Æü(¶â)08»þ11ʬ10ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.527[¸µµ­»ö¤Ø]

ÉÔ¶ñ¹ç²Õ½ê¤¬ÆÃÄê¤Ç¤­¤¿¤Î¤Ç¡¤½¤ÀµÈǤòºî¤ê¤Þ¤¹¡£

2¿Ê¥â¡¼¥É¤Ç¼¡¤Î¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¤ÈÊѤʸ½¾Ý¤¬µ¯¤³¤ê¤Þ¤¹¡£
2¿Ê¥â¡¼¥É¤Çʸ»úÎó½èÍý¤¹¤ë¿Í¤¬¤¤¤Ê¤«¤Ã¤¿¤Î¤¬¥Ð¥°È¯³Ð¤¬Ã٤줿¸¶°ø¤Ç¤·¤ç¤¦¤«¡£
OPTION ARITHMETIC NATIVE
DIM a$(4)
FOR i= 1 TO 4
   PRINT a$(i)
NEXT i
END

LinuxÈÇ¡¤MacÈǤÏGPL¤Ê¤Î¤Ç¡Ö¥Ð¥°Êó¹ð¤ÎµÁ̳¡×¤ò»ÈÍѾò·ï¤Ë½ñ¤¯¤³¤È¤¬¤Ç¤­¤Ê¤¤¤Î¤Ç¤¹¤¬¡¤
ÉÔ¶ñ¹ç¤ò¸«¤Ä¤±¤¿¤È¤­¤ÏÊó¹ð¤¯¤À¤µ¤ë¤è¤¦¤ª´ê¤¤¤·¤Þ¤¹¡£
 

C++ data ¤ò¡¡full basic ¤Ç¡¡graphick

 Åê¹Æ¼Ô¡§Í¿ºä¡¡¡¡¾ºÊ¿  Åê¹ÆÆü¡§2009ǯ 9·î 4Æü(¶â)10»þ00ʬ41ÉÃ
ÊÖ¿®¡¦°úÍÑ
  Í­¸ÂÍ×ÁÇË¡¤Ç¡¡¹½Â¤²òÀÏ¥½¥Õ¥È¤ò¡¡¡¡ºîÀ®¤·¤Æ¤¤¤Þ¤¹

ÀÜÅÀ¿ô¡¡¡¡£µ£µ£±£±¸Ä¤Î¡¡¡¡6ÁؤΡ¡¡¡¥Õ¥ì¡½¥à¤ò
»ä¤Î¡¡¥½¥Õ¥È¤Ç¡¡²ò¤¯¤È
full  basic  ¤Ç¡¡¡¡Ìó¡¡170»þ´Ö¡¡¡¡¤«¤«¤ê¤Þ¤¹
¤½¤ì¤ò
turbo  C++  ¤Ç¤È¤¯¤È¡¡¡¡Ìó¡¡3»þ´Ö¤Î¡¡¡¡Í½Äê¤Ç¤¹

turbo C++  ¤Ç¡¡¡¡¹½Â¤²òÀÏͽÄê¤Î
6ÁØ¡¡¥Õ¥ì¡½¥à¤Î
turbo C++  ¤Ç¡¡¡¡ºîÀ½¤·¤¿
input data  ¤ò
¿ô»ú¤Î¡¡¡¡´Ö¤Ë¡¡¡¡¥³¥ó¥Þ¡¡°õ¤ò¡¡¡¡Æþ¤ì¤ë¤À¤±¤Ç
´Êñ¤Ë
full  basic  ¤Ç¡¡¡¡computer graphic  ¤¹¤ë¤³¤È¤Ë
À®¸ù¤·¤Þ¤·¤¿

¥Õ¥¡¥¤¥ë£±¡¡¡¡¤Ë¡¡¡¡ÅºÉÕ¤·¤Þ¤¹

turbo C++  ¤Ç¤Î¡¡¡¡computer grahic  ¤Ï
Èó¾ï¤Ë¡¡¡¡Æñ¤·¤¯
Ť¤´Ö¡¡¡¡Çº¤ó¤Ç¤¤¤Þ¤·¤¿
 

turbo C++ and full basic

 Åê¹Æ¼Ô¡§Í¿ºä¡¡¡¡¾ºÊ¿  Åê¹ÆÆü¡§2009ǯ 9·î 4Æü(¶â)14»þ52ʬ42ÉÃ
ÊÖ¿®¡¦°úÍÑ
  »ä¤¬¡¡¡¡ºîÀ½¤·¤¿¡¡¡¡Í­¸ÂÍ×ÁÇË¡¤Î¡¡¡¡¹½Â¤²òÀÏ¥½¥Õ¥È¤Ç
6ÁؤΡ¡¡¡¥Õ¥ì¡½¥à¤Î¡¡¡¡ÃÏ¿Ì»þ¤Î¡¡¡¡¶Ê¤¬¤ê¤ò
²òÀϤ·¤Þ¤·¤¿

ÀÜÅÀ¿ô¡¡¡¡£µ£µ£±£±¡¡¸Ä¤Ç
turbo c++  ¤Ç¡¡¡¡·×»»»þ´Ö¡¡1»þ´Ö¡¡¡¡¤Ç¤¹

¤½¤Î¡¡ÀÜÅÀ¤Î¡¡¡¡ÊÑ°ÌÎ̤ò
full  basic  ¤Ë¡¡¡¡°Ü¤·¤Æ
500  Çܤˡ¡¡¡³ÈÂ礷¤Æ
¥°¥é¥Ò¥Ã¥¯¤Ë¡¡¡¡¤·¤Þ¤·¤¿

źÉÕ¤·¤Þ¤¹

full  basic  ¤Ç¡¡¡¡·×»»¤µ¤»¤ë¤È¡¡¡¡£¸£°»þ´Ö°Ê¾å
¤«¤«¤ë¡¡¡¡Í½ÁۤǤ¹
 

2¿§¤Î¡¡±þÎÏ¿Þ

 Åê¹Æ¼Ô¡§Í¿ºä¡¡¡¡¾ºÊ¿  Åê¹ÆÆü¡§2009ǯ 9·î 4Æü(¶â)20»þ02ʬ35ÉÃ
ÊÖ¿®¡¦°úÍÑ
  turbo C++  ¤Ç¡¡¡¡6Áإե졽¥à¤ò¡¡¡¡²¼¤«¤é¡¡¡¡²¡¤·¾å¤²¤¿»þ¤Î
¾ò·ï¤Ç¡¡¡¡·×»»¤µ¤»
full  basic  ¤Ç¡¡¡¡6Áإե졽¥à¤Î¡¡¡¡°ú¤ÃÄ¥¤ê¡¡Éôʬ¤ò¡¡¡¡ÀÄ
°µ½ÌÉôʬ¤ò¡¡¡¡À֤ǡ¡¡¡¿§¤º¤±¡¡¡¡¤·¤Þ¤·¤¿

¤³¤ì¤¬
Í­¸ÂÍ×ÁÇË¡¤Î¡¡¡¡¿Íµ¤¤Î¤¢¤ë
computer  graphic  ¤À¤È¡¡¡¡»×¤¤¤Þ¤¹
 

Re: 2¿§¤Î¡¡±þÎÏ¿Þ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 9·î 4Æü(¶â)20»þ55ʬ57ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.532[¸µµ­»ö¤Ø]

Í¿ºä¡¡¡¡¾ºÊ¿¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

²£Ä¹¤Î¿Þ·Á¤òɽ¼¨¤¹¤ë¤È¤­¡¢501¡ß501¤ÎÀµÊý·Á¤Î²èÌ̤ǤϸúΨ¤è¤¯É½¼¨¤Ç¤­¤Ê¤¤¤Î¤Ç¤Ï¡©

¥°¥é¥Õ¥£¥Ã¥¯¥¹²èÌ̤ⲣŤˤ¹¤ë¤ÈÎɤ¤¤Ç¤·¤ç¤¦¡£
SET bitmap SIZE 800,400
SET WINDOW -10,10,-5,5
DRAW grid
END
 

¿§¤ò¡¡¡¡ÊѤ¨¤Æ

 Åê¹Æ¼Ô¡§Í¿ºä¡¡¡¡¾ºÊ¿  Åê¹ÆÆü¡§2009ǯ 9·î 4Æü(¶â)21»þ36ʬ45ÉÃ
ÊÖ¿®¡¦°úÍÑ
  Á°¤Ë¡¡¡¡Åê¹Æ¤·¤¿
Í­¸ÂÍ×ÁÇË¡¤Î¡¡¡¡computer  grahic  ¤Î¡¡¡¡¿§¤ò
ÊѤ¨¤Æ¡¡¡¡¸«¤Þ¤·¤¿

Ìó¡¡1ËüËܤΡ¡¡¡Àþ¤Ç¡¡¡¡ÉÁ¤¤¤Æ¤¤¤Þ¤¹

ÍýÏÀ¤Î¡¡¡¡Í­¤ë¡¡¡¡Íý¹©²ÊŪ¡¡¡¡·Ý½Ñ¤Ç¤¹

ÀÖ¿§¡¡¡¡°µ½ÌÉôʬ
¾¡¡¡¡¡¡¡¡°ú¤ÃÄ¥¤ê¡¡¡¡Éôʬ
 

Re: ʤÌÌ»»¤Ï¤É¤¦²ò¤¯¤Î¤«¡©

 Åê¹Æ¼Ô¡§Åç¼1243  Åê¹ÆÆü¡§2009ǯ 9·î 5Æü(ÅÚ)09»þ26ʬ8ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.529[¸µµ­»ö¤Ø]

ÇòÀС¡ÏÂÉפµ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ÉÔ¶ñ¹ç²Õ½ê¤¬ÆÃÄê¤Ç¤­¤¿¤Î¤Ç¡¤½¤ÀµÈǤòºî¤ê¤Þ¤¹¡£
> 2¿Ê¥â¡¼¥É¤Ç¼¡¤Î¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¤ÈÊѤʸ½¾Ý¤¬µ¯¤³¤ê¤Þ¤¹¡£
> LinuxÈÇ¡¤MacÈǤÏGPL¤Ê¤Î¤Ç¡Ö¥Ð¥°Êó¹ð¤ÎµÁ̳¡×¤ò»ÈÍѾò·ï¤Ë½ñ¤¯¤³¤È¤¬¤Ç¤­¤Ê¤¤¤Î¤Ç¤¹¤¬¡¤
> ÉÔ¶ñ¹ç¤ò¸«¤Ä¤±¤¿¤È¤­¤ÏÊó¹ð¤¯¤À¤µ¤ë¤è¤¦¤ª´ê¤¤¤·¤Þ¤¹¡£

Linux(i386)ÈÇ ºÇ¿·¤Î¡ÖBASIC-6.5.A¡×¤òFedora10¾å¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤·¡¢¹ÓÅĤµ¤óºîÀ®¤Î
¡ÖʤÌÌ»»¡×¥³¡¼¥É¤ò¡¢¥¦¥§¥Ö²èÌ̤«¤é¥³¥Ô¡¼Å½¤êÉÕ¤±¤·¤ÆRUN¤·¤Þ¤·¤¿¤é¡¢Àµ¾ï¤Ë·×»»¤¬
´°Î»¤·¤Þ¤·¤¿¡£

ÇòÀÐÀèÀ¸¡¢Í­Æñ¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
¹ÓÅĤµ¤ó¡¢¥³¡¼¥É¤Î¸ø³«Í­Æñ¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£ÊÙ¶¯¤Ë¤Ê¤ê¤Þ¤¹¡£

°Ê¾å¡¢¤´Êó¹ð¤Ç¤¹¡£
 

¥¨¥é¡¼ EXTYPE 5001

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ 9·î 5Æü(ÅÚ)20»þ43ʬ47ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  OPTION ARITHMETIC NATIVE ! Native ¤Î¤ß¡¢²¼µ­¥¨¥é¡¼¤Ë¤Ê¤ê¤Þ¤¹¡£ver.7.3.3

DIM D(500,500)
MAT D=ZER(136,100)
!
MAT D=ZER(136,104) !<-- ¥¨¥é¡¼ EXTYPE 5001¡¡ÇÛÎó¤ÎºÆÄêµÁ¤ËɬÍפÊÍ×ÁÇ¿ô¤ÎÉÔ­

END
 

Re: ¥¨¥é¡¼ EXTYPE 5001

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 9·î 5Æü(ÅÚ)21»þ18ʬ4ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.536[¸µµ­»ö¤Ø]

¾®¤µ¤¯¤¹¤ë¾ì¹ç¤Ï£Ï£Ë¡£Â礭¤¯¤¹¤ë¾ì¹ç¤Ë£Î£Ç¡£
¤Þ¤¿¡¢redim¤Ç¤âƱÍͤǤ¹¡£

DIM D(500)
MAT D=ZER(100)
redim D(300) !<-- ¥¨¥é¡¼ EXTYPE 5001¡¡ÇÛÎó¤ÎºÆÄêµÁ¤ËɬÍפÊÍ×ÁÇ¿ô¤ÎÉÔ­
END
 

Re: ¥¨¥é¡¼ EXTYPE 5001

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 9·î 6Æü(Æü)06»þ50ʬ14ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.536[¸µµ­»ö¤Ø]

¤´Êó¹ð¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
MAXSIZE¤¬½ñ¤­´¹¤ï¤Ã¤Æ¤¤¤Þ¤·¤¿¡£

OPTION ARITHMETIC NATIVE
DIM D(500,500)
PRINT MAXSIZE(D)        ! 250000
MAT D=ZER(136,100)
PRINT MAXSIZE(D)        ! 13600¤ËÊѤï¤Ã¤Æ¤·¤Þ¤¦
END
 

ʤÌÌ»»¡¢ºÆ¹Í

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 9·î 7Æü(·î)11»þ18ʬ38ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  °ìÈ̤ˣò¸Ä¤ÎÊÑ¿ô¤Ë£î¸Ä¤Î¿ô¤ò³ä¤êÅö¤Æ¤ë¡Ö¾ì¹ç¤Î¿ô¡×¤Ï¡¢perm(n,r)Ä̤ꡣ
¤·¤¿¤¬¤Ã¤Æ¡¢¹â¡¹perm(10,10)=10!Ä̤ê¤ò¸¡¾Ú¤¹¤ì¤Ð¤è¤¤¤³¤È¤Ë¤Ê¤ë¤¬¡¢¡¢¡¢
¼ÂºÝ¡¢¸½¾õ¤Î¥Ñ¥½¥³¥ó¤Ç¤ÏÉé²Ù¤Ë¤Ê¤ë¤â¤Î¤Ç¤â¤Ê¤¤¡£
¤Þ¤¿¡¢°ìÅÙ²òÅú¤Ç¤­¤ì¤Ð¥×¥í¥°¥é¥à¤â¤½¤ì¤Ã¤­¤ê¤Ë¤Ê¤ë¡£¡Êone write¡Ë

ÏÀÍýŪÍ×ÁǤò°ìÉô¹Íθ¤·¤Æ¡¢
»Þ´¢¤ê¤ò¤¹¤ë¤³¤È¡Ê¥Ð¥Ã¥¯¥È¥é¥Ã¥¯Ë¡¡Ë¤Ç¡Ö¾ì¹ç¤Î¿ô¡×¤ò¸º¤é¤¹¤³¤È¤¬¤Ç¤­¤ë¡£

¡ü¥¢¥ë¥´¥ê¥º¥à¤Î³µÍ×
²Ã»»¤Ï¡¢°ì¤Î°Ì¤«¤é½ç¤Ë·×»»¤·¤Æ¤¤¤¯¤Î¤Ç¡¢°Û¤Ê¤ëʸ»ú¤ò°ì¤Î°Ì¤«¤é½ç¤Ë³ä¤êÉÕ¤±¤ë¡£

°ì¤Î°Ì¡ÊE+O+R=N¡Ë¤ò»»½Ð¤¹¤ë¤Ë¤Ï¡¢
a(i):1234xxxxxx
c$="EORNWUTVFS"
¤Þ¤Ç¿ô¤¬Ëä¤Þ¤Ã¤Æ¤¤¤ì¤Ð¤è¤¤¡£

¤½¤³¤Ç MOD(1+2+3,10)=4 ¡© ¤ò³Îǧ¤·¤Æ¡¢ÉÔÀ®Î©¤Ê¤éxxxxxx¤Ï¤É¤¦ÁÈÂؤ¨¤Æ¤â¤³¤Î¡Ö½çÎó¡×¤ÏÀ®Î©¤·¤Ê¤¤¡£
¤·¤¿¤¬¤Ã¤Æ¡¢6!¡Êx¤Î¿ô¡ËÄ̤ê¤Ï¸¡¾Ú¤¹¤ëɬÍפ¬¤Ê¤¤¤³¤È¤Ë¤Ê¤ë¡£

°ì¤Ä²¼¤Î°Ì¤¬À®Î©¤·¤¿¤Ê¤é¾å¤Î°Ì¤ÇƱ¤¸¤³¤È¤ò¹Ô¤¦¡£
!ʤÌÌ»»¡ÊnPr½çÎó¡Ü»Þ¼í¤ê¡Ë

DECLARE EXTERNAL SUB F.perm !³°Éô¼ê³¤­¡¢ÊÑ¿ô¤òÀë¸À¤¹¤ë
DECLARE EXTERNAL NUMERIC F.ANSWER_COUNT

LET t0=TIME

CALL perm(0, 1) !¥­¥ã¥ê¡¼¤Ï£°¡¢°ì¤Î°Ì¤«¤é
IF ANSWER_COUNT=0 THEN PRINT "²ò¤Ê¤·"

PRINT "·×»»»þ´Ö=";TIME-t0

END


MODULE F

SHARE STRING c$

!¡¡ ONE ¢­¢¨°ì¤Î°Ì¤«¤éa()¤Ë½ç¤Ë³ä¤êÉÕ¤±¤ë
!   TWO ¢­
!+ FOUR ¢­
!------
! SEVEN ¢­
LET c$="EORNWUTVFS" !°Û¤Ê¤ëʸ»ú¡¡¢«¢«¢«¢«¢«¡¡¢¨º¹¤·Âؤ¨

IF LEN(c$)>10 THEN
   PRINT "»ØÄê¤Ç¤­¤ëʸ»ú¤Ï£±£°Ê¸»ú°ÊÆâ¤Ç¤¹¡£"
   STOP
END IF

SHARE NUMERIC a(10) !ʸ»ú¤ËÀßÄꤷ¤¿¿ôÃÍ¡Ê£°¡Á£¹¡Ë
MAT a=ZER(LEN(c$)) !ʸ»ú¿ô¤ÈƱ¿ô¤ËÄ´À°¤¹¤ë

SHARE NUMERIC f(0 TO 9) !ʸ»ú¤Ë³ä¤êÅö¤Æ¤ë¿ô¡Ê£°¡Á£¹¡Ë¥Õ¥é¥°ÍÑ¡¡¢¨
MAT f=ZER

PUBLIC NUMERIC ANSWER_COUNT !²òÅú¿ô
LET ANSWER_COUNT=0


EXTERNAL FUNCTION fnVAL(w$) !ʸ»úɽ¸½¤Î¿ô¤ò¿ôÃͤ˴¹¤¨¤ë
   LET v=0
   FOR i=1 TO LEN(w$)
      LET p=POS(c$,w$(i:i))
      LET v=v*10+a(p)
   NEXT i
   LET fnVAL=v
END FUNCTION

PUBLIC SUB perm
EXTERNAL SUB perm(cy, L) !nPr½çÎó¤Ç¤Î¿ô¤ÎÁȤòÀ¸À®¤¹¤ë
   FOR nm=LBOUND(f) TO UBOUND(f) !½ÅÊ£¤òÈò¤±¤Æ¡¢£°¡Á£¹¤Î¿ô»ú¤ò³ä¤êÅö¤Æ¤ë
      IF f(nm)=0 THEN
         LET f(nm)=1 !»ÈÍÑÃæ¥Õ¥é¥°¤òON¤Ë¤¹¤ë

         LET a(L)=nm !LÈÖÌܤò¿ônm¤È¤¹¤ë

         !----- ¢­¢­¢­¢­¢­ -----¡¡¢¨º¹¤·Âؤ¨
         SELECT CASE c$(L:L)
         CASE "N" !°ì¤Î°Ì¤ò³Îǧ¤¹¤ë
            LET k=fnVAL("E")+fnVAL("O")+fnVAL("R")
            IF MOD(k,10)=fnVAL("N") THEN
               CALL perm(INT(k/10), L+1)
            END IF
         CASE "U" !½½¤Î°Ì¤ò³Îǧ¤¹¤ë
            LET k=fnVAL("N")+fnVAL("W")+fnVAL("U") + cy
            IF MOD(k,10)=fnVAL("E") THEN
               CALL perm(INT(k/10), L+1)
            END IF
         CASE "V" !É´¤Î°Ì¤ò³Îǧ¤¹¤ë
            LET k=fnVAL("O")+fnVAL("T")+fnVAL("O") + cy
            IF fnVAL("O")>0 AND fnVAL("T")>0 AND MOD(k,10)=fnVAL("V") THEN
               CALL perm(INT(k/10), L+1)
            END IF
         CASE "S" !Ëü¤ÈÀé¤Î°Ì¤ò³Îǧ¤¹¤ë
            LET k=fnVAL("F") + cy
            IF fnVAL("F")>0 AND fnVAL("S")>0 AND k=fnVAL("SE") THEN

               LET ANSWER_COUNT=ANSWER_COUNT+1 !²òÅú¿ô
               PRINT ANSWER_COUNT

               PRINT USING "    ONE   ####":fnVAL("ONE") !·ë²Ì¤Îɽ¼¨
               PRINT USING "    TWO   ####":fnVAL("TWO")
               PRINT USING "¡Ü FOUR   ####":fnVAL("FOUR")
               PRINT "-------"
               PRINT USING "  SEVEN  #####":fnVAL("SEVEN")
               PRINT

               !STOP !£±¤Ä¤À¤±¤Ê¤é¥³¥á¥ó¥È¤ò¤Ï¤º¤¹
            END IF
         CASE ELSE
            IF L<LEN(c$) THEN CALL perm((cy), L+1) !¼¡¤Îʸ»ú¤Ø¡¡¢¨cy¤ÏÃÍÅϤ·
         END SELECT
         !----- ¢¬¢¬¢¬¢¬¢¬ -----

         LET f(nm)=0 !̤»ÈÍÑ
      END IF
   NEXT nm
END SUB

END MODULE
 

ºÇ¾¯¼ê¿ô¤Ï¡©

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ 9·î 7Æü(·î)13»þ31ʬ4ÉÃ
ÊÖ¿®¡¦°úÍÑ
  °ìÆ󻰻͸ÞÏ»¼·È¬¶å
¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦
¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦
ÊâÊâÊâÊâÊâÊâÊâÊâÊ⣷
¡¡³Ñ¶ä¶â¹á¶â¶äÈô¡¡£¸
¹á·Ë¶ä¶â¶Ì¶â¶ä·Ë¹á£¹

¤È¤¤¤¦¾­´ýÈ×¾å¤ÎÇÛÃÖ¤«¤é¡¢Èô¤È³Ñ¤Î°ÌÃÖ¤ò¸ò´¹¤µ¤»¤ë¡Ê¤¿¤À¤·Æþ¤ìÂؤï¤Ã¤¿¸å¤Î¾¤Î¶ð¤Ï
¸µ¤Î°ÌÃ֤ˤ¢¤ë¤³¤È¡£¶å£¸Èô¤¬£±¼êÌÜ¡Ë
¤³¤ÎÆþ¤ìÂؤ¨¥Ñ¥º¥ë¤ÎºÇ¾¯¼ê¿ô¤òµá¤á¤é¤ì¤Þ¤¹¤«¡©
 

Re: ºÇ¾¯¼ê¿ô¤Ï¡©

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 9·î 8Æü(²Ð)16»þ55ʬ37ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.540[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

Êâ¡¢¹á¡¢·Ë¤ÏÁ°Êý°ÜÆ°¤Î¤ß¤Ê¤Î¤Ç¡¢¤³¤³¤Ç¤Ï°ÜÆ°¤Ç¤­¤Ê¤¤¡£¤·¤¿¤¬¤Ã¤Æ¡¢¤³¤ì¤é¤ÏÊɤȤʤ롣

¡¡³Ñ¶ä¶â¡ß¶â¶äÈô
¡ß¡ß¶ä¶â¶Ì¶â¶ä¡ß¡ß

¤ÎÈפȶð¤Ç¹Í¤¨¤ì¤Ð¤è¤¤¡£

1 ¼ê
¡¡³Ñ¶ä¶â¡ß¶â¶ä¡¡Èô¡¡¢¨£±¼ê¤Î¤ß
¡ß¡ß¶ä¶â¶Ì¶â¶ä¡ß¡ß
2 ¼ê
¡¡³Ñ¶ä¶â¡ß¶â¶ä¶äÈô¡¡¢¨£±¼ê¤Î¤ß
¡ß¡ß¶ä¶â¶Ì¶â¡¡¡ß¡ß
3 ¼ê
¡¡³Ñ¶ä¶â¡ß¶â¶ä¶äÈô¡¡¢¨£±¼ê¤Î¤ß
¡ß¡ß¶ä¶â¶Ì¡¡¶â¡ß¡ß

¼¡¤Î£´¼êÌܤϣ²Ä̤ꤢ¤ë¡£
4 ¼ê
¡¡³Ñ¶ä¶â¡ß¡¡¶ä¶äÈô
¡ß¡ß¶ä¶â¶Ì¶â¶â¡ß¡ß

4 ¼ê
¡¡³Ñ¶ä¶â¡ß¶â¶ä¶äÈô
¡ß¡ß¶ä¶â¡¡¶Ì¶â¡ß¡ß

¡¡¡§
¡¡¡§
¡¡¡§

£±¼ê¤ËÊ¿¶Ñ¤·¤Æ¸õÊ䤬£²Ä̤ꤢ¤ë¤È¤¹¤ë¤È¡¢2^99Ä̤ê¡ÊºÇ¾®¼ê¤¬¤ï¤«¤Ã¤Æ¤¤¤ë¤È¤·¤Æ¤â¡Ë¡£
¤³¤ì¤Ïŷʸ³ØŪ¤ÊÃͤǤ¹¡£

ñ½ã¤Ê¥Ð¥Ã¥¯¥È¥é¥Ã¥¯Ë¡¤Ç¡¢ÈóÎϤʥѥ½¥³¥ó¤ò»È¤Ã¤Æ²ò¤òµá¤á¤ë¤Î¤Ï̵Íý¤Ç¤·¤ç¤¦¡£
 

µ¿Ìä

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ 9·î 8Æü(²Ð)19»þ25ʬ34ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¤É¤¦¤·¤Æ£²¡°£¹£¹¤òȽÃǤµ¤ì¤¿¤ó¤Ç¤¹¤«¡©  

Re: µ¿Ìä

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 9·î 8Æü(²Ð)19»þ43ʬ33ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.542[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¤É¤¦¤·¤Æ£²¡°£¹£¹¤òȽÃǤµ¤ì¤¿¤ó¤Ç¤¹¤«¡©

ºÇ¾®¤¬£¹£¹¼ê¤À¤«¤é¤Ç¤¹¡£¤½¤ì¤ò¸«¤Ä¤±¤ë¤¿¤á¤ËéÍÄÙ¤·¤Ëõ¤¹¡Ö¾ì¹ç¤Î¿ô¡×¤Ç¤¹¡£
 

Re: µ¿Ìä

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ 9·î 8Æü(²Ð)21»þ51ʬ48ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.543[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£


> ºÇ¾®¤¬£¹£¹¼ê¤À¤«¤é¤Ç¤¹¡£¤½¤ì¤ò¸«¤Ä¤±¤ë¤¿¤á¤ËéÍÄÙ¤·¤Ëõ¤¹¡Ö¾ì¹ç¤Î¿ô¡×¤Ç¤¹¡£


£¹£¹¼ê¤«¤«¤ë¤³¤È¤Ï¡¢»î¹Ôºø¸í¤Ç¸«¤Ä¤±½Ð¤µ¤ì¤¿¤Î¤Ç¤¹¤«¡©
¤½¤ì¤Ë¤·¤Æ¤â¤³¤ó¤Êû»þ´Ö¤Ç¤É¤¦¤ä¤Ã¤¿¤é¸«¤Ä¤±¤é¤ì¤ë¤Î¤«Êòµ¤¤Ë¼è¤é¤ì¤Þ¤¹¡£
 

¥Ñ¥º¥ë¤Î²ò¤¬ÃΤꤿ¤¤¡£

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ 9·î11Æü(¶â)19»þ40ʬ13ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¼¡¤Î£²¤Ä¤Î¥Ñ¥º¥ë¤Ë½Ð¤¯¤ï¤·¡¢¤É¤¦¤·¤Æ¤â²ò¤­¤¿¤¯£±½µ´ÖÄ©À魯¤ë¤â»õ¤¬¤¿¤¿¤º¡¢¥µ¥¤¥È¤ÇÄ´¤Ù¤Æ¤â¤É¤³¤Ë¤â²òÅú¤é¤·¤­¤â¤Î¤Ë½Ð²ñ¤¨¤º¡¢¤Ç¤â¤É¤¦¤·¤Æ¤â²òÅú¤¬ÃΤꤿ¤¤¡£
¥×¥í¥°¥é¥à¤ÎÎϤǸ«¤Ä¤±¤Æ¤â¤é¤¨¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£
¤Þ¤¿¤Ï¡¢¤É¤Ê¤¿¤«²òÅú¤ò¤´Â¸¤¸¤Ç¤Ï¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡©


Rolling Cube1
¤µ¤¤¤³¤í¤¬£¹¸Ä¡Ê£³¡ß£³¡ËÆþ¤ëÈ¢¤¬¤¢¤ê¡¢Ãæ±û¤Ë¤Ï¤µ¤¤¤³¤í¤¬¤Ê¤¯¡¢¼þ¤ê¤Ë£¸¸Ä¤Î¤µ¤¤¤³¤í¤¬£±¤ÎÌܤò²¼¤Ë¤·¤ÆÇÛÃÖ¤µ¤ì¤Æ¤¤¤ë¡£
¤µ¤¤¤³¤í¤ò¶õ¤­ÃϤËž¤¬¤¹¤³¤È¤Ç¡¢Á´¤Æ¤Î¤µ¤¤¤³¤í¤ÎÌܤ¬£±¤¬½Ð¸½¤¹¤ë¤è¤¦¤Ë¤»¤è¡£
Rolling Cube2
8¡ß8¤Î¥ª¥»¥íÈĤκ¸¾å¤Ë£±¤ÎÌܤò¾å¤Ë¤·¤¿¤µ¤¤¤³¤í¤¬¤¢¤ë¡£Á´¤Æ¤Î¥Þ¥¹Ìܤò£±¤ÎÌܤ¬½Ð¸½¤·¤Ê¤¤¤è¤¦¡Ê¾å¤ÎÌ̤ˣ±¤ÎÌܤ¬½Ð¤Ê¤¤¡£¡Ë¤Ëž¤¬¤·¤Æ¤¤¤­¡¢ºÇ¸å¤Ë±¦¾å¤Î¥Þ¥¹ÌܤǽªÎ»¤¹¤ë»þ½é¤á¤Æ£±¤ÎÌܤ¬¸½¤ì¤ë¤³¤È¡£
 

Re: ¥Ñ¥º¥ë¤Î²ò¤¬ÃΤꤿ¤¤¡£

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 9·î11Æü(¶â)20»þ51ʬ23ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.545[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¡Ö¤µ¤¤¤³¤í¤òž¤¬¤¹¡×¤ò»²¾È¤Î¤³¤È¡£¡¡No.99[¸µµ­»ö¤Ø]

£²²Õ½ê¡Ê¥×¥í¥°¥é¥à¤ÎÃæ±û¤¢¤¿¤ê¡Ë

LET s$="RRRRRRR" !¼ê½ç 1

SET WINDOW -1,9,9,-1 !ɽ¼¨Îΰè

¤ò½¤Àµ¤·¤Æ¤¯¤À¤µ¤¤¡£Å¾¤¬¤·¤Æ¤¤¤¯¤ÈÆ°¤­¤¬¸«¤¨¤Æ¤¯¤ë¤È»×¤¤¤Þ¤¹¡£
 

¥ä¥Ã¥¿¡¼¡ª¡ª

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ 9·î11Æü(¶â)23»þ21ʬ14ÉÃ
ÊÖ¿®¡¦°úÍÑ
  Rolling Cube2¤¬
LET s$="RRRDLDLULDDDDDDRURDRUULLUURDRUURDDRURDDLLDDRURDRUUUUUULDLULURRR"
¤Ç̵»öÅþÃ夷¤Þ¤·¤¿¡£
Ť¤¤â¤ä¤â¤ä¤¬¥¹¥Ã¥­¥ê¤·¤¿µ¤Ê¬¤Ç¤¹¡£
¤½¤¦¤¤¤¨¤Ð¡¢°ÊÁ°¤³¤ó¤ÊÌäÂê¤ò»³Ã椵¤ó¤«¤é½ÐÂꤵ¤ì¤Æ¤¤¤Þ¤·¤¿¤Í¡£
¤¹¤Ã¤«¤ê˺¤ì¤Æ¤¤¤Þ¤·¤¿¡£¤³¤ó¤Ê¤È¤³¤í¤Ç·Ò¤¬¤ë¤È¤Ï»×¤Ã¤Æ¤â¤¤¤Þ¤»¤ó¤Ç¤·¤¿¡£
¶¯ÎÏ¤Ê¥×¥í¥°¥é¥àÍ­¤êÆñ¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
 

Re: ¥Ñ¥º¥ë¤Î²ò¤¬ÃΤꤿ¤¤¡£

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 9·î13Æü(Æü)09»þ56ʬ11ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.545[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¥×¥í¥°¥é¥à¤ÎÎϤǸ«¤Ä¤±¤Æ¤â¤é¤¨¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£

Rolling Cube 2 ¤ò²ò¤¯¥×¥í¥°¥é¥à

¡Ö¥Þ¥Ã¥×¤Î·Ðϩõº÷¡×¤È¡ÖÃÖ´¹¡×¤È¤òÁȤ߹ç¤ï¤»¤Þ¤·¤¿¡£
£¸¡ß£¸¤ÏÈóÎϤʥѥ½¥³¥ó¤Ç¤Ï°ìÆüºî¶È¤Ë¤Ê¤ê¤Þ¤¹¡££²¿Ê¥â¡¼¥É¤Ç¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£

!ÌäÂê
!¡¡¤µ¤¤¤³¤í¤¬£±¤Ä¡¢£¸¡ß£¸¤ÎÈפκ¸¾å¶ù¤Ë£±¤ÎÌ̤ò¾å¤Ë¾è¤Ã¤Æ¤¤¤Þ¤¹¡£
!¡¡¤³¤Î¤µ¤¤¤³¤í¤òÁ´¤Æ¤Î¥Þ¥¹¤ò£±ÅÙ¤À¤±Ä̤äƱ¦¾å¶ù¤Ëž¤¬¤·¤Æ°ÜÆ°¤µ¤»¤Þ¤¹¡£
!¡¡¤³¤Î¤È¤­¡¢ÅÓÃæ¤Ç£±¤ÎÌ̤¬¾å¤ËÍè¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£
!¡¡ºÇ¸å¤Ë±¦¾å¶ù¤ËÍ褿¤È¤­¤Ï¡¢£±¤ÎÌ̤¬¾å¤Ë¤Ê¤ë¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£

DECLARE EXTERNAL NUMERIC RollCube.A() !³°Éô¼ê³¤­¡¢ÊÑ¿ô
DECLARE EXTERNAL NUMERIC Map.ANSWER_COUNT
DECLARE EXTERNAL SUB Map.visit

LET t0=TIME

CALL visit(2,2,1,A) !º¸¾å¤ÎºÂɸ(Y,X)=(1,1)¡¡¢¨³°Êɤò¹Íθ¤¹¤ë
IF ANSWER_COUNT=0 THEN PRINT "²ò¤Ê¤·"

PRINT "¼Â¹Ô»þ´Ö=";TIME-t0

END


MODULE Map !¥Þ¥Ã¥×¤Î¹½ÃۤȤ½¤Î·Ðϩõº÷

SHARE NUMERIC SX,SY !¥Þ¥Ã¥×¤ÎÂ礭¤µ¡¡¢¨
LET SY=8 !½Ä
LET SX=8 !²£


SHARE NUMERIC M(20,20) !¥Þ¥Ã¥×
MAT M=ZER(SY+2,SX+2)
FOR i=1 TO SX+2 !³°Êɤò¤Ä¤¯¤ë¡¡¢¨ÈÖʼ
   LET M(1,i)=-1
   LET M(SY+2,i)=-1
NEXT i
FOR i=1 TO SY+2
   LET M(i,1)=-1
   LET M(i,SX+2)=-1
NEXT i

!ÆâÊɤò¤Ä¤¯¤ë¡¡¢¨

!!!MAT PRINT M; !debug


SHARE NUMERIC EX,EY !½ªÅÀ¤ÎºÂɸ¡¡¢¨
LET EX=SX+1 !±¦¾å¶ù¡¡¢¨³°Êɤò¹Íθ¤¹¤ë
LET EY=1+1


SHARE NUMERIC DIST !·ÐÏ©¤ò£±ÅÙ¤À¤±Ä̤ëºÇÂçµ÷Î¥
FOR i=2 TO SY+1
   FOR j=2 TO SX+1
      IF M(i,j)=0 THEN LET DIST=DIST+1
   NEXT j
NEXT i
!!!PRINT DIST !debug


PUBLIC NUMERIC ANSWER_COUNT !²òÅú¿ô
LET ANSWER_COUNT=0

SET WINDOW 0,1,1,0 !---------- trace


PUBLIC SUB vist
EXTERNAL SUB visit(yy,xx,Cnt,T()) !·ÐÏ©¡Ê£±ÅÙ¤À¤±Ä̤ë¡Ë¤òõº÷¤¹¤ë
   DECLARE EXTERNAL SUB RollCube.PermMultiply,RollCube.PermPrintOut !³°Éô¼ê³¤­¡¢ÊÑ¿ô
   DECLARE EXTERNAL NUMERIC RollCube.U(),RollCube.D(),RollCube.L(),RollCube.R()
   DECLARE EXTERNAL NUMERIC RollCube.DX(),RollCube.DY()
   DIM TT(UBOUND(T)) !ºî¶ÈÍÑ

   LET M(yy,xx)=Cnt !­À×

   SET DRAW mode hidden !---------- trace start
   CLEAR
   FOR i=1 TO SY+2
      FOR j=1 TO SX+2
         PLOT TEXT, AT 0.06*j,0.06*i: STR$(M(i,j))
      NEXT j
   NEXT i
   SET DRAW mode explicit !---------- trace end

   IF (xx=EX AND yy=EY) THEN !½ªÅÀ¤Ê¤é
      IF Cnt=DIST AND T(3)=1 THEN !¤¹¤Ù¤Æ¤Î¥Þ¥¹¤ò·Ðͳ¤·¤Æ¡¢£±¤ÎÌܤʤé
         LET ANSWER_COUNT=ANSWER_COUNT+1
         PRINT "No.";ANSWER_COUNT
         MAT PRINT USING(REPEAT$(" ##",UBOUND(M,2))): M
      END IF

   ELSE
      FOR i=1 TO 4 !¾å²¼º¸±¦¤Î£´¶á˵
         LET ty=yy+DY(i)
         LET tx=xx+DX(i)

         IF DIST=SY*SX AND Cnt<(SY-1)*(SX-1) AND (ty>SY OR tx>SX) THEN !¥Þ¥Ã¥×¤òʬ³ä¤¹¤ë¤³¤È¤òËɤ°
         ELSE !!!!!¢¨³«»Ï°ÌÃÖ¤¬ºÇ²¼¹Ô°Ê³°

            IF M(ty,tx)=0 THEN !̤Ƨ¤Ê¤é

               SELECT CASE i !¤µ¤¤¤³¤í¤òž¤¬¤·¤Æ¤ß¤ë
               CASE 1
                  CALL PermMultiply(T,U,TT)
               CASE 2
                  CALL PermMultiply(T,D,TT)
               CASE 3
                  CALL PermMultiply(T,L,TT)
               CASE 4
                  CALL PermMultiply(T,R,TT)
               CASE ELSE
               END SELECT

               IF Cnt+1=DIST OR TT(3)<>1 THEN CALL visit(ty,tx,Cnt+1,TT) !£±¤ÎÌܰʳ°¤Ê¤é¡¢¼¡¤Ø

            END IF

         END IF !!!!!

      NEXT i

   END IF

   LET M(yy,xx)=0 !¸µ¤ËÌ᤹

END SUB

END MODULE


MODULE RollCube !¤µ¤¤¤³¤í¤òž¤¬¤¹

PUBLIC NUMERIC DX(4),DY(4) !¾å²¼º¸±¦¤Î£´¶á˵
DATA  0,0,-1,1
DATA -1,1, 0,0
MAT READ DX
MAT READ DY


!Ÿ³«¿Þ¤ÎÇÛÃÖ¤ÈÌÌÈÖ¹æ¡ÊÇÛÎó¤Îź¤¨»ú¡Ë¤È¤Î´Ø·¸
!¡¡¢¢¡¡¡¡¡¡¡¡¸å¡¡¡¡¡¡¡¡£±
!¢¢¢¢¢¢¢¢¡¡º¸¾å±¦²¼¡¡£²£³£´£µ
!¡¡¢¢¡¡¡¡¡¡¡¡Àµ¡¡¡¡¡¡¡¡£¶

PUBLIC NUMERIC A(6)
DATA 5,4,1,3,6,2 !ÌܤÎÇÛÃÖ¡¡¢¨Å¸³«¿Þ»²¾È
MAT READ A


PUBLIC NUMERIC U(6),D(6),L(6),R(6) !ÃÖ´¹
!    1,2,3,4,5,6
DATA 3,2,6,4,1,5 !¾å¡¡¢¨ÀµÌ̤ò¾åÌ̤ˤ¹¤ë¡Ê¿Þ¤Ç¤Î¿åÊ¿¼´¡Ë²óž
!!!DATA 5,2,1,4,6,3 !²¼
DATA 1,3,4,5,2,6 !º¸
!!!DATA 1,5,2,3,4,6 !±¦

MAT READ U
CALL PermInverse(U,D)
!!!MAT READ D
MAT READ L
CALL PermInverse(L,R)
!!!MAT READ R


!ÃÖ´¹¡ÊPermutation¡Ë¤Î·×»»
PUBLIC SUB PermPrintOut
EXTERNAL SUB PermPrintOut(A()) !ɽ¼¨¤¹¤ë
   MAT PRINT USING(REPEAT$(" ##",UBOUND(A))): A;
   PRINT
END SUB
PUBLIC SUB PermIdentity
EXTERNAL SUB PermIdentity(A()) !¹±ÅùÃÖ´¹
   FOR i=1 TO UBOUND(A)
      LET A(i)=i
   NEXT i
END SUB
PUBLIC SUB PermInverse
EXTERNAL SUB PermInverse(A(), iA()) !µÕÃÖ´¹¡¡¢¨iA¤ÏA°Ê³°¤ÎÇÛÎó¤ò»ØÄꤹ¤ë¤³¤È
   FOR i=1 TO UBOUND(A)
      LET iA(A(i))=i
   NEXT i
END SUB
PUBLIC SUB PermMultiply
EXTERNAL SUB PermMultiply(A(),B(), AB()) !ÀÑAB¡¡¢¨AB¤ÏA°Ê³°¤«¤ÄB°Ê³°¤ÎÇÛÎó¤ò»ØÄꤹ¤ë¤³¤È
   LET ua=UBOUND(A)
   LET ub=UBOUND(B)
   IF ua=ub THEN
      FOR i=1 TO ua
         LET AB(i)=A(B(i)) !¢¨¹çÀ®¼ÌÁü(AB)(i)=A(B(i))
      NEXT i
   ELSE
      PRINT "¼¡¸µ¤¬°ã¤¤¤Þ¤¹¡£A=";ua;" B=";ub
      STOP
   END IF
END SUB

END MODULE


>¥µ¥¤¥È¤ÇÄ´¤Ù¤Æ¤â¤É¤³¤Ë¤â²òÅú¤é¤·¤­¤â¤Î¤Ë½Ð²ñ¤¨¤º¡¢

¤³¤Á¤é ¤ËξÊý¤¢¤ê¤Þ¤¹¡£
 

ʤÌÌ»»¤«¤é¾®Ä®»»¤Ø

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ 9·î13Æü(Æü)19»þ21ʬ53ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ºî¤Ã¤Æ夤¤¿Ê¤ÌÌ»»¤Î¥×¥í¥°¥é¥à¤òÍøÍѤ·¤Æ¼¡¤Î¤è¤¦¤Ê·ë²Ì¤¬²Äǽ¤Ê¤³¤È¤¬³Îǧ¤Ç¤­¤Þ¤·¤¿¡£

¡¡£·£¹£³£²¡¡¡¡£±
---------- = ---¡Ê¾Á´Éô¤Ç£±£²Ä̤ê¡Ë
£±£µ£¸£¶£´¡¡¡¡£²

¡¡£µ£¸£³£²¡¡¡¡£±
---------- = ---(¾£²Ä̤ê¡Ë
£±£·£´£¹£¶¡¡¡¡£³

¡¡£³£¹£´£²¡¡¡¡£±
---------- = ---¡Ê¾£´Ä̤ê¡Ë
£±£µ£·£¶£¸¡¡¡¡£´

¡¡£¹£·£²£³¡¡¡¡£±
---------- = ---¡Ê¾£±£²Ä̤ê¡Ë
£´£¸£¶£±£µ¡¡¡¡£µ

¡¡£²£¹£´£³¡¡¡¡£±
---------- = ---¡Ê¾£³Ä̤ê¡Ë
£±£·£¶£µ£¸¡¡¡¡£¶

¡¡£·£¶£±£´¡¡¡¡£±
---------- = ---¡Ê¾£·Ä̤ê¡Ë
£µ£³£²£¹£¸¡¡¡¡£·

¡¡£¹£³£²£±¡¡¡¡£±
---------- = ---¡Ê¾£´£¶Ä̤ê¡Ë
£·£´£µ£¶£¸¡¡¡¡£¸

¡¡£¸£³£¶£±¡¡¡¡£±
---------- = ---¡Ê¾£³Ä̤ê¡Ë
£·£µ£²£´£¹¡¡¡¡£¹

ʬ¿ô¤¬¾®Ä®»»·¿¤Ç¤³¤ì¤À¤±ºî¤ì¤ë¤³¤È¤Ë¶Ãس¤·¤Þ¤·¤¿¡£
 

(̵Âê)

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ 9·î13Æü(Æü)22»þ23ʬ9ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.548[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> Rolling Cube 2 ¤ò²ò¤¯¥×¥í¥°¥é¥à
>
> ¡Ö¥Þ¥Ã¥×¤Î·Ðϩõº÷¡×¤È¡ÖÃÖ´¹¡×¤È¤òÁȤ߹ç¤ï¤»¤Þ¤·¤¿¡£
> £¸¡ß£¸¤ÏÈóÎϤʥѥ½¥³¥ó¤Ç¤Ï°ìÆüºî¶È¤Ë¤Ê¤ê¤Þ¤¹¡££²¿Ê¥â¡¼¥É¤Ç¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£

¥×¥í¥°¥é¥à¤ò£²¿ÊË¡¤Ç£±£°»þ´Ö°ÌÁö¤é¤»¤¿¤é½ªÎ»¤·¤Þ¤·¤¿¤¬¡¢
·ë²Ì¤¬
£±£²£³£´
¡¡£·£¶£µ
¡¡£¸£¹10
  131211
  141516
  191817
  202122
¤Îž¤¬¤¹Èֹ椬ÉÕ¤¤¤¿¤â¤Î¤ò²òÅú¤È¤·¤Æ¼¨¤·¤Þ¤·¤¿¤¬¡Ê£²£³ÈְʹߤÎÈÖ¹æ¤Ï½Ð¤Æ¤­¤Þ¤»¤ó¡£¡Ë¡¢³Î¤«¤Ë¤³¤ì¤Çž¤¬¤¹¤È£±¤ÎÌܤϽи½¤·¤Þ¤»¤ó¤¬¡¢¤³¤Î¸åÁ´Ì̤Υޥ¹ÌܤòÀ©ÇƤ·¤è¤¦¤È¤¹¤ë¤Èɬ¤º£±¤ÎÌܤϽи½¤·¤Æ¤·¤Þ¤¤¤Þ¤¹¡£
¡¡»ä¤Ë¤Ï¸¶°ø¤¬¤É¤³¤Ë¤¢¤ë¤Î¤«¤Þ¤Ã¤¿¤¯Ê¬¤«¤ê¤Þ¤»¤ó¤Î¤Ç¡¢¤´¸¡Æ¤¤ò¤ª´ê¤¤¤·¤Þ¤¹¡£
 

Re: ¥Ñ¥º¥ë¤Î²ò¤¬ÃΤꤿ¤¤¡£

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 9·î13Æü(Æü)23»þ28ʬ10ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.548[¸µµ­»ö¤Ø]

¤´ÌÂÏǤò¤ª¤«¤±¤·¤Þ¤¹¡£
²ò¤â»Þ´¢¤ê¤·¤Æ¤¤¤Þ¤·¤¿¤Î¤Ç¡¢Àµ¤·¤¤·ë²Ì¤Ë¤Ê¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£

¼¡¤Î¤è¤¦¤Ë½¤Àµ¤·¤Æ¤¯¤À¤µ¤¤¡£
!ÌäÂê
!¡¡¤µ¤¤¤³¤í¤¬£±¤Ä¡¢£¸¡ß£¸¤ÎÈפκ¸¾å¶ù¤Ë£±¤ÎÌ̤ò¾å¤Ë¾è¤Ã¤Æ¤¤¤Þ¤¹¡£
!¡¡¤³¤Î¤µ¤¤¤³¤í¤òÁ´¤Æ¤Î¥Þ¥¹¤ò£±ÅÙ¤À¤±Ä̤äƱ¦¾å¶ù¤Ëž¤¬¤·¤Æ°ÜÆ°¤µ¤»¤Þ¤¹¡£
!¡¡¤³¤Î¤È¤­¡¢ÅÓÃæ¤Ç£±¤ÎÌ̤¬¾å¤ËÍè¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£
!¡¡ºÇ¸å¤Ë±¦¾å¶ù¤ËÍ褿¤È¤­¤Ï¡¢£±¤ÎÌ̤¬¾å¤Ë¤Ê¤ë¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£

!¤½¤Î¾¤Ç¤Ï¡¢£±¡ß£±¡¢£±¡ß£µ¡¢£²¡ß£²¡¢£´¡ß£²¡¢£´¡ß£¶¤Ê¤É

DECLARE EXTERNAL NUMERIC RollCube.A() !³°Éô¼ê³¤­¡¢ÊÑ¿ô
DECLARE EXTERNAL NUMERIC Map.ANSWER_COUNT
DECLARE EXTERNAL SUB Map.visit

LET t0=TIME

CALL visit(2,2,1,A) !º¸¾å¤ÎºÂɸ(Y,X)=(1,1)¡¡¢¨³°Êɤò¹Íθ¤¹¤ë
IF ANSWER_COUNT=0 THEN PRINT "²ò¤Ê¤·"

PRINT "¼Â¹Ô»þ´Ö=";TIME-t0;"ÉÃ"

END


MODULE Map !¥Þ¥Ã¥×¤Î¹½ÃۤȤ½¤Î·Ðϩõº÷

SHARE NUMERIC SX,SY !¥Þ¥Ã¥×¤ÎÂ礭¤µ¡¡¢¨
LET SY=8 !½Ä
LET SX=8 !²£


SHARE NUMERIC M(20,20) !¥Þ¥Ã¥×
MAT M=ZER(SY+2,SX+2)
FOR i=1 TO SX+2 !³°Êɤò¤Ä¤¯¤ë¡¡¢¨ÈÖʼ
   LET M(1,i)=-1
   LET M(SY+2,i)=-1
NEXT i
FOR i=1 TO SY+2
   LET M(i,1)=-1
   LET M(i,SX+2)=-1
NEXT i

!ÆâÊɤò¤Ä¤¯¤ë¡¡¢¨

!!!MAT PRINT M; !debug


SHARE NUMERIC EX,EY !½ªÅÀ¤ÎºÂɸ¡¡¢¨
LET EX=SX+1 !±¦¾å¶ù¡¡¢¨³°Êɤò¹Íθ¤¹¤ë
LET EY=1+1


SHARE NUMERIC DIST !·ÐÏ©¤ò£±ÅÙ¤À¤±Ä̤ëºÇÂçµ÷Î¥
FOR i=2 TO SY+1
   FOR j=2 TO SX+1
      IF M(i,j)=0 THEN LET DIST=DIST+1
   NEXT j
NEXT i
!!!PRINT DIST !debug


PUBLIC NUMERIC ANSWER_COUNT !²òÅú¿ô
LET ANSWER_COUNT=0

SET WINDOW 0,1,1,0 !---------- trace


PUBLIC SUB vist
EXTERNAL SUB visit(yy,xx,Cnt,T()) !·ÐÏ©¡Ê£±ÅÙ¤À¤±Ä̤ë¡Ë¤òõº÷¤¹¤ë
   DECLARE EXTERNAL SUB RollCube.PermMultiply,RollCube.PermPrintOut !³°Éô¼ê³¤­¡¢ÊÑ¿ô
   DECLARE EXTERNAL NUMERIC RollCube.U(),RollCube.D(),RollCube.L(),RollCube.R()
   DECLARE EXTERNAL NUMERIC RollCube.DX(),RollCube.DY()
   DIM TT(UBOUND(T)) !ºî¶ÈÍÑ

   LET M(yy,xx)=Cnt !­À×

   SET DRAW mode hidden !---------- trace start
   CLEAR
   FOR i=1 TO SY+2 !¥Þ¥Ã¥×¤òɽ¼¨¤¹¤ë
      FOR j=1 TO SX+2
         PLOT TEXT, AT 0.06*j,0.06*i: STR$(M(i,j))
      NEXT j
   NEXT i
   SET DRAW mode explicit !---------- trace end

   IF (xx=EX AND yy=EY) THEN !½ªÅÀ¤Ê¤é
      IF Cnt=DIST AND T(3)=1 THEN !¤¹¤Ù¤Æ¤Î¥Þ¥¹¤ò·Ðͳ¤·¤Æ¡¢£±¤ÎÌܤʤé
         LET ANSWER_COUNT=ANSWER_COUNT+1 !²ò¤òɽ¼¨¤¹¤ë
         PRINT "No.";ANSWER_COUNT
         MAT PRINT USING(REPEAT$(" ##",UBOUND(M,2))): M
      END IF

   ELSE
      IF (Cnt>=DIST/5 AND Cnt<=DIST*4/5) AND MOD(Cnt,4)=0 THEN !¸ÉΩÎΰè¤Î̵ͭ¡¡¢¨Í×Ä´À°
         IF ChkDivdRegion(M)<>0 THEN !¤¢¤ì¤Ð¡¢½ªÎ»¡ª
            LET M(yy,xx)=0 !!!!!
            EXIT SUB
         END IF
      END IF


      FOR i=4 TO 1 STEP -1 !¾å²¼º¸±¦¤Î£´¶á˵¡¡¢¨¥±¡¼¥¹¥Ð¥¤¥±¡¼¥¹
      !!FOR i=1 TO 4 !¾å²¼º¸±¦¤Î£´¶á˵¡¡¢¨¥±¡¼¥¹¥Ð¥¤¥±¡¼¥¹
         LET ty=yy+DY(i)
         LET tx=xx+DX(i)

         IF M(ty,tx)=0 THEN !̤Ƨ¤Ê¤é

            SELECT CASE i !¤µ¤¤¤³¤í¤òž¤¬¤·¤Æ¤ß¤ë
            CASE 1
               CALL PermMultiply(T,U,TT)
            CASE 2
               CALL PermMultiply(T,D,TT)
            CASE 3
               CALL PermMultiply(T,L,TT)
            CASE 4
               CALL PermMultiply(T,R,TT)
            CASE ELSE
            END SELECT

            IF Cnt+1=DIST OR TT(3)<>1 THEN CALL visit(ty,tx,Cnt+1,TT) !£±¤ÎÌܰʳ°¤Ê¤é¡¢¼¡¤Ø

         END IF

      NEXT i

   END IF

   LET M(yy,xx)=0 !¸µ¤ËÌ᤹
END SUB

EXTERNAL FUNCTION ChkDivdRegion(M(,)) !¥Þ¥Ã¥×¤¬Ê¬³ä¤µ¤ì¤¿¤«¤É¤¦¤«³Îǧ¤¹¤ë
   LET ChkDivdRegion=0 !¡Ö¤Ê¤·¡×

   LET i=2 !first scan
   DO WHILE i<=SY+1
      FOR j=2 TO SX+1
         IF M(i,j)=0 THEN EXIT DO !£±¸ÄÌܤ¬¸«¤Ä¤«¤Ã¤¿¤é
      NEXT j
      LET i=i+1
   LOOP
   IF i>SY+1 AND j>SX+1 THEN EXIT FUNCTION !¤¹¤Ù¤ÆËä¤Þ¤Ã¤Æ¤¤¤ë

   CALL PaintRegion(M,i,j) !¤½¤ÎÎΰè¤òËä¤á¤ë
   !!!MAT PRINT M; !debug

   LET ChkDivdRegion=1 !¡Ö¤¢¤ê¡×
   FOR i=2 TO SY+1 !second scan
      FOR j=2 TO SX+1
         IF M(i,j)=0 THEN EXIT FUNCTION !¾¤Ë¤â¤¢¤ë¤Ê¤é¡¢¤½¤³¤¬¸ÉΩÎΰè¤Ë¤Ê¤ë
      NEXT j
   NEXT i
   LET ChkDivdRegion=0 !¤¹¤Ù¤ÆËä¤Þ¤Ã¤Æ¤¤¤ë
END FUNCTION

EXTERNAL SUB PaintRegion(M(,),i,j) !Îΰè¤òÅɤê¤Ä¤Ö¤¹
   LET M(i,j)=-2
   IF M(i-1,j)=0 THEN CALL PaintRegion(M,i-1,j)
   IF M(i,j-1)=0 THEN CALL PaintRegion(M,i,j-1)
   IF M(i,j+1)=0 THEN CALL PaintRegion(M,i,j+1)
   IF M(i+1,j)=0 THEN CALL PaintRegion(M,i+1,j)
END SUB

END MODULE


MODULE RollCube !¤µ¤¤¤³¤í¤òž¤¬¤¹

PUBLIC NUMERIC DX(4),DY(4) !¾å²¼º¸±¦¤Î£´¶á˵
DATA  0,0,-1,1
DATA -1,1, 0,0
MAT READ DX
MAT READ DY


!Ÿ³«¿Þ¤ÎÇÛÃÖ¤ÈÌÌÈÖ¹æ¡ÊÇÛÎó¤Îź¤¨»ú¡Ë¤È¤Î´Ø·¸
!¡¡¢¢¡¡¡¡¡¡¡¡¸å¡¡¡¡¡¡¡¡£±
!¢¢¢¢¢¢¢¢¡¡º¸¾å±¦²¼¡¡£²£³£´£µ
!¡¡¢¢¡¡¡¡¡¡¡¡Àµ¡¡¡¡¡¡¡¡£¶

PUBLIC NUMERIC A(6)
DATA 5,4,1,3,6,2 !ÌܤÎÇÛÃÖ¡¡¢¨Å¸³«¿Þ»²¾È
MAT READ A


PUBLIC NUMERIC U(6),D(6),L(6),R(6) !ÃÖ´¹
!    1,2,3,4,5,6
DATA 3,2,6,4,1,5 !¾å¡¡¢¨ÀµÌ̤ò¾åÌ̤ˤ¹¤ë¡Ê¿Þ¤Ç¤Î¿åÊ¿¼´¡Ë²óž
!!!DATA 5,2,1,4,6,3 !²¼
DATA 1,3,4,5,2,6 !º¸
!!!DATA 1,5,2,3,4,6 !±¦

MAT READ U
CALL PermInverse(U,D)
!!!MAT READ D
MAT READ L
CALL PermInverse(L,R)
!!!MAT READ R


!ÃÖ´¹¡ÊPermutation¡Ë¤Î·×»»
PUBLIC SUB PermPrintOut
EXTERNAL SUB PermPrintOut(A()) !ɽ¼¨¤¹¤ë
   MAT PRINT USING(REPEAT$(" ##",UBOUND(A))): A;
   PRINT
END SUB
PUBLIC SUB PermIdentity
EXTERNAL SUB PermIdentity(A()) !¹±ÅùÃÖ´¹
   FOR i=1 TO UBOUND(A)
      LET A(i)=i
   NEXT i
END SUB
PUBLIC SUB PermInverse
EXTERNAL SUB PermInverse(A(), iA()) !µÕÃÖ´¹¡¡¢¨iA¤ÏA°Ê³°¤ÎÇÛÎó¤ò»ØÄꤹ¤ë¤³¤È
   FOR i=1 TO UBOUND(A)
      LET iA(A(i))=i
   NEXT i
END SUB
PUBLIC SUB PermMultiply
EXTERNAL SUB PermMultiply(A(),B(), AB()) !ÀÑAB¡¡¢¨AB¤ÏA°Ê³°¤«¤ÄB°Ê³°¤ÎÇÛÎó¤ò»ØÄꤹ¤ë¤³¤È
   LET ua=UBOUND(A)
   LET ub=UBOUND(B)
   IF ua=ub THEN
      FOR i=1 TO ua
         LET AB(i)=A(B(i)) !¢¨¹çÀ®¼ÌÁü(AB)(i)=A(B(i))
      NEXT i
   ELSE
      PRINT "¼¡¸µ¤¬°ã¤¤¤Þ¤¹¡£A=";ua;" B=";ub
      STOP
   END IF
END SUB

END MODULE
 

¾­´ý¶ð¤ÎÆþ¤ìÂؤ¨¡¢ºÆ¹Í

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 9·î14Æü(·î)16»þ15ʬ59ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  Èפä¶ð¤òʸ»úÎó¤Ç°·¤Ã¤Æ¤¤¤ë¤Î¤ò¡¢¿ôÃͤËÃÖ¤­´¹¤¨¤ë¤È£²ÇÜÄøÅ١ʷи³Â§¡Ë®¤¯¤Ê¤ë¤È»×¤¤¤Þ¤¹¡£

¥µ¥ó¥×¥ë¡¦¥×¥í¥°¥é¥à
!¥Ñ¥º¥ë - ¾­´ý¶ð¤ÎÆþ¤ìÂؤ¨

!£³¡ß£³¡¡£±¹ÔÌܤȣ³¹ÔÌܤòÆþ¤ìÂؤ¨¤ë
!¡¡¶ä¶â¶ä¡¡¡¡¡¡ÊâÊâÊâ
!¡¡³Ñ¡¡Èô¡¡¢ª¡¡³Ñ¡¡Èô
!¡¡ÊâÊâÊâ¡¡¡¡¡¡¶ä¶â¶ä
!Åú¤¨¡¡£³£°¼ê

LET t0=TIME

PUBLIC NUMERIC xSIZE,ySIZE !ÈפÎÂ礭¤µ
LET xSIZE=3
LET ySIZE=3

PUBLIC NUMERIC cSPACE !¶õÇò¤Î¿ô
LET cSPACE=1

DECLARE STRING INIT$ !½é´ü¤Î¾õÂÖ
LET INIT$="¶ä¶â¶ä³Ñ¡¡ÈôÊâÊâÊâ"

PUBLIC STRING GOAL$ !´°À®¤Î¾õÂÖ
LET GOAL$="ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä" !´°Á´°ìÃ×
!!LET GOAL$="ÊâÊâÊâ¡û¡û¡û¡û¡û¡û" !Éôʬ°ìÃ×


PUBLIC STRING KO$(6) !¶ð¤Î¼ïÎà¤È°ÜÆ°²ÄǽÈÏ°Ï¡¡¢¨£¸¶á˵¡¡Æ°¤­¤Ï¾­´ý¤ÈƱ¤¸
DATA "¡ß¡û¡ß¡ßÊâ¡ß¡ß¡ß¡ß"
DATA "¡û¡û¡û¡ß¶ä¡ß¡û¡ß¡û"
DATA "¡û¡û¡û¡û¶â¡û¡ß¡û¡ß"
DATA "¡û¡ß¡û¡ß³Ñ¡ß¡û¡ß¡û"
DATA "¡ß¡û¡ß¡ûÈô¡û¡ß¡û¡ß"
DATA "¡û¡û¡û¡û¶Ì¡û¡û¡û¡û"
FOR i=1 TO 6
   READ KO$(i)
NEXT i

PUBLIC NUMERIC LIM !¼ê¿ô¤Î¾å¸Â¡¡¢ªºÇ¾¯¼ê¿ô
LET LIM=200

PUBLIC STRING ANS$(0 TO 200) !¾å¸Â¤Þ¤Ç¤Î¼ê½ç
PUBLIC STRING STK$(0 TO 200) !¶ÉÌ̤ε­Ï¿¡¡¢¨¥¹¥¿¥Ã¥¯
FOR i=0 TO 200
   LET ANS$(i)=""
   LET STK$(i)=""
NEXT i

!PUBLIC NUMERIC LVL(0 TO 200) !----- trace -----
!MAT LVL=ZER


IF LEN(INIT$)<>ySIZE*xSIZE THEN
   PRINT "ÈפÎÂ礭¤µ¡ÊxSIZE,ySIZE¡Ë¤È¶ð¤Î¿ô¡ÊINIT$¡Ë¤¬¹ç¤¤¤Þ¤»¤ó¡£"
   STOP
END IF
IF LEN(GOAL$)<>ySIZE*xSIZE THEN
   PRINT "ÈפÎÂ礭¤µ¡ÊxSIZE,ySIZE¡Ë¤È¶ð¤Î¿ô¡ÊGOAL$¡Ë¤¬¹ç¤¤¤Þ¤»¤ó¡£"
   STOP
END IF

LET STK$(0)=INIT$
CALL backtrack(0) !£°¼êÌÜ

IF ANS$(0)="" THEN
   PRINT "²ò¤Ê¤·"
ELSE
   PRINT
   FOR i=1 TO LIM !²ò¤òɽ¼¨¤¹¤ë
      PRINT ANS$(i)
   NEXT i
END IF

PRINT "·×»»»þ´Ö=";TIME-t0;"ÉÃ"

END


EXTERNAL SUB backtrack(L) !£±¼ê¤º¤ÄÂǤäƤ¤¤­¡¢¹Ô¤­µÍ¤Þ¤ì¤Ð¸µ¤ËÌá¤Ã¤Æ¤ä¤êľ¤¹
LET bd$=stk$(L) !¸½ºß¤Î¶ÉÌÌ

!---------- ¢­¢­¢­¢­¢­ ---------- trace
!SET DRAW mode hidden !¤Á¤é¤Ä¤­Ëɻߤγ«»Ï
!CLEAR
!FOR i=1 TO L
!   PLOT TEXT ,AT 0.4+0.05*MOD(i-1,10),0.95-0.04*INT((i-1)/10): STR$(LVL(i))
!NEXT i
!FOR i=1 TO ySIZE
!   LET t=(i-1)*xSIZE
!   PLOT TEXT ,AT 0.1,0.50-i*0.05: bd$(t+1:t+xSIZE)
!NEXT i
!SET DRAW mode explicit !¤Á¤é¤Ä¤­ËɻߤνªÎ»
!---------- ¢¬¢¬¢¬¢¬¢¬ ----------

LET C=0 !»Þ´¢¤ê¡¡¢¨¡Ö»Ä¤ê¤Î¼ê¿ô¡×¤È¡Ö¶ð¤Î°ÌÃÖ¤¬°ìÃפ·¤Ê¤¤¿ô¡×¤È¤Î´Ø·¸¤è¤ê
FOR i=1 TO ySIZE*xSIZE
   SELECT CASE GOAL$(i:i)
   CASE "¡ß","¡¡","¡û" !²¿¤Ç¤âÎɤ¤
   CASE ELSE !´°Á´°ìÃ×
      IF GOAL$(i:i)<>bd$(i:i) THEN LET C=C+1 !£Ã¸Ä¤Î¶ð¤ò°ìÃפµ¤»¤ëɬÍפ¬¤¢¤ë¤¬¡¢
   END SELECT
NEXT i
IF L+C>LIM THEN EXIT SUB !»Ä¤ê¤Î¼ê¿ô¤¬Â­¤ê¤Ê¤¤¤Î¤Ç¡¢ÉÔ²Äǽ¡ª¡ª¡ª

IF C=0 THEN !´°À®¤Ê¤é¡¢¼ê½ç¤òµ­Ï¿¤·¤Æ¤ª¤¯
   PRINT L;"¼ê"
   FOR i=0 TO L
      LET ANS$(i)=STK$(i)
   NEXT i
   PRINT STK$(L) !debug
   LET LIM=L !¾å¸Â¤ò¶¹¤á¤ë
END IF

IF L>=LIM THEN EXIT SUB !¾å¸Â¤Þ¤Ç


LET CntOfSP=0
FOR p=1 TO ySIZE*xSIZE !ÈפòÁöºº¤·¤Æ¶õÇò¤Ë¶ð¤ò°ÜÆ°¤µ¤»¤ë
   IF bd$(p:p)="¡¡" THEN

      LET px=MOD(p-1,xSIZE)+1 !¿åÊ¿¡¦¿âľ¤ÎºÂɸ¤Ø
      LET py=INT((p-1)/xSIZE)+1

      !!!FOR d=1 TO 9 !ÎÙÀܤ¹¤ë¶ð¤òõ¤¹¡¡¢¨¥±¡¼¥¹¥Ð¥¤¥±¡¼¥¹
      FOR d=9 TO 1 STEP -1 !ÎÙÀܤ¹¤ë¶ð¤òõ¤¹¡¡¢¨¥±¡¼¥¹¥Ð¥¤¥±¡¼¥¹
         IF d=5 THEN
         ELSE
            LET mx=px + MOD(d-1,3)-1 !°ÜÆ°¸µ¤ÎºÂɸ¡¡¢¨d¤ò¿åÊ¿¡¦¿âľ¤Îº¹Ê¬dx,dy¤Ø
            LET my=py + INT((d-1)/3)-1
            IF (mx>=1 AND mx<=xSIZE) AND (my>=1 AND my<=ySIZE) THEN !È×Æ⤫³Îǧ¤¹¤ë

               LET mp=(my-1)*xSIZE + mx !Ï¢ÈÖ¤Ø
               LET t$=bd$(mp:mp)
               IF t$="¡ß" OR t$="¡¡" THEN
               ELSE

                  FOR a=1 TO UBOUND(KO$) !¶ð¤Î°À­¤òÆÀ¤ë
                     IF t$=KO$(a)(5:5) THEN EXIT FOR
                  NEXT a
                  IF KO$(a)(10-d:10-d)="¡ß" THEN !°ÜÆ°²ÄǽÈϰϤʤé
                  ELSE

                     LET w$=bd$
                     LET w$(p:p)=KO$(a)(5:5) !°ÜÆ°¤µ¤»¤ë
                     LET w$(mp:mp)="¡¡"

                     FOR t=L TO 0 STEP -1 !ºÇ¶á¤Î¶ÉÌ̤«¤é½ç¤Ë¿·¤·¤¤¼ê¤«¤É¤¦¤«³Îǧ¤¹¤ë
                        IF STK$(t)=w$ THEN EXIT FOR
                     NEXT t
                     IF t<0 THEN
                     !LET LVL(L+1)=CntOfSP*10+d !----- trace -----
                        LET STK$(L+1)=w$ !µ­Ï¿¤·¤Æ¡¢¼¡¤Î¶ÉÌ̤Ø
                        CALL backtrack(L+1)
                     END IF

                  END IF

               END IF

            END IF

         END IF
      NEXT d

      LET CntOfSP=CntOfSP+1
      IF CntOfSP=cSPACE THEN EXIT FOR !¶õÇò¤Î¿ô¤À¤±
   END IF
NEXT p
END SUB


WindowsMe¡¢Pentium­·700MHz¡¢192MB¤Ë¤Æ¡¢½½¿ÊBASIC¡¡£²¿Ê¥â¡¼¥É¤Ç¼Â¹Ô¡£
 86 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 84 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 84 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 82 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 82 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 79 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 77 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 76 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 76 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 75 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 74 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 74 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 69 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 67 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 63 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 61 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 61 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 59 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 58 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 58 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 57 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 56 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 48 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 48 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 46 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 46 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 44 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 44 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 42 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 42 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 42 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 42 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 40 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 40 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 40 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 40 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 39 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 39 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 39 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 39 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 36 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 32 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 32 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 32 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 32 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 32 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 30 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
 30 ¼ê
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä

¶ä¶â¡¡³Ñ¶äÈôÊâÊâÊâ
¶ä¡¡¶â³Ñ¶äÈôÊâÊâÊâ
¶ä¶ä¶â³Ñ¡¡ÈôÊâÊâÊâ
¶ä¶ä¶â³ÑÊâÈôÊâ¡¡Êâ
¶ä¶ä¶â¡¡ÊâÈôÊâ³ÑÊâ
¶ä¡¡¶â¶äÊâÈôÊâ³ÑÊâ
¶äÊâ¶â¶ä¡¡ÈôÊâ³ÑÊâ
¶äÊâ¶â¶äÈô¡¡Êâ³ÑÊâ
¶äÊâ¶â¶äÈô³ÑÊâ¡¡Êâ
¶äÊâ¶â¶ä¡¡³ÑÊâÈôÊâ
¡¡Êâ¶â¶ä¶ä³ÑÊâÈôÊâ
¶äÊâ¶â¡¡¶ä³ÑÊâÈôÊâ
¶äÊâ¶âÊâ¶ä³Ñ¡¡ÈôÊâ
¶äÊâ¶âÊâ¶ä³ÑÈô¡¡Êâ
¶äÊâ¶âÊâ¶ä¡¡Èô³ÑÊâ
¶äÊâ¡¡Êâ¶ä¶âÈô³ÑÊâ
¶äÊâ¶äÊâ¡¡¶âÈô³ÑÊâ
¡¡Êâ¶äÊâ¶ä¶âÈô³ÑÊâ
ÊâÊâ¶ä¡¡¶ä¶âÈô³ÑÊâ
ÊâÊâ¶ä³Ñ¶ä¶âÈô¡¡Êâ
ÊâÊâ¶ä³Ñ¶ä¶â¡¡ÈôÊâ
ÊâÊâ¶ä³Ñ¡¡¶â¶äÈôÊâ
ÊâÊâ¶ä³Ñ¶â¡¡¶äÈôÊâ
ÊâÊâ¶ä³Ñ¶âÊâ¶äÈô
ÊâÊâ¶ä³Ñ¶âÊâ¶ä¡¡Èô
ÊâÊâ¶ä³Ñ¡¡Êâ¶ä¶âÈô
ÊâÊâ¡¡³Ñ¶äÊâ¶ä¶âÈô
ÊâÊâÊâ³Ñ¶ä¡¡¶ä¶âÈô
ÊâÊâÊâ³Ñ¶äÈô¶ä¶â
ÊâÊâÊâ³Ñ¡¡Èô¶ä¶â¶ä
·×»»»þ´Ö= 45.0900000000001 ÉÃ
 

Re: Full BASIC¹â®²½¤Î»î¤ß

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 9·î14Æü(·î)18»þ29ʬ58ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.511[¸µµ­»ö¤Ø]

BASICAcc ver. 0.9.1¸ø³«¤·¤Þ¤·¤¿¡£
¤¤¤¯¤é¤«¸ÂÄ꤬¤¢¤ê¤Þ¤¹¤¬¡¤TRACEʸ°Ê³°¤ÎÁ´Full BASIC(¿Þ·Áµ¡Ç½Ã±°Ì¡Ü¥â¥¸¥å¡¼¥ëµ¡Ç½Ã±°Ì)Ì¿Îá¤ËÂбþ¤·¤Þ¤·¤¿¡£
º£¤Î¤È¤³¤í2¿Ê±é»»¸ÂÄê¤Ç¤¹¤¬¡¤Ã±½ã¤Ê¿ôÃÍ·×»»¤Ï¡Ê²¾¾Î¡Ë½½¿ÊBASIC¤Î2¿Ê¥â¡¼¥É¤è¤ê¿ôÇÜ®¤¯¤Ê¤ë¤è¤¦¤Ç¤¹¡£

http://sourceforge.jp/projects/decimalbasic/

·Ç¼¨ÈÄ(¿·µì)¤ËÅê¹Æ¤µ¤ì¤¿¥×¥í¥°¥é¥à¤òÆ°ºî³Îǧ¤ËÍøÍѤµ¤»¤Æ¤¤¤¿¤À¤­¤Þ¤·¤¿¡£
¡Ê²¾¾Î¡Ë½½¿ÊBASIC¤Ï¥Á¥§¥Ã¥¯¤¬´Å¤¯¡¤¼ç¥×¥í¥°¥é¥à¤Î³°Éô¤«¤é¼ç¥×¥í¥°¥é¥à¤ÎÆâÉô¼ê³¤­¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤Æ¤·¤Þ¤¤¤Þ¤¹¤¬¡¤BASICAcc¤Ç¤Ï¤½¤ì¤Ï¤Ç¤­¤Þ¤»¤ó¡£
¤Þ¤¿¡¤¼±ÊÌ̾¤Ï±Ñ¿ô»ú¤Î¤ß»ÈÍѲÄǽ¤Ç¤¹¡£
¤½¤Î¾¡¤ºÙÉô¤Ç½½¿ÊBASIC¤È¤Îº¹°Û¤¬¤¢¤ê¤Þ¤¹¤¬¡¤ÂçÊý¤Î¥×¥í¥°¥é¥à¤Ï¤½¤Î¤Þ¤ÞÆ°¤¯¤È»×¤¤¤Þ¤¹¡£
 

Re: ¥Ñ¥º¥ë¤Î²ò¤¬ÃΤꤿ¤¤¡£

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 9·î15Æü(²Ð)16»þ09ʬ21ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.551[¸µµ­»ö¤Ø]

¥Ù¥ó¥Á¥Þ¡¼¥¯¥Æ¥¹¥È¡¡WindowsME¡¢Pentium­·700MHz¡¢RAM192MB ¤Ë¤Æ

¡ÖRolling Cube2¤ò²ò¤¯¥×¥í¥°¥é¥à¡×

> !ÌäÂê
> !¡¡¤µ¤¤¤³¤í¤¬£±¤Ä¡¢£¸¡ß£¸¤ÎÈפκ¸¾å¶ù¤Ë£±¤ÎÌ̤ò¾å¤Ë¾è¤Ã¤Æ¤¤¤Þ¤¹¡£
> !¡¡¤³¤Î¤µ¤¤¤³¤í¤òÁ´¤Æ¤Î¥Þ¥¹¤ò£±ÅÙ¤À¤±Ä̤äƱ¦¾å¶ù¤Ëž¤¬¤·¤Æ°ÜÆ°¤µ¤»¤Þ¤¹¡£
> !¡¡¤³¤Î¤È¤­¡¢ÅÓÃæ¤Ç£±¤ÎÌ̤¬¾å¤ËÍè¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£
> !¡¡ºÇ¸å¤Ë±¦¾å¶ù¤ËÍ褿¤È¤­¤Ï¡¢£±¤ÎÌ̤¬¾å¤Ë¤Ê¤ë¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£

63¹Ô
   !SET WINDOW 0,1,1,0 !---------- trace

74¹Ô
   !SET DRAW mode hidden !---------- trace start
   !CLEAR
   !FOR i=1 TO SY+2 !¥Þ¥Ã¥×¤òɽ¼¨¤¹¤ë
   !   FOR j=1 TO SX+2
   !      PLOT TEXT, AT 0.06*j,0.06*i: STR$(M(i,j))
   !   NEXT j
   !NEXT i
   !SET DRAW mode explicit !---------- trace end

¤Î¡Ê¥È¥ì¡¼¥¹¤Ë»È¤Ã¤Æ¤¤¤ë¡Ë¥°¥é¥Õ¥£¥Ã¥¯¥¹Ì¿Îá¤ò¥³¥á¥ó¥È¥¢¥¦¥È¤·¤Æ¤¯¤À¤µ¤¤¡£


¡ü½½¿ÊBASIC 10¿Ê¥â¡¼¥É¤Ë¤è¤ë
No. 1
 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
 -1  1  2  3  4 61 62 63 64 -1
 -1 10  9  6  5 60 59 56 55 -1
 -1 11  8  7 32 33 58 57 54 -1
 -1 12 27 28 31 34 37 38 53 -1
 -1 13 26 29 30 35 36 39 52 -1
 -1 14 25 24 23 42 41 40 51 -1
 -1 15 18 19 22 43 46 47 50 -1
 -1 16 17 20 21 44 45 48 49 -1
 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
¼Â¹Ô»þ´Ö= 359.27 ÉÃ


¡ü½½¿ÊBASIC £²¿Ê¥â¡¼¥É¤Ë¤è¤ë
No. 1
 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
 -1  1  2  3  4 61 62 63 64 -1
 -1 10  9  6  5 60 59 56 55 -1
 -1 11  8  7 32 33 58 57 54 -1
 -1 12 27 28 31 34 37 38 53 -1
 -1 13 26 29 30 35 36 39 52 -1
 -1 14 25 24 23 42 41 40 51 -1
 -1 15 18 19 22 43 46 47 50 -1
 -1 16 17 20 21 44 45 48 49 -1
 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
¼Â¹Ô»þ´Ö= 92.5999999999985 ÉÃ


¡üBASICAcc¤Ë¤è¤ë
No. 1
 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
 -1  1  2  3  4 61 62 63 64 -1
 -1 10  9  6  5 60 59 56 55 -1
 -1 11  8  7 32 33 58 57 54 -1
 -1 12 27 28 31 34 37 38 53 -1
 -1 13 26 29 30 35 36 39 52 -1
 -1 14 25 24 23 42 41 40 51 -1
 -1 15 18 19 22 43 46 47 50 -1
 -1 16 17 20 21 44 45 48 49 -1
 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
¼Â¹Ô»þ´Ö= 15.1000000000009 ÉÃ
 

¶Ã¤­

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ 9·î17Æü(ÌÚ)06»þ14ʬ26ÉÃ
ÊÖ¿®¡¦°úÍÑ
  BASICAcc¤Î°ÒÎ϶²¤ë¤Ù¤·¤Ç¤¹¤Í¡£
£µ¡Á£¶Çܤ⥹¥Ô¡¼¥É¥¢¥Ã¥×¤¬²Äǽ¤Ê¤ó¤À¡ª
 

Rolling Cube 1

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 9·î17Æü(ÌÚ)10»þ17ʬ17ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ´Êñ¤ÊGUI¤Î¥Ñ¥º¥ë¥²¡¼¥à¥×¥í¥°¥é¥ß¥ó¥°¤Ç¤¹¡£
¥×¥í¥°¥é¥à¤ÎÃæÃǤϡ¢¡ÖÃæÃǡץܥ¿¥ó¡Ê¥á¥Ë¥å¡¼¡Ë¤Ç¹Ô¤¤¤Þ¤¹¡£
!¡üÌäÂê
!£¸¸Ä¤Î¤µ¤¤¤³¤í¤¬¡¢£³¡ß£³¤ÎÈפˣ±¤ÎÌܤò¾å¤Ë¤·¤Æ¾¤ÎÌܤâƱ¤¸¸þ¤­¤ÇÇÛÃÖ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
!¶õ¤¤¤Æ¤¤¤ë¥Þ¥¹¤Ëž¤¬¤·¤Æ¡¢¤¹¤Ù¤Æ¤ÎÌܤ¬£¶¤Ë¤Ê¤ë¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£


!ÃÖ´¹¡ÊPermutation¡Ë¤Î·×»»
SUB PermPrintOut(A()) !ɽ¼¨¤¹¤ë
   MAT PRINT USING(REPEAT$(" ##",UBOUND(A))): A;
   PRINT
END SUB
SUB PermIdentity(A()) !¹±ÅùÃÖ´¹
   FOR i=1 TO UBOUND(A)
      LET A(i)=i
   NEXT i
END SUB
SUB PermInverse(A(), iA()) !µÕÃÖ´¹¡¡¢¨iA¤ÏA°Ê³°¤ÎÇÛÎó¤ò»ØÄꤹ¤ë¤³¤È
   FOR i=1 TO UBOUND(A)
      LET iA(A(i))=i
   NEXT i
END SUB
SUB PermMultiply(A(),B(), AB()) !ÀÑAB¡¡¢¨AB¤ÏA¤«¤ÄB°Ê³°¤ÎÇÛÎó¤ò»ØÄꤹ¤ë¤³¤È
   FOR i=1 TO UBOUND(A)
      LET AB(i)=A(B(i)) !¢¨¹çÀ®¼ÌÁü(AB)(i)=A(B(i))
   NEXT i
END SUB
!-------------------- ¤³¤³¤Þ¤Ç¤¬¥µ¥Ö¥ë¡¼¥Á¥ó


DIM U(6),D(6),L(6),R(6) !ÃÖ´¹
!    1,2,3,4,5,6
DATA 3,2,6,4,1,5 !¾å¡¡¢¨ÀµÌ̤ò¾åÌ̤ˤ¹¤ë¤Î¡Ê¿Þ¤Ç¤Î¿åÊ¿¼´¡Ë²óž
!!!DATA 5,2,1,4,6,3 !²¼
DATA 1,3,4,5,2,6 !º¸
!!!DATA 1,5,2,3,4,6 !±¦

MAT READ U
CALL PermInverse(U,D)
!!!MAT READ D
MAT READ L
CALL PermInverse(L,R)
!!!MAT READ R
!---------- ¢¬¢¬¢¬¢¬¢¬ ----------


!Ÿ³«¿Þ¤ÎÇÛÃÖ¤ÈÌÌÈÖ¹æ¡ÊÇÛÎó¤Îź¤¨»ú¡Ë¤È¤Î´Ø·¸
!¡¡¢¢¡¡¡¡¡¡¡¡¸å¡¡¡¡¡¡¡¡£±
!¢¢¢¢¢¢¢¢¡¡º¸¾å±¦²¼¡¡£²£³£´£µ
!¡¡¢¢¡¡¡¡¡¡¡¡Àµ¡¡¡¡¡¡¡¡£¶

DIM T1(6),T2(6),T3(6),T4(6),T5(6),T6(6),T7(6),T8(6) !£¸¸Ä¤Î¤µ¤¤¤³¤í
DATA 5,4,1,3,6,2 !ÌܤÎÇÛÃÖ¡¡¢¨Å¸³«¿Þ»²¾È
MAT READ T1
MAT T2=T1 !Ʊ¤¸¸þ¤­
MAT T3=T1
MAT T4=T1
MAT T5=T1
MAT T6=T1
MAT T7=T1
MAT T8=T1

PICTURE dice(T()) !¤µ¤¤¤³¤í¤òɽ¼¨¤¹¤ë¡¡¢¨¸¶ÅÀ´ð½à
   SET TEXT JUSTIFY "CENTER","HALF"
   PLOT TEXT ,AT 0,-0.4: STR$(T(1)) !¦Ì̤ÎÌܤοô
   PLOT TEXT ,AT -0.4,0: STR$(T(2))
   PLOT TEXT ,AT 0.4,0: STR$(T(4))
   PLOT TEXT ,AT 0,0.4: STR$(T(6))

   LET nm=T(3) !¾åÌ̤ÎÌܤοô
   IF nm=1 THEN DRAW eye(4) !Ãæ±û
   IF nm=3 OR nm=5 THEN DRAW eye(1)

   IF nm=2 OR nm=4 OR nm=5 OR nm=6 THEN !º¸¼Ð¤á
      DRAW eye(1) WITH SHIFT(0.25,0.25)
      DRAW eye(1) WITH SHIFT(-0.25,-0.25)
   END IF
   IF nm=3 OR nm=4 OR nm=5 OR nm=6 THEN !±¦¼Ð¤á
      DRAW eye(1) WITH SHIFT(0.25,-0.25)
      DRAW eye(1) WITH SHIFT(-0.25,0.25)
   END IF
   IF nm=6 THEN !ÃæÃÊ
      DRAW eye(1) WITH SHIFT(0.25,0)
      DRAW eye(1) WITH SHIFT(-0.25,0)
   END IF
END PICTURE

PICTURE eye(c) !£±¤Ä¤ÎÌܤòɽ¼¨¤¹¤ë
   SET AREA COLOR c
   DRAW disk WITH SCALE(0.1) !¢¨Í×Ä´À°
END PICTURE
!---------- ¢¬¢¬¢¬¢¬¢¬ ----------


LET MY=3 !¥Þ¥Ã¥×¤ÎÂ礭¤µ
LET MX=3

DIM M(MY,MX) !¤µ¤¤¤³¤í¤ÎÇÛÃÖ¡¡¢¨¿ô»ú¤ÏÈֹ桢£°¤Ï¶õ¤­
DATA 1,2,3
DATA 4,0,5
DATA 6,7,8
MAT READ M

SUB dispMap !¥Þ¥Ã¥×¾å¤Î¤µ¤¤¤³¤í¤òɽ¼¨¤¹¤ë
   FOR y=1 TO 3 !º¸¾å¤«¤é½ç¤Ë
      LET yy=y-0.5 !°ÌÃÖ¤ò»»½Ð¤¹¤ë
      FOR x=1 TO 3
         LET xx=x-0.5

         SELECT CASE M(y,x) !ÇÛÃÖ¤µ¤ì¤¿¤µ¤¤¤³¤í¤Ë±þ¤¸¤Æ
         CASE 1
            DRAW dice(T1) WITH SHIFT(xx,yy) !¾åÌÌ
         CASE 2
            DRAW dice(T2) WITH SHIFT(xx,yy)
         CASE 3
            DRAW dice(T3) WITH SHIFT(xx,yy)
         CASE 4
            DRAW dice(T4) WITH SHIFT(xx,yy)
         CASE 5
            DRAW dice(T5) WITH SHIFT(xx,yy)
         CASE 6
            DRAW dice(T6) WITH SHIFT(xx,yy)
         CASE 7
            DRAW dice(T7) WITH SHIFT(xx,yy)
         CASE 8
            DRAW dice(T8) WITH SHIFT(xx,yy)
         CASE ELSE
         END SELECT

      NEXT x
   NEXT y
END SUB
!---------- ¢¬¢¬¢¬¢¬¢¬ ----------


SUB move(T(),OP(),x,y,dx,dy) !¤µ¤¤¤³¤í¤ò²óž°ÜÆ°¤µ¤»¤ë
   LET ANSWER_COUNT=ANSWER_COUNT+1
   PRINT ANSWER_COUNT;"¼ê"

   DIM TT(6) !ºî¶ÈÇÛÎó
   CALL PermMultiply(T,OP,TT) !²óž
   MAT T=TT
   LET w=M(y,x) !°ÜÆ°
   LET M(y,x)=M(y+dy,x+dx)
   LET M(y+dy,x+dx)=w
END SUB

SUB CalcDirection(x,y, T()) !°ÜÆ°²Äǽ¤ÊÊý¸þ¤Ø²óž°ÜÆ°¤µ¤»¤ë
   IF y>=2 THEN !¾å¤Ë°ÜÆ°²Äǽ¤Ç
      IF M(y-1,x)=0 THEN !¶õ¤­¥Þ¥¹¤Ê¤é
         CALL move(T,U,x,y,0,-1) !²óž°ÜÆ°¤µ¤»¤ë
         PRINT "UP";y;x
      END IF
   END IF
   IF y<=2 THEN !²¼
      IF M(y+1,x)=0 THEN
         CALL move(T,D,x,y,0,1)
         PRINT "DOWN";y;x
      END IF
   END IF
   IF x>=2 THEN !º¸
      IF M(y,x-1)=0 THEN
         CALL move(T,L,x,y,-1,0)
         PRINT "LEFT";y;x
      END IF
   END IF
   IF x<=2 THEN !±¦
      IF M(y,x+1)=0 THEN
         CALL move(T,R,x,y,1,0)
         PRINT "RIGHT";y;x
      END IF
   END IF
   MAT PRINT M; !debug
END SUB


LET ANSWER_COUNT=0 !¼ê¿ô

SET WINDOW -1,MX+1,MY+1,-1 !ɽ¼¨Îΰè

LET cx=1 !¥Ý¥¤¥ó¥¿¤òº¸¾å¤Ë°ÌÃÖÉÕ¤±¤ë
LET cy=1
DO
   mouse poll x,y,left,right !¥Þ¥¦¥¹¤Î¾ðÊó¤òÆÀ¤ë
   LET xx=INT(x) !°ÌÃÖ
   LET yy=INT(y)
   IF xx>=0 AND xx<MX AND yy>=0 AND yy<MY THEN !¥Þ¥Ã¥×Æâ¤Ê¤é
      LET cx=xx+1 ![1,MX]
      LET cy=yy+1 ![1,MY]
   END IF

   IF left=1 THEN !º¸¥Ü¥¿¥ó¤¬²¡¤µ¤ì¤¿¤é
      SELECT CASE M(cy,cx) !¤µ¤¤¤³¤í¤ÎÈÖ¹æ¤òÆÀ¤ë
      CASE 1
         CALL CalcDirection(cx,cy, T1) !²óž°ÜÆ°¤µ¤»¤ë
      CASE 2
         CALL CalcDirection(cx,cy, T2)
      CASE 3
         CALL CalcDirection(cx,cy, T3)
      CASE 4
         CALL CalcDirection(cx,cy, T4)
      CASE 5
         CALL CalcDirection(cx,cy, T5)
      CASE 6
         CALL CalcDirection(cx,cy, T6)
      CASE 7
         CALL CalcDirection(cx,cy, T7)
      CASE 8
         CALL CalcDirection(cx,cy, T8)
      CASE ELSE
      END SELECT
      WAIT DELAY 0.2 !¢¨Í×Ä´À°
   END IF

   SET DRAW mode hidden !¤Á¤é¤Ä¤­Ëɻ߳«»Ï
   CLEAR
   DRAW grid !ÌÜÀ¹¤ê

   SET LINE width 2 !¥Ý¥¤¥ó¥¿¤òɽ¼¨¤¹¤ë
   PLOT LINES: cx-1,cy-1; cx,cy-1; cx,cy; cx-1,cy; cx-1,cy-1
   SET LINE width 1

   CALL dispMap !¤µ¤¤¤³¤í¤òɽ¼¨¤¹¤ë

   SET TEXT JUSTIFY "LEFT","BOTTOM" !ʸ»ú°ÌÃÖ¤ÎÄ´À°
   PLOT TEXT ,AT -0.5,-0.5: "°ÜÆ°¤¹¤ë¤µ¤¤¤³¤í¤òº¸¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£"

   SET DRAW mode explicit !¤Á¤é¤Ä¤­Ëɻ߽ªÎ»
LOOP


END


!Åú¤¨¡¡£³£¸¼ê
!¡¡URDL,DRUL,LDRR,UULD,RUL;LDR,ULDD,RRUL,LDRU,LURD
 

Rolling Cube 1¤Î³ÈÄ¥

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ 9·î18Æü(¶â)14»þ47ʬ11ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.556[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ´Êñ¤ÊGUI¤Î¥Ñ¥º¥ë¥²¡¼¥à¥×¥í¥°¥é¥ß¥ó¥°¤Ç¤¹¡£
> ¥×¥í¥°¥é¥à¤ÎÃæÃǤϡ¢¡ÖÃæÃǡץܥ¿¥ó¡Ê¥á¥Ë¥å¡¼¡Ë¤Ç¹Ô¤¤¤Þ¤¹¡£
>

> !¡üÌäÂê
> !£¸¸Ä¤Î¤µ¤¤¤³¤í¤¬¡¢£³¡ß£³¤ÎÈפˣ±¤ÎÌܤò¾å¤Ë¤·¤Æ¾¤ÎÌܤâƱ¤¸¸þ¤­¤ÇÇÛÃÖ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
> !¶õ¤¤¤Æ¤¤¤ë¥Þ¥¹¤Ëž¤¬¤·¤Æ¤¹¤Ù¤Æ¤ÎÌܤ¬£²¡¢¤¹¤Ù¤Æ¤ÎÌܤ¬£³¡¢¤¹¤Ù¤Æ¤ÎÌܤ¬£´¡¢¤¹¤Ù¤Æ¤ÎÌܤ¬£µ¡¢¤¹¤Ù¤Æ¤ÎÌܤ¬£¶¤Ë¤Ê¤ë¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£

¤ÈÌäÂê¤ò³ÈÄ¥¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¤Í¡£
¤½¤ì¤¾¤ì¤Î¼ê½ç¤òȯ¸«¤·¤Æ¤â¤é¤¤¤¿¤¤¡£
 

Re: Rolling Cube 1¤Î³ÈÄ¥

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 9·î19Æü(ÅÚ)11»þ06ʬ0ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.557[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¤½¤ì¤¾¤ì¤Î¼ê½ç¤òȯ¸«¤·¤Æ¤â¤é¤¤¤¿¤¤¡£

¡Ö¾­´ý¶ð¤ÎÆþ¤ìÂؤ¨¡×ƱÍÍ Give up ¤Ç¤¹¡£

¶öÁ³¤Ë¼¡¤Î¤è¤¦¤Ê¤â¤Î¤¬¸«¤Ä¤«¤ì¤Ð¡¢¡¢¡¢

£±¢ª£µ¤È£±¢ª£´¤Ï¡¢
£±¢ª£²¤È£±¢ª£³¤ò¸«¤Ä¤±¤Æ¡¢¡Ê²¿¼ê¤«¤ÏÉÔÌÀ¡Ë
£²¢ª£µ¤È£³¢ª£´¤È¹Í¤¨¤Æ¡¢£±¢ª£¶Æ±ÍͤÎȿž¤Ç´°À®¡¢¤¿¤À¤·ºÇ¾¯¼ê¤È¤Ï¸Â¤é¤Ê¤¤¡£

¤È¤³¤í¤Ç¡¢£±¢ª£²¤Ê¤É¤Ï¤ß¤Ä¤«¤ë¤Î¤«¡©
£±¼ê¤Ë¸õÊ䤬ʿ¶Ñ£³¼å¤¢¤ë¤Î¤Ç¡¢¡Ö¾ì¹ç¤Î¿ô¡×¤Ï¡¢£±¢ª£¶¤ÈƱ¤¸¤È¹Í¤¨¤Æ¤â3^36ÄøÅÙ¡£

¡¦»Þ´¢¤ê¤È¤·¤Æ¤Ï¡¢²óž¤äȿž¤ÎÂоΤòºï½ü¡£¡Ê£±¼ê¡¢£²¼ê¤ò¸ÇÄꤹ¤ë¡Ë


¤Á¤Ê¤ß¤Ë¡¢£±¢ª£¶¤Ï URDL,LDRR,ULDL,URDR,ULDL,UURD,RULD,RDLU,LDRU ¡Ê£³£¶¼ê¡Ë¡£


¤³¤Î¤è¤¦¤ÊÌäÂê¤Ï¡¢¡Ø¤¤¤«¤Ë¡Ö¾ì¹ç¤Î¿ô¡×¤ò¸º¤é¤¹¤Î¤«¡Ù¤È¤¤¤¦¤³¤È¤Ç¤¹¡£
ʤÌÌ»»¤äRolling Cube 2¤Î¤è¤¦¤ÊÏÀÍýŪ¡¢²òÀÏŪ¤Ê¼êË¡¤¬¤¢¤ì¤Ð¤¤¤¤¤Î¤Ç¤¹¤¬¡¢¡¢¡¢
 

»³Ã椵¤óÀ¨¤¤¡ª

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ 9·î19Æü(ÅÚ)11»þ48ʬ20ÉÃ
ÊÖ¿®¡¦°úÍÑ
  £±¢ª£¶¤ÎºÇ¾¯¼ê¿ô¤ò£³£¶¼ê¤Çȯ¸«¤µ¤ì¤¿¤Î¤ÏÀ¨¤¤¡ª¡ª¡ª¡Ê¤¼¤ÒÎã¤Î¥µ¥¤¥È¤ØÊó¹ð¤·¤Æ²¼¤µ¤¤¡£¤³¤ì¤ÏÀ¤³¦½é¤Ç¤¹¤è¡£¡Ë
»ä¤â£±¢ª£²¤òºî¤Ã¤Æ夤¤¿¥×¥í¥°¥é¥à¤Ç£³£µ£°¼ê¤°¤é¤¤¤«¤±¤Æ¤¤¤¸¤¯¤ê²ó¤·¤Æ¤Ï¤ß¤¿¤â¤Î¤Î¤¢¤È£±¸Ä¤¬¤É¤¦¤·¤Æ¤â£²¤Ë¤Ê¤é¤ºº£¤À²ò·è¤Ë»ê¤Ã¤Æ¤ª¤ê¤Þ¤»¤ó¡£
¤³¤ì¤¬½ÐÍè¤Ê¤¤¤È¤¤¤¦¾ÚÌÀ¤¬¤¢¤ì¤ÐÄü¤á¤â¿Ô¤­¤Þ¤¹¤¬¡¦¡¦¡¦
µ¤Ä¹¤ËÄ©À路³¤±¤Þ¤¹¡£¡Ê¤¹¤Ù¤Æ¤Ë²ò¤¬¤¢¤ì¤Ð¤¹¤Ð¤é¤·¤¤¥Ñ¥º¥ë¤Ë¤Ê¤ë¤Î¤Ç¤¹¤¬¡¦¡¦¡¦¡Ë
 

Re: Rolling Cube 1¤Î³ÈÄ¥

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 9·î20Æü(Æü)08»þ45ʬ23ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.558[¸µµ­»ö¤Ø]

£±¢ª£²
UR,DLLURRDLLURRDLLDRULDRULURDRULLDRRDLU;R,DLLUURRD,DLLUURRD,DLLUURRD,DLLU,R

¥»¥ß¥³¥í¥ó¤ÎÁ°È¾¡Ê£³£¸¼ê¡Ë
¡¡222
¡¡5 2
¡¡222

¥»¥ß¥³¥í¥ó¤Î¸åȾ¡Ê£³£°¼ê¡Ë
¡¡xxx
¡¡o x¡¡¡û¤Îȿž
¡¡xxx
 

¥ï¥ó¥À¥Õ¥ë

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ 9·î20Æü(Æü)12»þ15ʬ7ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.560[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> £±¢ª£²
> UR,DLLURRDLLURRDLLDRULDRULURDRULLDRRDLU;R,DLLUURRD,DLLUURRD,DLLUURRD,DLLU,R
>
> ¥»¥ß¥³¥í¥ó¤ÎÁ°È¾¡Ê£³£¸¼ê¡Ë
> ¡¡222
> ¡¡5 2
> ¡¡222
>
> ¥»¥ß¥³¥í¥ó¤Î¸åȾ¡Ê£³£°¼ê¡Ë
> ¡¡xxx
> ¡¡o x¡¡¡û¤Îȿž
> ¡¡xxx

ɬ»à¤Ë¼ê½ç¤òõ¤·¤Æ¤¤¤Þ¤·¤¿¡£
¤É¤¦¤·¤Æ¤âÊɤˤ֤ÁÅö¤¿¤ê¡¢¤¿¤¤¤¬¤¤Ç¾¤ß¤½¤¬¥Ñ¥ó¥¯¤·¤½¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤·¤¿¡£
ºÇ¸å¤Ë¤Ï±¿¤òÅ·¤ËǤ¤»¤ë¤Ù¤¯¡¢Å¾¤¬¤¹»ÏËö¤Ç¤·¤¿¡£
¤è¤¯¤³¤ó¤Ê¼ê½ç¤¬¸«¤¨¤Æ¤­¤Þ¤¹¤Í¡©¡ÊǽÎϤΰ㤤¤ò¤Þ¤¶¤Þ¤¶¤È´¶¤¸¤Æ¤·¤Þ¤¤¤Þ¤¹¡£¡Ë
£²¡¤£¶¤¬È¯¸«¤Ç¤­¤¿¤«¤é£³¡¤£´¡¤£µ¤âÉÔ²Äǽ¤Ç¤Ï¤Ê¤¯¤Ê¤ë¤Î¤Ç¤·¤ç¤¦¤«¡©
 

Re: Rolling Cube 1¤Î³ÈÄ¥

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ 9·î20Æü(Æü)12»þ35ʬ26ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.560[¸µµ­»ö¤Ø]

ÈפÎÂоÎÀ­¤Ëµ¤¤¬¤Ä¤±¤Ð¡¢¡¢¡¢

¸Ä¡¹¤Î¤µ¤¤¤³¤í¤Î¸þ¤­¤Ï¡¢

5¡¡¡¡¡¡¸å¡¡¡¡¡¡¢¨Å¸³«¿Þ¡¢Èפò¾å¤«¤é¸«²¼¤í¤·¤Æ¤¤¤ë¤Î¤Ç¾åÌ̤¬¸«¤¨¤ë
4136¡¡º¸¾å±¦²¼
2¡¡¡¡¡¡Àµ

¤Ç¤¢¤ë¡£
Á°½Ð¤ÎÁàºî£±¢ª£²¤Ï¡¢ÀµÌÌ¡Ê£²¤ÎÌܡˤ¬¾åÌ̤˰ÜÆ°¤·¤¿¤³¤È¤ò°ÕÌ£¤¹¤ë¡£

¤·¤¿¤¬¤Ã¤Æ¡¢Â¦Ì̤ËÃåÌܤ¹¤ë¤È
£±¢ª£³¤Ï¡¢Èפα¦¡Ê£³¤ÎÌܡˤ¬²¼¤Ë¤Ê¤ë¤è¤¦¤ËÈפò»ý¤ÁÂؤ¨¤ë¡£¡Ê»þ·×¤Þ¤ï¤ê¤Ë£¹£°ÅÙ²óž¡Ë
¤½¤Î¾õÂ֤ǡ¢£±¢ª£²¤Î¼ê½ç¤ò¹Ô¤¨¤Ð¤è¤¤¡£

£±¢ª£³
LU,RDDLUURDDLUURDDRULDRULDLURULDDRUURDL;U,RDDLLUUR,RDDLLUUR,RDDLLUUR,RDDL,U

¢¨¥¹¥¯¥ê¥×¥Èµ­½Ò¤Ï¡¢Èפ¬¸ÇÄê¤Ë¤Ê¤ë¤Î¤Ç¡¢È¿»þ·×¤Þ¤ï¤ê¤Ë£¹£°ÅÙ²óž¤Ë¤Ê¤ë¡£


£±¢ª£´¡¢£±¢ª£µ¤âƱÍÍ¡£
 

´°Á´¤Ëλ²ò

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ 9·î20Æü(Æü)19»þ16ʬ50ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¤³¤Î¥Ñ¥º¥ë¤Î±ü¿¼¤µ¤¬¤è¤¦¤ä¤¯Íý²ò¤Ç¤­¤Þ¤·¤¿¡£¡Ê¼«Ê¬¤ÎƬ¤Î¸Ç¤µ¤¬Íý²ò¤Ç¤­¤Þ¤·¤¿¡£¡Ë
À¤¤ÎÃæ¤Ë¥ë¡¼¥Ó¥Ã¥¯¥­¥å¡¼¥Ö¤Ê¤ë¾¦Éʤ¬·ë¹½¹â²Á¤ÊÃÍÃʤÇÈÎÇ䤵¤ì¤Æ¤¤¤Þ¤¹¤¬¡¢¤½¤ì¤è¤ê¤â
¤â¤Ã¤ÈÄã³Øǯ¤ÎǯÎð¤Î»Ò¶¡¤Ë¤â°Â²Á¤Ç¼êºî¤ê¤Ç¤­¤Æ¡¢¥ë¡¼¥ë¤¬¥·¥ó¥×¥ë¤Ç´Êñ¡¢¤Ç¤â¤½¤ÎÌÂϩŪ»î¹Ôºø¸í¤¬»É·ãŪ¤Ç¡¢¤Ê¤ó¤È¤â¸À¤¨¤Ì¤â¤É¤«¤·¤µ¤¬¿´ÃϤ褯ºîÍѤ·¤Þ¤¹¡£
¤ª¤â¤Á¤ã¤ÎÀ¤³¦¤Ë¤â¡¢¤³¤ó¤Ê¾¦ÉʤòÃÖ¤¤¤Æ¤ª¤¤¤Æ¤Û¤·¤¤¤â¤Î¤Ç¤¹¡£
À¤¤ÎÃæ¤Ë¤â¤Ã¤È¾Ò²ð¤·¤Æ¡¢Á´¹ñ¤Î±à»ù¤¬¤³¤ì¤ÇÍ·¤ó¤Ç¤¤¤ë»Ñ¤òÁÛÁü¤·¤Æ¤¤¤Þ¤¹¡£
 

´ñ¿ô¤È¶ö¿ô

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ 9·î22Æü(²Ð)19»þ43ʬ37ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¶ö¿ô¤Ïɬ¤º£²¤Ç³ä¤êÀÚ¤ì¤ë¤È¤¤¤¦¤«¡¢£²¤Ç³ä¤êÀÚ¤ì¤ë¤«¤é¶ö¿ô¤³¤ì¤Ï´Ö°ã¤¤¤Ç¤Ï¤Ê¤¤¡©
¤±¤É´ñ¿ô¤Ë¤Ï¤½¤ó¤Ê·è¤Þ¤Ã¤¿¿ô¤Ï¤Ê¤¯¡¢¡Ê£²£î¡Ü£±¡Ë¡¢¡Ê£²£î¡Ý£±¡Ë¤Çɽ¸½¤¹¤ë¤³¤È¤Ë·è¤á
¤¿¤ê¤¹¤ë¤³¤È¤Ï¤¢¤ê¤Þ¤¹¤Í¤³¤ì¤Ë°ãÏ´¶¶ö¿ô¤Ã¤ÆÆÃÊ̤ʿô¤Ê¤ó¤À¤È»×¤Ã¤¿¤³¤È¤Î¤¢¤ë¿Í¤Ï¤¤¤Þ¤»¤ó¤«¡©
 

¤¹¤ß¤Þ¤»¤óÊÔ½¸¤µ¤»¤Æ¤¤¤¿¤À¤­¤Þ¤·¤¿¡ÊÁÇ¿ô¡Ë

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ 9·î22Æü(²Ð)19»þ51ʬ41ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  £±¤È¤½¤Î¿ô¼«¿È¤Ç³ä¤êÀÚ¤ì¤Ê¤¤¼«Á³¿ô
£±¤ÏÁÇ¿ô¤È¤Ï¤·¤Ê¤¤¡¢¤³¤Î¤È¤­¡¢
£²,£³,£µ,£·,£±£±,£±£³,£±£·¡¤£±£¹¡¤£²£³¡¤£²£¹¡¤£³£±¡¤£³£·¤Ï¡¢
£±¤«¤é£´£°¤Þ¤Ç¤ÎÁÇ¿ô¤Ç¤¹¤¬´Ö°ã¤Ã¤Æ¤Þ¤»¤ó¤«
 

Re: ´°Á´¤Ëλ²ò

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ 9·î22Æü(²Ð)20»þ08ʬ4ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.563[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¤³¤Î¥Ñ¥º¥ë¤Î±ü¿¼¤µ¤¬¤è¤¦¤ä¤¯Íý²ò¤Ç¤­¤Þ¤·¤¿¡£¡Ê¼«Ê¬¤ÎƬ¤Î¸Ç¤µ¤¬Íý²ò¤Ç¤­¤Þ¤·¤¿¡£¡Ë
> À¤¤ÎÃæ¤Ë¥ë¡¼¥Ó¥Ã¥¯¥­¥å¡¼¥Ö¤Ê¤ë¾¦Éʤ¬·ë¹½¹â²Á¤ÊÃÍÃʤÇÈÎÇ䤵¤ì¤Æ¤¤¤Þ¤¹¤¬¡¢¤½¤ì¤è¤ê¤â
> ¤â¤Ã¤ÈÄã³Øǯ¤ÎǯÎð¤Î»Ò¶¡¤Ë¤â°Â²Á¤Ç¼êºî¤ê¤Ç¤­¤Æ¡¢¥ë¡¼¥ë¤¬¥·¥ó¥×¥ë¤Ç´Êñ¡¢¤Ç¤â¤½¤ÎÌÂϩŪ»î¹Ôºø¸í¤¬»É·ãŪ¤Ç¡¢¤Ê¤ó¤È¤â¸À¤¨¤Ì¤â¤É¤«¤·¤µ¤¬¿´ÃϤ褯ºîÍѤ·¤Þ¤¹¡£
> ¤ª¤â¤Á¤ã¤ÎÀ¤³¦¤Ë¤â¡¢¤³¤ó¤Ê¾¦ÉʤòÃÖ¤¤¤Æ¤ª¤¤¤Æ¤Û¤·¤¤¤â¤Î¤Ç¤¹¡£
> À¤¤ÎÃæ¤Ë¤â¤Ã¤È¾Ò²ð¤·¤Æ¡¢Á´¹ñ¤Î±à»ù¤¬¤³¤ì¤ÇÍ·¤ó¤Ç¤¤¤ë»Ñ¤òÁÛÁü¤·¤Æ¤¤¤Þ¤¹¡£

¥Ï¥Î¥¤¤ÎÅã±ßÈ×£³Ëç¡Á£´Ë礯¤é¤¤¤âÌÌÇò¤¤¤È»×¤¤¤Þ¤¹¤è¡£
 

ÊÔ½¸¤µ¤»¤Æ¤¤¤¿¤À¤­¤Þ¤·¤¿(¥×¥í¥°¥é¥àºîÀ®¤Ë¤Ä¤¤¤Æ¡Ë

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ 9·î22Æü(²Ð)20»þ17ʬ14ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ²èÌ̾å¤ä¡¢»æÌ̾å¤Ç¡¢Æ¬¤ÎÃæ¤Ç¡¢¶ìÏ«¤ò½Å¤Í¤Æ½ÐÍè¤â¤Î¤Ê¤ó¤À¤È»×¤Ã¤Æ¤¤¤Þ¤¹
·Ç¼¨Èľå¤Î¥×¥í¥°¥é¥à¤Ë¤Ï¡¢¸«¤Æ¤¤¤Æ¡¢Ìܤò¸«Ä¥¤ë¤â¤Î¤¬¤¢¤ê¤Þ¤¹¡£
Æɤá¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¤Î¤Ç¤¹¤¬¡¢°õºþ¤·¤Æį¤á¤¿¤ê¤·¤Æ¤ë¤È¡¢
¼«Ê¬¤ÇÅØÎϤ·¤Æ¥×¥í¥°¥é¥à¤òºî¤í¤¦¤È¹½ÁÛ¤òÎý¤í¤¦¤È¤¹¤ë¤È¤­¤Ëºî¤í¤¦¤È¤¹¤ë¤È¤­¤ËÎå¤ß¤Ë¤Ê¤ë¤È»×¤ï¤ì¤Þ¤¹¡£
 

¥×¥í¥°¥é¥à¤ÎÊÙ¶¯¤ò¤¹¤ë¤È¤­

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ 9·î22Æü(²Ð)20»þ20ʬ45ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¥×¥í¥°¥é¥àÆþÌç½ñ¡¢ÌäÂ꽸¡¢¥¢¥ë¥´¥ê¥º¥à¤È¥Ç¡¼¥¿¹½Â¤¤Ë¤Ä¤¤¤Æ¡¢
¤Î£³ºý¤ÎËܤ¬¤¢¤ê¤Þ¤¹¡¢¤É¤Î½ç¤ÇÆɤ߿ʤó¤Ç¤¤¤¯¤Î¤¬Îɤ¤¤È»×¤ï¤ì¤Þ¤¹¤«¡¢
µ¹¤·¤±¤ì¤Ð¤´½õ¸ÀÅù¤ª´ê¤¤¤·¤Þ¤¹¡£
 

¤¹¤ß¤Þ¤»¤ó

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ 9·î23Æü(¿å)13»þ26ʬ26ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ¤¢¤Þ¤ê°ÕÌ£¤Î¤Ê¤¤·Ç¼¨¤¹¤ß¤Þ¤»¤ó
¤·¤Ð¤é¤¯ÍͻҤò¸«¤Æ¤ß¤Þ¤¹¡£
µ¹¤·¤±¤ì¤Ð¡¢¤´½õ¸À¤Ê¤É¡¢¤ª´ê¤¤¤·¤Þ¤¹¡£
 

¤¹¤ß¤Þ¤»¤ó

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ 9·î23Æü(¿å)13»þ28ʬ2ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ¸íÊÑ´¹¤Î¤¢¤Ã¤¿·Ç¼¨¤ò¡¢

·Ç¼¨ÈĤÎÊÔ½¸µ¡Ç½¤è¤ê¡¢

ÄûÀµ¤µ¤»¤Æ¤¤¤¿¤À¤­¤Þ¤·¤¿¡£

¤¹¤ß¤Þ¤»¤ó¤Ç¤·¤¿¡£
 

¹ÔÈÖ¹æ¤ÎÁ°¸å

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ 9·î24Æü(ÌÚ)18»þ44ʬ52ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ½½¿ÊBASIC¤Ç¤Ï¼¡¤Î¤è¤¦¤Ê¹ÔÈֹ椬̤À°Îó¤Î¥×¥í¥°¥é¥à¤â¼Â¹Ô²Äǽ¤Ç¤¹¤¬¡¢JISµ¬³Ê¤Ç¤Ï
¡Ø4.2.2 (26)  ¹Ô¤Ï¡¢¹ÔÈÖ¹æ¤ÎÃͤξº½ç¤Ëʤó¤Ç¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤(16.»²¾È)¡£¡Ù
¤È¤¢¤ë¤Î¤Ç¡¢¥¨¥é¡¼¤Ë¤¹¤ë¤Ù¤­¤À¤È»×¤¦¤Î¤Ç¤¹¤¬¤¤¤«¤¬¤Ç¤·¤ç¤¦¤«¡£

10 LET a=3
20 LET b=4
30 LET b=a+b
25 PRINT b
50 END
 

Re: ¹ÔÈÖ¹æ¤ÎÁ°¸å

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ 9·î24Æü(ÌÚ)20»þ27ʬ44ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.571[¸µµ­»ö¤Ø]

¸½¾õ¤Ç¤Ï¥Á¥§¥Ã¥¯¤¬ÉÔ½½Ê¬¤Ç¼Â¹Ô¤Ç¤­¤Æ¤·¤Þ¤¤¤Þ¤¹¤¬¡¤¾­ÍèŪ¤Ë¤Ï¥¨¥é¡¼¤ò½Ð¤¹¤è¤¦¤Ë¤·¤¿¤¤¤È»×¤¤¤Þ¤¹¡£ÅöÌÌ¡¤¤½¤Î¤è¤¦¤Ê¥×¥í¥°¥é¥à¤òºî¤é¤Ê¤¤¤è¤¦¤Ë¤ª´ê¤¤¤·¤Þ¤¹¡£

> ½½¿ÊBASIC¤Ç¤Ï¼¡¤Î¤è¤¦¤Ê¹ÔÈֹ椬̤À°Îó¤Î¥×¥í¥°¥é¥à¤â¼Â¹Ô²Äǽ¤Ç¤¹¤¬¡¢JISµ¬³Ê¤Ç¤Ï
> ¡Ø4.2.2 (26)  ¹Ô¤Ï¡¢¹ÔÈÖ¹æ¤ÎÃͤξº½ç¤Ëʤó¤Ç¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤(16.»²¾È)¡£¡Ù
> ¤È¤¢¤ë¤Î¤Ç¡¢¥¨¥é¡¼¤Ë¤¹¤ë¤Ù¤­¤À¤È»×¤¦¤Î¤Ç¤¹¤¬¤¤¤«¤¬¤Ç¤·¤ç¤¦¤«¡£
>
> 10 LET a=3
> 20 LET b=4
> 30 LET b=a+b
> 25 PRINT b
> 50 END
 

±é»»¸íº¹¶¯À©½¤Àµ

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2009ǯ 9·î27Æü(Æü)13»þ27ʬ23ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ·×»»·ë²Ì¤Ë±é»»¸íº¹¤ò´Þ¤à¤È¤­¡¢¶¯À©Åª¤Ë½¤Àµ¤¹¤ë¡£
⤷¡¢ËüǽÅù¤Ç¤Ï¤Ê¤¯¡¢1.249999999999¤ò1.25¤È½¤Àµ¤Ç¤­¤ëÄøÅÙ¡£
»ÈÍѤˤÏÃí°Õ¤¬É¬ÍפǤ¹¡£(1000000/1000001¤ò1¤È¤·¤Æ¤·¤Þ¤¦²ÄǽÀ­¤¬¤¢¤ë)



PUBLIC NUMERIC FLG
LET X=8.99999999865/1.999999991572
PRINT "½¤ÀµÁ°";X;"½¤Àµ¸å";NUM(X);"ÍýÁÛÃÍ";9/2
LET X=7.000000000357/3.000000001345*5.99999999993247
PRINT "½¤ÀµÁ°";X;"½¤Àµ¸å";NUM(X);"ÍýÁÛÃÍ";14
LET X=-15/6.00000000352*10.000000034/2.999999999247
PRINT "½¤ÀµÁ°";X;"½¤Àµ¸å";NUM(X);"ÍýÁÛÃÍ";-25/3
LET X=SQR(2.500000000354)*SQR(2.9999999999999871)
PRINT "½¤ÀµÁ°";X;"½¤Àµ¸å";NUM(X);"ÍýÁÛÃÍ";SQR(7.5)
LET X=EXP(1.50000000321)*EXP(3.9999999999992417)
PRINT "½¤ÀµÁ°";X;"½¤Àµ¸å";NUM(X);"ÍýÁÛÃÍ";EXP(5.5)
END

EXTERNAL  FUNCTION INTNUM(X)
LET EPS=1E-5 !'(Í×)Ä´À°
FOR I=0 TO 4 !'(Í×)Ä´À°
   FOR J=0 TO 1
      LET Y=ABS(X)*10^I+J*EPS
      IF ABS(Y)-INT(ABS(Y))<=EPS THEN
         LET INTNUM=SGN(X)*INT(ABS(Y))/10^I
         LET FLG=1
         EXIT FUNCTION
      END IF
   NEXT J
NEXT  I
LET INTNUM=X
LET FLG=0
END FUNCTION

EXTERNAL  FUNCTION NUM(X)
LET Y=INT(ABS(X))
LET P=ABS(X)-Y
LET K=INTNUM(X)
IF FLG=1 THEN
   LET NUM=K
   EXIT FUNCTION
END IF
LET K=INTNUM(1/P)
IF FLG=1 THEN
   LET NUM=(Y+1/K)*SGN(X)
   EXIT FUNCTION
END IF
LET K=INTNUM(X*X)
IF FLG=1 THEN
   LET NUM=SQR(K)*SGN(X)
   EXIT FUNCTION
END IF
IF X>0 THEN
   LET K=INTNUM(LOG(X))
   IF  FLG=1  THEN
      LET NUM=EXP(K)
      EXIT FUNCTION
   END IF
END IF
IF ABS(X)<228 THEN
   LET K=INTNUM(EXP(X))
   IF FLG=1  THEN
      LET NUM=LOG(K)*SGN(X)
      EXIT FUNCTION
   END IF
END IF
LET NUM=X
END FUNCTION
 

Ê£ÁÇ¿ô¥é¥¤¥Ö¥é¥ê¡¼

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2009ǯ 9·î27Æü(Æü)13»þ29ʬ39ÉÃ
ÊÖ¿®¡¦°úÍÑ
  Ê£ÁÇ¿ô¥â¡¼¥É¤Ç»ÈÍѤǤ­¤ë´Ø¿ô¤ò¤¤¤¯¤Ä¤«ÄêµÁ¤·¤Æ¤ß¤Þ¤·¤¿¡£
¤Ê¤ª¡¢ºîÀ®¤Ë¤Ï¡ÖMaxima¡×¤òÍøÍѤ·¤Þ¤·¤¿¡£ {ex.   realpart(cos(x+%i*y));  }
                                         {      imagpart(cos(x+%i*y));  }
http://sourceforge.net/projects/maxima/files/


OPTION ARITHMETIC COMPLEX
LET X=COMPLEX(1,-2)
LET N=5
DIM A(N)
PRINT "X=";X;"(";REAL(X);IMAG(X);")"
PRINT "SIN=";CSIN(X);CSIN2(X)
PRINT "COS=";CCOS(X);CCOS2(X)
PRINT "TAN=";CTAN(X);CTAN2(X)
PRINT "COSEC=";CCOSEC(X);CCOSEC2(X)
PRINT "SEC=";CSEC(X);CSEC2(X)
PRINT "COTAN=";CCOTAN(X);CCOTAN2(X)
PRINT "SINH=";CSINH(X);CSINH2(X)
PRINT "COSH=";CCOSH(X);CCOSH2(X)
PRINT "TANH=";CTANH(X);CTANH2(X)
PRINT "COSECH=";CCOSECH(X);CCOSECH2(X)
PRINT "SECH=";CSECH(X);CSECH2(X)
PRINT "COTANH=";CCOTANH(X);CCOTANH2(X)
PRINT "Ê¿Êýº¬=";CSQR(X);CEXP(CLOG(X)/2)
CALL CNPOW(X,N,A)
PRINT N;"¾èº¬"
FOR I=1 TO N
   PRINT I;":";A(I);A(I)^N
NEXT I
LET Y=COMPLEX(1,2)
PRINT "X^Y=";CPOW(X,Y);CEXP(Y*CLOG(X))
END

! »°³Ñ´Ø¿ô

EXTERNAL  FUNCTION CSIN(Z) !'sine
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
LET XR = SIN(X) * COSH(Y)
LET XI = COS(X) * SINH(Y)
LET CSIN=COMPLEX(XR,XI)
END FUNCTION

EXTERNAL  FUNCTION CSIN2(Z)
OPTION ARITHMETIC COMPLEX
LET I=SQR(-1)
LET CSIN2=(CEXP(I*Z)-CEXP(-I*Z))/(2*I)
END FUNCTION

EXTERNAL  FUNCTION CCOS(Z) !'cosine
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
LET XR = COS(X) * COSH(Y)
LET XI = -SIN(X) * SINH(Y)
LET CCOS=COMPLEX(XR,XI)
END FUNCTION

EXTERNAL  FUNCTION CCOS2(Z)
OPTION ARITHMETIC COMPLEX
LET I=SQR(-1)
LET CCOS2=(CEXP(I*Z)+CEXP(-I*Z))/2
END FUNCTION

EXTERNAL  FUNCTION CTAN(Z) !'tangent
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
LET D = COS(2 * X) + COSH(2 * Y)
LET XR = SIN(2 * X) / D
LET XI = SINH(2 * Y) / D
LET CTAN=COMPLEX(XR,XI)
END FUNCTION

EXTERNAL  FUNCTION CTAN2(Z)
OPTION ARITHMETIC COMPLEX
LET CTAN2=CSIN(Z)/CCOS(Z)
END FUNCTION

EXTERNAL  FUNCTION CCOSEC(Z) !'cosecant
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
LET D=COS(X)^2*SINH(Y)^2+SIN(X)^2*COSH(Y)^2
LET XR=SIN(X)*COSH(Y)/D
LET XI=-COS(X)*SINH(Y)/D
LET CCOSEC=COMPLEX(XR,XI)
END FUNCTION

EXTERNAL  FUNCTION CCOSEC2(Z)
OPTION ARITHMETIC COMPLEX
LET CCOSEC2=1/CSIN(Z)
END FUNCTION

EXTERNAL  FUNCTION CSEC(Z) !'secant
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
LET D=SIN(X)^2*SINH(Y)^2+COS(X)^2*COSH(Y)^2
LET XR=COS(X)*COSH(Y)/D
LET XI=SIN(X)*SINH(Y)/D
LET CSEC=COMPLEX(XR,XI)
END FUNCTION

EXTERNAL  FUNCTION CSEC2(Z)
OPTION ARITHMETIC COMPLEX
LET CSEC2=1/CCOS(Z)
END FUNCTION

EXTERNAL  FUNCTION CCOTAN(Z) !'cotangent
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
LET D=COSH(2*Y)+COS(2*X)
LET DD=SINH(2*Y)^2+SIN(2*X)^2
LET XR=SIN(2*X)*D/DD
LET XI=-SINH(2*Y)*D/DD
LET CCOTAN=COMPLEX(XR,XI)
END FUNCTION

EXTERNAL  FUNCTION CCOTAN2(Z)
OPTION ARITHMETIC COMPLEX
LET CCOTAN2=1/CTAN(Z)
END FUNCTION

! µÕ»°³Ñ´Ø¿ô

EXTERNAL  FUNCTION CASIN(Z) !'arcsine
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
LET D=SQR((Y^2-X^2+1)^2+4*X^2*Y^2)
LET S=SQR(D-Y^2+X^2-1)/SQR(2)
LET SS=SQR(D+Y^2-X^2+1)/SQR(2)
IF X*Y>0 THEN
   LET XR=-ATAN2(S-X,SS-Y)
   LET XI=-LOG((SS-Y)^2+(X-S)^2)/2
ELSE
   LET XR=ATAN2(S+X,SS-Y)
   LET XI=-LOG((SS-Y)^2+(X+S)^2)/2
END IF
LET CASIN=COMPLEX(XR,XI)
END FUNCTION

EXTERNAL FUNCTION CASIN2(Z)
OPTION ARITHMETIC COMPLEX
LET CASIN2=CATAN(Z/CSQR(1-Z*Z))
END FUNCTION

EXTERNAL  FUNCTION CASIN3(Z)
OPTION ARITHMETIC COMPLEX
LET I=SQR(-1)
LET CASIN3=-I*CLOG(CSQR(1-Z*Z)+Z*I)
END FUNCTION

EXTERNAL  FUNCTION CACOS(Z) !'arccosine
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
LET D=SQR((Y^2-X^2+1)^2+4*X^2*Y^2)
LET S=SQR(D+Y^2-X^2+1)/SQR(2)
LET SS=SQR(D-Y^2+X^2-1)/SQR(2)
IF X*Y>0 THEN
   LET XR=ATAN2(S+Y,X+SS)
   LET XI=-LOG((S+Y)^2+(SS+X)^2)/2
ELSE
   LET XR=ATAN2(S+Y,X-SS)
   LET XI=-LOG((S+Y)^2+(X-SS)^2)/2
END IF
LET CACOS=COMPLEX(XR,XI)
END FUNCTION

EXTERNAL  FUNCTION CACOS2(Z)
OPTION ARITHMETIC COMPLEX
LET I=SQR(-1)
LET CACOS2=-I*CLOG(Z+I*CSQR(1-Z*Z))
END FUNCTION

EXTERNAL  FUNCTION CATAN(Z) !'arctangent
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
LET XR=(ATAN2(X,Y+1)+ATAN2(X,1-Y))/2
LET XI=-LOG((1-Y)^2+X^2)/4+LOG((Y+1)^2+X^2)/4
LET CATAN=COMPLEX(XR,XI)
END FUNCTION

EXTERNAL  FUNCTION CATAN2(Z)
OPTION ARITHMETIC COMPLEX
LET I=SQR(-1)
LET CATAN2=I/2*CLOG((I+Z)/(I-Z))
END FUNCTION

EXTERNAL  FUNCTION CACOSEC(Z) !'arccosecant
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
LET S=X^2-Y^2
LET SS=4*X^2*Y^2
LET D=S^2+SS
LET E=S/D
LET DD=SS/D^2
LET EE=Y^2/D-X^2/D+1
IF X*Y>=0 THEN
   LET XR= ATAN2(SQR(SQR((1-E)^2+DD)+E-1)/SQR(2)+X/(X^2+Y^2),SQR(SQR((1-E)^2+DD)-E+1)/SQR(2)+Y/(X^2+Y^2))
   LET XI=-LOG((SQR(SQR(EE^2+DD)+EE)/SQR(2)+Y/(Y^2+X^2))^2+(X/(X^2+Y^2)+SQR(SQR(EE^2+DD)-EE)/SQR(2))^2)/2
ELSE
   LET XR=-ATAN2(SQR(SQR((1-E)^2+DD)+E-1)/SQR(2)-X/(X^2+Y^2),SQR(SQR((1-E)^2+DD)-E+1)/SQR(2)+Y/(X^2+Y^2))
   LET XI=-LOG((SQR(SQR(EE^2+DD)+EE)/SQR(2)+Y/(Y^2+X^2))^2+(X/(X^2+Y^2)-SQR(SQR(EE^2+DD)-EE)/SQR(2))^2)/2
END IF
LET CACOSEC=COMPLEX(XR,XI)
END FUNCTION

EXTERNAL  FUNCTION CACOSEC2(Z)
OPTION ARITHMETIC COMPLEX
LET CACOSEC2=CASIN(1/Z)
END FUNCTION

EXTERNAL  FUNCTION CACOSEC3(Z)
OPTION ARITHMETIC COMPLEX
LET CACOSEC3=CATAN(1/CSQR(Z*Z-1))
END FUNCTION

EXTERNAL  FUNCTION CASEC(Z) !'arcsecant
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
LET S=X^2-Y^2
LET SS=4*X^2*Y^2
LET D=S^2+SS
LET E=S/D
LET DD=SS/D^2
LET EE=Y^2/D-X^2/D+1
IF X*Y>=0 THEN
   LET XR=ATAN2(SQR(SQR((1-E)^2+DD)-E+1)/SQR(2)-Y/(X^2+Y^2),X/(X^2+Y^2)-SQR(SQR((1-E)^2+DD)+E-1)/SQR(2))
   LET XI=-LOG((SQR(SQR(EE^2+DD)+EE)/SQR(2)-Y/(Y^2+X^2))^2+(X/(X^2+Y^2)-SQR(SQR(EE^2+DD)-EE)/SQR(2))^2)/2
ELSE
   LET XR=ATAN2(SQR(SQR((1-E)^2+DD)-E+1)/SQR(2)-Y/(X^2+Y^2),X/(X^2+Y^2)+SQR(SQR((1-E)^2+DD)+E-1)/SQR(2))
   LET XI=-LOG((SQR(SQR(EE^2+DD)+EE)/SQR(2)-Y/(Y^2+X^2))^2+(X/(X^2+Y^2)+SQR(SQR(EE^2+DD)-EE)/SQR(2))^2)/2
END IF
LET CASEC=COMPLEX(XR,XI)
END FUNCTION

EXTERNAL FUNCTION CASEC2(Z)
OPTION ARITHMETIC COMPLEX
LET CASEC2=CATAN(CSQR(Z*Z-1))
END FUNCTION
 

Re: Ê£ÁÇ¿ô¥é¥¤¥Ö¥é¥ê¡¼

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2009ǯ 9·î27Æü(Æü)13»þ30ʬ40ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.574[¸µµ­»ö¤Ø]

³¤­


EXTERNAL FUNCTION CASEC3(Z)
OPTION ARITHMETIC COMPLEX
LET CASEC3=CACOS(1/Z)
END FUNCTION

EXTERNAL  FUNCTION CACOTAN(Z) !'arccotangent
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
LET D=X^2+Y^2
LET XR=(ATAN2(X/D,Y/D+1)+ATAN2(X/D,1-Y/D))/2
LET XI=-LOG((Y/D+1)^2+X^2/D^2)/4+LOG((1-Y/D)^2+X^2/D^2)/4
LET CACOTAN=COMPLEX(XR,XI)
END FUNCTION

EXTERNAL  FUNCTION CACOTAN2(Z)
OPTION ARITHMETIC COMPLEX
LET CACOTAN2=CATAN(1/Z)
END FUNCTION

! ÁжÊÀþ´Ø¿ô

EXTERNAL  FUNCTION CSINH(Z) !'hyperbolic sine
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
LET XR = SINH(X) * COS(Y)
LET XI = COSH(X) * SIN(Y)
LET CSINH=COMPLEX(XR,XI)
END FUNCTION

EXTERNAL FUNCTION CSINH2(Z)
OPTION ARITHMETIC COMPLEX
LET CSINH2=(CEXP(Z)-CEXP(-Z))/2
END FUNCTION

EXTERNAL  FUNCTION CCOSH(Z) !'hyperbolic cosine
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
LET  XR = COSH(X) * COS(Y)
LET  XI = SINH(X) * SIN(Y)
LET CCOSH=COMPLEX(XR,XI)
END FUNCTION

EXTERNAL FUNCTION CCOSH2(Z)
OPTION ARITHMETIC COMPLEX
LET CCOSH2=(CEXP(Z)+CEXP(-Z))/2
END FUNCTION

EXTERNAL  FUNCTION CTANH(Z) !'hyperbolic tangent
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
LET  D = COS(2 * Y) + COSH(2 * X)
LET  XR = SINH(2 * X) / D
LET  XI = SIN(2 * Y) / D
LET CTANH=COMPLEX(XR,XI)
END FUNCTION

EXTERNAL FUNCTION CTANH2(Z)
OPTION ARITHMETIC COMPLEX
LET CTANH2=CSINH(Z)/CCOSH(Z)
END FUNCTION

EXTERNAL  FUNCTION CTANH3(Z)
OPTION ARITHMETIC COMPLEX
LET CTANH3=-CEXP(-Z)/(CEXP(Z)+CEXP(-Z))*2+1
END FUNCTION

EXTERNAL  FUNCTION CCOSECH(Z) !'hyperbolic cosecant
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
LET D=COSH(X)^2*SIN(Y)^2+SINH(X)^2*COS(Y)^2
LET XR=SINH(X)*COS(Y)/D
LET XI=-COSH(X)*SIN(Y)/D
LET CCOSECH=COMPLEX(XR,XI)
END FUNCTION

EXTERNAL  FUNCTION CCOSECH2(Z)
OPTION ARITHMETIC COMPLEX
LET CCOSECH2=1/CSINH(Z)
END FUNCTION

EXTERNAL  FUNCTION CSECH(Z) !'hyperbolic secant
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
LET D=SINH(X)^2*SIN(Y)^2+COSH(X)^2*COS(Y)^2
LET XR=COSH(X)*COS(Y)/D
LET XI=-SINH(X)*SIN(Y)/D
LET CSECH=COMPLEX(XR,XI)
END FUNCTION

EXTERNAL  FUNCTION CSECH2(Z)
OPTION ARITHMETIC COMPLEX
LET CSECH2=1/CCOSH(Z)
END FUNCTION

EXTERNAL  FUNCTION CCOTANH(Z) !'hyperbolic cotangent
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
LET D=COS(2*Y)+COSH(2*X)
LET DD=SIN(2*Y)^2+SINH(2*X)^2
LET XR=SINH(2*X)*D/DD
LET XI=-SIN(2*Y)*D/DD
LET CCOTANH=COMPLEX(XR,XI)
END FUNCTION

EXTERNAL  FUNCTION CCOTANH2(Z)
OPTION ARITHMETIC COMPLEX
LET CCOTANH2=1/CTANH(Z)
END FUNCTION

EXTERNAL FUNCTION CCOTANH3(Z)
OPTION ARITHMETIC COMPLEX
LET CCOTANH3=CEXP(-Z)/(CEXP(Z)-CEXP(-Z))*2+1
END FUNCTION

! µÕÁжÊÀþ´Ø¿ô

EXTERNAL  FUNCTION CASINH(Z) !'arc-hyperbolic sine
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
LET D=SQR((-Y^2+X^2+1)^2+4*X^2*Y^2)
IF X*Y>=0 THEN
   LET XR=LOG((SQR(D+Y^2-X^2-1)/SQR(2)+Y)^2+(SQR(D-Y^2+X^2+1)/SQR(2)+X)^2)/2
   LET XI=ATAN2(SQR(D+Y^2-X^2-1)/SQR(2)+Y,SQR(D-Y^2+X^2+1)/SQR(2)+X)
ELSE
   LET XR=LOG((Y-SQR(D+Y^2-X^2-1)/SQR(2))^2+(SQR(D-Y^2+X^2+1)/SQR(2)+X)^2)/2
   LET XI=-ATAN2(SQR(D+Y^2-X^2-1)/SQR(2)-Y,SQR(D-Y^2+X^2+1)/SQR(2)+X)
END IF
LET CASINH=COMPLEX(XR,XI)
END FUNCTION

EXTERNAL FUNCTION CASINH2(Z)
OPTION ARITHMETIC COMPLEX
LET CASINH2=CLOG(Z+CSQR(Z*Z+1))
END FUNCTION

EXTERNAL  FUNCTION CACOSH(Z) !'arc-hyperbolic cosine
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
LET D=SQR(Y^2+(X+1)^2)
LET DD=SQR(Y^2+(X-1)^2)
IF Y>=0 THEN
   LET XR=LOG((SQR(D+X+1)/2+SQR(DD+X-1)/2)^2+(SQR(D-X-1)/2+SQR(DD-X+1)/2)^2)
   LET XI=2*ATAN2(SQR(D-X-1)/2+SQR(DD-X+1)/2,SQR(D+X+1)/2+SQR(DD+X-1)/2)
ELSE
   LET XR=LOG((SQR(D+X+1)/2+SQR(DD+X-1)/2)^2+(-SQR(D-X-1)/2-SQR(DD-X+1)/2)^2)
   LET XI=-2*ATAN2(SQR(D-X-1)/2+SQR(DD-X+1)/2,SQR(D+X+1)/2+SQR(DD+X-1)/2)
END IF
LET CACOSH=COMPLEX(XR,XI)
END FUNCTION

EXTERNAL FUNCTION CACOSH2(Z)
OPTION ARITHMETIC COMPLEX
LET CACOSH2=CLOG(Z+CSQR(Z*Z-1))
END FUNCTION

EXTERNAL  FUNCTION CATANH(Z) !'arc-hyperbolic tangent
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
LET XR=LOG(Y^2+(X+1)^2)/4-LOG(Y^2+(1-X)^2)/4
LET XI=(ATAN2(Y,X+1)+ATAN2(Y,1-X))/2
LET CATANH=COMPLEX(XR,XI)
END FUNCTION

EXTERNAL FUNCTION CATANH2(Z)
OPTION ARITHMETIC COMPLEX
LET CATANH2=CLOG((1+Z)/(1-Z))/2
END FUNCTION

EXTERNAL  FUNCTION CACOSECH(Z) !'arc-hyperbolic cosecant
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
LET S=(X^2-Y^2)^2+4*X^2*Y^2
LET D=Y^2/S
LET DD=X^2/S
LET SS=4*X^2*Y^2/S^2
LET E=(X^2-Y^2)/S
IF X*Y>0 THEN
   LET XR=LOG((-SQR(SQR((-D+DD+1)^2+SS)+D-DD-1)/SQR(2)-Y/(X^2+Y^2))^2+(SQR(SQR((-D+DD+1)^2+SS)-D+DD+1)/SQR(2)+X/(X^2+Y^2))^2)/2
   LET XI=-ATAN2(SQR(SQR((E+1)^2+SS)-E-1)/SQR(2)+Y/(X^2+Y^2),SQR(SQR((E+1)^2+SS)+E+1)/SQR(2)+X/(X^2+Y^2))
ELSE
   LET XR=LOG((SQR(SQR((-D+DD+1)^2+SS)+D-DD-1)/SQR(2)-Y/(X^2+Y^2))^2+(SQR(SQR((-D+DD+1)^2+SS)-D+DD+1)/SQR(2)+X/(X^2+Y^2))^2)/2
   LET XI=ATAN2(SQR(SQR((E+1)^2+SS)-E-1)/SQR(2)-Y/(X^2+Y^2),SQR(SQR((E+1)^2+SS)+E+1)/SQR(2)+X/(X^2+Y^2))
END IF
LET CACOSECH=COMPLEX(XR,XI)
END FUNCTION

EXTERNAL  FUNCTION CACOSECH2(Z)
OPTION ARITHMETIC COMPLEX
LET CACOSECH2=CASINH(1/Z)
END FUNCTION

EXTERNAL FUNCTION CACOSECH3(Z)
OPTION ARITHMETIC COMPLEX
LET CACOSECH3=CLOG((CSQR(Z*Z+1)+1)/Z)
END FUNCTION

EXTERNAL  FUNCTION CASECH(Z) !'arc-hyperbolic secant
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
LET D=X/(X^2+Y^2)
LET DD=Y^2/(X^2+Y^2)^2
IF Y>0 THEN
   LET XR=LOG((SQR(SQR((D+1)^2+DD)+D+1)/2+SQR(SQR((D-1)^2+DD)+D-1)/2)^2+(-SQR(SQR((D+1)^2+DD)-D-1)/2-SQR(SQR((D-1)^2+DD)-D+1)/2)^2)
   LET XI=-2*ATAN2(SQR(SQR((D+1)^2+DD)-D-1)/2+SQR(SQR((D-1)^2+DD)-D+1)/2,SQR(SQR((D+1)^2+DD)+D+1)/2+SQR(SQR((D-1)^2+DD)+D-1)/2)
ELSE
   LET XR=LOG((SQR(SQR((D+1)^2+DD)+D+1)/2+SQR(SQR((D-1)^2+DD)+D-1)/2)^2+(SQR(SQR((D+1)^2+DD)-D-1)/2+SQR(SQR((D-1)^2+DD)-D+1)/2)^2)
   LET XI=2*ATAN2(SQR(SQR((D+1)^2+DD)-D-1)/2+SQR(SQR((D-1)^2+DD)-D+1)/2,SQR(SQR((D+1)^2+DD)+D+1)/2+SQR(SQR((D-1)^2+DD)+D-1)/2)
END IF
LET CASECH=COMPLEX(XR,XI)
END FUNCTION

EXTERNAL  FUNCTION CASECH2(Z)
OPTION ARITHMETIC COMPLEX
LET CASECH2=CACOSH(1/Z)
END FUNCTION

EXTERNAL FUNCTION CASECH3(Z)
OPTION ARITHMETIC COMPLEX
LET CASECH3=CLOG((CSQR(1-Z*Z)+1)/Z)
END FUNCTION

EXTERNAL  FUNCTION CACOTANH(Z) !'arc-hyperbolic cotangent
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
LET D=X/(X^2+Y^2)
LET S=Y/(X^2+Y^2)
LET DD=S^2
LET XR=LOG((D+1)^2+DD)/4-LOG((1-D)^2+DD)/4
LET XI=(-ATAN2(S,D+1)-ATAN2(S,1-D))/2
LET CACOTANH=COMPLEX(XR,XI)
END FUNCTION
 

Re: Ê£ÁÇ¿ô¥é¥¤¥Ö¥é¥ê¡¼

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2009ǯ 9·î27Æü(Æü)13»þ32ʬ37ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.575[¸µµ­»ö¤Ø]

³¤­



EXTERNAL  FUNCTION CACOTANH2(Z)
OPTION ARITHMETIC COMPLEX
LET CACOTANH2=CATANH(1/Z)
END FUNCTION

EXTERNAL FUNCTION CACOTANH3(Z)
OPTION ARITHMETIC COMPLEX
LET CACOTANH3=CLOG((Z+1)/(Z-1))/2
END FUNCTION

! ¤½¤Î¾

EXTERNAL  FUNCTION CABS(Z) !'ÀäÂÐÃÍ
OPTION ARITHMETIC COMPLEX
LET CABS=SQR(RE(Z)^2+IM(Z)^2)
END FUNCTION

EXTERNAL  FUNCTION CSQR(Z) !'Ê¿Êýº¬
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
LET R=SQR(X*X+Y*Y)
LET XR=SQR(R+X)/SQR(2)
IF Y>=0 THEN
   LET  XI=SQR(R-X)/SQR(2)
ELSE
   LET  XI=-SQR(R-X)/SQR(2)
END IF
LET CSQR=COMPLEX(XR,XI)
END FUNCTION

EXTERNAL  FUNCTION CLOG(Z) !'Âпô
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
LET XR = LOG(X * X + Y * Y) / 2
LET XI = ATAN2(Y, X)
LET CLOG=COMPLEX(XR,XI)
END FUNCTION

EXTERNAL  FUNCTION CEXP(Z) !'»Ø¿ô
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
LET XR = EXP(X) * COS(Y)
LET XI = EXP(X) * SIN(Y)
LET CEXP=COMPLEX(XR,XI)
END FUNCTION

EXTERNAL  FUNCTION CARG(Z) !'ÊгÑ
OPTION ARITHMETIC COMPLEX
LET  CARG = ATAN2(IM(Z), RE(Z))
END FUNCTION

EXTERNAL  FUNCTION CPOW(X,Y) !'(A+Bi)^(C+Di)
OPTION ARITHMETIC COMPLEX
LET A=RE(X)
LET B=IM(X)
LET C=RE(Y)
LET D=IM(Y)
LET XR=(B^2+A^2)^(C/2)*EXP(-ATAN2(B,A)*D)*COS(LOG(B^2+A^2)*D/2+ATAN2(B,A)*C)
LET XI=(B^2+A^2)^(C/2)*EXP(-ATAN2(B,A)*D)*SIN(LOG(B^2+A^2)*D/2+ATAN2(B,A)*C)
LET CPOW=COMPLEX(XR,XI)
END FUNCTION

EXTERNAL  SUB CNPOW(Z, N, V()) !'(A+Bi)^(1/N)
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
LET  R = (X * X + Y * Y)^(1 / (2 * N))
LET TH = ATAN2(Y,X)
LET  A = R * COS(TH / N)
LET  B = R * SIN(TH / N)
FOR I = 1 TO N
   LET  C = COS(2 * PI / N * I)
   LET  S = SIN(2 * PI / N * I)
   LET  AA = A * C - B * S
   LET  BB = B * C + A * S
   LET  V(I) = COMPLEX(AA,BB)
NEXT I
END SUB

EXTERNAL  FUNCTION CRUIJYO(Z, N) !'(A+Bi)^N
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
LET  N = INT(N)
LET  R = (X * X + Y * Y)^(N / 2)
LET TH=ATAN2(Y,X)
LET  XR = R * COS(TH * N)
LET  XI = R * SIN(TH * N)
LET CRUIJYO=COMPLEX(XR,XI)
END FUNCTION

EXTERNAL  FUNCTION CCONJ(Z) !'¶¦Ìò¿ô
OPTION ARITHMETIC COMPLEX
LET CCONJ=COMPLEX(RE(Z),-IM(Z))
END FUNCTION

EXTERNAL  FUNCTION REAL(Z) !'¼ÂÉô
OPTION ARITHMETIC COMPLEX
LET REAL=CABS(Z)*COS(CARG(Z))
END FUNCTION

EXTERNAL  FUNCTION IMAG(Z) !'µõÉô
OPTION ARITHMETIC COMPLEX
LET IMAG=CABS(Z)*SIN(CARG(Z))
END FUNCTION

EXTERNAL  SUB CPRINT(Z)
OPTION ARITHMETIC COMPLEX
LET X=RE(Z)
LET Y=IM(Z)
IF X=0 AND Y=0 THEN
   PRINT "0"
   EXIT SUB
END IF
IF Y=0 THEN
   IF X < 0 THEN PRINT "- ";
   PRINT STR$(ABS(X))
   EXIT SUB
END IF
IF X=0 THEN
   IF Y < 0 THEN PRINT "- ";
   IF ABS(Y)= 1 THEN
      PRINT "i"
      EXIT SUB
   END IF
   PRINT STR$(ABS(Y)); " i"
   EXIT SUB
END IF
IF X < 0 THEN PRINT "- ";
PRINT STR$(ABS(X)); " ";
IF Y < 0 THEN PRINT "- ";  ELSE PRINT "+ ";
IF ABS(Y)= 1 THEN
   PRINT "i"
   EXIT SUB
END IF
PRINT STR$(ABS(Y)); " i"
END SUB

EXTERNAL  FUNCTION ATAN2(Y,X) !'-¦Ð¡Á¦Ð
OPTION ARITHMETIC COMPLEX
IF ABS(IM(X))<1E-4 AND ABS(IM(Y))<1E-4 THEN
   LET X=RE(X)
   LET Y=RE(Y)
ELSE
   PRINT "ERROR!!"
   STOP
END IF
LET ATAN2=ANGLE(X,Y)
!' LET L=ACOS(X/SQR(X*X+Y*Y))
!' IF Y<0 THEN LET ATAN2=-L ELSE LET ATAN2=L
END FUNCTION

!EXTERNAL  FUNCTION ATAN2(Y,X) '0¡Á2¦Ð
!OPTION ARITHMETIC COMPLEX
!IF ABS(IM(X))<1E-4 AND ABS(IM(Y))<1E-4 THEN
!   LET X=RE(X)
!   LET Y=RE(Y)
!ELSE
!   PRINT "ERROR!!"
!   STOP
!END IF
!IF X<>0 THEN
!   LET TH=ATN(Y/X)
!   IF Y<>0 THEN
!      IF X>0 AND Y<0 THEN LET TH=TH+PI*2
!      IF X<0 THEN LET TH=TH+PI
!   ELSE
!      IF X<0 THEN LET TH=PI ELSE LET TH=0
!   END IF
!ELSE
!   LET TH=PI/2
!   IF Y<0 THEN LET TH=TH+PI
!END IF
!LET ATAN2=TH
!END FUNCTION
 

16¸µ¿ô

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2009ǯ 9·î27Æü(Æü)13»þ39ʬ21ÉÃ
ÊÖ¿®¡¦°úÍÑ
  16¸µ¿ô¤Î»Í§±é»»¤È´Ø¿ô¤ò¤¤¤¯¤Ä¤«ÄêµÁ¤·¤Æ¤ß¤Þ¤·¤¿¡£


PUBLIC NUMERIC MAXLEVEL
OPTION BASE 0
LET MAXLEVEL=50
DIM A(15),B(15),C(15)
MAT READ A
!'DATA 1,-1 ,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 !'2¸µ¿ô(Ê£ÁÇ¿ô)
!'DATA 1,-1,-1,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 !'4¸µ¿ô(¥¯¥©¡¼¥¿¥Ë¥ª¥ó)
DATA 1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 0, 0, 0 !'8¸µ¿ô(¥ª¥¯¥È¥Ë¥ª¥ó)
!'DATA 1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 !'16¸µ¿ô
MAT READ B
!'DATA 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
!'DATA 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
DATA 2, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0
!'DATA 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
PRINT "A = ";
CALL CPRINT(A)
PRINT "B = ";
CALL CPRINT(B)
CALL CADD(A,B,C)
PRINT "A + B = ";
CALL CPRINT(C)
CALL CSUB(A,B,C)
PRINT "A - B = ";
CALL CPRINT(C)
CALL CMUL(A,B,C)
PRINT "A * B = ";
CALL CPRINT(C)
CALL CMUL(B,A,C)
PRINT "B * A = ";
CALL CPRINT(C) !' A¡ßB¡âB¡ßA
CALL CDIV(A,B,C)
PRINT "A / B = ";
CALL CPRINT(C)
CALL CPOWER(A,B,C)
PRINT "A ^ B=";
CALL CPRINT(C)
CALL CSIN(A,B)
PRINT "SIN(A)=";
CALL CPRINT(B)
CALL CCOS(A,B)
PRINT "COS(A)=";
CALL CPRINT(B)
CALL CTAN(A,B)
PRINT "TAN(A)=";
CALL CPRINT(B)
END

EXTERNAL  SUB HORNER(X(),Y(),K())
MAT Y=ZER
LET Y(0)=K(MAXLEVEL)
FOR I=MAXLEVEL-1 TO 0 STEP -1
   CALL CMUL2(Y,X)
   LET Y(0)=Y(0)+K(I)
NEXT I
END SUB

EXTERNAL  SUB SMUL(A(),N)
MAT A=(N)*A
END SUB

EXTERNAL  SUB COPY(A(),B())
MAT A=B
END SUB

EXTERNAL  SUB CMUL(A(),B(),C())
OPTION BASE 0
DIM T$(15,15)
MAT C=ZER
MAT READ T$
FOR I=0 TO 15
   FOR J=0 TO 15
      IF A(I)<>0 AND B(J)<>0 THEN
         IF T$(I,J)="-0" THEN
            LET C(0)=C(0)-A(I)*B(J)
         ELSE
            LET D=VAL(T$(I,J))
            IF D>=0 THEN
               LET C(D)=C(D)+A(I)*B(J)
            ELSE
               LET C(-D)=C(-D)-A(I)*B(J)
            END IF
         END IF
      END IF
   NEXT J
NEXT I
DATA  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15 !'16¸µ¿ô¾èÀÑɽ (¥¦¥£¥­¥Ú¥Ç¥£¥¢¤è¤ê)
DATA  1, -0,  3, -2,  5, -4, -7,  6,  9, -8,-11, 10,-13, 12, 15,-14
DATA  2, -3, -0,  1,  6,  7, -4, -5, 10, 11, -8, -9,-14,-15, 12, 13
DATA  3,  2, -1, -0,  7, -6,  5, -4, 11,-10,  9, -8,-15, 14,-13, 12
DATA  4, -5, -6, -7, -0,  1,  2,  3, 12, 13, 14, 15, -8, -9,-10,-11
DATA  5,  4, -7,  6, -1, -0, -3,  2, 13,-12, 15,-14,  9, -8, 11,-10
DATA  6,  7,  4, -5, -2,  3, -0, -1, 14,-15,-12, 13, 10,-11, -8,  9
DATA  7, -6,  5,  4, -3, -2,  1, -0, 15, 14,-13,-12, 11, 10, -9, -8
DATA  8, -9,-10,-11,-12,-13,-14,-15, -0,  1,  2,  3,  4,  5,  6,  7
DATA  9,  8,-11, 10,-13, 12, 15,-14, -1, -0, -3,  2, -5,  4,  7, -6
DATA 10, 11,  8, -9,-14,-15, 12, 13, -2,  3, -0, -1, -6, -7,  4,  5
DATA 11,-10,  9,  8,-15, 14,-13, 12, -3, -2,  1, -0, -7,  6, -5,  4
DATA 12, 13, 14, 15,  8, -9,-10,-11, -4,  5,  6,  7, -0, -1, -2, -3
DATA 13,-12, 15,-14,  9,  8, 11,-10, -5, -4,  7, -6,  1, -0,  3, -2
DATA 14,-15,-12, 13, 10,-11,  8,  9, -6, -7, -4,  5,  2, -3, -0,  1
DATA 15, 14,-13,-12, 11, 10, -9,  8, -7,  6, -5, -4,  3,  2, -1, -0
END SUB

EXTERNAL  SUB CMUL2(A(),B())
OPTION BASE 0
DIM C(15)
CALL CMUL(A,B,C)
CALL COPY(A,C)
END SUB

EXTERNAL  SUB CADD(A(),B(),C())
MAT C=A+B
END SUB

EXTERNAL  SUB CSUB(A(),B(),C())
MAT C=A-B
END SUB

EXTERNAL  SUB CDIV(A(),B(),C())
OPTION BASE 0
DIM BB(15),S(15)
CALL CCONJ(B,BB)
CALL CMUL(B,BB,S)
CALL CMUL(A,BB,C)
CALL SMUL(C,1/S(0))
END SUB

EXTERNAL  SUB CCONJ(A(),B())
LET B(0)=A(0)
FOR I=1 TO 15
   LET B(I)=-A(I)
NEXT I
END SUB

EXTERNAL  SUB CPRINT(A())
FOR I=0 TO 15
   IF A(I)<>0 THEN
      IF A(I)<0 THEN
         PRINT " - ";
      ELSE
         IF I>0 AND A(0)<>0 THEN PRINT " + ";
      END IF
      IF ABS(A(I))<>1 OR I=0 THEN PRINT STR$(ABS(A(I)));
      IF I>0 THEN PRINT MID$("ijklmnopqrstuvw",I,1);
   END IF
NEXT I
PRINT
END SUB

EXTERNAL  SUB CSIN(X(),Y())
OPTION BASE 0
DIM V(MAXLEVEL)
CALL SINE(V)
CALL HORNER(X,Y,V)
END SUB

EXTERNAL  SUB CCOS(X(),Y())
OPTION BASE 0
DIM V(MAXLEVEL)
CALL COSINE(V)
CALL HORNER(X,Y,V)
END SUB

EXTERNAL  SUB CTAN(X(),Y())
OPTION BASE 0
DIM XX(15),YY(15)
CALL CSIN(X,XX)
CALL CCOS(X,YY)
CALL CDIV(XX,YY,Y)
END SUB

EXTERNAL  SUB CEXP(X(),Y())
OPTION BASE 0
DIM V(MAXLEVEL)
CALL EXPON(V)
CALL HORNER(X,Y,V)
END SUB

EXTERNAL  SUB CLOG(X(),Y())
OPTION BASE 0
DIM V(MAXLEVEL),A(15),B(15),C(15)
CALL LN(V)
CALL COPY(A,X)
CALL COPY(B,X)
LET A(0)=A(0)-1
LET B(0)=B(0)+1
CALL CDIV(A,B,C)
CALL HORNER(C,Y,V)
CALL SMUL(Y,2)
END SUB

EXTERNAL  SUB CPOWER(X(),Y(),A())
OPTION BASE 0
DIM XX(15),YY(15)
CALL COPY(YY,Y)
CALL CLOG(X,XX)
CALL CMUL2(YY,XX)
CALL CEXP(YY,A)
END SUB

EXTERNAL  SUB SINE(X())
!'SIN(X)
LET  X(1)=1
LET  T=1
FOR I=3 TO MAXLEVEL STEP 2
   LET T=-T/(I-1)/I
   LET  X(I)=T
NEXT I
END SUB

EXTERNAL  SUB COSINE(X())
!'COS(X)
LET  X(0)=1
LET  T=1
FOR I=2 TO MAXLEVEL STEP 2
   LET T=-T/(I-1)/I
   LET  X(I)=T
NEXT I
END SUB

EXTERNAL  SUB EXPON(X())
!'EXP(X)
LET  X(0)=1
LET  T=1
FOR I=1 TO MAXLEVEL
   LET  T=T/I
   LET  X(I)=T
NEXT I
END SUB

EXTERNAL  SUB LN(X())
!'LOG((X-1)/(X+1))
FOR I=1 TO MAXLEVEL
   IF MOD(I,2)=1 THEN LET  X(I)=1/I
NEXT I
END SUB
 

Ìó¿ô

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2009ǯ 9·î27Æü(Æü)13»þ45ʬ33ÉÃ
ÊÖ¿®¡¦°úÍÑ
  Ìó¿ô¤òµá¤á¤ë


OPTION ARITHMETIC COMPLEX
LET  N=10 !'õº÷ÈÏ°Ï
DIM P(-N TO N,-N TO N)
FOR X=0 TO N
   FOR Y=0 TO N
      LET Z=COMPLEX(X,Y)
      PRINT Z;":";
      LET FL=0
      MAT P=ZER
      LET P(0,0)=1  !'0,¡Þ1,¡Þi¤ÏÌó¿ô(?)¤Ç¤Ï¤Ê¤¤
      LET P(1,0)=1
      LET P(0,1)=1
      LET P(-1,0)=1
      LET P(0,-1)=1
      IF P(RE(Z),IM(Z))=0 THEN
      !'IF ISGAUSSIANPRIME(Z)<>0 THEN
      !'   PRINT "ÁÇ¿ô";
      !'ELSE
         FOR A=0 TO N
            FOR B=0 TO N
               FOR I=1 TO -1 STEP -2
                  FOR J=1 TO -1 STEP -2
                     LET V=COMPLEX(A*I,B*J)
                     IF V<>0 THEN
                        LET S=Z/V
                        IF CMOD(Z,V)=0 AND P(RE(S),IM(S))=0 AND P(RE(V),IM(V))=0 THEN
                           PRINT "{";V;",";S;"}";
                           LET P(RE(S),IM(S))=1
                           LET P(RE(V),IM(V))=1
                           LET FL=1
                        END IF
                     END IF
                  NEXT J
               NEXT  I
            NEXT B
         NEXT A
         IF FL=0 THEN PRINT "ÁÇ¿ô";
         !' END IF
      END IF
      PRINT
   NEXT Y
NEXT X
END

EXTERNAL  FUNCTION CINT(Z)
OPTION ARITHMETIC COMPLEX
LET CINT=COMPLEX(INT(RE(Z)),INT(IM(Z)))
END FUNCTION

EXTERNAL  FUNCTION CMOD(X,Y)
OPTION ARITHMETIC COMPLEX
LET CMOD=X-CINT(X/Y)*Y
END FUNCTION

EXTERNAL  FUNCTION ISGAUSSIANPRIME(Z) !'¥¬¥¦¥¹ÁÇ¿ô
OPTION ARITHMETIC COMPLEX
LET  ISGAUSSIANPRIME=0
LET  A = ABS(RE(Z))
LET  B = ABS(IM(Z))
IF A = 0 THEN
   IF MOD(B, 4) = 3 AND ISPRIME(B)<>0 THEN LET  ISGAUSSIANPRIME=-1
END IF
IF B = 0 THEN
   IF MOD(A , 4) = 3 AND ISPRIME(A)<>0 THEN LET  ISGAUSSIANPRIME=-1
END IF
IF ISPRIME(A*A+B*B)<>0 THEN LET  ISGAUSSIANPRIME=-1
END FUNCTION

EXTERNAL  FUNCTION ISPRIME(X)
OPTION ARITHMETIC COMPLEX
IF X=0 OR X=1 THEN
   LET  ISPRIME=0
   EXIT FUNCTION
END IF
IF X=2 THEN
   LET  ISPRIME=-1
   EXIT FUNCTION
END IF
IF MOD(X,2)=0 THEN
   LET  ISPRIME=0
   EXIT FUNCTION
END IF
FOR I=3 TO INT(SQR(X)) STEP 2
   IF MOD(X,I)=0 THEN
      LET  ISPRIME=0
      EXIT FUNCTION
   END IF
NEXT I
LET  ISPRIME=-1
END FUNCTION
 

100¤Þ¤Ç¤ÎÁÇ¿ô

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2009ǯ 9·î27Æü(Æü)13»þ52ʬ56ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¼«Á³¿ô100¤Þ¤Ç¤ÎÁÇ¿ô(?)¤òµá¤á¤ë


PUBLIC NUMERIC N
LET N=10 !'õº÷ÈÏ°Ï (+n+ni+nj+nj+nk..)¡Á(-n-ni-nj-nj-nk..)  (i,j,k...¤Ïµõ¿ôñ°Ì)
DO
   READ L
   IF L=0 THEN STOP
   DATA 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97
   DATA 0
   PRINT L;":";
   IF CHECK(L)=1 THEN PRINT "ÁÇ¿ô"
LOOP
END

EXTERNAL  FUNCTION CHECK(L) !'¥ª¥¯¥È¥Ë¥ª¥ó(8¸µ¿ô)õº÷  (8½Å¥ë¡¼¥×)
OPTION BASE 0
DIM X(15),Y(15),Z(15)
LET X(0)=L
FOR H=0 TO N
   FOR S8=1 TO -1 STEP -2
      LET Y(7)=H*S8
      FOR G=0 TO N
         FOR S7=1 TO -1 STEP -2
            LET Y(6)=G*S7
            FOR F=0 TO N
               FOR S6=1 TO -1 STEP -2
                  LET Y(5)=F*S6
                  FOR E=0 TO N
                     FOR S5=1 TO -1 STEP -2
                        LET Y(4)=E*S5
                        FOR D=0 TO N
                           FOR S4=1 TO -1 STEP -2
                              LET Y(3)=D*S4
                              FOR C=0 TO N
                                 FOR S3=1 TO -1 STEP -2
                                    LET Y(2)=C*S3
                                    FOR B=0 TO N
                                       FOR S2=1 TO -1 STEP -2
                                          LET Y(1)=B*S2
                                          FOR A=0 TO N
                                             FOR S1=1 TO -1 STEP -2
                                                LET Y(0)=A*S1
                                                IF COMP(Y)=0 THEN
                                                   CALL CDIV(X,Y,Z)
                                                   IF COMP(Z)=0 THEN
                                                      LET FR=0
                                                      FOR I=0 TO 15
                                                         IF FRAC(Z(I))<>0 THEN
                                                            LET FR=1
                                                            EXIT FOR
                                                         END IF
                                                      NEXT I
                                                      IF FR=0 THEN
                                                         PRINT "{";
                                                         CALL CPRINT(Y)
                                                         PRINT ",";
                                                         CALL CPRINT(Z)
                                                         PRINT "}"
                                                         LET CHECK=0
                                                         EXIT FUNCTION !'¸«¤Ä¤±¼¡Âè¥ë¡¼¥×ÂǤÁÀÚ¤ê
                                                      END IF
                                                   END IF
                                                END IF
                                             NEXT  S1
                                          NEXT  A
                                       NEXT  S2
                                    NEXT  B
                                 NEXT  S3
                              NEXT C
                           NEXT  S4
                        NEXT  D
                     NEXT  S5
                  NEXT  E
               NEXT  S6
            NEXT  F
         NEXT  S7
      NEXT  G
   NEXT   S8
NEXT  H
LET CHECK=1
END FUNCTION

EXTERNAL  FUNCTION COMP(Y())
OPTION BASE 0
DIM Z(15)
FOR I=1 TO 16
   LET FL=0
   MAT READ Z
   DATA  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 !'0
   DATA  1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 !'1
   DATA -1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
   DATA 0, 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0 !'i
   DATA 0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0
   DATA 0,0, 1,0,0,0,0,0,0,0,0,0,0,0,0,0 !'j
   DATA 0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0
   DATA 0,0,0, 1,0,0,0,0,0,0,0,0,0,0,0,0 !'k
   DATA 0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0
   DATA 0,0,0,0, 1,0,0,0,0,0,0,0,0,0,0,0 !'l
   DATA 0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0
   DATA 0,0,0,0,0, 1,0,0,0,0,0,0,0,0,0,0 !'m
   DATA 0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0
   DATA 0,0,0,0,0,0, 1,0,0,0,0,0,0,0,0,0 !'n
   DATA 0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0
   DATA 0,0,0,0,0,0,0, 1,0,0,0,0,0,0,0,0 !'o
   DATA 0,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0
   !'DATA 0,0,0,0,0,0,0,0, 1,0,0,0,0,0,0,0
   !'DATA 0,0,0,0,0,0,0,0,-1,0,0,0,0,0,0,0
   !'DATA 0,0,0,0,0,0,0,0,0, 1,0,0,0,0,0,0
   !'DATA 0,0,0,0,0,0,0,0,0,-1,0,0,0,0,0,0
   !'DATA 0,0,0,0,0,0,0,0,0,0, 1,0,0,0,0,0
   !'DATA 0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,0
   !'DATA 0,0,0,0,0,0,0,0,0,0,0, 1,0,0,0,0
   !'DATA 0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0
   !'DATA 0,0,0,0,0,0,0,0,0,0,0,0, 1,0,0,0
   !'DATA 0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0
   !'DATA 0,0,0,0,0,0,0,0,0,0,0,0,0, 1,0,0
   !'DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0
   !'DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,0
   !'DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0
   !'DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1
   !'DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1
   FOR J=0 TO 15
      IF Y(J)=Z(J) THEN LET FL=FL+1 !'0,¡Þ1,¡Þi,¡Þj,¡Þk...¤ÏÌó¿ô(?)¤Ç¤Ï¤Ê¤¤
   NEXT J
   IF FL=16 THEN
      LET COMP=1
      EXIT FUNCTION
   END IF
NEXT I
LET COMP=0
END FUNCTION

EXTERNAL  FUNCTION FRAC(X) !'¾®¿ôÉô
LET FRAC=X-INT(X)
END FUNCTION

EXTERNAL  SUB CDIV(A(),B(),C())
OPTION BASE 0
DIM BB(15),S(15)
CALL CCONJ(B,BB)
CALL CMUL(B,BB,S)
CALL CMUL(A,BB,C)
MAT C=(1/S(0))*C
END SUB

EXTERNAL  SUB CCONJ(A(),B()) !'¶¦Ìò¿ô
LET B(0)=A(0)
FOR I=1 TO 15
   LET B(I)=-A(I)
NEXT I
END SUB

EXTERNAL  SUB CPRINT(A())
FOR I=0 TO 15
   IF A(I)<>0 THEN
      IF A(I)<0 THEN
         PRINT " - ";
      ELSE
         IF I>0 THEN PRINT " + ";
      END IF
      IF ABS(A(I))<>1 OR I=0 THEN PRINT STR$(ABS(A(I)));
      IF I>0 THEN PRINT MID$("ijklmnopqrstuvw",I,1);
   END IF
NEXT I
END SUB

EXTERNAL  SUB CMUL(A(),B(),S())
LET S(0)=A(0)*B(0)-A(1)*B(1)-A(2)*B(2)-A(3)*B(3)-A(4)*B(4)-A(5)*B(5)-A(6)*B(6)-A(7)*B(7)-A(8)*B(8)-A(9)*B(9)-A(10)*B(10)-A(11)*B(11)-A(12)*B(12)-A(13)*B(13)-A(14)*B(14)-A(15)*B(15)
LET S(1)=A(0)*B(1)+A(1)*B(0)+A(2)*B(3)-A(3)*B(2)+A(4)*B(5)-A(5)*B(4)-A(6)*B(7)+A(7)*B(6)+A(8)*B(9)-A(9)*B(8)-A(10)*B(11)+A(11)*B(10)-A(12)*B(13)+A(13)*B(12)+A(14)*B(15)-A(15)*B(14)
LET S(2)=A(0)*B(2)-A(1)*B(3)+A(2)*B(0)+A(3)*B(1)+A(4)*B(6)+A(5)*B(7)-A(6)*B(4)-A(7)*B(5)+A(8)*B(10)+A(9)*B(11)-A(10)*B(8)-A(11)*B(9)-A(12)*B(14)-A(13)*B(15)+A(14)*B(12)+A(15)*B(13)
LET S(3)=A(0)*B(3)+A(1)*B(2)-A(2)*B(1)+A(3)*B(0)+A(4)*B(7)-A(5)*B(6)+A(6)*B(5)-A(7)*B(4)+A(8)*B(11)-A(9)*B(10)+A(10)*B(9)-A(11)*B(8)-A(12)*B(15)+A(13)*B(14)-A(14)*B(13)+A(15)*B(12)
LET S(4)=A(0)*B(4)-A(1)*B(5)-A(2)*B(6)-A(3)*B(7)+A(4)*B(0)+A(5)*B(1)+A(6)*B(2)+A(7)*B(3)+A(8)*B(12)+A(9)*B(13)+A(10)*B(14)+A(11)*B(15)-A(12)*B(8)-A(13)*B(9)-A(14)*B(10)-A(15)*B(11)
LET S(5)=A(0)*B(5)+A(1)*B(4)-A(2)*B(7)+A(3)*B(6)-A(4)*B(1)+A(5)*B(0)-A(6)*B(3)+A(7)*B(2)+A(8)*B(13)-A(9)*B(12)+A(10)*B(15)-A(11)*B(14)+A(12)*B(9)-A(13)*B(8)+A(14)*B(11)-A(15)*B(10)
LET S(6)=A(0)*B(6)+A(1)*B(7)+A(2)*B(4)-A(3)*B(5)-A(4)*B(2)+A(5)*B(3)+A(6)*B(0)-A(7)*B(1)+A(8)*B(14)-A(9)*B(15)-A(10)*B(12)+A(11)*B(13)+A(12)*B(10)-A(13)*B(11)-A(14)*B(8)+A(15)*B(9)
LET S(7)=A(0)*B(7)-A(1)*B(6)+A(2)*B(5)+A(3)*B(4)-A(4)*B(3)-A(5)*B(2)+A(6)*B(1)+A(7)*B(0)+A(8)*B(15)+A(9)*B(14)-A(10)*B(13)-A(11)*B(12)+A(12)*B(11)+A(13)*B(10)-A(14)*B(9)-A(15)*B(8)
LET S(8)=A(0)*B(8)-A(1)*B(9)-A(2)*B(10)-A(3)*B(11)-A(4)*B(12)-A(5)*B(13)-A(6)*B(14)-A(7)*B(15)+A(8)*B(0)+A(9)*B(1)+A(10)*B(2)+A(11)*B(3)+A(12)*B(4)+A(13)*B(5)+A(14)*B(6)+A(15)*B(7)
LET S(9)=A(0)*B(9)+A(1)*B(8)-A(2)*B(11)+A(3)*B(10)-A(4)*B(13)+A(5)*B(12)+A(6)*B(15)-A(7)*B(14)-A(8)*B(1)+A(9)*B(0)-A(10)*B(3)+A(11)*B(2)-A(12)*B(5)+A(13)*B(4)+A(14)*B(7)-A(15)*B(6)
LET S(10)=A(0)*B(10)+A(1)*B(11)+A(2)*B(8)-A(3)*B(9)-A(4)*B(14)-A(5)*B(15)+A(6)*B(12)+A(7)*B(13)-A(8)*B(2)+A(9)*B(3)+A(10)*B(0)-A(11)*B(1)-A(12)*B(6)-A(13)*B(7)+A(14)*B(4)+A(15)*B(5)
LET S(11)=A(0)*B(11)-A(1)*B(10)+A(2)*B(9)+A(3)*B(8)-A(4)*B(15)+A(5)*B(14)-A(6)*B(13)+A(7)*B(12)-A(8)*B(3)-A(9)*B(2)+A(10)*B(1)+A(11)*B(0)-A(12)*B(7)+A(13)*B(6)-A(14)*B(5)+A(15)*B(4)
LET S(12)=A(0)*B(12)+A(1)*B(13)+A(2)*B(14)+A(3)*B(15)+A(4)*B(8)-A(5)*B(9)-A(6)*B(10)-A(7)*B(11)-A(8)*B(4)+A(9)*B(5)+A(10)*B(6)+A(11)*B(7)+A(12)*B(0)-A(13)*B(1)-A(14)*B(2)-A(15)*B(3)
LET S(13)=A(0)*B(13)-A(1)*B(12)+A(2)*B(15)-A(3)*B(14)+A(4)*B(9)+A(5)*B(8)+A(6)*B(11)-A(7)*B(10)-A(8)*B(5)-A(9)*B(4)+A(10)*B(7)-A(11)*B(6)+A(12)*B(1)+A(13)*B(0)+A(14)*B(3)-A(15)*B(2)
LET S(14)=A(0)*B(14)-A(1)*B(15)-A(2)*B(12)+A(3)*B(13)+A(4)*B(10)-A(5)*B(11)+A(6)*B(8)+A(7)*B(9)-A(8)*B(6)-A(9)*B(7)-A(10)*B(4)+A(11)*B(5)+A(12)*B(2)-A(13)*B(3)+A(14)*B(0)+A(15)*B(1)
LET S(15)=A(0)*B(15)+A(1)*B(14)-A(2)*B(13)-A(3)*B(12)+A(4)*B(11)+A(5)*B(10)-A(6)*B(9)+A(7)*B(8)-A(8)*B(7)+A(9)*B(6)-A(10)*B(5)-A(11)*B(4)+A(12)*B(3)+A(13)*B(2)-A(14)*B(1)+A(15)*B(0)
END SUB

!EXTERNAL  SUB CMUL(A(),B(),C())
!OPTION BASE 0
!DIM T$(15,15)
!MAT C=ZER
!MAT READ T$
!FOR I=0 TO 15
!   FOR J=0 TO 15
!      IF A(I)<>0 AND B(J)<>0 THEN
!         IF T$(I,J)="-0" THEN
!            LET C(0)=C(0)-A(I)*B(J)
!         ELSE
!            LET D=VAL(T$(I,J))
!            IF D>=0 THEN
!               LET C(D)=C(D)+A(I)*B(J)
!            ELSE
!               LET C(-D)=C(-D)-A(I)*B(J)
!            END IF
!         END IF
!      END IF
!   NEXT J
!NEXT I
!DATA  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15 '16¸µ¿ô¾èÀÑɽ
!DATA  1, -0,  3, -2,  5, -4, -7,  6,  9, -8,-11, 10,-13, 12, 15,-14
!DATA  2, -3, -0,  1,  6,  7, -4, -5, 10, 11, -8, -9,-14,-15, 12, 13
!DATA  3,  2, -1, -0,  7, -6,  5, -4, 11,-10,  9, -8,-15, 14,-13, 12
!DATA  4, -5, -6, -7, -0,  1,  2,  3, 12, 13, 14, 15, -8, -9,-10,-11
!DATA  5,  4, -7,  6, -1, -0, -3,  2, 13,-12, 15,-14,  9, -8, 11,-10
!DATA  6,  7,  4, -5, -2,  3, -0, -1, 14,-15,-12, 13, 10,-11, -8,  9
!DATA  7, -6,  5,  4, -3, -2,  1, -0, 15, 14,-13,-12, 11, 10, -9, -8
!DATA  8, -9,-10,-11,-12,-13,-14,-15, -0,  1,  2,  3,  4,  5,  6,  7
!DATA  9,  8,-11, 10,-13, 12, 15,-14, -1, -0, -3,  2, -5,  4,  7, -6
!DATA 10, 11,  8, -9,-14,-15, 12, 13, -2,  3, -0, -1, -6, -7,  4,  5
!DATA 11,-10,  9,  8,-15, 14,-13, 12, -3, -2,  1, -0, -7,  6, -5,  4
!DATA 12, 13, 14, 15,  8, -9,-10,-11, -4,  5,  6,  7, -0, -1, -2, -3
!DATA 13,-12, 15,-14,  9,  8, 11,-10, -5, -4,  7, -6,  1, -0,  3, -2
!DATA 14,-15,-12, 13, 10,-11,  8,  9, -6, -7, -4,  5,  2, -3, -0,  1
!DATA 15, 14,-13,-12, 11, 10, -9,  8, -7,  6, -5, -4,  3,  2, -1, -0
!END SUB
 

Re: 100¤Þ¤Ç¤ÎÁÇ¿ô

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2009ǯ 9·î27Æü(Æü)13»þ55ʬ0ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.579[¸µµ­»ö¤Ø]

100¤Þ¤Ç¤Î¼«Á³¿ô¤Ë¤ÏÌó¿ô¤¬Â¸ºß¤·¡¢Á´¤Æ³ä¤êÀÚ¤ì¤ë¡£¤è¤Ã¤ÆÁÇ¿ô¤Ï¤Ê¤¤(?)¡£¡¡¥Á¥ã¥ó¡¢¥Á¥ã¥ó(¾Ð)

(¤â¤·¤«¤¹¤ë¤È¡¢Á´¤Æ¤Î¼«Á³¿ô¤¬³ä¤êÀÚ¤ì¤ë¤Î¤«¤â¤·¤ì¤Ê¤¤)

(Ãí)¡¡Ìó¿ô¤Ï¤Þ¤ÀÊ£¿ôÁȸºß¤¹¤ë¤È»×¤ï¤ì¤ë
2 :{1 + i,1 - i}
3 :{1 + i + j,1 - i - j}
5 :{2 + i,2 - i}
7 :{2 + i + j + k,2 - i - j - k}
11 :{3 + i + j,3 - i - j}
13 :{3 + 2i,3 - 2i}
17 :{4 + i,4 - i}
19 :{3 + 3i + j,3 - 3i - j}
23 :{3 + 3i + 2j + k,3 - 3i - 2j - k}
29 :{5 + 2i,5 - 2i}
31 :{5 + 2i + j + k,5 - 2i - j - k}
37 :{6 + i,6 - i}
41 :{5 + 4i,5 - 4i}
43 :{5 + 3i + 3j,5 - 3i - 3j}
47 :{6 + 3i + j + k,6 - 3i - j - k}
53 :{7 + 2i,7 - 2i}
59 :{7 + 3i + j,7 - 3i - j}
61 :{6 + 5i,6 - 5i}
67 :{7 + 3i + 3j,7 - 3i - 3j}
71 :{6 + 5i + 3j + k,6 - 5i - 3j - k}
73 :{8 + 3i,8 - 3i}
79 :{7 + 5i + 2j + k,7 - 5i - 2j - k}
83 :{9 + i + j,9 - i - j}
89 :{8 + 5i,8 - 5i}
97 :{9 + 4i,9 - 4i}
 

Re: ÁÇ¿ô

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ 9·î27Æü(Æü)15»þ23ʬ21ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.565[¸µµ­»ö¤Ø]

kikiriri¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> £±¤È¤½¤Î¿ô¼«¿È¤Ç³ä¤êÀÚ¤ì¤Ê¤¤¼«Á³¿ô
> £±¤ÏÁÇ¿ô¤È¤¹¤ë¡¢¤³¤Î¤È¤­¡¢
> £±,£²,£³,£µ,£·,£±£±,£±£³,£±£·¡¤£±£¹¡¤£²£³¡¤£²£¹¡¤£³£±¡¤£³£·¤Ï¡¢
> £±¤«¤é£´£°¤Þ¤Ç¤ÎÁÇ¿ô¤Ç¤¹¤¬´Ö°ã¤Ã¤Æ¤Þ¤»¤ó¤«


¡É> £±¤È¤½¤Î¿ô¼«¿È¤Ç³ä¤êÀÚ¤ì¤Ê¤¤¼«Á³¿ô¡É

¾å¤Ï´Ö°ã¤¤¤Ç¡¢

1¤È¤½¤Î¿ô¼«¿È°Ê³°¤Î¿ô¤Ç³ä¤êÀÚ¤ì¤Ê¤¤¿ô¤Ç¤·¤¿

´Ö°ã¤¤¤ò²þ¤áÈ¿¾Ê¤·¤Þ¤¹
 

Re: 100¤Þ¤Ç¤ÎÁÇ¿ô

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ 9·î27Æü(Æü)17»þ26ʬ54ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.579[¸µµ­»ö¤Ø]

¤·¤Ð¤Ã¤Á¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¤·¤Ð¤Ã¤Á¤µ¤ó¤Ø¡¢
kikiriri¤è¤ê¡¢
ÁÇ¿ô¤òµá¤á¤ë¥×¥í¥°¥é¥à¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
¥×¥í¥°¥é¥à¤ÏÆɤá¤Ê¤¤¤ó¤Ç¤¹¤¬¡£
100¤Þ¤Ç¤ÎÁÇ¿ô½Ð¤Þ¤·¤¿¡£
°Õ³°¤È»þ´Ö¤¬¤«¤«¤ê¤Þ¤·¤¿

Àµ¸í¤Î³Îǧ¤â¤·¤Æ¤¤¤Ê¤¤¤Î¤Ç¤¹¤¬(°Ê²¼URL¤è¤ê³Îǧ¤·¤Þ¤·¤¿)

¡É£±¡É¤¬½Ð¤Æ¤³¤Ê¤¤¤Ç¤¹¤Í¡É£±¡É¤Ã¤ÆÁÇ¿ô¤Ç¤Ï¤Ê¤¤¤Î¤Ç¤¹¤«¡©

¡Ê¡Ö¡É£±¡É¤ÏÁÇ¿ô¤Ç¤Ï¤Ê¤¤¡×Ãæ3¤Î»²¹Í½ñ¤è¤ê¡Ë

¶ö¿ô¤Ë¤Ä¤¤¤Æ²¿¤«»×¤¦¤È¤³¤í¤Ï¤¢¤ê¤Þ¤¹¤«¡©

http://members.jcom.home.ne.jp/sansuu/nyuushi/sosuuhyou/sosuu3000.html
 

Re: 100¤Þ¤Ç¤ÎÁÇ¿ô

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2009ǯ 9·î27Æü(Æü)19»þ53ʬ59ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.582[¸µµ­»ö¤Ø]

kikiriri¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¼ÂºÝ¤Ëµá¤á¤Æ¤¤¤ë¤Î¤Ï(4¸µ¿ô¤Ç¤Î)Ìó¿ô¤Ç¤¹¡£(¥×¥í¥°¥é¥à¤Ç¤Ï8¸µ¿ô¤Çõº÷)
Ìó¿ô¤¬Â¸ºß¤·¤Ê¤¤¤È¤­¡¢¤½¤Î¿ô¤¬ÁÇ¿ô¤À¤È¤¤¤¨¤ë¤È»×¤¤¤Þ¤¹¡£
100¤Þ¤Ç¤Î¼«Á³¿ô¤Ë¤Ï¡¢Á´¤ÆÌó¿ô(4¸µ¿ô)¤¬¤¢¤ë¤¿¤á¡¢ÁÇ¿ô¤Ï¤Ê¤¤¤È¤·¤Æ¤¤¤Þ¤¹¡£
Âê̾¤ò¡Ö100¤Þ¤Ç¤ÎÌó¿ô¡×¤È¤¹¤ì¤ÐÎɤ«¤Ã¤¿¤Î¤«¤â¤·¤ì¤Þ¤»¤ó¡£
ÁÇ¿ô¤Ï¡Ö1¤È¤½¤Î¿ô¼«¿È¤Ç¤·¤«³ä¤ì¤Ê¤¤¿ô¡×¤È¤·¤Æ¤¤¤ë¤Î¤Ç£±¤Ï´Þ¤Þ¤Ê¤¤¤È¤·¤Æ¤¤¤Þ¤¹¡£(¤Á¤Ê¤ß¤Ë1=-i¡ßi¤Èʬ²ò¤Ç¤­¤ë)
ƱÍͤ˵õ¿ôñ°Ì¤Î¡Þi,¡Þj,¡Þk...¤â³°¤·¤Æ¤¤¤Þ¤¹¡£(i^2=-1,j^2=-1,k^2=-1...)
¶ö¿ô¤Ë¤Ä¤¤¤Æ¤Ï»×¤¤¤Ä¤¯¤³¤È¤Ï¤¢¤ê¤Þ¤»¤ó¡£
 

Re: 100¤Þ¤Ç¤ÎÁÇ¿ô

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ 9·î27Æü(Æü)21»þ03ʬ39ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.583[¸µµ­»ö¤Ø]

¤·¤Ð¤Ã¤Á¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¤·¤Ð¤Ã¤Á¤µ¤ó¤Ø

¡¡kikiriri¤è¤ê

ÁᮤΤ´ÊÖ¿®¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£

Æñ¤·¤¤¤³¤È¤Ï¤è¤¯Ê¬¤«¤ê¤Þ¤»¤ó¤¬¡¢

i^2=-1¡¡i=¢å¡Ê-1¡Ë¡¡¤Ï¤«¤í¤¦¤¸¤Æ»×¤¤½Ð¤»¤Þ¤·¤¿¡£

¿¼¡¸µ¤È¤¤¤¦¤È¡¢¹ÔÎóɽµ­(Àþ·ÁÂå¿ô¡Ö¤Ë¤¬¤Æ¡×¤ò»×¤¤½Ð¤·¤Þ¤¹.)

°õºþ¤·¤¿¥×¥í¥°¥é¥à¤ò¸«¤¿´¶¤¸¤Ç¤Ï¡¢²¿¤È¤â¤¤¤¨¤Þ¤»¤ó¤¬(²òÀâ¤Ê¤·¤Î¥×¥í¥°¥é¥à¤¬Æɤá¤Ê¤¤¡£¡Ë

¿¼¡¸µ¹ÔÎó·×»»¤Ï¥×¥í¥°¥é¥à¤Ç¤Ï¤³¤¦½ñ¤¯¤Î¤Ç¤¹¤Í¡©¡Ê¤¢¤Ã¤Æ¤Þ¤¹¤«¡©(Ū³°¤ì¡©¡Ë¡Ë

¤·¤«¤âÁÇ¿ô¤òõº÷¤·¤Ê¤¬¤é¡£

¤³¤¦¤¤¤¦¤Î¥¢¥ë¥´¥ê¥º¥à¤ò¹Íθ¤·¤¿¥×¥í¥°¥é¥à¤È¤¤¤¦¤ó¤Ç¤¹¤Í¡©

¤â¤·µ¹¤·¤±¤ì¤Ð¹©Éפ·¤¿ÅÀ¤Ê¤ó¤Æ¶µ¤¨¤Æ¤¤¤¿¤À¤±¤Ê¤¤¤Ç¤¹¤«¡©¡Ê¤¹¤ß¤Þ¤»¤ó¡Ë

ËÍ¤Ë¤Ï¥×¥í¥°¥é¥à¤ÏÆɤá¤Þ¤»¤ó¤¬(ʬ¤«¤ê¤ä¤¹¤¯ÀâÌÀ¤¹¤ë¤Ë¤Ï¼ê´Ö¤È¤¤¤¦¤«¥»¥ó¥¹¤¬É¬Íפˤʤ俤ꤷ¤ÆËͤˤ½¤ì¤¬¤¢¤ë¤«¤É¤¦¤«¤Ï¤Ê¤¾¤Ç¤¹¡£¡Ë


°Ê¾å¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿
 

Re: 100¤Þ¤Ç¤ÎÁÇ¿ô¡Ê¤¹¤ß¤Þ¤»¤ó¡Ë

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ 9·î28Æü(·î)18»þ48ʬ58ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.584[¸µµ­»ö¤Ø]

¥×¥í¥°¥é¥à¤¬Æɤá¤Ê¤¤Ëͤˡ¢¤³¤Î¥×¥í¥°¥é¥à¤ÎÆâÍƤò²òÀ⤷¤ÆÍߤ·¤¤¤È¤¤¤¦¤Î¤Ï¡¢

¤·¤Ð¤Ã¤Á¤µ¤ó¤Ë¤È¤Ã¤ÆÌÂÏǤʤ³¤È¤Ç¤Ï¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£

¤·¤«¤â¤³¤ÎĹʸ¼ºÎ餷¤Þ¤·¤¿¡¢¼Ø­¤Î¤è¤¦¤Ç¤¹¤Í¡¢¡Ê¤¹¤ß¤Þ¤»¤ó¡Ë



¤·¤Ð¤Ã¤Á¤µ¤ó¤Ø


¡¡¡¡kikiriri¤è¤ê
 

Re: 100¤Þ¤Ç¤ÎÁÇ¿ô¡Ê¤¹¤ß¤Þ¤»¤ó¡Ë

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2009ǯ 9·î28Æü(·î)20»þ19ʬ27ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.585[¸µµ­»ö¤Ø]

kikiriri¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

²òÀâ¤È¤¤¤¦¤Ï¤¢¤Þ¤êÆÀ°Õ¤Ç¤Ï¤Ê¤¤¤¿¤á¡¢±ó褵¤»¤Æ¤¤¤¿¤À¤­¤¿¤¤¤Î¤Ç¤¹¤¬
DATAʸ¤Ç¼«Á³¿ô¤Ç¤Î¡ÖÁÇ¿ô¡×¤òÍ¿¤¨¡¢¤½¤ì¤¬8¸µ¿ô¤Ç³ä¤êÀÚ¤ì¤ë¤«¤òÄ´¤Ù¤Æ¤¤¤Þ¤¹¡£
CHECK¥ë¡¼¥Á¥ó¤Ç¼ÂºÝ¤Ë¥ë¡¼¥×¤ò¤Ä¤¯¤ê8¸µ¿ô¤òÀ¸À®¤·¤Æ¤¤¤Þ¤¹¡£
ÀäÂÐÃͤò¾®¤µ¤¤Êý¤«¤éÀ¸À®¤·¤¿¤¤¤Î¤Ç¥ë¡¼¥×(S1,S2,S3..)¤ÇÉä¹æ¤òȿž¤µ¤»¤Æ¤¤¤Þ¤¹¡£
COMP¥ë¡¼¥Á¥ó¤Ç¤ÏÀ¸À®¤·¤¿8¸µ¿ô¤¬ 0,¡Þ1,¡Þi,¡Þj,¡Þk...(i,j,k..¤Ïµõ¿ôñ°Ì)¤Ç³ä¤ê»»¤·¤Ê¤¤¤¿¤á¤Î¤â¤Î¤Ç¤¹¡£
CDIV¥ë¡¼¥Á¥ó¤Ç¼ÂºÝ¤Ë³ä¤ê»»¤ò¹Ô¤¤¤Þ¤¹¡£·ë²Ì¤òÇÛÎóZ¤ËÊÖ¤·¤Þ¤¹¡£
·×»»·ë²Ì¤¬¡Þ1,¡Þi,¡Þj,¡Þk..¤Ç¤Ê¤¤¤³¤È¤òCOMP¥ë¡¼¥Á¥ó¤ÇÄ´¤Ù¤Þ¤¹¡£(Ìó¿ô¤Ç¤Ï¤Ê¤¤¤¿¤á)
FRAC¥ë¡¼¥Á¥ó¤Ï¾®¿ôÉô¤òÍ¿¤¨¡¢¤³¤ì¤¬0¤Ê¤é³ä¤êÀڤ줿¤È¤·¤ÆCPRINT¥ë¡¼¥Á¥ó¤Çɽ¼¨¤µ¤»¥ë¡¼¥×¤òæ½Ð¤µ¤»¤Æ¤¤¤Þ¤¹¡£
ñ½ã¤Ê¥ë¡¼¥×¤Ë¤è¤ëõº÷¥×¥í¥°¥é¥à¤Ê¤Î¤Ç·è¤·¤ÆÆñ¤·¤¯¤Ï¤Ê¤¤¤È»×¤¤¤Þ¤¹¡£
¤¢¤ÈCCONJ¥ë¡¼¥Á¥ó¤Ï¶¦Ìò¿ô(A+Bi+Cj+Dk¤Ê¤éA-Bi-Cj-Dk)¤òÍ¿¤¨¡¢¤³¤ì¤Ï³ä¤ê»»¤¹¤ë»þ¤ËʬÊì¤ò¼Â¿ô²½¤¹¤ë¤¿¤á»È¤¤¤Þ¤¹¡£
(A+Bi)/(C+Di)=(A+Bi)(C-Di)/{(C+Di)(C-Di)}=(AC-BD+BCi+ADi)/(C^2+D^2)
CMUL¥ë¡¼¥Á¥ó¤Ï16¸µ¿ô¤Ç¤Î³Ý¤±»»¤ò¤·¤Þ¤¹¡£¤½¤Îˡ§¤ò¾èÀÑɽ¤ÇDATAʸ¤Ë¤è¤êÍ¿¤¨¤Æ¤¤¤Þ¤¹¡£
º¸¾å¤«¤é±¦¤Ë1,i,j,k,...²¼Êý¸þ¤Ë¤â1,i,j,k...(i,j,k..¤Ïµõ¿ôñ°Ì)¤Èʤó¤Ç¤¤¤Þ¤¹¡£
¸òº¹¤·¤¿¿ô»ú¤¬¡Þ0¤Ê¤é¼Â¿ô¡¢1°Ê¹ß¤Ê¤éi,j,k..¤ÈÂбþ¤·¤Æ¤¤¤Þ¤¹¡£i¡ßj¤Ê¤éº¸¾å0¤«¤é±¦¤Ë2ÈÖÌܤȺ¸¾å¤«¤é²¼¤Ø3ÈÖÌܤÇ-3
¤Ä¤Þ¤êi¡ßj=-k¤È¤Ê¤ê¤Þ¤¹¡£
CMUL¥ë¡¼¥Á¥ó¤¬2¤Ä¤¢¤ê¤Þ¤¹¤¬¾èÀÑɽ¤«¤é¿ô¼°¤ËÊÑ´¹¤·¤¿Êý¤ò¼ÂºÝ¤Î·×»»¤Ç»È¤Ã¤Æ¤¤¤Þ¤¹¡£
¤Ê¤ª¡¢¤³¤³¤Ç¤Ï S(8)°Ê¹ß¤ÏÃí¼á¤Ç¤â¹½¤¤¤Þ¤»¤ó¡£
¥ë¡¼¥×¤òÁý¤ä¤·16¸µ¿ô¤Çõº÷¤µ¤»¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¤·¡¢(COMP¥ë¡¼¥Á¥óÆâDATAʬ¤ÎÃí¼á¤ò³°¤·¡¢¥ë¡¼¥×²ó¿ô¤ò16¤«¤é32¤ËÊѹ¹¤¹¤ë)
¥ë¡¼¥×¤ò¸º¤é¤·4¸µ¿ô¤Çõº÷¤µ¤»¤Æ¹â®²½¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£(CHECK¥ë¡¼¥Á¥óÆâ¥ë¡¼¥×E°Ê¹ß¤òÃí¼á¤Ë¤¹¤ë)
kikiriri¤µ¤ó¤¬»×¤¦¤è¤¦¤Ë²þ¤¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£(¥á¥¤¥ó¥ë¡¼¥Á¥óDATAʸ¤Î¿ôÃͤò½ñ¤­´¹¤¨¤Æ¤ß¤ë,õº÷ÈÏ°ÏN¤Î¿ôÃͤòÊѤ¨¤Æ¤ß¤ëÅù)
¤½¤·¤Æ¡¢¤¼¤Ò¥×¥í¥°¥é¥à¤¬Æɤá¤Æ½ñ¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¯¤À¤µ¤¤¡£³Ú¤·¤ß¤âÇÜÁý¤·¤Þ¤¹¡£
Æä˾¿Í¤¬ÃΤé¤Ê¤¤¤è¤¦¤Ê·×»»·ë²Ì¤òÆÀ¤ë¤³¤È¤Ï¡Ö²÷´¶¡×¤Ç¤¹¡£(±ß¼þΨ¤Ê¤É¤Ï´û¤Ë¿¤¯·×»»¤µ¤ì¤Æ¤¤¤ë)
¥Ù¥¿¤Êʸ¾Ï¤Ç¤¹¤ß¤Þ¤»¤ó¡£(by ¤·¤Ð¤Ã¤Á ¥Á¥ã¥ó¥Á¥ã¥ó)
 

Re: 100¤Þ¤Ç¤ÎÁÇ¿ô¡Ê¤¹¤ß¤Þ¤»¤ó¡Ë

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ 9·î29Æü(²Ð)07»þ40ʬ42ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.586[¸µµ­»ö¤Ø]

¤·¤Ð¤Ã¤Á¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¤·¤Ð¤Ã¤Á¤µ¤ó¤Ø

¡¡¡¡kikiriri¤è¤ê

ËͤˤÏʬ¤«¤ê¤Þ¤»¤ó¤¬¡¢ÁᮤΤ´ÊÖ¿®¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£

°õºþ¤·¤Æ²¿ÅÙ¤«Æɤßľ¤½¤¦¤«¤È¤Ï»×¤¤¤Þ¤¹¤¬¡¢

8¸µ¿ô¤Ã¤Æ²¿¤Ç¤¹¤«

¤¹¤ß¤Þ¤»¤ó


kikiriri¤è¤ê
 

Re: 100¤Þ¤Ç¤ÎÁÇ¿ô¡Ê¤¹¤ß¤Þ¤»¤ó¡Ë

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ 9·î29Æü(²Ð)08»þ24ʬ1ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.586[¸µµ­»ö¤Ø]

¤·¤Ð¤Ã¤Á¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¤·¤Ð¤Ã¤Á¤µ¤ó¤Ø

¡¡¡¡kikiriri¤è¤ê

¡ä¤½¤·¤Æ¡¢¤¼¤Ò¥×¥í¥°¥é¥à¤¬Æɤá¤Æ½ñ¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¯¤À¤µ¤¤¡£³Ú¤·¤ß¤âÇÜÁý¤·¤Þ¤¹¡£

Îɤ¤¤´½õ¸ÀÅù¤¢¤ê¤Þ¤·¤¿¤é¤ª´ê¤¤¤·¤Þ¤¹¡£
 

ÁÇ¿ô¤Î¼è¤ê½Ð¤·

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ 9·î29Æü(²Ð)12»þ36ʬ51ÉÃ
ÊÖ¿®¡¦°úÍÑ
      1   2   3   4   5   6
    7   8   9¡¡10  11  12
   13  14  15  16  17  18
   19  20  21  22  23  24
   25  26  27  28  29  30
   31  32  33  34  35  36
   37  38  39  40  41  42
   43  44  45  46  47  48
   49  50  51  52  53  54
   55  56  57  58  59  60
   61  62  63  64  65  66
   67  68  69  70  71  72
   73  74  75  76  77  78
   79  80  81  82  83  84
   85  86  87  88  89  90
   91  92  93  94  95  96
   97  98  99 100 101 102
  103 104 105 106 107 108
  109 110 111 112 113 114
  115 116 117 118 119 120

¤Îɽ¤Ç¼¡¤Î£±£±ËܤÎľÀþ¤ò°ú¤¯
£¸¡Ý£±£±£¶
£¹¡Ý£±£±£·
£´¡Ý£±£±£¸
£¶¡Ý£±£²£°¡¡  °Ê¾å½ÄÀþ£´ËÜ

£±£°¡Ý£²£µ
£³£°¡Ý£µ£µ
£¶£°¡Ý£¸£µ
£¹£°¡Ý£±£±£µ¡¡°Ê¾å±¦¾å¤¬¤ê¼Ð¤áÀþ£´ËÜ

£±£´¡Ý£´£²
£´£¹¡Ý£¸£´
£¹£±¡Ý£±£±£¹¡¡°Ê¾åº¸¾å¤¬¤ê¼Ð¤áÀþ£³ËÜ

¾Ã¤µ¤ì¤º¤Ë»Ä¤Ã¤¿¿ô»ú¤¬ÁÇ¿ô¤Ç¤¹¡£¡Ê£±¤Ï½ü³°¤¹¤ë¤³¤È¡£¡Ë
 

Re: 100¤Þ¤Ç¤ÎÁÇ¿ô¡Ê¤¹¤ß¤Þ¤»¤ó¡Ë

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2009ǯ 9·î29Æü(²Ð)19»þ33ʬ31ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.588[¸µµ­»ö¤Ø]

kikiriri¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

4¸µ¿ô¡¢8¸µ¿ô¡¢16¸µ¿ô¤È¤Ï¡¢Ê£ÁÇ¿ô¤Î³µÇ°¤ò³ÈÄ¥¤·¤¿¤â¤Î¤Ç¤¹¡£
¾Ü¤·¤¤¤³¤È¤Ï¥Í¥Ã¥È¾å¤ÇÄ´¤Ù¤é¤ì¤ë¤È»×¤¤¤Þ¤¹¡£
»ä¤â¥¦¥£¥­¥Ú¥Ç¥£¥¢¤ÇÃΤê¤Þ¤·¤¿¡£
¾¿Í¤¬ºî¤Ã¤¿¥×¥í¥°¥é¥à¤ÏÎɤ¤ÊÙ¶¯¤Ë¤Ê¤ê¤Þ¤¹¡£
»ä¤â¤³¤Î·Ç¼¨Èľå¤Î¥×¥í¥°¥é¥à¤ä¥Í¥Ã¥È¾å¤Î¥½¡¼¥¹¥×¥í¥°¥é¥à¤Ê¤É
ÂçÊÑ»²¹Í¤Ë¤·¤Æ¤¤¤Þ¤¹¡£
¥Í¥Ã¥È¾å¤Ë¤Ï¤¤¤í¤¤¤í¤Ê¥×¥í¥°¥é¥à¥³¡¼¥É¤¬¸ø³«¤µ¤ì¤Æ¤¤¤Þ¤¹¤«¤é
¤½¤ì¤é¤ò»²¹Í¤Ë¤·¡¢¼«Ê¬¤Ê¤ê¤Ë½ñ¤­´¹¤¨¤¿¤ê¡¢ºî¤Ã¤Æ¤ß¤ë¤³¤È¤À¤È»×¤¤¤Þ¤¹¡£
¥Í¥Ã¥È¾å¤Ë¤Ï¾ðÊ󤬰î¤ì¤Æ¤¤¤Þ¤¹¤«¤é¡¢¤½¤ÎÃ椫¤é¼«Ê¬¤¬»²¹Í¤Ë¤·¤¿¤¤¾ðÊó¤ò
¤¦¤Þ¤¯¸«¤Ä¤±¤Æ¤¤¤¯¤³¤È¤¬Âç»ö¤À¤È»×¤¤¤Þ¤¹¡£
 

¸æÊÖ¿®¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ 9·î30Æü(¿å)08»þ58ʬ24ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.590[¸µµ­»ö¤Ø]

¤·¤Ð¤Ã¤Á¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¤·¤Ð¤Ã¤Á¤µ¤ó¤Ø

¡¡¡¡kikiriri¤è¤ê


> ¾¿Í¤¬ºî¤Ã¤¿¥×¥í¥°¥é¥à¤ÏÎɤ¤ÊÙ¶¯¤Ë¤Ê¤ê¤Þ¤¹¡£
> »ä¤â¤³¤Î·Ç¼¨Èľå¤Î¥×¥í¥°¥é¥à¤ä¥Í¥Ã¥È¾å¤Î¥½¡¼¥¹¥×¥í¥°¥é¥à¤Ê¤É
> ÂçÊÑ»²¹Í¤Ë¤·¤Æ¤¤¤Þ¤¹¡£
> ¥Í¥Ã¥È¾å¤Ë¤Ï¤¤¤í¤¤¤í¤Ê¥×¥í¥°¥é¥à¥³¡¼¥É¤¬¸ø³«¤µ¤ì¤Æ¤¤¤Þ¤¹¤«¤é
> ¤½¤ì¤é¤ò»²¹Í¤Ë¤·¡¢¼«Ê¬¤Ê¤ê¤Ë½ñ¤­´¹¤¨¤¿¤ê¡¢ºî¤Ã¤Æ¤ß¤ë¤³¤È¤À¤È»×¤¤¤Þ¤¹¡£
> ¥Í¥Ã¥È¾å¤Ë¤Ï¾ðÊ󤬰î¤ì¤Æ¤¤¤Þ¤¹¤«¤é¡¢¤½¤ÎÃ椫¤é¼«Ê¬¤¬»²¹Í¤Ë¤·¤¿¤¤¾ðÊó¤ò
> ¤¦¤Þ¤¯¸«¤Ä¤±¤Æ¤¤¤¯¤³¤È¤¬Âç»ö¤À¤È»×¤¤¤Þ¤¹¡£

¤´½õ¸À¤¢¤ê¤¬¤È¤¦¡¢¤´¡¦¤¶¡¦¤¤¡¦¤Þ¡¦¤¹¡£¡Ê¤¹¤ß¤Þ¤»¤ó¡Ë»²¹Í¤Ë¤·¤¿¤¤¤Ç¤¹¡£
 

Re: ÁÇ¿ô¤Î¼è¤ê½Ð¤·

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ 9·î30Æü(¿å)13»þ12ʬ28ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.589[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

GAI¤µ¤ó¤Ø

¡¡¡¡kikiriri¤è¤ê

°õºþ¤·¤ÆÀþ¤ò°ú¤¤¤Æ¡¢1¤ò¾Ã¤·¤Æ¡¢»Ä¤Ã¤¿¿ô¤ò¡û¤Ç°Ï¤ß

²¼µ­¡¡URL¤è¤ê¥Á¥§¥Ã¥¯¤·¤Æ¸«¤ë¤È¡¢¤Á¤ã¤ó¤È¹ç¤Ã¤Æ¤Þ¤·¤¿¡£


ÉԻ׵ĤÀ¤Ê¡Á¤Î°ì¸À¤Ç¤¹¤Í¡£

http://members.jcom.home.ne.jp/sansuu/nyuushi/sosuuhyou/sosuu3000.html
 

¤¹¤ß¤Þ¤»¤óÊÔ½¸¤µ¤»¤Æ¤¤¤¿¤À¤­¤Þ¤·¤¿¡Ê°Ê²¼¤ÎÍѸì¤Ë¤Ä¤¤¤Æ¾ðÊóÂԤġË

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ 9·î30Æü(¿å)16»þ34ʬ8ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ¤¹¤Ç¤Ë¤´ÊÖÅú¤Ï¤¢¤ê¤Þ¤·¤¿¤¬Ê¬¤«¤é¤Ê¤¤¤Î¤Ç
¤â¤·²÷¤¯¤´ÊÖÅú¤Ç¤­¤ëÊý¤¬¤¤¤é¤Ã¤·¤ã¤ì¤Ð
µ¹¤·¤¯¤ª´ê¤¤¤·¤Þ¤¹¡£


´ûÃÎÅÀ
´Ñ¬ÃÍ
´Ñ¬ÃÍ¡¢¥³¥¢¥Õ¥¡¥¯¥¿
̤Ãοô
¼«Í³ÅÙR¡¡¢¨¾ò·ïÊýÄø¼°¤Î¿ô
¾ò·ïÊýÄø¼° UV=t
Áê´Ø¼° NK=t¡¢N=UG(Ut)¤è¤ê¡¢K=(Ni)t¤òµá¤á¤ë
ÊäÀµÃͤη׻»¡Êmm¡Ë V=G(Ut)K
ºÇ³ÎÃÍ X~=X+V
ÀºÅ٤η׻»¡Êmm^2¡Ë ¦Ò^2=(Kt)NK/r
ʬ»¶¹ÔÎó¡Êmm^2¡Ë ¦Ò^2*Gx¡¢Gx=G-G(Ut)(Ni)UG

°Ê¾å¤ÎÍѸì¤Ë¤Ä¤¤¤Æ¡¢
ÀâÌÀ¤ª´ê¤¤¤Ç¤­¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£
 

Re: ¬Î̺Ǿ®Æó¾èË¡¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ 9·î30Æü(¿å)17»þ05ʬ56ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.255[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

»³ÃæϵÁ¤µ¤ó¤Ø

¡¡¡¡kikiriri¤è¤ê

°Ê²¼¤Î¥×¥í¥°¥é¥à¤Î²òÀ⤪´ê¤¤¤Ç¤­¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡¢BASIC½é¿´¼Ô¤Ç¡¢¿ô³Ø¤Ë´Ø¤·¤Æ¤â¹â¹»

¥ì¥Ù¥ë¤À¤È¤·¤Æ

¼Â¹Ô¤µ¤»¤Þ¤·¤¿·ë²Ì¤ÎÆɤßÊý¤¬Ê¬¤«¤ê¤Þ¤»¤ó¡£

Ï©Àþ£±¡Á£µ
ÅÀ£Ð
ÅÀ£Ñ

ÃͤÎ̾Á°¤¬½Ð¤Æ¤¤¤Þ¤¹¤¬

Ï©Àþ£±¡Á£µ¤ÏÃͤ¬ÊѤï¤Ã¤Æ¤¤¤Þ¤¹¤Í¡¢»Í¼Î¸ÞÆþ¤¹¤ë¤È¤¹¤ì¤Ð¡ÊDATAÃÍ¡Ë

Ï©Àþ£±¡á¡Ý£¶¡¥£²£²£´¡Ê¡Ý£¶¡¥£²£²£µ¡Ë¡Ê¡Ü£°¡¥£°£°£±¡Ë¡¡¹âÄ㺹¡Ê£í¡Ë°Ê²¼Æ±¤¸
Ï©Àþ£²¡á¡Ý£µ¡¥£²£´£µ¡Ê¡Ý£µ¡¥£²£´£µ¡Ë¡Ê¡Þ£°¡¥£°£°£°¡Ë
Ï©Àþ£³¡á¡¡£°¡¥£²£·£·¡Ê¡¡£°¡¥£²£·£¸¡Ë¡Ê¡Ý£°¡¥£°£°£±¡Ë
Ï©Àþ£´¡á¡Ý£°¡¥£³£¹£¸¡Ê¡Ý£°¡¥£³£¹£¹¡Ë¡Ê¡Ü£°¡¥£°£°£±¡Ë
Ï©Àþ£µ¡á¡¡£µ¡¥£¸£¸£°¡Ê¡¡£µ¡¥£¸£·£¹¡Ë¡Ê¡Ü£°¡¥£°£°£±¡Ë

µáÅÀ£Ð¤È£Ñ¡Ê¤¿¤Ö¤óɸ¹â¤À¤È»×¤¦¤Î¤Ç¤¹¤¬¡Ë

ÅÀ£Ð¡¡£±£¹¡¥£´£²£±¡¡£±£¹¡¥£´£²£±¡¡Î¾Êýɸ¹â¡Ê£í¡Ë°Ê²¼Æ±¤¸
ÅÀ£Ñ¡¡£²£µ¡¥£³£°£±¡¡£²£µ¡¥£³£°£±

£²¤ÄÃͤ¬½Ð¤Æ¤¤¤ë°ÕÌ£¤¬Ê¬¤«¤ê¤Þ¤»¤ó¡Ê»Í¼Î¸ÞÆþ¤¹¤ì¤ÐƱ¤¸¡Ë

¤È¡¢»×¤¦¤Î¤Ç¤¹¤¬¡¢¤Ê¤Ë¤È¤¾¤´»ØƳ¤Î¤Û¤Éµ¹¤·¤¯¤ª´ê¤¤¤·¤Þ¤¹¡£



> kikiriri¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£
>
> »²¹Í¥µ¥¤¥È¡¡http://hw001.gate01.com/kazuok/geodetic/leveling.html
>
> Full BASIC¤Î¾ì¹ç¡¢¹ÔÎ󤬷׻»¤Ç¤­¤ë¤Î¤Ç¡¢Â¾¤Î¸À¸ì¤è¤ê¤Ï´Êñ¤Ë·×»»¤Ç¤­¤ë¤È»×¤¤¤Þ¤¹¡£
> ¤¿¤À¡¢£²¹à±é»»¤Þ¤Ç¤Ç¤¹¤«¤é¡¢Å¸³«¤·¤Ê¤¬¤é¤³¤Ä¤³¤Ä·×»»¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
>
> ¤Þ¤¿¡¢É½·×»»¤ÎÊý¤¬GUI¤ò´Þ¤á¤Æ¼ÂÍѲ½¤·°×¤¤¤«¤â¤·¤ì¤Þ¤»¤ó¡£
>
>
> ¾åµ­¥µ¥¤¥È¤ÎÎãÂê¡ÊPDF¥Õ¥¡¥¤¥ëÆâ¡Ë¤Î¥µ¥ó¥×¥ë¥³¡¼¥Ç¥£¥ó¥°
>
> <PRE>
> !ºÇ¾®£²¾èË¡¤Ë¤è¤ë¬ÎÌÌÖÊ¿¶Ñ¡Ê¾ò·ïÊýÄø¼°Ë¡¡Ë
>
> !£È·¿
> !¡¡ £Á¡¡¡¡£Ã
> !¡¡1¢­ 5¡¡¢­3
> ! ¡¡£Ð ¢ª £Ñ
> !¡¡2¢¬¡¡¡¡¢¬4
> ! ¡¡£Â¡¡¡¡£Ä
>
> !´ûÃÎÅÀ
> LET C=4 !¿ô
>
> DATA 25.645 !£ÁÅÀ¤Îɸ¹â¡Êm¡Ë
> DATA 24.666 !£ÂÅÀ
> DATA 25.024 !£ÃÅÀ
> DATA 25.699 !£ÄÅÀ
> DIM Z(C)
> MAT READ Z
>
> !´Ñ¬ÃÍ
> LET P=5 !¿ô
>
> DATA -6.225, 0.44 !Ï©Àþ£±¡¡¹âÄ㺹¡Êm¡Ë¡¢Ï©ÀþĹ¡Êkm¡Ë
> DATA -5.245, 0.25 !Ï©Àþ£²
> DATA  0.278, 0.33 !Ï©Àþ£³
> DATA -0.399, 0.26 !Ï©Àþ£´
> DATA  5.879, 0.44 !Ï©Àþ£µ
>
> DIM X(P),G(P,P) !´Ñ¬ÃÍ¡¢¥³¥¢¥Õ¥¡¥¯¥¿
> MAT G=ZER
> FOR i=1 TO P
>    READ X(i),G(i,i)
> NEXT i
> MAT PRINT X;
> MAT PRINT G;
>
>
> !̤Ãοô
> LET Px=2 !µáÅÀ£Ð¤È£Ñ
>
>
> !------------------------------
>
> !¼«Í³ÅÙR¡¡¢¨¾ò·ïÊýÄø¼°¤Î¿ô
> LET R=P-Px
>
>
> !¾ò·ïÊýÄø¼° UV=t
> DIM U(R,P)
> DATA 1,-1,0,0,0 !ÅÀ£Ð¤Ë¤Ä¤¤¤Æ HA+h1~=HB+h2~ ¤è¤ê¡¢(h1+v1)-(h2+v2)=HB-HA¡¡¡èv1-v2=-(h1+HA)+(h2+HB)
> DATA 0,0,1,-1,0 !ÅÀ£Ñ¤Ë¤Ä¤¤¤Æ HC+h3~=HD+h4~
> DATA 1,0,0,-1,1 !ÅÀ£Ð¤ÈÅÀ£Ñ¤Ë¤Ä¤¤¤Æ HA+h1~+h5~=HD+h4~
> MAT READ U
>
> DIM t(R,1)
> FOR i=1 TO R
>    LET s=0
>    FOR j=1 TO P
>       IF j>C THEN LET Zj=0 ELSE LET Zj=Z(j)
>       LET s=s-(X(j)+Zj)*U(i,j)
>    NEXT j
>    LET t(i,1)=s
> NEXT i
> !!!LET t(1,1)=-X(1)+X(2)-Z(1)+Z(2) !0.001
> !!!LET t(2,1)=-X(3)+X(4)-Z(3)+Z(4) !-0.002
> !!!LET t(3,1)=-X(1)+X(4)-X(5)-Z(1)+Z(4) !0.001
> MAT PRINT t;
>
>
> !------------------------------
>
> !Áê´Ø¼° NK=t¡¢N=UG(Ut)¤è¤ê¡¢K=(Ni)t¤òµá¤á¤ë
> DIM Ut(P,R)
> MAT Ut=TRN(U)
> DIM TMP(P,R) !G(Ut)¡¡¢¨¼¡¤Ç¤â»È¤¦
> MAT TMP=G*Ut
> DIM N(R,R)
> MAT N=U*TMP
> MAT PRINT N;
>
> DIM invN(R,R)
> MAT invN=INV(N)
> DIM K(R,1)
> MAT K=invN*t
>
> MAT PRINT K;
>
>
> !ÊäÀµÃͤη׻»¡Êmm¡Ë V=G(Ut)K
> DIM V(P,1)
> MAT V=TMP*K
>
> MAT PRINT V;
>
>
> !ºÇ³ÎÃÍ X~=X+V
> FOR i=1 TO P
>    PRINT "Ï©Àþ";STR$(i);"=";X(i)+V(i,1)
> NEXT i
> PRINT "ÅÀ£Ð";Z(1)+(X(1)+V(1,1)); Z(2)+(X(2)+V(2,1)) !Í­¸ú·å¿ô ##.###
> PRINT "ÅÀ£Ñ";Z(3)+(X(3)+V(3,1)); Z(4)+(X(4)+V(4,1))
>
>
>
>
> !ÀºÅ٤η׻»¡Êmm^2¡Ë ¦Ò^2=(Kt)NK/r
> DIM s2(1,1),Kt(1,R)
> MAT Kt=TRN(K)
> MAT s2=Kt*t !NK=t
> LET sigma2=s2(1,1)/R
>
> PRINT "¦Ò^2=";sigma2
>
>
> !ʬ»¶¹ÔÎó¡Êmm^2¡Ë ¦Ò^2*Gx¡¢Gx=G-G(Ut)(Ni)UG
> DIM Gx(P,P)
> MAT Gx=TMP*invN !G(Ut)(Ni)
> MAT Gx=Gx*U
> MAT Gx=Gx*G
> MAT Gx=G-Gx
> MAT Gx=sigma2*Gx
>
> MAT PRINT Gx;
>
>
> END
> </PRE>
 

ºÂɸ¼´¿ô»ú°ÌÃÖ¼«Æ°Ä´À°

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ10·î 2Æü(¶â)22»þ15ʬ55ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ½½¿ÊBASIC¤Î¼´¡¦³Ê»Ò¤òÉÁ¤¯Áȹþ¤ß³¨ÄêµÁ AXES(p,q),GRID(p,q)¤ò¡¢¤¤¤Ä¤Ç¤â¿ô»ú¤¬ÉÁ²è¤µ¤ì¤ë¤è¤¦¤Ë³ÈÄ¥¤·¤Þ¤·¤¿¡£
ÉÁ²èÎΰèÆâ¤ËºÂɸ¼´¤¬¤Ê¤¤¾ì¹ç¡¢²¼Ã¼º¸Ã¼¤Ë¿ô»ú¤òÉÁ¤­¤Þ¤¹¡£
¡ÊÃí°Õ¡§¿ô»ú¤Î"0"¤Î°ÌÃÖ¤Ïɬ¤º¤·¤â¸¶ÅÀ(0,0)¤ò¼¨¤·¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡Ë
¿ô»úʸ»úÎó¤¬Ä¹¤¤¤È¤­¤Ï¾®¿ôÉôʬ¤ò¥«¥Ã¥È¤·¡¢½Å¤Ê¤Ã¤ÆÉÁ²è¤µ¤ì¤ë¤Î¤ò²óÈò¤·¤Þ¤¹¡£(»Ø¿ôÉô¤Î¤¢¤ë¾ì¹ç¤ò½ü¤¯)
AXES0(p,q),AXES(p,q)¤Ç¤Ï¡¢ºÂɸ¼´¤¬ÉÁ²è¤µ¤ì¤Ê¤¤¤È¤­¤Ë¤ÏÉÁ²èÎΰè¼þ°Ï¤ËÌÜÀ¹Àþ¤òÉÁ²è¤¹¤ë¤è¤¦¤Ë¤·¤Þ¤·¤¿¡£
ξ¼´¤È¤âÉÁ²è¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢Áȹþ¤ß³¨ÄêµÁ¤ÈƱ¤¸·ë²Ì¤Ë¤Ê¤ê¤Þ¤¹¡£

´û¸¤Î¥×¥í¥°¥é¥à¤Ë¡¢140¹ÔEND°Ê²¼¤Î³°Éô³¨ÄêµÁ¤òÉղ乤ë¤À¤±¤Ç³ÈÄ¥¤Ç¤­¤Þ¤¹¡£¤ª»î¤·¤¯¤À¤µ¤¤¡£
¡ÊÃí°Õ¡§°ú¿ô¤Î¤Ê¤¤DRAW AXES,DRAW GRID¤Ê¤É¤Ï¥¨¥é¡¼¤È¤Ê¤ë¡Ë


100 SET WINDOW 2,10,5,13
    !SET WINDOW -4,4,-4,4
    !SET WINDOW -3,5,4,12
110 LET a=1  ! a=.425
120 LET b=1
130 DRAW AXES(a,b)
    !DRAW AXES0(a,b)
    !DRAW GRID(a,b)
    !DRAW GRID0(a,b) ! Áȹþ¤ß³¨ÄêµÁ
140 END

REM ** ºÂɸ¿ô»ú°ÌÃÖ¼«Æ°Ä´À° **
EXTERNAL PICTURE AXES(p,q)
    DRAW axes_grid("on","ax",STR$(p),STR$(q))
END PICTURE
EXTERNAL PICTURE AXES0(p,q)
    DRAW axes_grid("off","ax",STR$(p),STR$(q))
END PICTURE
EXTERNAL PICTURE GRID(p,q)
    DRAW axes_grid("on","gr",STR$(p),STR$(q))
END PICTURE
!
!½½¿ÊBASICźÉÕ"\BASICw32\Library\Grid2.lib"»²¾È
! num$="off"¿ô»ú̵,"on"¿ô»úÍ­ , ag$="ax"¼´,"gr"³Ê»Ò , sx=x¼´ÌÜÀ¹´Ö³Ö , sy=y¼´ÌÜÀ¹´Ö³Ö
EXTERNAL PICTURE axes_grid(num$,ag$,sx$,sy$)
    OPTION ARITHMETIC DECIMAL
    FUNCTION val_r(f$)  ! Í­Íý¿ô¤ò¾®¿ô¤ËÊÑ´¹
       LET vrp=POS(f$,"/")
       IF vrp=0 THEN LET val_r=VAL(f$) ELSE LET val_r=VAL(f$(1:vrp-1))/VAL(f$(vrp+1:LEN(f$)))
    END FUNCTION
    FUNCTION round_cut$(a$,A,s)  ! ¾®¿ô·å¥«¥Ã¥È
       ASK TEXT WIDTH(a$) w
       LET d=LEN(a$)
       LET p=POS(a$,".")
       IF w>s AND p>0 AND POS(a$,"E")=0 AND d>2 AND NOT(d=3 AND a$(1:2)="-." OR a$(d:d)=".") THEN
          LET a$=STR$(SGN(A)*ROUND(ABS(A),d-p-1))
          ! LET a$=STR$(ROUND(A,d-p-1))
          IF POS(a$,".")>0 THEN LET a$=a$&"00000000" ELSE LET a$=a$&".00000000"
          LET a$=round_cut$(a$(1:d-1),A,s)
       END IF
       LET round_cut$=a$
    END FUNCTION
    LET sx=val_r(sx$)
    LET sy=val_r(sy$)
    ASK WINDOW L,R,B,T
    ASK LINE STYLE S
    ASK LINE COLOR C
    SET LINE COLOR 15   ! ¶ä¿§
    ASK TEXT COLOR TC
    SET TEXT COLOR 15   ! ¶ä¿§
    ASK TEXT JUSTIFY ts1$,ts2$
    SET LINE STYLE 1
    PLOT LINES:L,0;R,0  ! x¼´
    PLOT LINES:0,B;0,T  ! y¼´
    IF ag$="gr" THEN SET LINE STYLE 3
    IF sx<>0 THEN
       IF B*T<0 OR T=0 THEN SET TEXT JUSTIFY "RIGHT","TOP" ELSE SET TEXT JUSTIFY "RIGHT","BOTTOM"
       IF B*T<0 OR T=0 THEN LET y0=0 ELSE LET y0=B
       LET wy=WORLDY(PIXELY(0)+2)
       LET n=ABS(INT(LOG10(sx)-2))
       FOR X=CEIL(L/sx)*sx TO INT(R/sx)*sx+1.001*sx STEP sx
          IF ag$="gr" THEN PLOT LINES:X,B;X,T ELSE PLOT LINES:X,-wy;X,wy
          IF y0=B AND ag$="ax" THEN
             PLOT LINES:X,B-(T-B)/100;X,WORLDY(3)  ! ²¼Ã¼ÌÜÀ¹Àþ
             PLOT LINES:X,T+(T-B)/100;X,WORLDY(PIXELY(T)-3)  ! ¾åüÌÜÀ¹Àþ
          END IF
          IF num$="on" THEN PLOT TEXT,AT X,y0 : round_cut$(STR$(ROUND(X,n)),X,sx)
       NEXT X
    END IF
    IF sy<>0 THEN
       IF L*R<0 OR R=0 THEN SET TEXT JUSTIFY "RIGHT","TOP" ELSE SET TEXT JUSTIFY "LEFT","TOP"
       IF L*R<0 OR R=0 THEN LET x0=0 ELSE LET x0=L
       LET wx=WORLDX(PIXELX(0)+2)
       LET n=ABS(INT(LOG10(sy)-2))
       FOR Y=CEIL(B/sy)*sy TO INT(T/sy)*sy+1.001*sy STEP sy
          IF ag$="gr" THEN PLOT LINES:L,Y;R,Y ELSE PLOT LINES:-wx,Y;wx,Y
          IF x0=L AND ag$="ax" THEN
             PLOT LINES:L-(R-L)/100,Y;WORLDX(3),Y  ! º¸Ã¼ÌÜÀ¹Àþ
             PLOT LINES:R+(R-L)/100,Y;WORLDX(PIXELX(R)-3),Y  ! ±¦Ã¼ÌÜÀ¹Àþ
          END IF
          IF num$="on" THEN PLOT TEXT,AT x0,Y : STR$(ROUND(Y,n))
       NEXT Y
    END IF
    SET TEXT JUSTIFY "RIGHT","TOP"
    IF num$="on" AND sx=0 AND sy=0 THEN PLOT TEXT,AT 0,0:STR$(0)
    SET LINE COLOR C
    SET LINE STYLE S
    SET TEXT COLOR TC
    SET TEXT JUSTIFY ts1$,ts2$
END PICTURE
 

Re: ¬Î̺Ǿ®Æó¾èË¡¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ10·î 3Æü(ÅÚ)11»þ46ʬ59ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.594[¸µµ­»ö¤Ø]

kikiriri¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£


»²¹Í¥µ¥¤¥È¤ÎURL¤¬Êѹ¹¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤Ç¤¹¡£
¼ê½ç¤ª¤è¤ÓÍýÏÀ¤Ï¡¢¤³¤Î¥µ¥¤¥È¤ÎPDF¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£

¡¡http://hw001.gate01.com/kazuok/page03.html¡¡¢¨Ä¾¥ê¥ó¥¯¤Ç¤¹¤Î¤Ç¡¢Êѹ¹¤µ¤ì¤ë²ÄǽÀ­¤Ï¤¢¤ê¤Þ¤¹¡£

¡¡¥Ç¥¸¥¿¥ë¼Ì¿¿Â¬ÎÌ¡¡http://hw001.gate01.com/kazuok/index.html
¡¡¢¨¡Ö¥Ý¥±¥³¥ó¥×¥í¥°¥é¥à¤Ë¤è¤ë¬ÎÌ·×»»Ë¡¡Ê»³³¤Æ²¡Ë¡×¤ÎÃø¼Ô¤Î¤è¤¦¤Ç¤¹¡£


¤Þ¤¿¡¢Á°²ó¾Ò²ð¤·¤¿Ëܤμê·×»»Éôʬ¤ò¥×¥í¥°¥é¥à¤·¤¿¤â¤Î¤ò·ÇºÜ¤·¤Þ¤¹¡£»²¹Í¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£
!ºÇ¾®£²¾èË¡¤Ë¤è¤ë¬ÎÌÌÖÊ¿¶Ñ¡Ê´Ñ¬ÊýÄø¼°¡Ë

!»²¹Íʸ¸¥¡¡ºÇ¾®¥Ë¾èË¡¤È¬ÎÌÌÖÊ¿¶Ñ¤Î´ðÁá¡ÅìÍνÐÈÇ¡¡p.170¡Á173¡Êp.165¡Á177¡Ë

!´ûÃÎÅÀ
LET H301=41.7065 !301ÅÀ¤Îɸ¹â¡Êm¡Ë
LET H302=43.9632 !302ÅÀ


!´Ñ¬ÃÍ
LET n=6 !¿ô

DATA  5.1342, 4.6 !Ï©Àþ£±¡¡´Ñ¬Èæ¹â¡Ê¹âÄ㺹¡Ë¡Êm¡Ë¡¢Ï©Àþµ÷Î¥¡Êkm¡Ë
DATA -2.0508, 5.2 !Ï©Àþ£²
DATA -2.2287, 9.2 !Ï©Àþ£³
DATA -0.0330, 6.3 !Ï©Àþ£´
DATA -0.8601, 3.9 !Ï©Àþ£µ
DATA -0.8258, 8.3 !Ï©Àþ£¶

DIM Hb(n),P(n,n) !´Ñ¬ÃÍ¡¢½ÅÎ̹ÔÎó
MAT P=ZER
FOR i=1 TO n
   READ Hb(i),Wi
   LET P(i,i)=1/Wi
NEXT i

MAT PRINT Hb; !debug
MAT PRINT P; !debug


!¿·ÅÀ¡Ê̤ÃÎÅÀ¡Ë
LET m=3 !¿ô
LET pnt$="£±£²£³"


!------------------------------¡¡´Ñ¬ÊýÄø¼°¤Î°ìÈ̼° V=A*X+L¤òÁȤßΩ¤Æ¤ë¡¡p.170¡Á171

DIM A(n,m) !·¸¿ô¹ÔÎó¡¡¢¨³ÆÏ©Àþ¤Î´Ñ¬Èæ¹â¤È¿·ÅÀɸ¹â¤È¤Î´Ø·¸¤è¤ê
DATA -1, 1, 0
DATA  0,-1, 0
DATA  0, 0, 1
DATA  0, 0,-1
DATA  1, 0,-1
DATA  1, 0, 0
MAT READ A

DIM L(n,1) !Äê¿ô¹à
LET L(1,1)=-Hb(1)
LET L(2,1)=-(Hb(2)-H302)
LET L(3,1)=-(H302+Hb(3))
LET L(4,1)=-(Hb(4)-H301)
LET L(5,1)=-Hb(5)
LET L(6,1)=-(H301+Hb(6))

MAT PRINT A; !debug
MAT PRINT L; !debug


!------------------------------¡¡ÊýÄø¼°¤Î²ò¡ÊX~¡Ë¤òµá¤á¤ë¡¡p.172Ãæ

DIM TT(50,50),MM(50,50) !ºî¶ÈÍÑ

MAT TT=TRN(A) !TRN(A)*P*A¤Î·×»»
MAT TT=TT*P
MAT MM=TT !save it
MAT TT=TT*A
MAT PRINT TT; !debug

DIM Q(m,m) !½Å¤ß·¸¿ô¹ÔÎó Q=INV(TRN(A)*P*A)¤Î·×»»
MAT Q=INV(TT)
MAT PRINT Q; !debug


MAT TT=MM*L !TRN(A)*P*L¤Î·×»»
MAT PRINT TT; !debug


DIM Xb(m,1) !ºÇ³ÎÃÍ X~
MAT TT=Q*TT
MAT Xb=(-1)*TT
MAT PRINT Xb; !debug


!------------------------------ ÌÖÊ¿¶Ñ¤ÎºÇ½ª·ë²Ì¡¡p.172Ãæ¡Á173

DIM Vb(n,1) !»Äº¹¥Ù¥¯¥È¥ë V~=L-A*INV(TRN(A)*P*A)*TRN(A)*P*L¤Î·×»»
MAT TT=A*Xb !Xb=-INV(TRN(A)*P*A)*TRN(A)*P*L¤è¤ê
MAT Vb=L+TT
MAT PRINT Vb; !debug

MAT TT=TRN(Vb) !ñ°Ì½Å¤ß¤Îɸ½àÊк¹¦Ò0¤Î¿äÄêÃÍ m0=SQR(TRN(V~)*P*V~/(m-n))¤Î·×»»
MAT TT=TT*P
MAT TT=TT*Vb
MAT PRINT TT; !debug
LET m0=SQR(TT(1,1)/(n-m))
PRINT "m0="; m0 !debug

FOR i=1 TO m
   PRINT pnt$(i:i); "ÅÀ¤Îɸ¹â"; Xb(i,1);"m"; !Í­¸ú·å¿ô ##.####
   PRINT "¡¡¡Þ"; m0*SQR(Q(i,i)); "mm" !Í­¸ú·å¿ô #.#
NEXT i


END
 

¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ10·î 3Æü(ÅÚ)14»þ38ʬ57ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ÁᮤΤ´ÊÖ¿®¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£  

Áê´Ø¼°¤ÎɬÍ×À­¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ10·î 3Æü(ÅÚ)16»þ55ʬ14ÉÃ
ÊÖ¿®¡¦°úÍÑ
  »³ÃæϵÁ¤µ¤ó¤Ø

¡¡¡¡kikiriri¤è¤ê

²¿ÅÙ¤â¼ÁÌ䤷¤Æ¤¹¤ß¤Þ¤»¤ó¡£

º£²ó¤Î¥×¥í¥°¥é¥à¤ÇÁê´Ø¼°¤¬¤Ê¤¤¤è¤¦¤Ç¤¹¤¬
Àµ¤ÎÁê´Ø¤¬¤¢¤ë¤È¤«Éé¤ÎÁê´Ø¤¬¤¢¤ë¤Ê¤É¤Î¤è¤¦¤Ë»È¤¦¤ó¤Ç¤¹¤è¤Í¡£
ɬÍ×À­¤Î¸¡Æ¤ÊýË¡¡¢¥×¥í¥°¥é¥à¤ÎÁªÂòÊýË¡¡Ê¤É¤ó¤Ê¤È¤­¤Ë¤É¤Á¤é¤Î¥×¥í¥°¥é¥à¤ò»È¤¦¤ÈÎɤ¤¡Ë¤È¤«¤¢¤ê¤Þ¤¹¤«¡£
 

³ÎΨ¡¦Åý·×¡¡»§Ëà½çµÈÃø¤¢¤ê¡£

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ10·î 3Æü(ÅÚ)17»þ18ʬ14ÉÃ
ÊÖ¿®¡¦°úÍÑ
  »³ÃæϵÁ¤µ¤ó¤Ø

¡¡¡¡kikiriri¤è¤ê

ÅöÊý¼ê¸µ¤Ë¡Ö³ÎΨŽ¥Åý·×¡×»§Ëà½çµÈÃø¤¢¤ê¤Þ¤¹¡£
¤´»ØƳÃæ°úÍѤµ¤ì¤Æ¤âÅԹ礬Îɤ¤¤Ç¤¹¡£
¾¡¼ê¤ÊÄɲ乤ߤޤ»¤ó¡£
 

³ØÀ¸»þÂå¤ÎÌÑÁÛ

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ10·î 3Æü(ÅÚ)18»þ01ʬ14ÉÃ
ÊÖ¿®¡¦°úÍÑ
  »³ÃæϵÁ¤µ¤ó¤Ø

¡¡¡¡kikiriri¤è¤ê

¹©³ØÉô¤Ç¤·¤¿¤¬¡¢¥Ñ¥½¥³¥ó¤¬²ò·è¤Ç¤­¤Ê¤¤ÌäÂê¤Ê¤é¤¤¤¯¤é¤Ç¤â¤¢¤ë¤³¤È¤â¡¢
¼ê·×»»¤äÅÅÂî¤ÇÌäÂê¤ò²ò¤¯¼êÁ°¡¢¥Ñ¥½¥³¥ó¤¬¤É¤ì¤À¤±Í­ÍѤ«¤âʬ¤«¤Ã¤Æ¤¿¤Ï¤º¤Ê¤ó¤Ç¤¹¤¬¡¢
Í­¸ÂÍ×ÁÇË¡¤Ë¤Ä¤¤¤Æ¤â¤¦¤Û¤È¤ó¤É˺¤ì¤Þ¤·¤¿¤¬¡¢
¥Ñ¥½¥³¥ó¤Ç¼ÂºÝ¤ËÌäÂê¤È¸þ¤­¤¢¤¤¼ê¤ò½Ð¤¹¤³¤È¤Ë½Å¤ß¤ò´¶¤¸¤Þ¤¹¡£
 

Í­¸ú·å¿ô¤ÈÀºÅ٤ˤĤ¤¤Æ

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ10·î 3Æü(ÅÚ)18»þ27ʬ11ÉÃ
ÊÖ¿®¡¦°úÍÑ
  »³ÃæϵÁ¤µ¤ó¤Ø

¡¡¡¡kikiriri¤è¤ê

Í­¸ú·å¿ô¡©£±£¶·å¡©¤Ç·×»»¤·¤Æ¤¤¤Þ¤¹¤¬¡¢
Åú¤¨¤Ï»Í¼Î¸ÞÆþ¤¹¤ì¤Ð¤¢¤Ã¤Æ¤¤¤Þ¤¹¤¬¡¢
¶öÁ³¤Î°ìÃפǤϡ¢·åÍî¤Á¤Ï¤Ê¤¤¤Î¤Ç¤¹¤«¡©
¤Þ¤¿¡¢¤³¤ì¤â½é³Ø¼Ô¤Î¼ÁÌä¤À¤È»×¤¤¤Þ¤¹¤¬¡£
Àµµ¬Ê¬ÉۿޤϤɤÎÄøÅÙÀºÅÙ¤¬¿®Íê½ÐÍè¤ë¤Î¤Ç¤¹¤«¡£
²¿·å½Ð¤·¤Æ¤â¡¢ÀºÅ٤ϵ¤¤Ë¤¹¤ë¤³¤È¤Ï¤Ê¤¤¤È¤«¡¢
¤À¤Ã¤¿¤é£±£¶·å¤Ç·×»»¤·¤Æ¤¤¤ëº£²ó¤Î·×»»ÊýË¡¤âÎɤ¤¤Î¤Ç¤Ï¤Ê¤¤¤Î¤«¤È¤â»×¤¤¤Þ¤¹¤¬¡¢
½ã¿è¤ÊÍýÏÀ¾å¤Ï´°Á´¤ËÁ´·å¿®ÍѤ·¤Æ¡¢½ÐÍè¤ë¤À¤±Â¿·å¤Ç·×»»¤·¤Æ¡£
²òÅú¤¹¤ë»þ¤Ë¡¢Í­¸ú·å¿ô¡¢Í­¸úÀºÅÙ¤òÄ´¤Ù¤ë¤È¤¤¤¦¤³¤È¤Ç¤¹¤«¡£
¤³¤ÎÊդϤܤ«¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤Ë¤â¸«¤¨¤Þ¤¹¡©
 

Re: Í­¸ú·å¿ô¤ÈÀºÅ٤ˤĤ¤¤Æ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ10·î 3Æü(ÅÚ)19»þ36ʬ30ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.601[¸µµ­»ö¤Ø]

kikiriri¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¤ï¤«¤ëÈϰϤǤβóÅú¤Ç¤¹¡£

>Í­¸ú·å¿ô¤ÈÀºÅ٤ˤĤ¤¤Æ

¼°¤Ï¤¢¤¯¤Þ¤Ç¤âÍýÏÀÃͤǤ¹¤¬¡¢¥Ñ¥½¥³¥ó¤¬°·¤¦¿ôÃÍ·×»»¡Ê¼Â¿ô¤Î°·¤¤¡Ë¤Ï¶á»÷ÃͤǤ¹¤«¤é¡¢
¸íº¹¤ÏȯÀ¸¤·¤Þ¤¹¡£
¤³¤Î¾ì¹ç¡¢É¸¹â¤Î·×¬ÃͤϾ®¿ôÅÀ£´·å¡Ê301ÅÀ¤Ê¤é41.7065¡Ë¤Ç¤¹¤Î¤Ç¡¢
·×»»·ë²Ì¤Ï¾®¿ôÅÀ£µ·å¤ò»Í¼Î¸ÞÆþ¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£


>¥Ñ¥½¥³¥ó¤Ç¼ÂºÝ¤ËÌäÂê¤È¸þ¤­¤¢¤¤¼ê¤ò½Ð¤¹¤³¤È¤Ë½Å¤ß¤ò´¶¤¸¤Þ¤¹¡£

¾¤Î¥Ú¡¼¥¸¤Î·×»»Éôʬ¤ò¥×¥í¥°¥é¥à¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£Åê¹Æ¤òÂԤäƤ¤¤Þ¤¹¡£


>¥×¥í¥°¥é¥à¤ÎÁªÂòÊýË¡

»²¹ÍËܤÎP.138²¼¡Á140Ãæ¡£
 

¤´ÊÖ¿®¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹(¤¿¤Ó¤¿¤Ó¤¹¤ß¤Þ¤»¤ó¤¬¤Þ¤¿ÊÔ½¸¤µ¤»¤Æ¤¤¤¿¤À¤­¤Þ¤·¤¿¡Ë

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ10·î 3Æü(ÅÚ)20»þ10ʬ0ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  »³ÃæϵÁ¤µ¤ó¤Ø

¡¡¡¡kikiriri¤è¤ê

ÁᮤΤ´ÊÖ¿®¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£

¿¾¯¡¢¤¦¤ì¤·¤¤¶½Ê³µ¤Ì£¤Ç¤¹¤¬¡¢¤¹¤ß¤Þ¤»¤ó
>¼°¤Ï¤¢¤¯¤Þ¤Ç¤âÍýÏÀÃͤǤ¹¤¬¡¢¥Ñ¥½¥³¥ó¤¬°·¤¦¿ôÃÍ·×»»¡Ê¼Â¿ô¤Î°·¤¤¡Ë¤Ï¶á»÷ÃͤǤ¹¤«
>¤é¡¢
>¸íº¹¤ÏȯÀ¸¤·¤Þ¤¹¡£

>¤³¤Î¾ì¹ç¡¢É¸¹â¤Î·×¬ÃͤϾ®¿ôÅÀ£´·å¡Ê301ÅÀ¤Ê¤é41.7065¡Ë¤Ç¤¹¤Î¤Ç¡¢
>·×»»·ë²Ì¤Ï¾®¿ôÅÀ£µ·å¤ò»Í¼Î¸ÞÆþ¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£

½ã¿è¿ô³Ø¡ÊʪÍý³Ø¡Ë¤È¹©³ØŪ¤Ê¿ôÃÍ·×»»¤È¤Î°ã¤¤¤Ç¤·¤ç¤¦¤«¡£
41.7065¤Ï¡¢Í­¸ú·å¿ô6·å¤Ç¤Ï¡©4.17065¡ö10^1
¤³¤ÎÊÕ¤ÏË⵿ͤÌä¤Ê¤ó¤Ç¤¹¤¬¡£
¹â¹»ÊªÍý¤Ç¤Ï¡¢¾®¿ô°Ê²¼»Í·å¤Ç¤Ï³Ý¤±»»¤Ï¡¢°ì·å¿¤¤¸Þ·å¤Þ¤Ç·×»»¤·¤Æ»Í¼Î¸ÞÆþ¤Ç¤¹¤Í¡£
¸Þ¼Î¸ÞÆþ¤«¤â¤·¤ì¤Þ¤»¤ó¤¬¡¢

¾¤Î¥Ú¡¼¥¸¤ò¥×¥í¥°¥é¥à¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£Åê¹ÆÂԤäƤ¤¤Þ¤¹¡£¤ËÅú¤¨¤¬¤¢¤ëµ¤¤â¤¹¤ë¤Î¤Ç
¤¹¤¬

¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
 

¤Ä¤Å¤­£´

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ10·î 4Æü(Æü)06»þ12ʬ22ÉÃ
ÊÖ¿®¡¦°úÍÑ
  !Page-4 ¤Î»Ï¤á

!DQT
SUB FFDB
   DO WHILE 0< N
      CALL RED_D
      LET w= IP(ORD(D$)/16) !p=0(byte) p=1(word)
      LET J=MOD(ORD(D$),16) !J=0~3 (QT.number)
      FOR i=0 TO 63
         CALL RED_D
         LET DQ(U(i),V(i),J)=ORD(D$)
         IF w=1 THEN
            CALL RED_D
            LET DQ(U(i),V(i),J)=DQ(U(i),V(i),J)*256+ORD(D$)
         END IF
      NEXT i
      LET N=N-65-64*w ! remain size
   LOOP
END SUB

!SOF0
SUB FFC0
   CALL RED_D
   IF ORD(D$)<>8 THEN BREAK ! 8bit( 24bitColor ) at RGB.dimension
   CALL RED_D
   LET W=ORD(D$)*256
   CALL RED_D
   LET DY=W+ORD(D$) !V.pix.
   CALL RED_D
   LET W=ORD(D$)*256
   CALL RED_D
   LET DX=W+ORD(D$) !H.pix.
   CALL RED_D
   FOR i=0 TO ORD(D$)-1   !1~3 scan order items
      CALL RED_D
      LET CoID(ORD(D$))=i ! (Y=0, Cb=1, Cr=2)<-- CoID( ID=0~255)
      CALL RED_D
      LET MH(i)= IP(ORD(D$)/16) ! HV Y=11,12,21,22,41 Cb=11,11,11,11,11 Cr=11,11,11,11,11
      LET MV(i)=MOD(ORD(D$),16)
      CALL RED_D
      LET QS(i)=ORD(D$)   ! QT.number0~3 <-- QS( Y=0, Cb=1, Cr=2)
   NEXT i
   IF 2< i THEN LET CMO=2 ELSE LET CMO=0
END SUB

!DHT
SUB FFC4
   DO WHILE 0< N
      CALL RED_D
      LET J=ORD(D$)              ! 0?~1?=DC~AC  ?0~?3=ID0~ID3
      LET J=2*MOD(J,16)+IP(J/16) ! 0~1=ID0.DC~AC  2~3=ID1.DC~AC  4~5=ID2.¡Ä
      LET DH(0,J)=0 !!!for 2nd.use for clear
      FOR i=1 TO 16
         CALL RED_D
         LET DH(i,J)=ORD(D$)
         LET DH(0,J)=DH(0,J)+DH(i,J)
      NEXT i
      FOR i=0 TO DH(0,J)-1
         CALL RED_D
         LET DV(i,J)=ORD(D$)
      NEXT i
      !---
      FOR i=i TO 255
         LET DV(i,J)=0
      NEXT i
      CALL makeH0(J) ! make Huffman Code table B() L()
      CALL makeD0(J) ! make Huffman Decorder table A()
      !---
      LET N=N-1-16-DH(0,J) ! remain size
   LOOP
END SUB

!SOS
SUB FFDA
   CALL RED_D
   LET M2=ORD(D$)
   MAT HDC=(-2)*CON
   MAT HAC=(-2)*CON
   FOR i=1 TO M2
      CALL RED_D
      LET w=ORD(D$) !ID=0~255( normal 01~03)
      CALL RED_D    ! 00=Y 11=Cb 11=Cr
      LET HDC(CoID(w))= IP(ORD(D$)/16)*2   !DC 0~3-->0,2,4,6
      LET HAC(CoID(w))=MOD(ORD(D$),16)*2+1 !AC 0~3-->1,3,5,7
   NEXT i
   CALL RED_D
   LET Ss_=ORD(D$) ! low of spectral selection
   CALL RED_D
   LET Se_=ORD(D$) ! high of spectral selection
   CALL RED_D
   LET Al=MOD(ORD(D$),16) ! low bit of successive approximation
   LET Ah=IP(ORD(D$)/16)  !high bit of successive approximation
   !--- private controll M3(display timing)
   LET w=Ah-Al
   IF w=0 THEN LET w=1
   FOR i=0 TO 2
      IF 0<=HAC(i) THEN LET M3(i)=M3(i)+(Se_-Ss_+1)*w ! M3()= scan band sum
   NEXT i
   !--- next image data top
END SUB

SUB ROPEN
   OPEN #1 :NAME FL$ ,ACCESS INPUT
END SUB

SUB RED_D
   CHARACTER INPUT #1 :D$
   LET byt=byt+1 !!!
END SUB

END
 

¤Ä¤Å¤­£³

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ10·î 4Æü(Æü)06»þ13ʬ51ÉÃ
ÊÖ¿®¡¦°úÍÑ
  !Page-3 ¤Î»Ï¤á

!============
! B(,J)L(,J)<-- DH(,J) for decorder table A(,J)
!
SUB makeH0(J)
   LET i=0   ! ¥³¡¼¥ÉÀ¸À® ½çÈÖ(û¤¤½ç)
   LET Hx=0
   LET Tx=BVAL("8000",16)
   FOR L_=1 TO 16
      FOR P=1 TO DH(L_,J)
         LET L(i,J)=L_
         LET B(i,J)=Hx ! ¥³¡¼¥É(À¸À®½ç), ºÂɸDV(ÉÑÅٹ߽ç) ¤ÈƱ½ç¡£
         LET i=i+1
         LET Hx=Hx+Tx
      NEXT P
      LET Tx=Tx/2
   NEXT L_
   LET B(256,J)=0
   FOR i=i TO 255
      LET L(i,J)=0
      LET B(i,J)=0
   NEXT i
END SUB

!============
!A(,J)=output decorder table<-- B(,J) L(,J) DH(,J) DV(,J)
!
SUB makeD0(J)
   FOR LH=16 TO 1 STEP -1
      IF DH(LH,J)<>0 THEN EXIT FOR
   NEXT LH                 !length max. in huffman table
   LET LM=CEIL(LH/BST)*BST !length max. bound by BST
   !---
   LET I=0           !start huffman table adr.
   LET LA=0          !line adr.
   LET P=BST         !start Decord code width
   LET U_=2^(16-BST) !start Decord code step
   LET NC=0          !next start Decord code
   DO
      LET D_=NC !start Decord code
      LET NC=-1
      LET LB=LA+(65536-D_)/U_ !1st nest adr.
      DO
         CALL SERCH
         IF 0< L_ THEN
            LET A(LA,J)= BVAL("8000",16)+L_*256+DV(I,J) !b15=end. +L.+V.
         ELSEIF P=LM THEN
            LET A(LA,J)= BVAL("C000",16)+LH*256 !b15=end. b14=Unused. +L.
         ELSE
            IF NC=-1 THEN LET NC=D_
            LET A(LA,J)=LB ! nest adr.
            LET LB=LB+SHb  ! next nest adr.
         END IF
         LET D_=D_+U_
         LET LA=LA+1
      LOOP UNTIL IP(D_)=65536
      LET P=P+BST
      LET U_=U_/SHb        !shr(U_,BST)
   LOOP UNTIL P>LM
   !---
   FOR LA=LA TO 255
      LET A(LA,J)=0 !(0),table stop mark
   NEXT LA
END SUB

SUB SERCH
   FOR I=I TO DH(0,J)-1
      LET L_=L(I,J)
      IF L_<=P THEN LET w=IP(D_/2^(16-L_))*2^(16-L_) ELSE EXIT FOR
      IF w<=B(I,J) THEN
         IF w=B(I,J) THEN EXIT SUB ELSE EXIT FOR
      END IF
   NEXT I
   LET L_=-1
END SUB

!===========
! Inverse Fast Cosin Transform.( 8x8, iDCT-2 ) ¢« Inverse Quantization.DQ()
SUB IDDCT8X8
   FOR V0=0 TO DV_-1 STEP 8
      FOR U0=0 TO DU-1 STEP 8
         FOR P=0 TO CMO ! =0(mono) =2(color)
            FOR V_=0 TO 7
               FOR U_=0 TO 7
                  LET X(U_)=D2(U0+U_,V0+V_,P) *DQ(U_,V_,QS(P)) ! Inverse Quantization
               NEXT U_
               CALL IWANG
               FOR X_=0 TO 7
                  LET T(X_,V_)=X(X_)
               NEXT X_
            NEXT V_
            FOR X_=0 TO 7
               FOR V_=0 TO 7
                  LET X(V_)=T(X_,V_)
               NEXT V_
               CALL IWANG
               FOR Y_=0 TO 7
                  IF P=0 THEN LET D1(U0+X_,V0+Y_,P)=X(Y_)+128 ELSE LET D1(U0+X_,V0+Y_,P)=X(Y_)
               NEXT Y_
            NEXT X_
         NEXT P
      NEXT U0
   NEXT V0
END SUB

!----inverse Wang.( 8, iDCT-2 )
SUB IWANG
   LET XO(0)=SQR(2/8)*X(0)
   LET XO(1)=SQR(2/8)*X(4)
   LET XO(2)=SQR(2/8)*X(2)
   LET XO(3)=SQR(2/8)*X(6)
   LET XO(4)=SQR(1/8)*X(1)
   LET XO(5)=SQR(1/8)*X(5)
   LET XO(6)=SQR(1/8)*X(3)
   LET XO(7)=SQR(1/8)*X(7)
   !
   LET X(4)=(COS(PI  /16)*XO(4)+SIN(PI  /16)*XO(7))
   LET X(5)=(COS(PI*5/16)*XO(5)+SIN(PI*5/16)*XO(6))
   LET X(6)=(SIN(PI*5/16)*XO(5)-COS(PI*5/16)*XO(6))
   LET X(7)=(SIN(PI  /16)*XO(4)-COS(PI  /16)*XO(7))
   !
   LET XO(4)= X(4)+X(5)
   LET XO(5)= X(4)-X(5)
   LET XO(6)=-X(6)+X(7)
   LET XO(7)= X(6)+X(7)
   !
   LET X(0)=(COS(PI/4)*XO(0)+COS(PI  /4)*XO(1))
   LET X(1)=(COS(PI/4)*XO(0)-COS(PI  /4)*XO(1))
   LET X(2)=(SIN(PI/8)*XO(2)-SIN(PI*3/8)*XO(3))
   LET X(3)=(COS(PI/8)*XO(2)+COS(PI*3/8)*XO(3))
   LET X(4)=XO(4)
   LET X(5)=XO(6)
   LET X(6)=XO(5)
   LET X(7)=XO(7)
   !
   LET XO(0)=X(0)+X(3)
   LET XO(1)=X(1)+X(2)
   LET XO(2)=X(1)-X(2)
   LET XO(3)=X(0)-X(3)
   LET XO(4)=X(7)*SQR(2)
   LET XO(5)=X(6)-X(5)
   LET XO(6)=X(6)+X(5)
   LET XO(7)=X(4)*SQR(2)
   !
   LET X(0)=XO(0)+XO(7)
   LET X(1)=XO(1)+XO(6)
   LET X(2)=XO(2)+XO(5)
   LET X(3)=XO(3)+XO(4)
   LET X(4)=XO(3)-XO(4)
   LET X(5)=XO(2)-XO(5)
   LET X(6)=XO(1)-XO(6)
   LET X(7)=XO(0)-XO(7)
END SUB

!=============
SUB R_BIN31(M) ! decord(M) before new.search(M)
   DO
      IF M=BVAL("D8",16) THEN  ! SOI
         MAT DH=ZER   ! clear Huffman Table
         LET DRI=0    ! clear Restart Interval.value for RST0~7(restart marker)
         LET rct=-1   ! Interval.counter, valid (0<=rct), invalid (rct< 0)
         MAT M3=ZER   ! clear scan band sum
      ELSEIF M=BVAL("D9",16) THEN ! EOI
         EXIT DO      ! close & end_sub
      ELSEIF BVAL("D0",16)<=M AND M<=BVAL("D7",16) THEN ! RST0~7( restart marker)
         LET rct=DRI  ! set counter with Restart Interval
         EXIT SUB
      ELSEIF 0< M THEN     !M=0 is data"FF" in picture area
         CALL RED_D
         LET N=ORD(D$)*256
         CALL RED_D
         LET N=N+ORD(D$)-2 ! N=remain size
         !---
         IF BVAL("E0",16)<=M AND M<=BVAL("EF",16) THEN ! APP0~APP15
            CALL FFE0
         ELSEIF M=BVAL("DD",16) THEN
            CALL FFDD ! DRI  load DRI & rct=DRI
         ELSEIF M=BVAL("FE",16) THEN
            CALL FFFE ! COMMENT
         ELSEIF M=BVAL("C4",16) THEN
            CALL FFC4 ! DHT
         ELSEIF M=BVAL("DB",16) THEN
            CALL FFDB ! DQT
         ELSEIF M=BVAL("C0",16) OR M=BVAL("C2",16) THEN
            CALL FFC0 ! SOF0 SOF2
         ELSEIF M=BVAL("DA",16) THEN
            CALL FFDA ! SOS
            EXIT SUB  ! without close
         ELSE
            BREAK     ! new marker
         END IF
      END IF
      !---
      DO
         LET M=BVAL("D9",16) ! EOI, 256 ! end of file
         CHARACTER INPUT #1,IF MISSING THEN EXIT DO :D$
         LET byt=byt+1 !!!
         LET M=ORD(D$)
      LOOP UNTIL M=255       ! 1st.mark
      IF M<>255 THEN EXIT DO ! close & end_sub
      CALL RED_D
      LET M=ORD(D$)
   LOOP
   CLOSE #1
END SUB

!DRI
SUB FFDD
   CALL RED_D
   LET DRI=ORD(D$)*256
   CALL RED_D
   LET DRI=DRI+ORD(D$)
   LET rct=DRI
END SUB

!APP0
SUB FFE0
   FOR W=1 TO N
      CALL RED_D
   NEXT W
END SUB

!COMMENT
SUB FFFE
   FOR W=1 TO N
      CALL RED_D
   NEXT W
END SUB

!
Page-4 ¤Ø³¤¯
 

¤Ä¤Å¤­£²

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ10·î 4Æü(Æü)06»þ15ʬ40ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  !Page-2 ¤Î»Ï¤á

SUB frame
   PRINT "  Ss Se AhAl: ";Ss_;Se_;STR$(Ah);STR$(Al)
   PRINT "  Y  HDC HAC: ";IP(HDC(0)/2);IP(HAC(0)/2)
   PRINT "  Cb        : ";IP(HDC(1)/2);IP(HAC(1)/2)
   PRINT "  Cr        : ";IP(HDC(2)/2);IP(HAC(2)/2)
   CALL reset0
   !---
   FOR V09=0 TO DV_-1 STEP 8*MV(0)
      FOR U09=0 TO DU-1 STEP 8*MH(0)
         IF rct=0 THEN
            CALL R_BIN31(0)        ! read marker
            IF rct<>DRI THEN BREAK ! not RST0~7
            CALL reset0 ! Restart
         END IF
         CALL MCUxx11 ! read picture data
         LET rct=rct-1
         !---
         IF 0< ext THEN
            IF ext=103001 THEN
               PRINT "abort marker ";BSTR$(M,16)
               IF BVAL("D0",16)<=M AND M<=BVAL("D7",16) THEN ! RST0~7( restart marker)
                  LET rct=DRI ! set counter
                  CALL reset0 ! Restart
               ELSE
                  EXIT SUB ! others marker
               END IF
            ELSE
               PRINT "file error. display fragment"
               LET M=BVAL("D9",16) ! EOI
               EXIT SUB
            END IF
         END IF
      NEXT U09
   NEXT V09
   IF 0< EOB THEN PRINT "EOBn over frame";EOB !!!
END SUB

SUB MCUxx11
!---read MCU
   FOR P=0 TO CMO
      IF 0<=HDC(P) OR 0<=HAC(P) THEN
         FOR V0=V09 TO V09+8*MV(P)-1 STEP 8
            FOR U0=U09 TO U09+8*MH(P)-1 STEP 8
               WHEN EXCEPTION IN
                  IF EOB=0 THEN CALL R_BLK0 ELSE LET EOB=EOB-1
               USE
                  LET ext=EXTYPE
                  EXIT SUB
               END WHEN
               !---extend bitmap
               IF 0< Ah AND 0< Se_ THEN
                  FOR i=A_ TO Se_
                     IF D2(U0+U(i),V0+V(i),P)<>0 THEN
                        LET L_=1
                        WHEN EXCEPTION IN
                           CALL DEC1_EX
                        USE
                           LET ext=EXTYPE
                           EXIT SUB
                        END WHEN
                        LET V_=SGN(D2(U0+U(i),V0+V(i),P))*V_*2^Al
                        LET D2(U0+U(i),V0+V(i),P)=D2(U0+U(i),V0+V(i),P) +V_
                     END IF
                  NEXT i
                  LET A_=Ss_
               END IF
               !---
            NEXT U0
         NEXT V0
      END IF
   NEXT P
END SUB

!------
SUB R_BLK0
   IF Ss_=0 THEN
   !---D.C.part
      LET debug$="DC.huffman" !!!
      IF Ah=0 THEN  !-----baseline.progSS.progSA(1st.scan).
         LET J=HDC(P) !huffman D.C.table selection P( 0=Y 1=Cb 2=Cr)
         CALL DEC1_NS
         LET EL=V_     !extent length
         !---D.C.extent
         LET debug$="DC.huffman extend" !!!
         IF 0< EL THEN
            LET L_=EL
            CALL DEC1_EX   !keep EL, V_=extent value( length EL bits)
            LET W=2^(EL-1)                  !minimum in EL bits length
            IF V_< W THEN LET V_=V_-(W*2-1) !restore signed value
            LET B2(P)=B2(P)+V_*2^Al       !point transform, integrate to D.C.
         END IF
         LET D2(U0+U(0),V0+V(0),P)=B2(P)
      ELSE  !-----progSA(2st.scan).
         LET L_=1
         CALL DEC1_EX
         LET V_=SGN(D2(U0+U(0),V0+V(0),P))*V_
         LET D2(U0+U(0),V0+V(0),P)=D2(U0+U(0),V0+V(0),P) +V_*2^Al
      END IF
      LET Sa_=1
   ELSE
      LET Sa_=Ss_
   END IF
   !---A.C.parts
   IF Se_=0 THEN EXIT SUB !band Ss_~Se_
   LET J=HAC(P)          !huffman A.C.table selection P( 0=Y 1=Cb 2=Cr)
   LET debug$="AC.huffman"
   FOR A_=Sa_ TO Se_
      CALL DEC1_NS
      LET EL=MOD(V_,16)   !extent length
      LET RL= IP(V_/16)   !run length
      !---
      IF RL<=14 AND EL=0 THEN  !End Of Block(00). End Of Band(10,20,,E0)
      !---EOBn extend
         LET debug$="eobn extend"& STR$(RL)
         IF 0< RL THEN
            LET L_=RL         !extend= run_length
            CALL DEC1_EX      !keep RL, V_=run value( length RL bits)
            LET EOB=V_+2^RL-1 !RL= End Of Band(10,20,,E0) run length
         END IF
         EXIT SUB
         !---
      END IF
      !---RL=(0~15)EL=(1~10), RL=(15)EL=(0)
      LET debug$="AC.huffman extend" !!!
      IF Ah=0 THEN !-----baseline.progSS.progSA(1st.scan).
         LET A_=A_+RL        !skip zero_run_length 0~15
         !---A.C.extent
         IF 0< EL THEN       !ZRL(16) only skip
            LET L_=EL
            CALL DEC1_EX     !keep EL, V_=extent value( length EL bits)
            LET w=2^(EL-1)                  !minimum in EL bits length
            IF V_< w THEN LET V_=V_-(w*2-1) !restore signed value
            !---
            LET V_=V_*2^Al   !point transform
            LET D2(U0+U(A_),V0+V(A_),P)=V_
         END IF
      ELSE !-----progSA(2st.scan).
         IF 0< EL THEN       !ZRL(16) only skip
            LET L_=EL
            CALL DEC1_EX     !keep EL, V_=extent value( length EL bits)
            IF EL<>1 THEN PRINT "AC.2nd.=";EL;V_ !!!
            LET V01=V_
         END IF
         FOR i=A_ TO Se_
            IF D2(U0+U(i),V0+V(i),P)<>0 THEN !zz(k)=xxx_1?/0?
               LET L_=1
               CALL DEC1_EX
               LET V_=SGN(D2(U0+U(i),V0+V(i),P))*V_
               LET D2(U0+U(i),V0+V(i),P)=D2(U0+U(i),V0+V(i),P) +V_*2^Al
            ELSEIF RL=0 THEN                  !zz(k)=000_V01
               EXIT FOR
            ELSE                              !zz(k)=000_0  ,zero run
               LET RL=RL-1
            END IF
         NEXT i
         IF 0< EL THEN  !ZRL(16) skip
            IF V01=0 THEN LET V01=-1
            LET D2(U0+U(i),V0+V(i),P)=V01*2^Al
         END IF
         LET A_=i
      END IF
   NEXT A_
END SUB

!========================
! decorder
! J= huffman code table selection ( 0=YDC 1=YAC 2=CDC 3=CAC)
! V_= pickup RRRRssss <-- JPG.file

SUB DEC1_NS
   DO
      IF BC< BST THEN CALL DEC1_IN
      LET W=IP(Hx)           ! bits width BST
      !----
      LET W=A(NA+W,J)
      IF 32768<=W THEN EXIT DO
      LET NA=W               ! nest adr.  W=0 table end
      LET BC=BC-BST
      LET Hx=MOD(Hx*SHb,SHb)
   LOOP
   LET NA=0                  ! DU0L LLLL VVVV VVVV
   LET L_=MOD(IP(W/256),128) !  U0L LLLL
   LET V_=MOD(W,256)         !           VVVV VVVV
   IF 16< L_ THEN PRINT "unused code" !BREAK  !unused code ! LET V_=BVAL("8000",16)
   !----
   LET W=MOD(L_,BST)
   IF 0< W THEN
      LET BC=BC-W
      LET Hx=MOD(Hx*2^W,SHb)
   ELSE
      LET BC=BC-BST
      LET Hx=MOD(Hx*SHb,SHb)
   END IF
END SUB

SUB DEC1_IN
   CALL RED_D
   LET W=ORD(D$)
   IF W=255 THEN
      CALL RED_D
      LET M=ORD(D$)
      IF M<>0 THEN LET w=1/0 ! EXTYPE=3001, ffxx marker, abnormally break
   END IF
   LET Hx=Hx+W*2^(BST-8-BC)
   LET BC=BC+8
END SUB

!-------
SUB DEC1_EX
   LET V_=0
   DO
      IF L_< 1 THEN EXIT SUB
      IF BC< L_ THEN CALL DEC1_IN
      LET W=IP(Hx)
      !----
      IF BST>=L_ THEN EXIT DO
      LET V_=V_*SHb+W
      LET L_=L_-BST
      LET BC=BC-BST
      LET Hx=MOD(Hx*SHb,SHb)
   LOOP
   LET V_=V_*2^L_+IP(W*2^(L_-BST))
   !----
   LET BC=BC-L_
   LET Hx=MOD(Hx*2^L_,SHb)
END SUB

!
Page-3 ¤Ø³¤¯
 

¥×¥í¥°¥ì¥Ã¥·¥Ö JPG

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ10·î 4Æü(Æü)06»þ17ʬ42ÉÃ
ÊÖ¿®¡¦°úÍÑ
  !½½¿Ê BASIC ¤Ë¤è¤ë ¥×¥í¥°¥ì¥Ã¥·¥Ö JPG ¤ÎŸ³«¤È²èÁü²½¡£
!successive approximation subsequence Éôʬ¤Ï¡¢http://www.w3.org/Graphics/JPEG/itu-t81.pdf
!¤ò¸«¤Æ¤â¡¢ÀâÌÀ¤¬²ò¤ê¤Ë¤¯¤¯¡¢¼ÂºÝ¤ÎÎ㤬¡¢É¬ÍפǤ¹¡£¤¢¤¯¤Þ¤Ç¡¢¸Ä¿ÍŪÍý²ò¤ÎÈϰϤǤ¹¤¬¡¢
!
!¶ñÂÎŪ¡¢²Ä»ëŪ¤Ê¥×¥í¥°¥é¥à¤Ç¡¢¼Â¹Ô¤·²èÁü²½¤·¤Þ¤¹¤Î¤Ç¡¢¾ÜºÙ»ö¹à¤ÎÄÉÀפȸ滲¹Í¤Ë¡£
!ºÆÀ¸¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¤Ï¡¢1000x1000 ¤Þ¤Ç¤Î JPG ¤À¤±¤Ç¡¢
! baseline , spectral selection , successive approximation ¤Î£³¼ïÎà( web ¾å¤Î¡¢¤Û¤ÜÁ´¼ï)
!
!£±¡Ësuccessive approximation AC.subsequence¡ÊY,Cb,Cr ÊÌ¡¹¡¢£±bit ¤Å¤Ä¤Î½èÍý¡Ë
!
!      0      1      1      0      0      0      0      0      0     ¡©
!      0      0      0      0      0      1      0      0      0     ¡©
!      0      1      0      0      0      0      0      1      0     ¡©
!      0      1      1      0      0      1      0      1      0     ¡©
!      0      1      1      0      0      1      0      1      0     ¡©
! --------------------------------------------------------------------------
!    ¡Þ1      b1     b2     0      0      b3     0      b4   ¡Þ1     ¡©
! Á°¤Î½ª ¤ê                 RRRR   RRRR          RRRR        extend.   ¼¡¤Î»Ï¤á
!
!     huffman.
!     RRRRssss  extend.  b1 b2 b3 b4 ¡Ä
!       3   1  (0 or 1)  bit_stream=¡©²¿¸Ä¤Ë¤Ê¤ë¤«¤Ï¡¢¾å¿Þ¤Ç¡¢¾å°Ì·å =0 ¤Î·¸¿ô¤¬
!              -1   +1   (0 or 1)     RRRR ¸Ä ¤Ë¤Ê¤ë¤Þ¤Ç¤ËÄ̲ᤷ¤¿¾å°Ì·å <>0 ¤Î¸Ä¿ô¡£
!                         0  ¡Þ1
!                           0 ¢ª ̵ÊѲ½¡£
!                           1 ¢ª ¡ÞÉä¹æ¤Ï¾å°Ì·å¤Ë¹ç¤»¤Æ²Ã»»¡£(ÀäÂÐÃͤ¬¡Ü1)
!
!£²¡Ësuccessive approximation DC.subsequence¡ÊY,Cb,Cr ÊÌ¡¹¡¢£±bit ¤Å¤Ä¤Î½èÍý¡Ë
!
!  ¥Ï¥Õ¥Þ¥ó¡¦¥³¡¼¥É RRRRssss Éô¤Ï¡¢Â¸ºß¤»¤º¡¢
!  Æ¬¤«¤é¤Î bit_stream.¤Ç¡¢£±bit ¤Å¤Ä¡¢Á´¤Æ¤Îblock ¤Î DC·¸¿ô ¤Ë²Ã¤¨¤ë¡£
!
!  AC ¤ÈƱÍÍ¡¢0 ¢ª ̵ÊѲ½¡£1 ¢ª ¡ÞÉä¹æ¤Ï¾å°Ì·å¤Ë¹ç¤»¤Æ²Ã»»¡£(ÀäÂÐÃͤ¬¡Ü1)
!
!¢¨¾åµ­¡¢successive approximation AC, DC ¤È¤â¡¢²Ã¤¨¤ë£±¤Ï¡¢
!¡¡2^Al ÇܤΠpoint transfer. ¤È¤·¤Æ¤«¤é¡¢²Ã¤¨¤Þ¤¹¡£
!
DEBUG ON
!------------------------
!JPG.decoder
! Baseline
! Progressive( spectral selection )( successive approximation )
!------------------------
OPTION ARITHMETIC NATIVE
OPTION BASE 0
OPTION CHARACTER byte
SET TEXT background "OPAQUE"
ASK BITMAP SIZE bmx,bmy
SET WINDOW 0,bmx, bmy,0
SET ECHO "OFF"
SET COLOR MODE "NATIVE"
!
DIM D8(1000,1000)   !GDISP DSPYbr
DIM D2(1000,1000,2) !Y=D2(,,0)  Cb=D2(,,1)  Cr=D2(,,2)
DIM D1(1000,1000,2) !Y=D2(,,0)  Cb=D2(,,1)  Cr=D2(,,2)
DIM MH(2),MV(2)     !R_BIN31  SOF0 MCU.Ybr.H()V()
DIM HDC(2),HAC(2)   !R_BIN31 hT.table selection
DIM QS(2),CoID(255) !R_BIN31 qT.table selection
DIM M3(2)
!
DIM U(63),V(63)         !zigzag
DIM DQ(7,7,3)           !blk8x8 DQT
DIM DH(16,7),DV(255,7)  !DHT
DIM B(255+1,7),L(255,7) !encorder & decorder's pre_table, length, ( MAKE_H2,MAKE_H0)
DIM A(2000,7)           !decorder
DIM B2(2)               !Ybr D.C.À®Ê¬ starting & back_level for difference
DIM T(7,7),X(7),XO(7)   !DDCT8X8, IDDCT8X8
!
LET BST=2      !huffman decorder's bit step 1=8.5s 2=6.5s 4=8.0s 8=50.0s
LET SHb=2^BST  !huffman decorder  *SHb(shl BST) /SHb(shr BST)
!LET YDC0=1024  !prediction 128( 50%) * {SQR(2/8)^2 * SQR(1/2)^2 * (8*8)}
!
!---zigzag table
FOR V_=0 TO 7
   FOR U_=0 TO 7
      READ i
      LET U(i)=U_
      LET V(i)=V_
   NEXT U_
NEXT V_
DATA  0, 1, 5, 6,14,15,27,28
DATA  2, 4, 7,13,16,26,29,42
DATA  3, 8,12,17,25,30,41,43
DATA  9,11,18,24,31,40,44,53
DATA 10,19,23,32,39,45,52,54
DATA 20,22,33,38,46,51,55,60
DATA 21,34,37,47,50,56,59,61
DATA 35,36,48,49,57,58,62,63
!
DO
   FILE GETNAME FL$, "jpg"
   IF FL$="" THEN
      PRINT "ÆþÎÏ¥Õ¥¡¥¤¥ë̾¤¬¡¢¤¢¤ê¤Þ¤»¤ó¡£"
      STOP
   END IF
   PRINT "ÆþÎÏ¥Õ¥¡¥¤¥ë¡§"& FL$
   !---
   CLEAR
   CALL IZZRL0   ! D2()<-- decord JPG
   PRINT "¼¡¤Î¥Õ¥¡¥¤¥ë[ Any key ]"
   beep
   CHARACTER INPUT CLEAR: w$
LOOP UNTIL w$=CHR$(27) !ESC

!-------- IZZRL0 call here for display D2()
SUB MAIN65
   PRINT "²èÁü¤Î½àÈ÷Ãæ¡¢";
   CALL IDDCT8X8 ! D1()<-- iDCT<-- iDQT<-- D2()
   !---
   IF 1< MH(0) OR 1< MV(0) THEN ! Cb_Cr expand Blocks -->MCU scales
      FOR V09=0 TO DV_-1 STEP 8*MV(0)
         FOR U09=0 TO DU-1 STEP 8*MH(0)
         !---MCU part.Cb.Cr
            FOR V0=8*MV(0)-1 TO 0 STEP -1
               FOR U0=8*MH(0)-1 TO 0 STEP -1
                  LET D1(U09+U0,V09+V0,1)=D1(U09+IP(U0/MH(0)),V09+IP(V0/MV(0)),1)
                  LET D1(U09+U0,V09+V0,2)=D1(U09+IP(U0/MH(0)),V09+IP(V0/MV(0)),2)
               NEXT U0
            NEXT V0
            !---
         NEXT U09
      NEXT V09
   END IF
   ! END SUB
   !------ JPG ¿§¶õ´Ö ----------------------------
   ! | Y |   | 0.2990   +0.5870   +0.1140  | | R |
   ! |B-Y| = |-0.1687   -0.3313   +0.5000  | | G |
   ! |R-Y|   | 0.5000   -0.4187   -0.0813  | | B |
   !
   ! | R |   | 1         0        +1.40200 | | Y |
   ! | G | = | 1        -0.34414  -0.71414 | |B-Y|
   ! | B |   | 1        +1.77200   0       | |R-Y|
   !----------------------------------------------
   ! SUB DSPYbr
   FOR V0=0 TO DY-1
      FOR U0=0 TO DX-1
         LET w1=IP(D1(U0,V0,0)                      +1.40200*D1(U0,V0,2)) !R
         LET w2=IP(D1(U0,V0,0) -0.34414*D1(U0,V0,1) -0.71414*D1(U0,V0,2)) !G
         LET w3=IP(D1(U0,V0,0) +1.77200*D1(U0,V0,1))                      !B
         IF w1< 0 THEN
            LET w1=0
         ELSEIF 255< w1 THEN
            LET w1=255
         END IF
         IF w2< 0 THEN
            LET w2=0
         ELSEIF 255< w2 THEN
            LET w2=255
         END IF
         IF w3< 0 THEN
            LET w3=0
         ELSEIF 255< w3 THEN
            LET w3=255
         END IF
         LET D8(U0,V0)=w3*65536+w2*256+w1 !¡ÊµÕ¡ËBGR
      NEXT U0
   NEXT V0
   LET w=TRUNCATE(MIN( (bmx-1)/DX,(bmy-1)/DY),1)
   IF 1< w THEN LET w=IP(w)
   IF 4< w THEN LET w=4
   PRINT "ÉÁ²è¤ÎÇÜΨ=";w
   MAT PLOT CELLS,IN 1,1; DX*w, DY*w :D8
END SUB

!========================
!inverse haffman Transform.
SUB IZZRL0
   LET byt=0 !!!
   CALL ROPEN ! FL$
   !---
   CALL R_BIN31(0) !A() B(i,J)L(i,J)<-- DH(), return at img.top
   PRINT right$("000"& BSTR$(byt,16),4) !!!
   PRINT "(";STR$(DX);"x";STR$(DY);
   !---
   MAT D8=ZER(DX-1,DY-1) !DSPYbr
   LET i=8*MH(0) !MCU Y.Hsize
   LET j=8*MV(0) !MCU Y.Vsize
   LET DUM=CEIL(DX/i)*i      !Uwidth=bound by MCU Y.Hsize
   LET DVM=CEIL(DY/j)*j      !Vwidth=bound by MCU Y.Vsize
   MAT D1=ZER(DUM-1,DVM-1,2) !Y=D1(,,0)  Cb=D1(,,1)  Cr=D1(,,2)
   MAT D2=ZER(DUM-1,DVM-1,2) !Y=D2(,,0)  Cb=D2(,,1)  Cr=D2(,,2)
   LET MH_=MH(0)
   LET MV_=MV(0)
   LET DU =DUM               !Uwidth=bound by MCU Y.Hsize
   LET DV_=DVM               !Vwidth=bound by MCU Y.Vsize
   LET DU8=CEIL(DX/8)*8      !Uwidth=bound by block Y.Hsize
   LET DV8=CEIL(DY/8)*8      !Vwidth=bound by block Y.Vsize
   !---
   PRINT "/ ";STR$(DU8);",";STR$(DV8);"/ ";STR$(DUM);",";STR$(DVM);")"
   CALL frame
   !---
   CALL MAIN65
   !---
   IF 0< M THEN PRINT " (";STR$(DX);"x";STR$(DY);"/";STR$(U0);",";STR$(V0);") ";debug$;" abort by ";BSTR$(M,16) !!!
   PRINT right$("000"& BSTR$(byt-2*SGN(M),16),4) !!!
   CALL R_BIN31(M) ! return at img.top, or EOI
   !---
   DO WHILE M=BVAL("DA",16) !SOS
      IF 0<=HAC(0) THEN
         LET MV(0)=1
         LET MH(0)=1
         LET DU=DU8
         LET DV_=DV8
      END IF
      CALL frame
      LET MV(0)=MV_
      LET MH(0)=MH_
      LET DU=DUM
      LET DV_=DVM
      !---
      IF Ss_<>Se_ AND M3(0)=M3(1) AND M3(1)=M3(2) THEN CALL MAIN65
      !---
      IF 0< M THEN PRINT " (";STR$(DX);"x";STR$(DY);"/";STR$(U0);",";STR$(V0);") ";debug$;" abort by ";BSTR$(M,16) !!!
      PRINT right$("000"& BSTR$(byt-2*SGN(M),16),4) !!!
      CALL R_BIN31(M) ! return at img.top
   LOOP
   CLOSE #1 ! FL$
END SUB

SUB reset0
   LET B2(0)=0 !ROUND( YDC0/DQ(0,0,QS(0)) ) !prediction YDC.( 1st.reference level)
   LET B2(1)=0 !prediction CbDC.
   LET B2(2)=0 !prediction CrDC.
   LET Hx=0  !bits stream input buffer 0~(7+8)bits, use fraction
   LET BC=0  !stored bits in Hx
   LET NA=0  !nest adr. in A()
   LET EOB=0 !counter( end_of_band)
   LET M=0
   LET ext=0
END SUB

!
Page-2 ¤Ø³¤¯
 

¥¨¥é¡½¡¡¥á¥Ã¥»¥¤¥¸¡¡Ìµ¤·¤Î¡¡¡¡·×»»¥ß¥¹¡¡¡©¡©¡©

 Åê¹Æ¼Ô¡§Í¿ºä¡¡¡¡¾ºÊ¿  Åê¹ÆÆü¡§2009ǯ10·î 6Æü(²Ð)09»þ03ʬ51ÉÃ
ÊÖ¿®¡¦°úÍÑ
  t.fem - 3dimension zzzz 6 face comme theory  2 element  trial 2 mit print

¥×¥í¥°¥é¥à¡¡¡¡¤Ë¡¡´Ø¤·¤Æ


11 x 11 matrix  ¤ò¡¡¡¡gauss  ¤Î¡¡¡¡Áݤ­¤À¤·Êý¤Ç¡¡¡¡²ò¤¯
¥×¥í¥°¥é¥à¤Ç
·×»»¡¡ÅÓÃæ¤Ç¡¡¡¡tk2 7  3   ¤«¤é¡¡¡¡tk2  7  11
¤Î¡¡¡¡´Ö¤Ç
¥³¥ó¥Ô¥å¡½¥¿¡½¤Î¡¡¡¡·×»»¥ß¥¹¡¡¤ÎÍͤʡ¡¡¡²Õ½ê¤¬¤¢¤ê
¥¨¥é¡½¡¡¥á¥Ã¥»¥¤¥¸¤Ï¡¡¡¡½Ð¤Þ¤»¤ó¤Ç¤·¤¿

Î㤨¤Ð
print  Ê¬¤Ç
tk2  7  4    -1.5 E-15  ¤Î¡¡¡¡²óÅú¤¬¡¡¡¡¡¡Í­¤ê¤Þ¤¹¤¬
¼ê·×»»¤Ç¤Ï¡¡¡¡5.5 E-9
¤Ë¤Ê¤ê¤Þ¤¹

¸å¤Û¤É¡¡¡¡¼ê»æ¤Ç¡¡¡¡Á÷¤ê¤Þ¤¹
 

Re: ¥¨¥é¡½¡¡¥á¥Ã¥»¥¤¥¸¡¡Ìµ¤·¤Î¡¡¡¡·×»»¥ß¥¹¡¡¡©¡©¡©

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ10·î 6Æü(²Ð)09»þ58ʬ1ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.608[¸µµ­»ö¤Ø]

¼ê»æ¤Ç¥Ç¥Ð¥Ã¥°¤ò°ÍÍꤵ¤ì¤Æ¤â¤ª¼õ¤±¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¤Î¤Ç¡¤
¤¢¤·¤«¤é¤º¤´Î»¾µ¤¯¤À¤µ¤¤¡£
 

Re: ¥¨¥é¡½¡¡¥á¥Ã¥»¥¤¥¸¡¡Ìµ¤·¤Î¡¡¡¡·×»»¥ß¥¹¡¡¡©¡©¡©

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ10·î 6Æü(²Ð)10»þ25ʬ10ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.608[¸µµ­»ö¤Ø]

Í¿ºä¡¡¡¡¾ºÊ¿¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> Î㤨¤Ð
> print  Ê¬¤Ç
> tk2  7  4    -1.5 E-15  ¤Î¡¡¡¡²óÅú¤¬¡¡¡¡¡¡Í­¤ê¤Þ¤¹¤¬
> ¼ê·×»»¤Ç¤Ï¡¡¡¡5.5 E-9
> ¤Ë¤Ê¤ê¤Þ¤¹


ñÀºÅÙ¡ÊÍ­¸ú·å¿ô£¸·åÄøÅ١ˤÈÇÜÀºÅÙ¡ÊÍ­¸ú·å¿ô16·åÄøÅ١ˤǤη׻»¤Î°ã¤¤¤Ç¤Ï¡©
¤É¤Á¤é¤â¡¢¿ôÃÍ·×»»¾å¤Ç¤ÎÍýÏÀÃÍ£°¡Ê¶á»÷Ã͡ˤȻפ¤¤Þ¤¹¡£
 

Re: Rolling Cube 1¤Î³ÈÄ¥

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ10·î 6Æü(²Ð)11»þ56ʬ22ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.562[¸µµ­»ö¤Ø]

£±¢ª£²¤Î²òË¡¡¡WindowsMe¡¢Pentium­·700MHz¡¢192MB¤Ë¤Æ¡¢½½¿ÊBASIC¡¡£²¿Ê¥â¡¼¥É¤Ç¼Â¹Ô¡£
 36 ¼ê
URDLURDDLURDLURDLULDRULDRURDLLUURRDL
-1 -1 -1 -1 -1
-1  3  5  2 -1
-1  6  0  8 -1
-1  1  7  4 -1
-1 -1 -1 -1 -1

  :¾Êά
  :

·×»»»þ´Ö= 5440.15 Éá¡¡¡¢â 1.51 »þ´Ö

¥µ¥ó¥×¥ë¡¦¥×¥í¥°¥é¥à¡¡¡¡¢¨£²¿Ê¥â¡¼¥É¤Ç¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£
!Rolling Cube 1 ¤Î²òË¡

!¡üÌäÂê
!£³¡ß£³¤ÎÈפˡ¢£¸¸Ä¤Î¤µ¤¤¤³¤í¤¬£²¤ÎÌܤ¬¾å¡Ê¾¤ÎÌܤâƱ¤¸¸þ¤­¡Ë¤ÇÇÛÃÖ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
!¶õ¤¤¤Æ¤¤¤ë¥Þ¥¹¤Ëž¤¬¤·¤Æ¡¢¤¹¤Ù¤Æ¤ÎÌܤ¬£±¤Ë¤Ê¤ë¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£


LET t0=TIME


PUBLIC NUMERIC xSIZE,ySIZE !ÈפÎÂ礭¤µ
LET xSIZE=3
LET ySIZE=3

PUBLIC NUMERIC M(10,10) !¤µ¤¤¤³¤í¤ÎÇÛÃÖ¡¡¢¨¿ô»ú¤ÏÈֹ桢£°¤Ï¶õ¤­
MAT M=ZER(ySIZE+2,xSIZE+2)
DATA -1,-1,-1,-1,-1 !-1:ÊÉ¡¡¢¨ÈÖʼ
DATA -1, 1, 2, 3,-1 !¢«¢«¢«¢«¢« ¢¨
DATA -1, 4, 0, 5,-1
DATA -1, 6, 7, 8,-1
DATA -1,-1,-1,-1,-1
MAT READ M

FOR SY=2 TO ySIZE+1 !¶õÇò¤Î°ÌÃÖ¡¡¢¨ÈÖʼ¤ò¹Íθ
   LET SX=2
   DO UNTIL SX=xSIZE+1
      IF M(SY,SX)=0 THEN EXIT FOR
      LET SX=SX+1
   LOOP
NEXT SY

PUBLIC NUMERIC LIM !¼ê¿ô¤Î¾å¸Â¡¡¢ªºÇ¾¯¼ê¿ô
LET LIM=36 !¢«¢«¢«¢«¢« ¢¨

PUBLIC NUMERIC LVL(50) !¼ê¤Îµ­Ï¿
MAT LVL=ZER

LET L=0 !£°¼êÌÜ
CALL backtrack(L,-1,SY,SX) !¢¨ÈÖʼ¤ò¹Íθ


PRINT "·×»»»þ´Ö=";TIME-t0;"ÉÃ"

END


EXTERNAL SUB backtrack(L,D,SY,SX) !£±¼ê¤º¤ÄÂǤäƤ¤¤­¡¢¹Ô¤­µÍ¤Þ¤ì¤Ð¸µ¤ËÌá¤Ã¤Æ¤ä¤êľ¤¹

DECLARE EXTERNAL SUB Dice.rolling !³°Éô¼ê³¤­¡¢ÊÑ¿ô¤ÎÄêµÁ
DECLARE EXTERNAL NUMERIC Dice.T1(),Dice.T2(),Dice.T3(),Dice.T4()
DECLARE EXTERNAL NUMERIC Dice.T5(),Dice.T6(),Dice.T7(),Dice.T8()
DECLARE EXTERNAL NUMERIC Dice.DX(),Dice.DY()


DIM TT(6) !£±¤ÄÁ°¤ÎÊݸ
SUB ROTATEandMOVE(d) !¤µ¤¤¤³¤í¤ò²óž°ÜÆ°¤¹¤ë
   SELECT CASE id !²óž
   CASE 1
      MAT TT=T1
      CALL rolling(d,T1)
   CASE 2
      MAT TT=T2
      CALL rolling(d,T2)
   CASE 3
      MAT TT=T3
      CALL rolling(d,T3)
   CASE 4
      MAT TT=T4
      CALL rolling(d,T4)
   CASE 5
      MAT TT=T5
      CALL rolling(d,T5)
   CASE 6
      MAT TT=T6
      CALL rolling(d,T6)
   CASE 7
      MAT TT=T7
      CALL rolling(d,T7)
   CASE 8
      MAT TT=T8
      CALL rolling(d,T8)
   CASE ELSE
   END SELECT

   LET M(SY,SX)=id !°ÜÆ°
   LET M(TY,TX)=0
END SUB
SUB RESTORE !¸µ¤ËÌ᤹
   SELECT CASE id !²óž
   CASE 1
      MAT T1=TT
   CASE 2
      MAT T2=TT
   CASE 3
      MAT T3=TT
   CASE 4
      MAT T4=TT
   CASE 5
      MAT T5=TT
   CASE 6
      MAT T6=TT
   CASE 7
      MAT T7=TT
   CASE 8
      MAT T8=TT
   CASE ELSE
   END SELECT

   LET M(TY,TX)=id !°ÜÆ°
   LET M(SY,SX)=0
END SUB


LET C=0 !»Þ´¢¤ê¡¡¢¨¡Ö»Ä¤ê¤Î¼ê¿ô¡×¤È¡ÖÌܤοô¤¬°ìÃפ·¤Ê¤¤¤µ¤¤¤³¤í¤Î¿ô¡×¤È¤Î´Ø·¸¤è¤ê
IF T1(3)<>1 THEN !1:Ìܤοô¡¡¢«¢«¢«¢«¢« ¢¨
   IF T1(5)=1 THEN LET C=C+2 ELSE LET C=C+1
END IF
IF T2(3)<>1 THEN
   IF T2(5)=1 THEN LET C=C+2 ELSE LET C=C+1
END IF
IF T3(3)<>1 THEN
   IF T3(5)=1 THEN LET C=C+2 ELSE LET C=C+1
END IF
IF T4(3)<>1 THEN
   IF T4(5)=1 THEN LET C=C+2 ELSE LET C=C+1
END IF
IF T5(3)<>1 THEN
   IF T5(5)=1 THEN LET C=C+2 ELSE LET C=C+1
END IF
IF T6(3)<>1 THEN
   IF T6(5)=1 THEN LET C=C+2 ELSE LET C=C+1
END IF
IF T7(3)<>1 THEN
   IF T7(5)=1 THEN LET C=C+2 ELSE LET C=C+1
END IF
IF T8(3)<>1 THEN
   IF T8(5)=1 THEN LET C=C+2 ELSE LET C=C+1
END IF
!£Ã¸Ä¤Î¤µ¤¤¤³¤í¤ò°ìÃפµ¤»¤ëɬÍפ¬¤¢¤ë¤¬¡¢»Ä¤ê¤Î¼ê¿ô¤¬Â­¤ê¤Ê¤¤¤Î¤Ç¡¢ÉÔ²Äǽ¡ª¡ª¡ª
IF L+C>LIM THEN EXIT SUB

IF C=0 AND M(3,3)=0 THEN !´°À®¡©¡¡¢¨¡Ö¶õ¤­¡×¤¬Ãæ±û
!!!IF C=0 THEN !´°À®¡©¡¡¢¨¡Ö¶õ¤­¡×¤¬Ãæ±û°Ê³°¤â´Þ¤à
   PRINT L;"¼ê"
   FOR i=1 TO L !¾å¸Â¤Þ¤Ç¤Î¼ê½ç
      LET w$="LDRU" !¢¨¤µ¤¤¤³¤í¤Ë¤È¤Ã¤Æ¤ÏµÕ¤È¤Ê¤ë
      LET t=LVL(i)+1
      PRINT w$(t:t);
   NEXT i
   PRINT
   MAT PRINT M; !ÈפξõÂÖ

   !!  LET LIM=L !¾å¸Â¤ò¶¹¤á¤ë¡¡¢«¢«¢«¢«¢« ¢¨
END IF


IF L>=LIM THEN EXIT SUB !¾å¸Â¤Þ¤Ç


!!!IF L>=2 THEN !¢¨¡Ö¶õ¤­¡×¤òº¸²¼¤Ë°ÌÃÖÉÕ¤±¤ë¡Ê£³¼ê°Ê¹ß¡Ë¡¡¢«¢«¢«¢«¢« £±¤Ä²¼¤ÎIFʸ¤ËÃÖ¤­´¹¤¨¤ë
IF D>=0 THEN !£²¼ê°Ê¹ß
   FOR i=D-1 TO D+1 !µÕ¹Ô¡Ê¸å¤í¡Ë¤òÈò¤±¤Æ¡¢¡Ê±¦¡¦Á°¡¦º¸¤Ø¡ËÁ°¿Ê¤¹¤ë
      LET DD=MOD(i,4) !Ï¢ÈÖ¤ÇÊý¸þ¤òÆÀ¤ë
      LET TX=SX+DX(DD+1) !¡Ö¶õ¤­¡×¤Î¿ÊÏ©°ÌÃÖ
      LET TY=SY+DY(DD+1)
      LET id=M(TY,TX) !ÊÉ¡¢¤µ¤¤¤³¤í¤ÎÈÖ¹æ¤òÆÀ¤ë
      IF id>0 THEN !È×Æâ¤Ê¤é
         CALL ROTATEandMOVE(DD) !¤µ¤¤¤³¤í¤òž¤¬¤¹
         LET LVL(L+1)=DD !¼ê¤òµ­Ï¿¤¹¤ë
         CALL backtrack(L+1,DD,TY,TX) !¼¡¤Ø
         CALL RESTORE !¸µ¤ËÌ᤹
      END IF
   NEXT i

ELSE
   FOR i=3 TO 0 STEP -1 !¢¨¡Ö¶õ¤­¡×¤òº¸²¼¤Ë°ÌÃÖÉÕ¤±¤ë¡¡¢«¢«¢«¢«¢« £±¤Ä²¼¤ÎFORʸ¤ËÃÖ¤­´¹¤¨¤ë¡Ê¤½¤Î¤Þ¤Þ¤Ç¤â²Ä¡Ë
   !!!FOR i=0 TO 3 !Á´Êý¸þ¡¡¢¨Ï¢ÈÖ
      LET TX=SX+DX(i+1) !¡Ö¶õ¤­¡×¤Î¿ÊÏ©°ÌÃÖ
      LET TY=SY+DY(i+1)
      LET id=M(TY,TX) !ÊÉ¡¢¤µ¤¤¤³¤í¤ÎÈÖ¹æ¤òÆÀ¤ë
      IF id>0 THEN !È×Æâ¤Ê¤é
         CALL ROTATEandMOVE(i) !¤µ¤¤¤³¤í¤òž¤¬¤¹
         LET LVL(L+1)=i !¼ê¤òµ­Ï¿¤¹¤ë
         CALL backtrack(L+1,i,TY,TX) !¼¡¤Ø
         CALL RESTORE !¸µ¤ËÌ᤹
         !!!EXIT FOR !¢¨¡Ö¶õ¤­¡×¤òº¸²¼¤Ë°ÌÃÖÉÕ¤±¤ë¡¡¢«¢«¢«¢«¢« ºï½ü¤¹¤ë
      END IF
   NEXT i

END IF

END SUB


MODULE Dice !¤µ¤¤¤³¤í¤òž¤¬¤¹

!ÃÖ´¹¡ÊPermutation¡Ë¤Î·×»»

SHARE NUMERIC U(6),D(6),L(6),R(6) !ÃÖ´¹
!    1,2,3,4,5,6
DATA 3,2,6,4,1,5 !¾å¡¡¢¨ÀµÌ̤ò¾åÌ̤ˤ¹¤ë¡Ê¿Þ¤Ç¤Î¿åÊ¿¼´¡Ë²óž
DATA 1,3,4,5,2,6 !º¸
MAT READ U
CALL PermInverse(U,D)
MAT READ L
CALL PermInverse(L,R)

SHARE NUMERIC UU(6,6),DD(6,6),LL(6,6),RR(6,6) !ÃÖ´¹¹ÔÎó
CALL PermToMatrix(U,UU)
CALL PermToMatrix(D,DD)
CALL PermToMatrix(L,LL)
CALL PermToMatrix(R,RR)

EXTERNAL SUB PermInverse(A(), iA()) !µÕÃÖ´¹¡¡¢¨iA¤ÏA°Ê³°¤ÎÇÛÎó¤ò»ØÄꤹ¤ë¤³¤È
   FOR i=1 TO UBOUND(A)
      LET iA(A(i))=i
   NEXT i
END SUB
!EXTERNAL SUB PermMultiply(A(),B(), AB()) !ÀÑAB¡¡¢¨AB¤ÏA°Ê³°¤«¤ÄB°Ê³°¤ÎÇÛÎó¤ò»ØÄꤹ¤ë¤³¤È
!   FOR i=1 TO UBOUND(A)
!      LET AB(i)=A(B(i)) !¢¨¹çÀ®¼ÌÁü(AB)(i)=A(B(i))
!   NEXT i
!END SUB
EXTERNAL SUB PermToMatrix(A(), M(,)) !ÃÖ´¹¤Î¹ÔÎó¤òÆÀ¤ë
   MAT M=ZER
   FOR i=1 TO UBOUND(A)
      LET M(i,A(i))=1
   NEXT i
END SUB
!---------- ¢¬¢¬¢¬¢¬¢¬ ----------


!Ÿ³«¿Þ¤ÎÇÛÃÖ¤ÈÌÌÈÖ¹æ¡ÊÇÛÎó¤Îź¤¨»ú¡Ë¤È¤Î´Ø·¸
!¡¡¢¢¡¡¡¡¡¡¡¡¸å¡¡¡¡¡¡¡¡£±
!¢¢¢¢¢¢¢¢¡¡º¸¾å±¦²¼¡¡£²£³£´£µ
!¡¡¢¢¡¡¡¡¡¡¡¡Àµ¡¡¡¡¡¡¡¡£¶

PUBLIC NUMERIC T1(6),T2(6),T3(6),T4(6),T5(6),T6(6),T7(6),T8(6) !£¸¸Ä¤Î¤µ¤¤¤³¤í
DATA   1 !ÌܤÎÇÛÃÖ¡¡¢¨Å¸³«¿Þ»²¾È
DATA 4,2,3,5
DATA   6
MAT READ T1
MAT T2=T1 !Ʊ¤¸¸þ¤­
MAT T3=T1
MAT T4=T1
MAT T5=T1
MAT T6=T1
MAT T7=T1
MAT T8=T1

PUBLIC SUB rolling
EXTERNAL SUB rolling(i,T()) !¤µ¤¤¤³¤í¤ò²óž¤µ¤»¤ë
!DIM TT(6) !ºî¶ÈÍÑ

   SELECT CASE i !¢¨DX(),DY()»²¾È
   CASE 0
   !CALL PermMultiply(T,L,TT) !¢¨¤µ¤¤¤³¤í¤Ë¤È¤Ã¤Æ¤ÏµÕ¤È¤Ê¤ë
      MAT T=T*LL !¢¨¤µ¤¤¤³¤í¤Ë¤È¤Ã¤Æ¤ÏµÕ¤È¤Ê¤ë
   CASE 1
   !CALL PermMultiply(T,D,TT)
      MAT T=T*DD
   CASE 2
   !CALL PermMultiply(T,R,TT)
      MAT T=T*RR
   CASE 3
   !CALL PermMultiply(T,U,TT)
      MAT T=T*UU
   CASE ELSE
   END SELECT

   !MAT T=TT
END SUB
!---------- ¢¬¢¬¢¬¢¬¢¬ ----------


PUBLIC NUMERIC DX(4),DY(4) !£´¶á˵¡¡¢¨È¿»þ·×¤Þ¤ï¤ê¤ÎÏ¢ÈÖ¡¡±¦:0¡¢¾å:1¡¢º¸:2¡¢²¼:3
DATA 1, 0,-1,0
DATA 0,-1, 0,1
MAT READ DX
MAT READ DY

END MODULE
 

Rolling Cube 1¤ÎºÇû¼ê½ç

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ10·î 6Æü(²Ð)16»þ59ʬ55ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  º¸±¦ÂоΡ¢¾å²¼ÂоΡ¢²óžÂоΤξ¤Ë¡¢¡ÈÁ°¸åÂоΡɡʼê½ç¤òµÕ½ç¤Ë¤·¤ÆƱ¤¸¤Ë¤Ê¤ë¤â¤Î¡Ë¤â½ü¤¤¤ÆÂоηÁ¤òºï½ü¤·¤¿¾ì¹ç¤Î¿ô¡£


Ãæ¿´¶õ¤­Â¾Á´Éô΢¢ªÃæ¿´¶õ¤­Â¾Á´Éôɽ¡§£³£¶¼ê¡¢£±Ä̤ê
¢­¢«¢¬¢ª¢­¢ª¢¬¢«¢¬¢ª¢­¢«¢¬¢«¢­¢­¢ª¢¬¢ª¢­¢«¢¬¢«¢­¢ª¢¬¢ª¢­¢«¢«¢¬¢ª¢ª¢¬¢«¢­

Ãæ¿´¶õ¤­Â¾Á´Éô΢¢ª¶õ¤­°ÌÃÖÌä¤ï¤ºÁ´Éôɽ¡§£³£´¼ê¡¢£³Ä̤ê
¢­¢«¢¬¢¬¢ª¢­¢«¢­¢ª¢¬¢«¢­¢ª¢¬¢ª¢¬¢«¢«¢­¢ª¢­¢ª¢¬¢«¢¬¢«¢­¢­¢ª¢¬¢«¢¬¢ª¢ª
¢­¢«¢¬¢¬¢ª¢­¢«¢­¢ª¢¬¢ª¢¬¢«¢­¢«¢­¢ª¢ª¢¬¢«¢¬¢«¢­¢ª¢¬¢«¢­¢­¢ª¢¬¢«¢¬¢ª¢ª
¢­¢«¢¬¢¬¢ª¢­¢ª¢¬¢«¢­¢«¢­¢ª¢¬¢«¢­¢ª¢ª¢¬¢«¢¬¢«¢­¢ª¢¬¢«¢­¢­¢ª¢¬¢«¢¬¢ª¢ª

Ãæ¿´¶õ¤­Â¾Á´Éô¼êÁ°¸þ¤­¢ªÃæ¿´¶õ¤­Â¾Á´Éôɽ¡§£³£¶¼ê¡¢£±£°Ä̤ê
¢«¢¬¢ª¢ª¢­¢«¢«¢­¢ª¢¬¢¬¢ª¢­¢­¢«¢¬¢ª¢­¢«¢¬¢«¢­¢ª¢¬¢«¢¬¢ª¢­¢ª¢¬¢«¢­¢ª¢­¢«¢¬
¢«¢¬¢ª¢­¢«¢­¢ª¢¬¢ª¢­¢«¢¬¢«¢­¢ª¢¬¢¬¢«¢­¢ª¢ª¢­¢«¢«¢¬¢¬¢ª¢­¢«¢¬¢ª¢­¢ª¢¬¢«¢­
¢«¢­¢ª¢¬¢«¢¬¢ª¢ª¢­¢­¢«¢¬¢ª¢¬¢«¢«¢­¢­¢ª¢¬¢«¢¬¢ª¢­¢«¢­¢ª¢ª¢¬¢¬¢«¢­¢«¢¬¢ª¢­
¢«¢­¢ª¢¬¢«¢¬¢ª¢­¢«¢­¢ª¢¬¢«¢­¢ª¢¬¢ª¢­¢«¢¬¢ª¢¬¢«¢­¢«¢¬¢ª¢­¢«¢¬¢ª¢­¢«¢¬¢ª¢­
¢«¢­¢ª¢¬¢«¢¬¢ª¢­¢«¢­¢ª¢¬¢«¢­¢ª¢¬¢ª¢­¢«¢¬¢ª¢¬¢«¢­¢«¢¬¢ª¢­¢ª¢¬¢«¢­¢ª¢¬¢«¢­
¢«¢­¢ª¢¬¢«¢­¢ª¢¬¢«¢¬¢ª¢­¢ª¢¬¢«¢«¢­¢ª¢ª¢­¢«¢«¢¬¢ª¢ª¢¬¢«¢­¢«¢¬¢ª¢­¢ª¢¬¢«¢­
¢«¢­¢ª¢¬¢«¢­¢ª¢¬¢«¢¬¢ª¢­¢ª¢¬¢«¢«¢­¢ª¢ª¢­¢«¢¬¢ª¢¬¢«¢­¢­¢«¢¬¢¬¢ª¢­¢ª¢¬¢«¢­
¢«¢­¢ª¢¬¢«¢­¢ª¢¬¢«¢¬¢ª¢­¢ª¢¬¢«¢«¢­¢ª¢ª¢¬¢«¢­¢ª¢­¢«¢«¢¬¢ª¢ª¢¬¢«¢­¢«¢¬¢ª¢­
¢«¢­¢ª¢¬¢«¢­¢ª¢¬¢«¢¬¢ª¢­¢ª¢¬¢«¢«¢­¢ª¢ª¢¬¢«¢­¢ª¢­¢«¢¬¢ª¢¬¢«¢­¢­¢«¢¬¢¬¢ª¢­
¢¬¢«¢­¢ª¢¬¢«¢­¢­¢ª¢¬¢«¢­¢ª¢¬¢«¢­¢ª¢¬¢ª¢­¢«¢¬¢ª¢­¢«¢¬¢«¢­¢ª¢ª¢¬¢¬¢«¢«¢­¢ª

Ãæ¿´¶õ¤­Â¾Á´ÉôÁ°¸þ¤­¢ª¶õ¤­°ÌÃÖÌä¤ï¤ºÁ´Éôɽ¡§£²£·¼ê¡¢£±Ä̤ê
¢«¢­¢ª¢¬¢«¢¬¢ª¢­¢«¢­¢ª¢¬¢«¢­¢ª¢¬¢ª¢­¢«¢¬¢ª¢¬¢«¢­¢«¢¬¢ª

¤Î·ë²Ì¤¬¼ê¤ËÆþ¤ê¤Þ¤·¤¿¡£
 

Re: Í­¸ú·å¿ô¤ÈÀºÅ٤ˤĤ¤¤Æ

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ10·î 6Æü(²Ð)17»þ45ʬ6ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.602[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

»³ÃæϵÁ¤µ¤ó¤Ø

¡¡¡¡kikiriri¤è¤ê

¡¡¡¡ÇÜÀºÅÙ¡¢Ã±À©Åٰʳ°¤Ç¡¢Í­¸ú·å¿ô¤ò¹Íθ¤·¤Æ·×»»¤¹¤ëÊýË¡¤òÃΤê¤Þ¤»¤ó¤«
¡¡¤Þ¤¿¤½¤Î¤è¤¦¤Ê¥×¥í¥°¥é¥à¤òÃΤê¤Þ¤»¤ó¤«¡£
 

¥¹¥Æ¥Ã¥×Æ°ºî¤Ç¡¢£±ÊÑ¿ô¤ÎÆâÍƤòÄɤ¦»þ

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ10·î 6Æü(²Ð)17»þ55ʬ26ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¥¹¥Æ¥Ã¥×Æ°ºî¤Ç¡¢£±ÊÑ¿ô¤ÎÆâÍƤòÄɤ¦»þ¡¢¥¹¥Æ¥Ã¥×Å٤˥¹¥¯¥í¡¼¥ë¤µ¤ì¡¢
²¿½è¤Ø¹Ô¤Ã¤¿¤«¸«¼º¤¤¤Þ¤¹¤Î¤Ç¡¢¥¹¥¯¥í¡¼¥ë°ÌÃÖ¤ò¥ê¥¹¥È¥¢¡¼ ¤¹¤ë¤è¤¦
¤Ë¤·¤Æ失¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£
 

Re: ¥¹¥Æ¥Ã¥×Æ°ºî¤Ç¡¢£±ÊÑ¿ô¤ÎÆâÍƤòÄɤ¦»þ

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ10·î 6Æü(²Ð)18»þ11ʬ18ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.614[¸µµ­»ö¤Ø]

¥Ç¥Ð¥Ã¥°¥¦¥£¥ó¥É¥¦¤Î¥µ¥¤¥º¤Ï²ÄÊѤʤΤǡ¤¤¹¤Ù¤Æ¤ÎÊÑ¿ô¤¬°ìÍ÷¤Ç¤­¤ëÄøÅ٤ˤޤdzÈÂ礷¤Æ¤ª¤¯¤³¤È¤ÇÂбþ¤Ç¤­¤ë¤È»×¤¤¤Þ¤¹¡£ÊÑ¿ô¤Î¿ô¤¬Â¿¤¤¤È¤à¤º¤«¤·¤¤¤«¤â¤·¤ì¤Þ¤»¤ó¤¬¡£
 

ĶÉÔ»×µÄ

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ10·î 7Æü(¿å)09»þ30ʬ50ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¥×¥í¥°¥é¥à¤È¤Ï¤Þ¤Ã¤¿¤¯´Ø·¸¤Ê¤¤¤«¤â¤·¤ì¤Þ¤»¤ó¤¬¡¢¶áº¢¼¡¤Î¤³¤È¤òÃΤê¤Þ¤·¤¿¡£
µÕΩ¤Á¥´¥Þ¤È¤¤¤¦¤â¤Î¤ò¸«¤é¤ì¤¿¤³¤È¤¬¤¢¤ë¤È»×¤¤¤Þ¤¹¤¬¡¢»ä¤Ï¥³¥Þ¤¬¼«Á³¤ÈµÕΩ¤Á¤¹¤ë¤³¤È¤¬ÉԻ׵Ĥʸ½¾Ý¤Ç¤¢¤ë¤È¤Ð¤«¤ê»×¤Ã¤Æ¤ª¤ê¤Þ¤·¤¿¤¬¡¢¤³¤Î¥³¥Þ¤ÎËÜ Åö¤ÎÉԻ׵Ĥµ¤Ï¡¢¤â¤·±¦²ó¤ê¤Ë²óž¤ò¤«¤±¤Æ¥³¥Þ¤ò²ó¤·¤À¤·¡¢µÕΩ¤Á¤¹¤ì¤ÐÅöÁ³¾å¤«¤é¤Ïº¸²ó¤ê¤Ë²óž¤·¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤Ï¤º¤Ç¤¹¤¬¡¢µÕΩ¤Á¤·¤¿¾õÂÖ¤Ç ¤â¤Ê¤ó¤È±¦²ó¤ê¤Ë²óž¤·¤Æ¤¤¤ë¡ª¡ª¡ª
¤³¤ì¤Ã¤ÆĶÉԻ׵ĤǤϤʤ¤¤Ç¤¹¤«¡©
 

Re: ĶÉÔ»×µÄ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ10·î 7Æü(¿å)10»þ41ʬ35ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.616[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

»Ø¤Ç¤³¤Þ¤Ë±¦²ó¤ê¤Î²óž¤ò¤«¤±¤¿¾ì¹ç¡ÊÀÖ¤ÎÌð°õ¡Ë¡¢
¤³¤Þ¤Î¼´Éôʬ¡Ê¹õ¤¤Éôʬ¡Ë¤Ë¤â±¦²ó¤ê¤Î²óž¡ÊÎФÎÌð°õ¡Ë¤¬¤«¤«¤ê¤Þ¤¹¡£
µÕΩ¤Á¤Ï¡¢¤³¤Þ¤¬·¹¤¯¤³¤È¤Çµ¯¤­¤Þ¤¹¡£¡ÊÃæ±û¤Î³¨¡§¤³¤Þ¤Î¼´Éôʬ¤Ç²óž¤·¤Æ¤¤¤Ê¤¤¡Ë
¤³¤Î»Ø¤Î²óž¤Ï¡¢¤³¤Þ¤¬·¹¤¤¤¿¤ê¡¢µÕΩ¤Á¤·¤Æ¤âÊѤï¤ê¤Þ¤»¤ó¡£

µÕΩ¤Á¤ÎÁ°¸å¤Ç¤Ï¡¢¤³¤Þ¤Î¼´Éôʬ¤ò´ð½à¤Ë¹Í¤¨¤ì¤ÐµÕž¤·¤Æ¤¤¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£
 

Re: Í­¸ú·å¿ô¤ÈÀºÅ٤ˤĤ¤¤Æ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ10·î 7Æü(¿å)14»þ24ʬ55ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.613[¸µµ­»ö¤Ø]

kikiriri¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¡¡¡¡ÇÜÀºÅÙ¡¢Ã±À©Åٰʳ°¤Ç¡¢Í­¸ú·å¿ô¤ò¹Íθ¤·¤Æ·×»»¤¹¤ëÊýË¡¤òÃΤê¤Þ¤»¤ó¤«
> ¡¡¤Þ¤¿¤½¤Î¤è¤¦¤Ê¥×¥í¥°¥é¥à¤òÃΤê¤Þ¤»¤ó¤«¡£

¤è¤¯¤ï¤«¤ê¤Þ¤»¤ó¤¬¡¢¡¢¡¢¤³¤Î¤³¤È¤Ç¤¹¤«¡©

12.34/10*10¤Î·×»»

!##.##·Á¼°¤Î¸ÇÄê¾®¿ôÅÀ¿ô
a=12.34 !12.34
a=a/10 !12.34/10.00=01.23
a=a*10 !01.23*10.00=12.30

!#.###·Á¼°¤ÎÉâÆ°¾®¿ôÅÀ¿ô
a=12.34 !1.234*10^1
a=a/10 !(1.234*10^1)/(1.000*10^1)=1.234*10^0
a=a*10 !(1.234*10^0)*(1.000*10^1)=1.234*10^1
 

ÁᮤΤ´ÊÖ¿®¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹(¤¹¤ß¤Þ¤»¤ó¤¬¤Þ¤¿ÊÔ½¸¤µ¤»¤Æ¤¤¤¿¤À¤­¤Þ¤·¤¿¡Ë

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ10·î 7Æü(¿å)16»þ06ʬ40ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  »³ÃæϵÁ¤µ¤ó¤Ø

¡¡¡¡kikiriri¤è¤ê


ÁᮤΤ´ÊÖ¿®¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£

ÉâÆ°¾®¿ôÅÀ¿ô¤Î¤³¤È¤À¤È»×¤¤¤Þ¤¹¡£

¤É¤Á¤é¤â¤¤¤Ä¤É¤ó¤ÊÉ÷¤ËÍøÍѤ¹¤ë¤«»È¤¤Ê¬¤±Êý¤¬¤ï¤«¤ê¤Þ¤»¤ó¡£
¸ÇÄê¾®¿ôÅÀ¿ô¤³¤ó¤Ê¤È¤­¤Ë»È¤¦¡£(¤³¤ó¤Ê°ÕÌ£¤¬¤¢¤ë¡Ë
ÉâÆ°¾®¿ôÅÀ¿ô¤³¤ó¤Ê¤È¤­¤Ë»È¤¦¡£(¤³¤ó¤Ê°ÕÌ£¤¬¤¢¤ë¡Ë

ʬ¤«¤ê¤ä¤¹¤¤¤´½õ¸À¤ªÂÔ¤Á¤Þ¤¹¡£
 

Re: ÁᮤΤ´ÊÖ¿®¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹(¤¹¤ß¤Þ¤»¤ó¤¬¤Þ¤¿ÊÔ½¸¤µ¤»¤Æ¤¤¤¿¤À¤­¤Þ¤·¤¿¡Ë

 Åê¹Æ¼Ô¡§Åç¼1243  Åê¹ÆÆü¡§2009ǯ10·î 8Æü(ÌÚ)10»þ54ʬ21ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.619[¸µµ­»ö¤Ø]

kikiriri¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> »³ÃæϵÁ¤µ¤ó¤Ø
>
> ¡¡¡¡kikiriri¤è¤ê
>
>
> ÁᮤΤ´ÊÖ¿®¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
>
> ÉâÆ°¾®¿ôÅÀ¿ô¤Î¤³¤È¤À¤È»×¤¤¤Þ¤¹¡£
>
> ¤É¤Á¤é¤â¤¤¤Ä¤É¤ó¤ÊÉ÷¤ËÍøÍѤ¹¤ë¤«»È¤¤Ê¬¤±Êý¤¬¤ï¤«¤ê¤Þ¤»¤ó¡£
> ¸ÇÄê¾®¿ôÅÀ¿ô¤³¤ó¤Ê¤È¤­¤Ë»È¤¦¡£(¤³¤ó¤Ê°ÕÌ£¤¬¤¢¤ë¡Ë
> ÉâÆ°¾®¿ôÅÀ¿ô¤³¤ó¤Ê¤È¤­¤Ë»È¤¦¡£(¤³¤ó¤Ê°ÕÌ£¤¬¤¢¤ë¡Ë
>
> ʬ¤«¤ê¤ä¤¹¤¤¤´½õ¸À¤ªÂÔ¤Á¤Þ¤¹¡£

¤Þ¤º¤Ï¥Í¥Ã¥È¸¡º÷¤·¤¿¤é¤É¤¦¤Ç¤·¤ç¤¦¤«¡©
Î㤨¤Ð²¼µ­¤¬¸¡º÷¤Ç½Ð¤Þ¤¹¤è¡£
http://ja.wikipedia.org/wiki/%E5%9B%BA%E5%AE%9A%E5%B0%8F%E6%95%B0%E7%82%B9%E6%95%B0
 

¥¨¥é¡½¡¡¥á¥Ã¥»¥¤¥¸¤Î¡¡½Ð¤Ê¤¤¡¡¡¡¥¨¥é¡½

 Åê¹Æ¼Ô¡§Í¿ºä¡¡¡¡¾ºÊ¿  Åê¹ÆÆü¡§2009ǯ10·î 8Æü(ÌÚ)12»þ08ʬ17ÉÃ
ÊÖ¿®¡¦°úÍÑ
  Á°¤Î¡¡¡¡Åê¹Æ¤Ç
¥Þ¥È¥ê¥Ã¥¯¥¹¤ò¡¡¡¡¥¬¥¦¥¹¤Î¡¡¡¡Áݤ­¤À¤·Êý¤Ç¡¡¡¡²ò¤¤¤¿½ê
Àµ³Î¤Ë¤Ï¡¡¡¡5.5 E-9   ¤ò¡¡¡¡¥×¥í¥°¥é¥à¤Ï
-1.5E-15  ¤È¡¡¡¡É½¼¨¤·¡¡¡¡¤½¤Î¤Þ¤Þ
·×»»¤ò¡¡¡¡¤Ä¤º¤±¤Æ¡¡¡¡¡¡¥ª¥«¥·¥Ê¡¡¡¡²óÅú¤¬¡¡¡¡½Ð¤Þ¤·¤¿

¤½¤³¤Ç
·×»»ÅÓÃæ¤Î¡¡¡¡¡¡¿ôÃÍ
TK(a)  ¤Ë¡¡¡¡°Ê²¼¤Î¤è¤¦¤Ë¡¡¡¡¾ò·ï¤ò¡¡¡¡ÉÕ¤±²Ã¤¨¤Þ¤·¤¿

  if  abs(TK(a))<0.000001    then  goto 10  else  goto 20

      10
           TK(a)=0.000000000000000000000000000000

      20

¤½¤ì¤Ç
¤³¤Î¡¡¥×¥í¥°¥é¥à¤Ï¡¡¡¡¡¡°ì±þ¡¡¡¡Àµ³Î¤Ê¡¡¡¡Åú¤¨¤ò¡¡¡¡½Ð¤·¤Þ¤·¤¿


¤·¤«¤·
»þ¡¹¡¡¡¡¡¡·×»»¤µ¤ì¤¿¡¡¿ôÃͤˡ¡¡¡-34298675431657
Åù¤È¡¡¡¡°ìÌܤˡ¡¡¡¥×¥í¥°¥é¥à¤Î¡¡¡¡Ë½Áö¤È¡¡¡¡´¶¤¸¤é¤ì¤ë
¿ôÃͤ¬¡¡¡¡·×»»¤µ¤ì¤Þ¤¹

¤³¤Î¾ì¹ç
¤É¤ÎÍͤˡ¡¡¡¥×¥í¥°¥é¥à¤ò¡¡¡¡»ß¤á¤ë¤Î¤Ç¤·¤ç¤¦¤«¡¡¡©¡©¡©

Î㤨¤Ð

¡¡¡¡¡¡if  ABS(TK(a)>100000000  then  goto  30  else  goto 40

      30
          print " error "
          input xxx

      40



Î㤨¤Ð¡¡¡¡¥×¥í¥°¥é¥à¤Ç¡¡¡¡¥í¥Ü¥Ã¥È¤ò¡¡¡¡Æ°¤«¤¹¾ì¹ç
¥í¥Ü¥Ã¥È¤Ï¡¡¡¡¡¡¥×¥í¥°¥é¥à¤Î¡¡¡¡¥ß¥¹¤¬¡¡¡¡²ò¤ê¤Þ¤»¤ó¤Î¤Ç
°Û¾ï¤Î»þ¤Ï¡¡¡¡»ß¤á¤ë¡¡¡¡¾ì¹ç¤Ç¤¹
 

Re: ¥¨¥é¡½¡¡¥á¥Ã¥»¥¤¥¸¤Î¡¡½Ð¤Ê¤¤¡¡¡¡¥¨¥é¡½

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ10·î 8Æü(ÌÚ)12»þ38ʬ9ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.621[¸µµ­»ö¤Ø]

BASIC¥×¥í¥°¥é¥à¤ò¤ò½ªÎ»¤µ¤»¤ëÌ¿Îá¤Ï
STOP
¤Ç¤¹¡£
STOPʸ¤Ïñ½ã¼Â¹Ôʸ¤Ê¤Î¤Ç¡¤
IF ¡û¡û¡û THEN STOP
¤Î¤è¤¦¤ËIFʸ¤ÈÁȤ߹ç¤ï¤»¤Æ¤â»È¤¨¤Þ¤¹¡£
 

Re: ¥¨¥é¡½¡¡¥á¥Ã¥»¥¤¥¸¤Î¡¡½Ð¤Ê¤¤¡¡¡¡¥¨¥é¡½

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ10·î 8Æü(ÌÚ)12»þ39ʬ35ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.621[¸µµ­»ö¤Ø]

Í¿ºä¡¡¡¡¾ºÊ¿¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> »þ¡¹¡¡¡¡¡¡·×»»¤µ¤ì¤¿¡¡¿ôÃͤˡ¡¡¡-34298675431657
> Åù¤È¡¡¡¡°ìÌܤˡ¡¡¡¥×¥í¥°¥é¥à¤Î¡¡¡¡Ë½Áö¤È¡¡¡¡´¶¤¸¤é¤ì¤ë
> ¿ôÃͤ¬¡¡¡¡·×»»¤µ¤ì¤Þ¤¹

¥Ô¥Ü¥Ã¥ÈÁªÂò¤ÏÀµ¤·¤¯¹Ô¤Ã¤Æ¤¤¤Þ¤¹¤«¡£
£°¤Ë¶á¤¤¾®¤µ¤¤ÃͤdzƷ¸¿ô¤ò³ä¤ë¤È¸íº¹¤¬Â礭¤¯¤Ê¤Ã¤Æ¤¤¤­¤Þ¤¹¡£


> ¤³¤Î¾ì¹ç
> ¤É¤ÎÍͤˡ¡¡¡¥×¥í¥°¥é¥à¤ò¡¡¡¡»ß¤á¤ë¤Î¤Ç¤·¤ç¤¦¤«¡¡¡©¡©¡©

¤½¤ì¤Ç¤¤¤¤¤È»×¤¤¤Þ¤¹¡£


ϢΩÊýÄø¼°¤ò·ÇºÜ¤·¤Æ¤¤¤¿¤À¤±¤ì¤Ð¡¢¤³¤Á¤é¤Ç¤â¸¡¾Ú¤Ç¤­¤ë¤È»×¤¤¤Þ¤¹¤¬¡¢¡¢¡¢¡©
 

Îɤ¤¥Û¡¼¥à¥Ú¡¼¥¸¤Î¤´¾Ò²ð¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ10·î 8Æü(ÌÚ)16»þ41ʬ8ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.620[¸µµ­»ö¤Ø]

Åç¼1243¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

Åç¼1243¤µ¤ó¤Ø

¡¡¡¡kikiriri¤è¤ê

¡¡Îɤ¤¥Û¡¼¥à¥Ú¡¼¥¸¤Î¾Ò²ð¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£

Áᮡ¢´ØÏ¢¹àÌܤâ¤Þ¤¿¡¢°õºþ¤·¤ÆÆɤó¤Ç¤¤¤Þ¤¹¡£¤´½õ¸À¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
 

Îɤ¤¥Û¡¼¥à¥Ú¡¼¥¸¤Î¤´¾Ò²ð¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡££Î£Ï£²

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ10·î 8Æü(ÌÚ)17»þ46ʬ46ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.624[¸µµ­»ö¤Ø]

Åç¼1243¤µ¤ó¤Ø

¡¡¡¡kikiriri¤è¤ê

> Åç¼1243¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£
>
> Åç¼1243¤µ¤ó¤Ø
>
> ¡¡¡¡kikiriri¤è¤ê
>
> ¡¡Îɤ¤¥Û¡¼¥à¥Ú¡¼¥¸¤Î¾Ò²ð¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
>
> Áᮡ¢´ØÏ¢¹àÌܤâ¤Þ¤¿¡¢°õºþ¤·¤ÆÆɤó¤Ç¤¤¤Þ¤¹¡£¤´½õ¸À¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£


´ØÏ¢¹àÌܤǤ¹¤¬¡¢¡ÖÍ­¸ú¿ô»ú¡×
¡ÊÃæ¤Ë¤Ï¡¢µ¿Ìä¤ò´¶¤¸¤ëÅÀ¤â¤¢¤ê¤Þ¤¹¤¬¡Ë12000¤À¤±¤ò¸«¤ì¤Ð¡¢Í­¸ú¿ô»ú¤Ï1·å¤«¤é5·å¤Þ¤Ç
¤Î¤¤¤º¤ì¤Ë¤â¼õ¤±¤È¤ì¤ë¤¿¤á¡£

¤Î¤È¤³¤í¤Ç¡¢12¤Þ¤Ç¤Ï³ÎÄê¤Ê¤Î¤Ç2·å¤«¤é5·å¤Þ¤Ç¤Ç¤Ï¤Ê¤¤¤«¡£

¤Þ¤¿¤â¤ä´ØÏ¢¹àÌܤǤ¹¤¬¡¢¡ÖÀµ³ÎÅÙ¤ÈÀºÅÙ¡×
Ì𤬡¢Åª¤Ë¸þ¤«¤Ã¤ÆÃæ¿´¤«¤éƱ¤¸µ÷Î¥¤ËÅö¤¿¤Ã¤¿¤Ê¤é¡¢

¡É¹âÀµ³ÎÅÙ¤À¤¬ÄãÀºÅÙ¡É

¤Þ¤¿Ìð¤¬Åª¤«¤é¤Îµ÷Î¥¤¬¾¯¤·¤º¤ì¤Æ¤Æ¤âÎÙ¤ê¹ç¤¦¤¯¤é¤¤¶á¤¤ÅÀ¤ËÅö¤¿¤Ã¤¿¤Ê¤é

¡É¹âÀºÅÙ¤À¤¬¡¢ÄãÀµ³ÎÅÙ¡É

¤Ê¤ÉÊÙ¶¯¤Ë¤Ê¤ë¤³¤È¤â¤¢¤ê¤Þ¤·¤¿¡£


°Ê¾åÉÕ¤±Â­¤·¸«¤¿¤¤¤Ç¤¹¤¬¡¢¤¹¤ß¤Þ¤»¤ó¡£¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
 

¥¨¥é¡¼Êó¹ð

 Åê¹Æ¼Ô¡§¸Þ½½Íò¿¿¿Í  Åê¹ÆÆü¡§2009ǯ10·î 9Æü(¶â)20»þ16ʬ47ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ½½¿ÊBASIC¤Î¥×¥í¥°¥é¥à¤òÍ­Íý¿ô¥â¡¼¥É¤Ç¼Â¹Ô¤·¤¿»þ¤Ë°Ê²¼¤Î¤è¤¦¤Ê¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£

£±¡¢¥×¥í¥°¥é¥à

OPTION ARITHMETIC RATIONAL
LET n=1987829
!1987829¤ÏÁÇ¿ô¡£¤·¤¿¤¬¤Ã¤ÆMOD(3^(n-1),n)=1¤Î¤Ï¤º¤Ç¤¹¡£
PRINT MOD(3^(n-1),n)
END

£²¡¢¼Â¹Ô·ë²Ì

836640 ¡ªËÜÍè¤Ï¥Õ¥§¥ë¥Þ¡¼¤Î¾®ÄêÍý¤è¤ê£±¤È¤Ê¤ë¤Ï¤º¤Ç¤¹¡£

¤Ù¤­»Ø¿ô¤Ï-2147483647¡Á2147483647¤ÎÈϰϤÎÀ°¿ô¤Ê¤é¤è¤¤¤Ï¤º¤Ê¤Î¤Ç¤¹¤¬¡¢

¡ä
Í­Íý¿ô¥â¡¼¥É
¿·å¤ÎÍ­Íý¿ô¤Î·×»»¤¬¤Ç¤­¤Þ¤¹¡£
·×»»·ë²Ì¤Ï²¾Ê¬¿ô·Á¤Çɽ¼¨¤·¤Þ¤¹¡£
¤¿¤À¤·¡¤ÆþÎϤäDATAʸ¤Ë¤³¤Î·Á¼°¤Ï»È¤¨¤Þ¤»¤ó¡£
¤Ù¤­¾è±é»»¤Ç¤Ï¡¤¤Ù¤­»Ø¿ô¤Ï-2147483647¡Á2147483647¤ÎÈϰϤÎÀ°¿ô¤Ë¸ÂÄꤵ¤ì¤Þ¤¹¡£
 

Re: ¥¨¥é¡¼Êó¹ð

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ10·î10Æü(ÅÚ)07»þ53ʬ43ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.626[¸µµ­»ö¤Ø]

¤´Êó¹ð¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
Ä´¤Ù¤Æ¤ß¤Þ¤¹¡£
 

Re: ¥¨¥é¡¼Êó¹ð

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ10·î10Æü(ÅÚ)12»þ16ʬ13ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.627[¸µµ­»ö¤Ø]

¼¡¤Î¥×¥í¥°¥é¥à¤Ç¤Ï¡¢PRINTʸ¤Çɽ¼¨¤»¤º¥¨¥é¡¼¤È¤Ê¤ê¤Þ¤¹¡£
LET n=1987829
LET p=3^(n-1)
LET t=p-INT(p/n)*n
PRINT -1 !trace
PRINT t !¢«¢«¢«¢«¢«¡¡¤³¤³¤Ç¼Â¹Ô»þÆâÉô¥¨¥é¡¼¤¬È¯À¸¤¹¤ë
LET t=MOD(p,n)
PRINT -2 !trace
PRINT t
END

¼Â¹Ô·ë²Ì
-1
LET n=1987829
LET p=3^(n-1)
LET t=MOD(p,n)
PRINT -1 !trace
PRINT t !¢«¢«¢«¢«¢«¡¡É½¼¨¤µ¤ì¤ë¿ôÃͤ¬Àµ¤·¤¯¤Ê¤¤
LET t=p-INT(p/n)*n
PRINT -2 !trace
PRINT t !¢«¢«¢«¢«¢«¡¡¤³¤³¤Ç¼Â¹Ô»þÆâÉô¥¨¥é¡¼¤¬È¯À¸¤¹¤ë
END

¼Â¹Ô·ë²Ì
-1
 836640
-2
 

Re: ¥¨¥é¡¼Êó¹ð

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ10·î10Æü(ÅÚ)20»þ56ʬ29ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.627[¸µµ­»ö¤Ø]

¸¶°ø¤Ï¥¢¥»¥ó¥Ö¥é¤Çjecxz¤È¤¹¤Ù¤­¤È¤³¤í¤¬jcxz¤Ë¤Ê¤Ã¤Æ¤¤¤¿¤³¤È¤Ç¤·¤¿¡£
¶áÆüÃæ¤Ë½¤ÀµÈǤòºî¤ê¤Þ¤¹¡£
 

Rolling Cube 1¤Î¸¦µæ

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ10·î12Æü(·î)06»þ35ʬ17ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ¤¢¤ëÊý¤Î¸¦µæ¤Ë¤è¤ë¤È¡¢ºÇ½é¤Î¤µ¤¤¤³¤í¤È¶õ¤­ÃϤνé´üÀßÄê¤ÏǤ°Õ¡Ê¤µ¤¤¤³¤í¤ÎÌܤȸþ¤­¤Ï¾¡¼ê¤ËÁª¤Ù¡¢¶õ¤­ÃϤâÃæ±û¤Ë¸Â¤é¤º¤É¤³¤Ç¤âOK¡Ë
¤Ç¤¢¤Ã¤¿¤È¤·¤Æ¤â¡¢ºÇÄ㣴£¹¼ê°ÊÆâ¤ÇºÇ½ª·Á¡Ê¾åÌ̤ˣ±¤ÎÌܤ¬Â·¤¤¡¢Ãæ±û¤¬¶õ¤­ÃϡˤËÅþã²Äǽ¤Ë¤Ê¤ë¤½¤¦¤Ç¤¹¡£
¤½¤³¤Ç¡¢½é´ü¾ò·ï¤òÆþÎϤ·¤¿¤é¡¢ºÇ½ª·Á¤Þ¤Ç¤ÎºÇû¼ê½ç¤ò¸«¤Ä¤±½Ð¤»¤ë¥×¥í¥°¥é¥à¤òºî¤Ã¤Æ失¤Þ¤»¤ó¤«¡©
°ÊÁ°¡¢»³Ã椵¤ó¤¬·ÇºÜ¤µ¤ì¤Æ¤¤¤¿£±¢ª£²¤Î·Ðϩõº÷¥×¥í¥°¥é¥à¤ò¤¤¤¸¤ì¤Ð¤¤¤¤¤è¤¦¤Êµ¤¤â¤¹¤ë¤Î¤Ç¤¹¤¬¡¢¤Þ¤À¼«Ê¬¤Ç¤Ï¼êľ¤·²Õ½ê¤¬¤ï¤«¤ê¤Þ¤»¤ó¤Î¤Ç¤è¤í¤·¤¯¤ª´ê¤¤¤¤¤¿¤·¤Þ¤¹¡£
 

Re: Rolling Cube 1¤Î¸¦µæ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ10·î12Æü(·î)09»þ17ʬ1ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.630[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¥µ¥ó¥×¥ë¡¦¥×¥í¥°¥é¥à¡¡¡¡¢¨£²¿Ê¥â¡¼¥É¤Ç¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£
!Rolling Cube 1 ¤Î²òË¡

!¡üÌäÂê
!£³¡ß£³¤ÎÈפˡ¢£¸¸Ä¤Î¤µ¤¤¤³¤í¤¬£±¤ÎÌܤ¬¾å¡Ê¾¤ÎÌܤâƱ¤¸¸þ¤­¡Ë¤ÇÇÛÃÖ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
!¶õ¤¤¤Æ¤¤¤ë¥Þ¥¹¤Ëž¤¬¤·¤Æ¡¢¤¹¤Ù¤Æ¤ÎÌܤ¬£¶¤Ë¤Ê¤ë¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£


LET t0=TIME


PUBLIC NUMERIC xSIZE,ySIZE !ÈפÎÂ礭¤µ
LET xSIZE=3
LET ySIZE=3

!¡ü¤µ¤¤¤³¤í¤ÎÈ×¾å¤ÎÇÛÃÖ¤òÊѹ¹¤¹¤ë¾ì¹ç

PUBLIC NUMERIC M(10,10) !¤µ¤¤¤³¤í¤ÎÇÛÃÖ¡¡¢¨¿ô»ú¤ÏÈֹ桢£°¤Ï¶õ¤­
MAT M=ZER(ySIZE+2,xSIZE+2)
DATA -1,-1,-1,-1,-1 !-1:ÊÉ¡¡¢¨ÈÖʼ
DATA -1, 1, 2, 3,-1 !¢«¢«¢«¢«¢« ¢¨
DATA -1, 4, 0, 5,-1
DATA -1, 6, 7, 8,-1
DATA -1,-1,-1,-1,-1
MAT READ M
LET SY=3 !¶õÇò¤Î°ÌÃÖ¡¡¢¨ÈÖʼ¤ò¹Íθ
LET SX=3

!¡ü¼ê¿ô¤Î¾å¸Â¤òÊѹ¹¤¹¤ë¾ì¹ç

PUBLIC NUMERIC LIM !¼ê¿ô¤Î¾å¸Â¡¡¢ªºÇ¾¯¼ê¿ô
LET LIM=49 !¢«¢«¢«¢«¢« ¢¨
PUBLIC NUMERIC LVL(50) !¼ê¤Îµ­Ï¿
MAT LVL=ZER

LET L=0 !£°¼êÌÜ
CALL backtrack(L,-1,SY,SX) !¢¨ÈÖʼ¤ò¹Íθ


PRINT "·×»»»þ´Ö=";TIME-t0;"ÉÃ"

END


EXTERNAL SUB backtrack(L,D,SY,SX) !£±¼ê¤º¤ÄÂǤäƤ¤¤­¡¢¹Ô¤­µÍ¤Þ¤ì¤Ð¸µ¤ËÌá¤Ã¤Æ¤ä¤êľ¤¹

DECLARE EXTERNAL SUB Dice.rolling !³°Éô¼ê³¤­¡¢ÊÑ¿ô¤ÎÄêµÁ
DECLARE EXTERNAL NUMERIC Dice.T1(),Dice.T2(),Dice.T3(),Dice.T4()
DECLARE EXTERNAL NUMERIC Dice.T5(),Dice.T6(),Dice.T7(),Dice.T8()
DECLARE EXTERNAL NUMERIC Dice.DX(),Dice.DY()


DIM TT(6)
SUB ROTATEandMOVE(d) !¤µ¤¤¤³¤í¤ò²óž°ÜÆ°¤¹¤ë
   SELECT CASE id !²óž
   CASE 1
      MAT TT=T1
      CALL rolling(d,T1)
   CASE 2
      MAT TT=T2
      CALL rolling(d,T2)
   CASE 3
      MAT TT=T3
      CALL rolling(d,T3)
   CASE 4
      MAT TT=T4
      CALL rolling(d,T4)
   CASE 5
      MAT TT=T5
      CALL rolling(d,T5)
   CASE 6
      MAT TT=T6
      CALL rolling(d,T6)
   CASE 7
      MAT TT=T7
      CALL rolling(d,T7)
   CASE 8
      MAT TT=T8
      CALL rolling(d,T8)
   CASE ELSE
   END SELECT

   LET M(SY,SX)=id !°ÜÆ°
   LET M(TY,TX)=0
END SUB
SUB RESTORE !¸µ¤ËÌ᤹
   SELECT CASE id !²óž
   CASE 1
      MAT T1=TT
   CASE 2
      MAT T2=TT
   CASE 3
      MAT T3=TT
   CASE 4
      MAT T4=TT
   CASE 5
      MAT T5=TT
   CASE 6
      MAT T6=TT
   CASE 7
      MAT T7=TT
   CASE 8
      MAT T8=TT
   CASE ELSE
   END SELECT

   LET M(TY,TX)=id !°ÜÆ°
   LET M(SY,SX)=0
END SUB


LET C=0 !»Þ´¢¤ê¡¡¢¨¡Ö»Ä¤ê¤Î¼ê¿ô¡×¤È¡ÖÉÔ°ìÃפʤµ¤¤¤³¤í¤Î¿ô¡×¤È¤Î´Ø·¸¤è¤ê
IF T1(3)<>1 THEN LET C=C+1 !1:Ìܤοô¡¡¢«¢«¢«¢«¢« ¢¨
IF T2(3)<>1 THEN LET C=C+1
IF T3(3)<>1 THEN LET C=C+1
IF T4(3)<>1 THEN LET C=C+1
IF T5(3)<>1 THEN LET C=C+1
IF T6(3)<>1 THEN LET C=C+1
IF T7(3)<>1 THEN LET C=C+1
IF T8(3)<>1 THEN LET C=C+1
IF L+C>LIM THEN EXIT SUB !ÉÔ²Äǽ¡ª¡ª¡ª

IF C=0 AND M(3,3)=0 THEN !´°À®¡©¡¡¢¨¡Ö¶õ¤­¡×¤¬Ãæ±û
!!!IF C=0 THEN !´°À®¡©¡¡¢¨¡Ö¶õ¤­¡×¤¬Ãæ±û°Ê³°¤â´Þ¤à
   PRINT L;"¼ê"
   FOR i=1 TO L !¾å¸Â¤Þ¤Ç¤Î¼ê½ç
      SELECT CASE LVL(i)
      CASE 0
         PRINT "L"; !¢¨¤µ¤¤¤³¤í¤Ë¤È¤Ã¤Æ¤ÏµÕ¤È¤Ê¤ë
      CASE 1
         PRINT "D";
      CASE 2
         PRINT "R";
      CASE 3
         PRINT "U";
      CASE ELSE
      END SELECT
   NEXT i
   PRINT
   MAT PRINT M; !ÈפξõÂÖ

   LET LIM=L !¾å¸Â¤ò¶¹¤á¤ë
END IF


IF L>=LIM THEN EXIT SUB !¾å¸Â¤Þ¤Ç

!!!IF L>=2 THEN !¢¨¡Ö¶õ¤­¡×¤òº¸²¼¤Ë°ÌÃÖÉÕ¤±¤ë¡Ê£³¼ê°Ê¹ß¡Ë¡¡¢«¢«¢«¢«¢« £±¤Ä²¼¤ÎIFʸ¤ËÃÖ¤­´¹¤¨¤ë
IF D>=0 THEN !£²¼ê°Ê¹ß
   FOR i=D-1 TO D+1 !µÕ¹Ô¡Ê¸å¤í¡Ë¤òÈò¤±¤Æ¡¢¡Ê±¦¡¦Á°¡¦º¸¤Ø¡ËÁ°¿Ê¤¹¤ë
      LET DD=MOD(i,4) !Ï¢ÈÖ¤ÇÊý¸þ¤òÆÀ¤ë
      LET TX=SX+DX(DD+1) !¡Ö¶õ¤­¡×¤Î¿ÊÏ©°ÌÃÖ
      LET TY=SY+DY(DD+1)
      LET id=M(TY,TX) !ÊÉ¡¢¤µ¤¤¤³¤í¤ÎÈÖ¹æ¤òÆÀ¤ë
      IF id>0 THEN !È×Æâ¤Ê¤é
         CALL ROTATEandMOVE(DD) !¤µ¤¤¤³¤í¤òž¤¬¤¹
         LET LVL(L+1)=DD !¼ê¤òµ­Ï¿¤¹¤ë
         CALL backtrack(L+1,DD,TY,TX) !¼¡¤Ø
         CALL RESTORE !¸µ¤ËÌ᤹
      END IF
   NEXT i

ELSE
   FOR i=3 TO 0 STEP -1 !¢¨¡Ö¶õ¤­¡×¤òº¸²¼¤Ë°ÌÃÖÉÕ¤±¤ë¡¡¢«¢«¢«¢«¢« £±¤Ä²¼¤ÎFORʸ¤ËÃÖ¤­´¹¤¨¤ë¡Ê¤½¤Î¤Þ¤Þ¤Ç¤â²Ä¡Ë
   !!!FOR i=0 TO 3 !Á´Êý¸þ¡¡¢¨Ï¢ÈÖ
      LET TX=SX+DX(i+1) !¡Ö¶õ¤­¡×¤Î¿ÊÏ©°ÌÃÖ
      LET TY=SY+DY(i+1)
      LET id=M(TY,TX) !ÊÉ¡¢¤µ¤¤¤³¤í¤ÎÈÖ¹æ¤òÆÀ¤ë
      IF id>0 THEN !È×Æâ¤Ê¤é
         CALL ROTATEandMOVE(i) !¤µ¤¤¤³¤í¤òž¤¬¤¹
         LET LVL(L+1)=i !¼ê¤òµ­Ï¿¤¹¤ë
         CALL backtrack(L+1,i,TY,TX) !¼¡¤Ø
         CALL RESTORE !¸µ¤ËÌ᤹
         !!!EXIT FOR !¢¨¡Ö¶õ¤­¡×¤òº¸²¼¤Ë°ÌÃÖÉÕ¤±¤ë¡¡¢«¢«¢«¢«¢« ºï½ü¤¹¤ë
      END IF
   NEXT i

END IF

END SUB


MODULE Dice !¤µ¤¤¤³¤í¤òž¤¬¤¹

!ÃÖ´¹¡ÊPermutation¡Ë¤Î·×»»

SHARE NUMERIC U(6),D(6),L(6),R(6) !ÃÖ´¹
!    1,2,3,4,5,6
DATA 3,2,6,4,1,5 !¾å¡¡¢¨ÀµÌ̤ò¾åÌ̤ˤ¹¤ë¡Ê¿Þ¤Ç¤Î¿åÊ¿¼´¡Ë²óž
DATA 1,3,4,5,2,6 !º¸
MAT READ U
CALL PermInverse(U,D)
MAT READ L
CALL PermInverse(L,R)

EXTERNAL SUB PermInverse(A(), iA()) !µÕÃÖ´¹¡¡¢¨iA¤ÏA°Ê³°¤ÎÇÛÎó¤ò»ØÄꤹ¤ë¤³¤È
   FOR i=1 TO UBOUND(A)
      LET iA(A(i))=i
   NEXT i
END SUB
EXTERNAL SUB PermMultiply(A(),B(), AB()) !ÀÑAB¡¡¢¨AB¤ÏA°Ê³°¤«¤ÄB°Ê³°¤ÎÇÛÎó¤ò»ØÄꤹ¤ë¤³¤È
   FOR i=1 TO UBOUND(A)
      LET AB(i)=A(B(i)) !¢¨¹çÀ®¼ÌÁü(AB)(i)=A(B(i))
   NEXT i
END SUB
!---------- ¢¬¢¬¢¬¢¬¢¬ ----------

!¡ü¤µ¤¤¤³¤í¤ÎÌܤÎÇÛÃ֡ʸþ¤­¡Ë¤òÊѹ¹¤¹¤ë¾ì¹ç

!Ÿ³«¿Þ¤ÎÇÛÃÖ¤ÈÌÌÈÖ¹æ¡ÊÇÛÎóÊÑ¿ôT1¡ÁT8¤Îź¤¨»ú¤ËÂбþ¡Ë¤È¤Î´Ø·¸
!¡¡¢¢¡¡¡¡¡¡¡¡¸å¡¡¡¡¡¡¡¡£±
!¢¢¢¢¢¢¢¢¡¡º¸¾å±¦²¼¡¡£²£³£´£µ
!¡¡¢¢¡¡¡¡¡¡¡¡Àµ¡¡¡¡¡¡¡¡£¶
PUBLIC NUMERIC T1(6),T2(6),T3(6),T4(6),T5(6),T6(6),T7(6),T8(6) !£¸¸Ä¤Î¤µ¤¤¤³¤í
DATA   5 !ÌܤÎÇÛÃÖ¡¡¢¨Å¸³«¿Þ»²¾È
DATA 4,1,3,6
DATA   2
MAT READ T1

DATA   5
DATA 4,6,3,1
DATA   2
MAT READ T2

DATA   5
DATA 4,1,3,6
DATA   2
MAT READ T3

DATA   5
DATA 4,6,3,1
DATA   2
MAT READ T4

DATA   5
DATA 4,6,3,1
DATA   2
MAT READ T5

DATA   5
DATA 4,1,3,6
DATA   2
MAT READ T6

DATA   5
DATA 4,6,3,1
DATA   2
MAT READ T7

DATA   5
DATA 4,1,3,6
DATA   2
MAT READ T8
PUBLIC SUB rolling
EXTERNAL SUB rolling(i,T()) !¤µ¤¤¤³¤í¤ò²óž¤µ¤»¤ë
   DIM TT(6) !ºî¶ÈÍÑ

   SELECT CASE i !¢¨DX(),DY()»²¾È
   CASE 0
      CALL PermMultiply(T,L,TT) !¢¨¤µ¤¤¤³¤í¤Ë¤È¤Ã¤Æ¤ÏµÕ¤È¤Ê¤ë
   CASE 1
      CALL PermMultiply(T,D,TT)
   CASE 2
      CALL PermMultiply(T,R,TT)
   CASE 3
      CALL PermMultiply(T,U,TT)
   CASE ELSE
   END SELECT

   MAT T=TT
END SUB
!---------- ¢¬¢¬¢¬¢¬¢¬ ----------


PUBLIC NUMERIC DX(4),DY(4) !£´¶á˵¡¡¢¨È¿»þ·×¤Þ¤ï¤ê¤ÎÏ¢ÈÖ¡¡±¦:0¡¢¾å:1¡¢º¸:2¡¢²¼:3
DATA 1, 0,-1,0
DATA 0,-1, 0,1
MAT READ DX
MAT READ DY

END MODULE
 

Í­¸ú¿ô»ú¡ÊÍ­¸ú·å¿ô¡Ë¤Î·×»»ÊýË¡

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ10·î12Æü(·î)10»þ12ʬ9ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ÀºÅÙ¤òÍî¤È¤µ¤Ê¤¤·×»»ÊýË¡¤ò¸¡Æ¤¤·¤Þ¤¹¡£
ÅÅÂî¤Îµ¡Ç½¤ÈƱÅù¤Ê´Ø¿ô¤òÄêµÁ¤·¤Æ¡¢¥·¥ß¥å¥ì¡¼¥·¥ç¥ó¤·¤Æ¤ß¤Þ¤·¤¿¡£
!Í­¸ú¿ô»ú¡ÊÍ­¸ú·å¿ô¡Ë¤Î·×»»ÊýË¡
!»²¹Í¥µ¥¤¥È¡¡http://ja.wikipedia.org/wiki/%E6%9C%89%E5%8A%B9%E6%95%B0%E5%AD%97

!»²¹Í¥µ¥¤¥È¡¡http://hp.vector.co.jp/authors/VA008683/QA_JISROUND.htm
FUNCTION ROUND10(x,n) !ºÇ¶áÀܶö¿ô¤Ø¤Î´Ý¤á¤ÎÊýË¡¤Ç¡¢x¤ò¾®¿ôÅÀ°Ê²¼n·å¤Ë´Ý¤á¤ë
   LET x=x*10^n
   IF MOD(x,1)<0.5 THEN
      LET x=INT(x)
   ELSEIF MOD(x,1)>0.5 THEN
      LET x=CEIL(x)
   ELSEIF MOD(INT(x),2)=0 THEN
      LET x=INT(x)
   ELSE
      LET x=CEIL(x)
   END IF
   LET ROUND10=x/10^n
END FUNCTION

!¾®¿ôÅÀ°Ê²¼·å¿ô¸ÇÄê FIX(¿ôÃÍ,·å¿ô)
DEF FIX(x,n)=ROUND10(x,n)
!DEF FIX(x,n)=ROUND(x,n) !=INT(x*10^n+0.5)/10^n
!DEF FIX(x,n)=TRUNCATE(x,n) !=IP(x*10^n)/10^n

FUNCTION SCI(x,n) !Í­¸ú·å¿ô»ØÄê SCI(¿ôÃÍ,·å¿ô)
   LET m=0
   IF x>1 THEN !##.#¤Ê¤é
      DO UNTIL ABS(x)<1 !0.###·Á¼°¤Ø
         LET x=x/10
         LET m=m+1
      LOOP
      LET SCI=FIX(x,n)*10^m !¢¨JIS Z8401¡Ø¿ôÃͤδݤáÊý¡Ù¡¢Ã±½ã¤Ê»Í¼Î¸ÞÆþ¡¢ÀڼΤƤʤÉ
   ELSE !0.00###¤Ê¤é
      DO UNTIL ABS(x)>=1 !#.##·Á¼°¤Ø
         LET x=x*10
         LET m=m+1
      LOOP
      LET SCI=FIX(x,n-1)/10^m
   END IF
   !PRINT "x=";x; "m=";m !debug
END FUNCTION


!Îã¡¡12.3+50*0.650
PRINT FIX(12.3 + SCI(50*0.650,2), 0) !2=50¤ÎÍ­¸ú·å¿ô¡¢0=50¤ÎÍ­¸ú·å°ÌÃÖ
PRINT 12.3+50*0.650 !¤Ù¤¿
PRINT


!Îã¡¡( 2.234 * 5.67815 + 100.9049 ) * 4.60
PRINT SCI(FIX( SCI(2.234*5.67815,4) + 100.9049, 2) * 4.60, 3) !Ëè²ó´Ý¤á¤ë¤ÈÀºÅÙ¤¬Íî¤Á¤ë¾ì¹ç¤¬¤¢¤ë
PRINT SCI(FIX( SCI(2.234*5.67815,5) + 100.9049, 3) * 4.60, 3) !¤½¤³¤ÇÍ­¸ú¿ô»ú¡Ü£±·å¤Ç·×»»¤ò¿Ê¤á¤ë
PRINT ( 2.234 * 5.67815 + 100.9049 ) * 4.60
PRINT


!Îã¡¡£¸·å´Ø¿ôÅÅÂî¤Î¥·¥ß¥å¥ì¡¼¥·¥ç¥ó¡¡¢¨£È£Ð¤ÏJIS´Ý¤á¡¢¥·¥ã¡¼¥×¤È¥«¥·¥ª¤Ï»Í¼Î¸ÞÆþ

PRINT SCI(2+5E-8,8) !JIS Z8401¡Ø¿ôÃͤδݤáÊý¡Ù 2.0000000
PRINT SCI(2+5.1E-8,8) !2.0000001
PRINT SCI(5.0000002*5.0000003,8) !25.000003
PRINT 5.0000002*5.0000003
PRINT SCI(5.0000001*5,8) !25.000000¡¡¢¨2¿Ê¥â¡¼¥É¤Ç¤ÏNG
PRINT 5.0000001*5


END
 

MOD´Ø¿ô¤Ï10¿Ê°Ê³°¤Ï»È¤¨¤Ê¤¤¡©

 Åê¹Æ¼Ô¡§Åç¼1243  Åê¹ÆÆü¡§2009ǯ10·î12Æü(·î)11»þ28ʬ33ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ½½¿ÊBASIC-7.3.5¤ò»È¤ï¤»¤Æ夤¤Æ¤¤¤Þ¤¹¡£
²¼µ­¥×¥í¥°¥é¥à¤ò¥Ä¡¼¥ë¥Ü¥¿¥ó¤ÇÊ£ÁÇ¿ô¥â¡¼¥É¤È2¿Ê¥â¡¼¥É¤ËÊѹ¹(ÆÃÊ̤ʰÕÌ£¤Ï
¤Ê¤·¡Ë¤·¤ÆRUN¤·¤¿¤é¡¢ÍæÀûµ°Æ»¤òÉÁ¤¯¥Ü¡¼¥ë¤Î°ÌÃÖ¡Ê´Ý°õ¡Ë¤ÈȾ·ÂÀþ¤ÎÉÁ²è¤¬¤µ
¤ì¤Þ¤»¤ó¤Ç¤·¤¿¡£10¿Ê¥â¡¼¥É¤Ç¤ÏÀµ¾ï¤Ç¤¹¡£1000·å¥â¡¼¥É¤Ï¡Öcos´Ø¿ô¤ò¥µ¥Ý¡¼¥È
¤·¤Ê¤¤¡×¤È¸À¤¦¥á¥Ã¥»¡¼¥¸¤¬½Ð¤Þ¤¹¡£

¥Ü¡¼¥ë°ÌÃÖ¤ÈȾ·ÂÀþ¤ÎÉÁ²è¥¿¥¤¥ß¥ó¥°¤Ï¡¢MOD´Ø¿ô¤ò»È¤Ã¤ÆȽÃǤ·¤Æ¤¤¤ë¤Î¤Ç¡¢¤³¤Î´Ø¿ô¤Ï10¿Ê¥â¡¼¥ÉÀìÍÑ´Ø¿ô¤«¤Ê¡©¤È»×¤¤¤Þ¤·¤¿¤¬¡¢¤½¤¦¤Ê¤Î¤Ç¤·¤ç¤¦¤«¡£

SET WINDOW -25,5,-15,15

SET POINT STYLE 4

!DRAW grid

LET ydo=-20

LET xdo=-60

LET zdo=75

LET hrad=PI/180

LET xrad=xdo*hrad

LET yrad=ydo*hrad

LET zrad=zdo*hrad

LET R=8

LET f=0.1

LET w=2*PI*f

LET vz=0.6



CALL henkan(10,0,0,xrad,yrad,zrad,x3_,y3_,z3_)

PLOT LINES:0,0;x3_,y3_

CALL henkan(-10,0,0,xrad,yrad,zrad,x3_,y3_,z3_)

PLOT LINES:0,0;x3_,y3_



SET LINE COLOR "red"

CALL henkan(0,10,0,xrad,yrad,zrad,x3_,y3_,z3_)

PLOT LINES:0,0;x3_,y3_

CALL henkan(0,-10,0,xrad,yrad,zrad,x3_,y3_,z3_)

PLOT LINES:0,0;x3_,y3_



SET LINE COLOR "blue"

CALL henkan(0,0,28,xrad,yrad,zrad,x3_,y3_,z3_)

PLOT LINES:0,0;x3_,y3_



SET LINE COLOR "green"

CALL henkan(r,0,0,xrad,yrad,zrad,x3_,y3_,z3_)

FOR t=0 TO 10 STEP 0.05

   LET x=r*COS(w*t)

   LET y=r*SIN(w*t)

   LET z=0

   CALL henkan(x,y,z,xrad,yrad,zrad,x3,y3,z3)

   PLOT LINES:x3_,y3_;x3,y3

   LET x3_=x3

   LET y3_=y3

NEXT T



SET LINE COLOR "black"

FOR t=0 TO 41 STEP 0.05

   LET x=r*COS(w*t)

   LET y=r*SIN(w*t)

   LET z=vz*t

   CALL henkan(x,y,z,xrad,yrad,zrad,x3,y3,z3)

   PLOT LINES:x3_,y3_;x3,y3

   LET x3_=x3

   LET y3_=y3

   LET cnt=MOD(t,0.4)

   IF cnt=0 THEN

      LET x=0

      LET y=0

      CALL henkan(x,y,z,xrad,yrad,zrad,x0_,y0_,z0_)

      PLOT LINES:x0_,y0_;x3_,y3_

      PLOT POINTS:x3_,y3_

   END IF

NEXT T

END



EXTERNAL SUB henkan(x,y,z,xa,ya,za,x3,y3,z3)

LET x1=x*COS(ya)+z*SIN(ya)

LET y1=y

LET z1=-x*SIN(ya)+z*COS(ya)

LET x2=x1

LET y2=y1*COS(xa)-z1*SIN(xa)

LET z2=y1*SIN(xa)+z1*COS(xa)

LET x3=x2*COS(za)-y2*SIN(za)

LET y3=x2*SIN(za)+y2*COS(za)

LET z3=z2

END SUB
 

Re: MOD´Ø¿ô¤Ï10¿Ê°Ê³°¤Ï»È¤¨¤Ê¤¤¡©

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ10·î12Æü(·î)11»þ50ʬ18ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.633[¸µµ­»ö¤Ø]

2¿Ê¥â¡¼¥É¤Ç
FOR t=0 TO 41 STEP 0.05
¤È¤¹¤ë¤È¸íº¹¤¬È¯À¸¤·¤Þ¤¹¡£

  IF cnt=0 THEN
¤Î¤È¤³¤í¤ò
  IF ABS(cnt)<=0.01 THEN
¤ÈÊѤ¨¤Æ¤ß¤¿¤é¤¤¤«¤¬¤Ç¤·¤ç¤¦¤«¡£

¤Ê¤ª¡¤2¿Ê¥â¡¼¥É¤Ç¤Ï¡¤0.05¡¤0.4¤Î¤¤¤º¤ì¤â¸íº¹¤ò»ý¤Á¤Þ¤¹¡£
2¿Ê¥â¡¼¥É¤Ç¸íº¹¤òÈò¤±¤¿¤¤¤È¤­¤Ï¡¤0.5¡¤0.25¡¤0.125¡¤0.0625¤Ê¤É¡¤
ʬ¿ô¤Ë¤·¤¿¤È¤­Ê¬Ê줬2¤Î¤Ù¤­¤Ë¤Ê¤ë¿ô¤òÁª¤ó¤Ç¤¯¤À¤µ¤¤¡£
 

Re: MOD´Ø¿ô¤Ï10¿Ê°Ê³°¤Ï»È¤¨¤Ê¤¤¡©

 Åê¹Æ¼Ô¡§Åç¼1243  Åê¹ÆÆü¡§2009ǯ10·î12Æü(·î)17»þ22ʬ11ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.634[¸µµ­»ö¤Ø]

ÇòÀС¡ÏÂÉפµ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> 2¿Ê¥â¡¼¥É¤Ç
> FOR t=0 TO 41 STEP 0.05
> ¤È¤¹¤ë¤È¸íº¹¤¬È¯À¸¤·¤Þ¤¹¡£
>
>   IF cnt=0 THEN
> ¤Î¤È¤³¤í¤ò
>   IF ABS(cnt)<=0.01 THEN
> ¤ÈÊѤ¨¤Æ¤ß¤¿¤é¤¤¤«¤¬¤Ç¤·¤ç¤¦¤«¡£
>
> ¤Ê¤ª¡¤2¿Ê¥â¡¼¥É¤Ç¤Ï¡¤0.05¡¤0.4¤Î¤¤¤º¤ì¤â¸íº¹¤ò»ý¤Á¤Þ¤¹¡£
> 2¿Ê¥â¡¼¥É¤Ç¸íº¹¤òÈò¤±¤¿¤¤¤È¤­¤Ï¡¤0.5¡¤0.25¡¤0.125¡¤0.0625¤Ê¤É¡¤
> ʬ¿ô¤Ë¤·¤¿¤È¤­Ê¬Ê줬2¤Î¤Ù¤­¤Ë¤Ê¤ë¿ô¤òÁª¤ó¤Ç¤¯¤À¤µ¤¤¡£

ÇòÀÐÀèÀ¸¡¢¤´¶µ¼¨Í­Æñ¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
£²¿Ê¡¢Ê£ÁÇ¿ô¤Îξ¥â¡¼¥É¤Ç¡¢0.125°Ê¾å¤Ë¥»¥Ã¥È¤¹¤ë¤È¡¢´Ý¤ÈÀþ¤Ï¥À¥Ö¤ê¤Þ¤¹¤¬ÉÁ¤«¤ì¤Þ¤·¤¿¡£
¥»¥Ã¥ÈÃͤò¹¹¤Ë¾®¤µ¤¯¤¹¤ë¤ÈÉÁ²è¤µ¤ì¤Ê¤¤ÈϰϤ¬À¸¤¸¤Þ¤¹¡£

¤³¤Î·ë²Ì¤ò¸«¤Æ¡¢²þ¤á¤Æ£±£°¿Ê¥â¡¼¥É¤Î¶¯ÎϤµ¡¢½½¿ÊBASIC¤È̿̾¤·¤¿°ÕÌ£¹ç¤¤¤ò¼Â´¶¤·
¤Þ¤·¤¿¡£
 

Re: MOD´Ø¿ô¤Ï10¿Ê°Ê³°¤Ï»È¤¨¤Ê¤¤¡©

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ10·î12Æü(·î)17»þ54ʬ3ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.635[¸µµ­»ö¤Ø]

Åç¼1243¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> £²¿Ê¡¢Ê£ÁÇ¿ô¤Îξ¥â¡¼¥É¤Ç¡¢0.125°Ê¾å¤Ë¥»¥Ã¥È¤¹¤ë¤È¡¢´Ý¤ÈÀþ¤Ï¥À¥Ö¤ê¤Þ¤¹¤¬ÉÁ¤«¤ì¤Þ¤·¤¿¡£
> ¥»¥Ã¥ÈÃͤò¹¹¤Ë¾®¤µ¤¯¤¹¤ë¤ÈÉÁ²è¤µ¤ì¤Ê¤¤ÈϰϤ¬À¸¤¸¤Þ¤¹¡£

¾¤Î¸À¸ì¤Ê¤É¤Ç¤Ï¡¢£²¿Ê·×»»¤Ç¤¹¤Î¤ÇÄ̾ï¤Ï¤³¤Î¤è¤¦¤Ë¥³¡¼¥Ç¥£¥ó¥°¤·¤Þ¤¹¡£
ºÇ¸å¤ÎFORʸ¤Î½¤Àµ¤ò·ÇºÜ¤·¤Þ¤¹¡£Â¾¤ÎÉôʬ¤âƱÍͤǤ¹¡£
SET LINE COLOR "black"

FOR tt=0 TO 4100 STEP 5 !¥«¥¦¥ó¥¿ÊÑ¿ô¤ÏÀ°¿ô·¿¤È¤¹¤ë¡¡¢«¢«¢«¢«
   LET t=tt/100 !¼ÂºÝ¤ÎÃͤ˴¹»»¤¹¤ë¡¡¢«¢«¢«¢«

   LET x=r*COS(w*t)
   LET y=r*SIN(w*t)
   LET z=vz*t

   CALL henkan(x,y,z,xrad,yrad,zrad,x3,y3,z3)

   PLOT LINES:x3_,y3_;x3,y3

   LET x3_=x3
   LET y3_=y3

   LET cnt=MOD(tt,40) !¢«¢«¢«¢«
   IF cnt=0 THEN
      LET x=0
      LET y=0

      CALL henkan(x,y,z,xrad,yrad,zrad,x0_,y0_,z0_)

      PLOT LINES:x0_,y0_;x3_,y3_
      PLOT POINTS:x3_,y3_

   END IF

NEXT tt !¢«¢«¢«¢«
 

Re: MOD´Ø¿ô¤Ï10¿Ê°Ê³°¤Ï»È¤¨¤Ê¤¤¡©

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ10·î12Æü(·î)18»þ54ʬ39ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.633[¸µµ­»ö¤Ø]

!£²¿Ê¥ì¥¸¥¹¥¿¡¼¡¦¥¤¥á¡¼¥¸¤Î¡¢step ¤Ë½ÐÍè¤Þ¤¹¤«¡©¸íº¹¤¬¾Ã¤¨¤Þ¤¹¡£

FOR t=0 TO 41 STEP 2^(-5 ) !0.05
¡¡¡¡(
     )
   LET cnt=MOD(t, 2^(-5) *8 ) ! 1,2,3,,,8,,,
   IF cnt=0 THEN
 

!¤Ê¤¼¡¢¤³¤¦¤Ê¤ë¤Î¤«¡©

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ10·î13Æü(²Ð)08»þ07ʬ56ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  !¤Ê¤¼¡¢¤³¤¦¤Ê¤ë¤Î¤«¡©

OPTION ARITHMETIC NATIVE
OPTION BASE 0
DIM D8(500,500)
!
SET VIEWPORT 0, 0.4, 0.6, 1
CALL sample(DX$,DY$)
LET DX=VAL(DX$)
LET DY=VAL(DY$)
MAT D8=ZER(DX,DY)
!
SET VIEWPORT 0, 1, 0, 1
SET WINDOW 0, 500, 500, 0
!
! SET COLOR MODE "NATIVE" ! ¢«¤³¤ì¤òÆþ¤ì¤ë¤ÈÀµ¾ï¤Ë¥³¥Ô¡¼¤µ¤ì¤ë¡£
!
ASK PIXEL ARRAY (0,0) D8
MAT PLOT CELLS,IN 250,250; 450,450: D8
!
!main00
!   (
!    )
END

EXTERNAL SUB sample(DX$,DY$)
! ¥Þ¥ó¥Ç¥ë¥Ö¥í¡¼¡ÊComplex\mandelbm.bas ¤ÎÃ忧²þÊÑ¡Ë
OPTION ARITHMETIC COMPLEX
SET COLOR MODE "REGULAR"
SET POINT STYLE 1
FOR n=0 TO 50
   SET COLOR MIX(    n) 0   ,0     ,n/51   !BLACK =< < BLUE
   SET COLOR MIX( 51+n) 0   ,n/51  ,1      !BLUE =< < CYAN
   SET COLOR MIX(102+n) 0   ,1     ,1-n/51 !CYAN =< < GREEN
   SET COLOR MIX(153+n) n/51,1     ,0      !GREEN =< < YELLOW
   SET COLOR MIX(204+n) 1   ,1-n/51,0      !YELLOW =< < RED
NEXT n
LET XL=-2
LET XR=.8
LET w1=XR-XL
LET w2=w1/2
SET WINDOW XL, XR,-w2,w2
ASK PIXEL SIZE(XL,-w2; XR,w2) px,py
!
FOR x=XL TO XR STEP w1/(px-1)
   FOR y=-w2-.49*w1/(py-1) TO w2 STEP w1/(py-1) !¸Î°Õ¤Ë(x,0)¤òÉÁÅÀ¤Î´Ö¤Ë¶´¤à¡£
      LET z=0
      FOR n=1 TO 255
         LET z=z^2+COMPLEX(x,y)
         IF 2< ABS(z) THEN
            IF n< 64 THEN SET POINT COLOR n*4 ELSE SET POINT COLOR 255
            PLOT POINTS :x,y !¾å²¼¤ÎÂоݥץí¥Ã¥È¤ò¤·¤Ê¤¤¡£
            EXIT FOR
         END IF
      NEXT n
   NEXT y
NEXT x
LET DX$=STR$(px-1)
LET DY$=STR$(py-1)
END SUB

!¢¨¿§»Øɸ¤Þ¤Ç¡¢Ê£ÁÇ¿ô¤Ë¤Ê¤ë¤Î¤Ç¤·¤ç¤¦¤«¡£
 

Re: MOD´Ø¿ô¤Ï10¿Ê°Ê³°¤Ï»È¤¨¤Ê¤¤¡©

 Åê¹Æ¼Ô¡§Åç¼1243  Åê¹ÆÆü¡§2009ǯ10·î13Æü(²Ð)10»þ19ʬ21ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.636[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¾¤Î¸À¸ì¤Ê¤É¤Ç¤Ï¡¢£²¿Ê·×»»¤Ç¤¹¤Î¤ÇÄ̾ï¤Ï¤³¤Î¤è¤¦¤Ë¥³¡¼¥Ç¥£¥ó¥°¤·¤Þ¤¹¡£
> ºÇ¸å¤ÎFORʸ¤Î½¤Àµ¤ò·ÇºÜ¤·¤Þ¤¹¡£Â¾¤ÎÉôʬ¤âƱÍͤǤ¹¡£
> FOR tt=0 TO 4100 STEP 5 !¥«¥¦¥ó¥¿ÊÑ¿ô¤ÏÀ°¿ô·¿¤È¤¹¤ë¡¡¢«¢«¢«¢«
>    LET t=tt/100 !¼ÂºÝ¤ÎÃͤ˴¹»»¤¹¤ë¡¡¢«¢«¢«¢«

»³Ã椵¤ó¡¢¤´¶µ¼¨Í­Æñ¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
¥«¥¦¥ó¥¿ÊÑ¿ô¤ËÀµÅýŪ¤Ê·¿¤ò»È¤¨¤ÐÌäÂ̵꤬¤¤¤È¤¤¤¦¤³¤È¤Ê¤ó¤Ç¤¹¤Í¡£
½½¿ÊBASIC¤ÏÍưפ˰·¤¨¤ë¤Î¤Ç¡¢´ðËܤ¬¤¹¤Ã¤«¤êƬ¤«¤éÈ´¤±¤Æ¤·¤Þ¤¤¤Þ¤·¤¿¡£
 

Re: !¤Ê¤¼¡¢¤³¤¦¤Ê¤ë¤Î¤«¡©

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ10·î13Æü(²Ð)10»þ29ʬ29ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.638[¸µµ­»ö¤Ø]

ASK PIXEL ARRAY¤Ï¡¤³ºÅö¤¹¤ë¿§»Øɸ¤¬Â¸ºß¤·¤Ê¤¤¤È-1¤òÂåÆþ¤·¤Þ¤¹¡£
¤â¤È¤â¤È¤ÎÇØ·Ê¿§¡ÊÇò¡Ë¤ËÂбþ¤¹¤ë¿§»Øɸ¤¬¼º¤ï¤ì¤Æ¤·¤Þ¤Ã¤¿¤Î¤Ç¡¤¤½¤ÎÉôʬ¤Î¿§»Øɸ¤¬-1¤È¤·¤Æ¼èÆÀ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
ASK PIXEL ARRAY (0,0) D8
¤Î¸å¤Ë
MAT PRINT D8;
¤òÄɲ䷤Ƥߤë¤È¤ï¤«¤ë¤È»×¤¤¤Þ¤¹¡£
¤Ê¤ª¡¤MAT PLOT CELLS ¤Ï-1¤Ë½Ð²ñ¤¦¤È¤½¤Î¹Ô¤Î¤½¤ì°Ê¸å¤ÎÉÁ²è¤ò¥µ¥Ü¤ê¤Þ¤¹¡£¡Ê½¤Àµ¤¹¤Ù¤­»ö¹à¤«¤â¤·¤ì¤Þ¤»¤ó¡Ë
 

Re: MOD´Ø¿ô¤Ï10¿Ê°Ê³°¤Ï»È¤¨¤Ê¤¤¡©

 Åê¹Æ¼Ô¡§Åç¼1243  Åê¹ÆÆü¡§2009ǯ10·î13Æü(²Ð)10»þ30ʬ46ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.637[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> !£²¿Ê¥ì¥¸¥¹¥¿¡¼¡¦¥¤¥á¡¼¥¸¤Î¡¢step ¤Ë½ÐÍè¤Þ¤¹¤«¡©¸íº¹¤¬¾Ã¤¨¤Þ¤¹¡£

FORʸ¤ÎSTEPÃͤ⣲¿Ê¥¤¥á¡¼¥¸¤Ë¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤È¤Ïµ¤ÉÕ¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£
MOD´Ø¿ô¤¬¶´¤Þ¤ì¤Æ¤¤¤ëFOR NEXTʸÃæ¤Î£²¹Ô½¤Àµ¤Î¤ß¤ÇÌäÂê²ò·è¤·¤Þ¤·¤¿¡£
SECOND¤µ¤ó¡¢Í­Æñ¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
 

Re: !¤Ê¤¼¡¢¤³¤¦¤Ê¤ë¤Î¤«¡©

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ10·î13Æü(²Ð)14»þ00ʬ40ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.640[¸µµ­»ö¤Ø]

²ò¤ê¤Þ¤·¤¿¡¢¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£ÉÁÅÀ¤·¤Ê¤¤ÈϰϤò¡¢¤¹¤Ã¤«¤ê˺¤ì¤Æ¤¤¤Þ¤·¤¿¡£
 

¤Ä¤Å¤­£´

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ10·î13Æü(²Ð)22»þ40ʬ4ÉÃ
ÊÖ¿®¡¦°úÍÑ
  !Page-4 ¤Î»Ï¤á

!========================
SUB W_BIN31
!---SOI
   CALL WRT_H("FFD8")
   !---APP0
   CALL WRT_H("FFE0")
   CALL WRT_W( 2+14)  !size
   CALL WRT_M("JFIF"& CHR$(0))
   CALL WRT_H("0101") !ver 1.1
   CALL WRT_D(1)      !0=none 1=dpi 2=dpcm
   CALL WRT_W(72)     !Xd 72 ¥¢¥¹¥Ú¥¯¥ÈÈæ¡¡IE6(no) imaging(ok)
   CALL WRT_W(72)     !Yd 72 ¥¢¥¹¥Ú¥¯¥ÈÈæ
   CALL WRT_D(0)      !Xt 0
   CALL WRT_D(0)      !Yt 0
   !---DQT.Y.C
   CALL WRT_H("FFDB")
   LET W=2           !start size
   FOR J=0 TO CMO/2  !CMO=0(mono.) CMO=2(color)
      LET W=W+1+64   !+ID +QT
   NEXT J
   CALL WRT_W( W)    !size
   FOR J=0 TO CMO/2  ! CMO=0(mono.) CMO=2(color)
      CALL WRT_D(J)  !J= (0)Y.DQ (1)C.DQ
      FOR I=0 TO 63
         CALL WRT_D( DQ(U(i),V(i),J) )
      NEXT I
   NEXT J
   !---SOF0
   CALL WRT_H("FFC0")
   IF CMO=0 THEN CALL WRT_W( 11) ELSE CALL WRT_W( 17) !size
   CALL WRT_D( 8)  !8bit at RGB
   CALL WRT_W( DY) !V.pixels
   CALL WRT_W( DX) !H.pixels
   IF CMO=0 THEN
      CALL WRT_H("01")     !1 items
      CALL WRT_H("011100") !Y MCU(H:V) DQT
   ELSE
      CALL WRT_H("03")     !3 items
      CALL WRT_H("01"& STR$(MH(0))& STR$(MV(0))& "0"& STR$(QS(0))) !Y  MCU(H:V) DQT
      CALL WRT_H("02"& STR$(MH(1))& STR$(MV(1))& "0"& STR$(QS(1))) !Cb - -
      CALL WRT_H("03"& STR$(MH(2))& STR$(MV(2))& "0"& STR$(QS(2))) !Cr - -
   END IF
   !---DHT
   CALL WRT_H("FFC4")
   LET W=2                 !start size
   FOR J=0 TO CMO+1        !CMO=0(mono.) CMO=2(color)
      LET W=W+1+16+DH(0,J) !+ID +HT +VT
   NEXT J
   CALL WRT_W( W)          !size
   FOR J=0 TO CMO+1                     !CMO=0(mono.) CMO=2(color)
      CALL WRT_D( 16*MOD(J,2)+IP(J/2) ) !   00h=YDC 10h=YAC 01h=CDC 11h=CAC
      FOR I=1 TO 16                     !(J) 0 =YDC  1 =YAC  2 =CDC  3 =CAC
         CALL WRT_D( DH(I,J))
      NEXT I
      FOR I=0 TO DH(0,J)-1
         CALL WRT_D( DV(I,J))
      NEXT I
   NEXT J
   !---SOS
   CALL WRT_H("FFDA")
   IF CMO=0 THEN
      CALL WRT_W(8)      !size
      CALL WRT_D(1)      !1 items
      CALL WRT_H("0100") !No.  Y.HDC/HAC
   ELSE
      CALL WRT_W(12)     !size
      CALL WRT_D( 3)     !3 items
      CALL WRT_H("0100") !No.  Y.HDC/HAC
      CALL WRT_H("0211") !No. Cb.HDC/HAC
      CALL WRT_H("0311") !No. Cr.HDC/HAC
   END IF
   CALL WRT_H("003F00") !band 0~63, AhAl=00
END SUB

!----------------
!open write binary
SUB WOPEN
   OPEN #1:NAME FL$
   ERASE #1
END SUB

!sequential write byte
SUB WRT_D( D)
   PRINT #1 :CHR$(D);
   LET byt=byt+1 !!!
END SUB

!sequential write word
SUB WRT_W( w)
   PRINT #1 :CHR$(IP(w/256));CHR$(MOD(w,256));
   LET byt=byt+2 !!!
END SUB

!sequential write binary massage W$
SUB WRT_M( w$)
   FOR w=1 TO LEN(w$)
      PRINT #1 :MID$(w$,w,1);
   NEXT w
   LET byt=byt+w-1 !!!
END SUB

!sequential write binary hex.massage w$
SUB WRT_H( w$)
   FOR w=1 TO LEN(w$) STEP 2
      PRINT #1 :CHR$(BVAL(MID$(w$,w,2),16));
   NEXT w
   LET byt=byt+LEN(w$)/2 !!!
END SUB

!=====================
! print huffman_table
SUB list_HT( m$,J)
   PRINT m$;" ÉÑÅÙ ºÂɸ bit ¥³¡¼¥É(";
   IF MOD(B(256,J),2)=1 THEN PRINT "ºÂɸ½ç)" ELSE PRINT "À¸À®½ç¡¢ÉÑÅٹ߽ç)"
   LET sum=0
   FOR i=0 TO 255
      IF L(i,J)<>0 THEN
         IF MOD(B(256,J),2)=1 THEN ! 1=Sort_value. Encorder
            LET V_=i
            LET w$="     "& RIGHT$("   "& STR$(SV(i,J)),4)& "  " ! times
            LET sum=sum+L(i,J)*SV(i,J)
         ELSE                      ! 0=Sort_length. Decorder
            LET V_=DV(i,J)
            LET w$="     "& RIGHT$("   "& STR$(S_(i,J)),4)& "  " ! times
            LET sum=sum+L(i,J)*S_(i,J)
         END IF
         LET w$=w$& RIGHT$("0"& BSTR$(V_,16),2)& "  " ! value
         LET w$=w$& RIGHT$(" "& STR$(L(i,J)),2)& "  " ! length
         !--- huffman code
         LET H_=B(i,J) ! code
         LET L_=L(i,J) ! length
         !--- bit_pattern
         LET w$=w$& left$(right$("0000000"& BSTR$(H_,2),16),L_)
         PRINT w$
      END IF
   NEXT i
   PRINT " ¹ç·×( ÉÑÅÙ * bit)=";sum
END SUB

END

EXTERNAL SUB sample(DX$,DY$)
! ¥Þ¥ó¥Ç¥ë¥Ö¥í¡¼¡ÊComplex\mandelbm.bas ¤ÎÃ忧²þÊÑ¡Ë
OPTION ARITHMETIC COMPLEX
SET COLOR MODE "REGULAR"
SET POINT STYLE 1
FOR n=1 TO 51
   SET COLOR MIX(    n) 0   ,0     ,n/51   !BLACK < < BLUE
   SET COLOR MIX( 51+n) 0   ,n/51  ,1      !BLUE  < < CYAN
   SET COLOR MIX(102+n) 0   ,1     ,1-n/51 !CYAN  < < GREEN
   SET COLOR MIX(153+n) n/51,1     ,0      !GREEN < < YELLOW
   SET COLOR MIX(204+n) 1   ,1-n/51,n/51   !YELLOW< < MAGENTA
NEXT n
LET XL=-2
LET XR=.8
LET w1=XR-XL
LET w2=w1/2
SET WINDOW XL, XR,-w2,w2
ASK PIXEL SIZE(XL,-w2; XR,w2) px,py
!
FOR x=XL TO XR+1e-6 STEP w1/(px-1)
   FOR y=-w2-.49*w1/(py-1) TO w2 STEP w1/(py-1) !¸Î°Õ¤Ë(x,0)¤òÉÁÅÀ¤Î´Ö¤Ë¶´¤à¡£
      LET z=0
      FOR n=1 TO 255
         LET z=z^2+COMPLEX(x,y)
         IF 2< ABS(z) THEN
            IF n< 64 THEN SET POINT COLOR n*4 ELSE SET POINT COLOR 253
            PLOT POINTS :x,y !¾å²¼¤ÎÂоݥץí¥Ã¥È¤ò¤·¤Ê¤¤¡£
            EXIT FOR
         END IF
      NEXT n
   NEXT y
NEXT x
LET DX$=STR$(px)
LET DY$=STR$(py)
END SUB
 

¤Ä¤Å¤­£³

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ10·î13Æü(²Ð)22»þ41ʬ20ÉÃ
ÊÖ¿®¡¦°úÍÑ
  !Page-3 ¤Î»Ï¤á

!-------------------
! make huffman tree
SUB TREE3
   MAT Tr=ZER
   FOR i=0 TO SE
      LET F_(i)=S_(i,P)
   NEXT i
   !---minimum2
   DO
      LET w=1e8
      FOR i=0 TO SE
         IF F_(i)< w THEN
            LET w=F_(i)
            LET Ad1=i ! minimum1
         END IF
      NEXT i
      LET w=1e8
      FOR i=0 TO SE
         IF F_(i)< w AND i<>Ad1 THEN
            LET w=F_(i)
            LET Ad2=i ! minimum2
         END IF
      NEXT i
      IF w=1e8 THEN EXIT DO
      IF Ad1>Ad2 THEN swap Ad1,Ad2
      !---
      LET F_(Ad1)=F_(Ad1)+F_(Ad2)
      LET F_(Ad2)=1e9
      !---
      FOR Le1=16 TO 1 STEP -1
         IF Tr(Le1,Ad1,1)>0 OR Tr(Le1,Ad1,3)>0 THEN EXIT FOR
      NEXT Le1
      FOR Le2=16 TO 1 STEP -1
         IF Tr(Le2,Ad2,1)>0 OR Tr(Le2,Ad2,3)>0 THEN EXIT FOR
      NEXT Le2
      LET Le0=MAX( Le1,Le2 )+1
      !---
      LET Tr(Le0,Ad1,0)=Le1
      LET Tr(Le0,Ad1,1)=Ad1
      LET Tr(Le0,Ad1,2)=Le2
      LET Tr(Le0,Ad1,3)=Ad2
   LOOP
   !---make DH()
   LET DH(0,P)=SE+1
   LET k=0
   CALL bitl(Le0,Ad1)
   FOR Ad=0 TO SE
      LET DH(Tr(0,Ad,1),P)=DH(Tr(0,Ad,1),P)+1
   NEXT Ad
END SUB

SUB bitl(Le,Ad)
   IF 0< Le THEN
      LET k=k+1
      CALL bitl( Tr(Le,Ad,0), Tr(Le,Ad,1) )
      CALL bitl( Tr(Le,Ad,2), Tr(Le,Ad,3) )
      LET k=k-1
   ELSE
      LET Tr(Le,Ad,1)=k
   END IF
END SUB

!-------------------
! Quick Sort S_()
SUB Qsort(L,R) ! ¹ß½ç¤Ë¥»¥Ã¥È¡£
   local i,j
   LET i=L
   LET j=R
   LET Tx=S_(IP((L+R)/2),P)
   DO
      DO WHILE S_(i,P) >Tx ! ¹ß½ç¡ä¡¢¾º½ç¡ã
         LET i=i+1
      LOOP
      DO WHILE Tx >S_(j,P) ! ¹ß½ç¡ä¡¢¾º½ç¡ã
         LET j=j-1
      LOOP
      IF j< i THEN EXIT DO ! Åù¹æÉÕ j<=i ¤Ï¡¢Ë½Áö¡£
      SWAP S_(i,P),S_(j,P)
      SWAP DV(i,P),DV(j,P)
      LET i=i+1
      LET j=j-1
   LOOP UNTIL j< i  ! Åù¹æÉÕ j<=i ¤Ï¡¢Ä㮡£
   IF L< j THEN CALL Qsort(L,j)
   IF i< R THEN CALL Qsort(i,R)
END SUB

!===================================
! make encorder table B()L()<-- DH()
SUB MAKE_H2
   MAT L=ZER
   FOR J=0 TO CMO+1
      LET I=0        ! ¥³¡¼¥ÉÀ¸À® ½çÈÖ(û¤¤½ç)
      LET Hx=0
      LET Tx=BVAL("8000",16)
      FOR L_=1 TO 16
         FOR N=1 TO DH(L_,J)
            LET V_=DV(I,J)   ! ºÂɸDV(ÉÑÅٹ߽ç)
            LET L(V_,J)=L_
            LET B(V_,J)=Hx   ! ¥³¡¼¥É(ºÂɸV_)
            LET I=I+1
            LET Hx=Hx+Tx
         NEXT N
         LET Tx=Tx/2
      NEXT L_
      LET B(256,J)=1
   NEXT J
END SUB

!==============================
!Fast Discrete Cosin Transform.( M=8x8, DCT-2 )
SUB DDCT8X8
   FOR P=0 TO CMO ! (0=Y,1=Cb,2=Cr)
      FOR V0=0 TO DV_-1 STEP 8*MV(0)/MV(P)
         FOR U0=0 TO DU-1 STEP 8*MH(0)/MH(P)
            FOR Y_=0 TO 7
               LET w=Y_*MV(0) !sampling pt.Y
               FOR X_=0 TO 7  !level shift, sampling CbCr from MCU
                  IF P=0 THEN LET X(X_)=D2(U0+X_,V0+Y_,P)-128 ELSE LET X(X_)=D2(U0+X_*MH(0),V0+w,P)
               NEXT X_
               CALL WANG
               FOR U_=0 TO 7
                  LET T(U_,Y_)=X(U_)
               NEXT U_
            NEXT Y_
            FOR U_=0 TO 7
               FOR Y_=0 TO 7
                  LET X(Y_)=T(U_,Y_)
               NEXT Y_
               CALL WANG
               FOR V_=0 TO 7
                  LET D2(U0+U_,V0+V_,P)=ROUND( X(V_)/DQ(U_,V_,QS(P)) ) ! Quantization
               NEXT V_
            NEXT U_
         NEXT U0
      NEXT V0
   NEXT P
END SUB

!=============================
!Fast Discrete Cosin Transform
!Wang.( M=8, DCT-2 )
SUB WANG
   LET XO(0)=X(0)+X(7)
   LET XO(1)=X(1)+X(6)
   LET XO(2)=X(2)+X(5)
   LET XO(3)=X(3)+X(4)
   LET XO(4)=X(3)-X(4)
   LET XO(5)=X(2)-X(5)
   LET XO(6)=X(1)-X(6)
   LET XO(7)=X(0)-X(7)
   !
   LET X(0)=XO(0)+XO(3)
   LET X(1)=XO(1)+XO(2)
   LET X(2)=XO(1)-XO(2)
   LET X(3)=XO(0)-XO(3)
   LET X(4)=XO(7)*SQR(2)
   LET X(5)=XO(6)-XO(5)
   LET X(6)=XO(6)+XO(5)
   LET X(7)=XO(4)*SQR(2)
   !
   LET XO(0)=(COS(PI/4)*X(0)+COS(PI/4)*X(1))
   LET XO(1)=(COS(PI/4)*X(0)-COS(PI/4)*X(1)) !fin 0(0),1(4)
   LET XO(2)=(COS(PI/8)*X(3)+SIN(PI/8)*X(2))
   LET XO(3)=(COS(PI*3/8)*X(3)-SIN(PI*3/8)*X(2)) !fin 2(2),3(6)
   LET XO(4)=X(4)
   LET XO(5)=X(6)
   LET XO(6)=X(5)
   LET XO(7)=X(7)
   !
   LET X(4)=XO(4)+XO(5)
   LET X(5)=XO(4)-XO(5)
   LET X(6)=-XO(6)+XO(7)
   LET X(7)=XO(6)+XO(7)
   !
   LET XO(4)=(COS(PI/16)*X(4)+SIN(PI/16)*X(7))
   LET XO(5)=(COS(PI*5/16)*X(5)+SIN(PI*5/16)*X(6))
   LET XO(6)=(SIN(PI*5/16)*X(5)-COS(PI*5/16)*X(6))
   LET XO(7)=(SIN(PI/16)*X(4)-COS(PI/16)*X(7))
   !
   LET X(0)=SQR(2/8)*XO(0)
   LET X(4)=SQR(2/8)*XO(1)
   LET X(2)=SQR(2/8)*XO(2)
   LET X(6)=SQR(2/8)*XO(3)
   LET X(1)=SQR(1/8)*XO(4)
   LET X(5)=SQR(1/8)*XO(5)
   LET X(3)=SQR(1/8)*XO(6)
   LET X(7)=SQR(1/8)*XO(7)
END SUB

!
Page-4 ¤Ø³¤¯
 

¤Ä¤Å¤­£²

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ10·î13Æü(²Ð)22»þ42ʬ38ÉÃ
ÊÖ¿®¡¦°úÍÑ
  !Page-2 ¤Î»Ï¤á

! haffman Transform. main
SUB ZZRL0
!   ---pass-1 analize frequency SV(nnnn,ssss) -->DV( ,J) DH( ,J)
   IF 0< MHT OR DH(0,0)=0 THEN CALL ZFRE0
   !---pass-2
   CALL MAKE_H2 ! huffman code=B(V,J) len.=L(V,J) <-- DH( ,J) DV( ,J)
   !---
   LET byt=0 !!!
   CALL WOPEN
   CALL W_BIN31
   !---
   LET Hw=0 !bits stream buffer
   LET BC=0 !bits in Hw
   !---
   LET B2(0)=0 !  Y.DC( start prediction)
   LET B2(1)=0 ! Cb.DC
   LET B2(2)=0 ! Cr.DC
   !---
   FOR V09=0 TO DV_-1 STEP 8*MV(0)
      FOR U09=0 TO DU-1 STEP 8*MH(0)
      !---MCU
         FOR P=0 TO CMO    !( 0=Y 1=Cb 2=Cr)
            FOR V0=V09 TO V09+8*MV(P)-1 STEP 8
               FOR U0=U09 TO U09+8*MH(P)-1 STEP 8
                  CALL W_BLK0
               NEXT U0
            NEXT V0
         NEXT P
         !---
      NEXT U09
   NEXT V09
   CALL W_FLUSH
   !---EOI
   CALL WRT_H("FFD9")
   CLOSE #1
   PRINT "byte size:";byt
END SUB

!------
SUB F_BLK0
   LET J=2*SGN(P) ! ( 0=Y 1=Cb 2=Cr)
   !---D.C.part
   LET W=D2(U0+U(0),V0+V(0),P)
   LET SY=W-B2(P)
   LET B2(P)=W ! previous of D.C.difference
   IF SY<>0 THEN LET SS=LEN(BSTR$(ABS( SY),2)) ELSE LET SS=0 ! bit_length
   LET SV(SS,J)=SV(SS,J)+1
   !---A.C.parts
   FOR AE=63 TO 0 STEP -1
      IF 0<>D2(U0+U(AE),V0+V(AE),P) THEN EXIT FOR
   NEXT AE
   !---
   LET Z=0 !zero run counter
   FOR A_=1 TO AE
      LET SY=D2(U0+U(A_),V0+V(A_),P)
      IF SY=0 AND Z< 15 THEN
         LET Z=Z+1
      ELSE
         IF SY<>0 THEN LET SS=LEN(BSTR$(ABS(SY),2)) ELSE LET SS=0 ! bit_length
         LET W=Z*16+SS
         LET Z=0
         LET SV(W,J+1)=SV(W,J+1)+1
      END IF
   NEXT A_
   IF A_< 64 THEN LET SV(0,J+1)=SV(0,J+1)+1 !End Of Block
END SUB

SUB W_BLK0
   LET J=2*SGN(P) ! ( 0=Y 1=Cb 2=Cr)
   !---D.C.part absolute SY bits length
   LET W=D2(U0+U(0),V0+V(0),P)
   LET SY=W-B2(P)
   LET B2(P)=W ! previous of D.C.difference
   IF SY<>0 THEN LET SS=LEN(BSTR$(ABS( SY),2)) ELSE LET SS=0 ! bit_length
   LET L_=L(SS,J)
   LET Ww=B(SS,J)
   CALL W_HUFF
   !---D.C.extent
   IF SS<>0 THEN
      IF SY< 0 THEN LET SY=SY+2^SS-1 !add maxim. in same bit_length.
      LET L_=SS
      LET Ww=SY*2^(16-L_)
      CALL W_HUFF
   END IF
   !---A.C.parts
   FOR AE=63 TO 0 STEP -1
      IF 0<>D2(U0+U(AE),V0+V(AE),P) THEN EXIT FOR
   NEXT AE
   !---
   LET Z=0 !zero run counter
   FOR A_=1 TO AE
      LET SY=D2(U0+U(A_),V0+V(A_),P)
      IF SY=0 AND Z< 15 THEN
         LET Z=Z+1
      ELSE
         IF SY<>0 THEN LET SS=LEN(BSTR$(ABS(SY),2)) ELSE LET SS=0 ! bit_length
         LET W=Z*16+SS
         LET Z=0
         LET L_=L(W,J+1)
         LET Ww=B(W,J+1)
         CALL W_HUFF
         !---A.C.extent
         IF SS<>0 THEN
            IF SY< 0 THEN LET SY=SY+2^SS-1 !add maxim. in same bit_length.
            LET L_=SS
            LET Ww=SY*2^(16-L_)
            CALL W_HUFF
         END IF
      END IF
   NEXT A_
   IF A_< 64 THEN
      LET L_=L(0,J+1)
      LET Ww=B(0,J+1)
      CALL W_HUFF !End Of Block
   END IF
END SUB

!-----
!Ww¡§b15 ~0 º¸µÍ¤á ÆþÎÏ bit_stream.  L_¡§bitĹ
SUB W_HUFF
   LET Hw=Hw+Ww*2^(-BC-8)
   LET BC=BC+L_
   DO WHILE 8<=BC
      CALL WRT_D( IP(Hw))
      IF IP(Hw)=255 THEN CALL WRT_D( 0)
      LET Hw=FP(Hw)*256
      LET BC=BC-8
   LOOP
END SUB

!flush bit buffer with byte_bound( fill"1"in blank)
SUB W_FLUSH
   IF BC<>0 THEN
      LET w=Hw +2^(8-BC)-1
      CALL WRT_D( w)
      IF w=255 THEN CALL WRT_D( 0)
   END IF
END SUB

!=====================
!pre hafman Transform.
!sort frequency S_() of nnnnssss( zero_run_length data)
!make DH() DV()

SUB MAKE_DHT
   MAT DH=ZER
   !---debug monitor
   PRINT "-----------------------------------------"
   FOR J=0 TO CMO+1  ! CMO =0=mono =2=color
      PRINT "Zero_Run_Length ÉÑÅÙɽ¡¡(¢ª)²èÁÇbitÉý0~15¡¢(¢­)ľÁ°£°¿ô0~15"
      PRINT W_$(J)
      CALL msg00( SV, 0,255,J, 5) ! SV( 0~255, J)
      PRINT "total=";Tx
   NEXT J
   PRINT
   !---
   FOR P=0 TO CMO+1 ! P(0~1=Y.DC~AC  2~3=C.DC~AC), CMO( 0=mono 2=color)
   !--- make S_(,)DV(,)<-- SV(,)
      LET SE=-1
      FOR i=0 TO 255
         IF SV(i,P)<>0 THEN
            LET SE=SE+1
            LET S_(SE,P)=SV(i,P)
            LET DV(SE,P)=i
         END IF
      NEXT i
      PRINT "===================================="
      PRINT W_$(P)
      PRINT "Zero Run Length ÉÑÅÙɽ¤òµÍ¤á¤¿¤â¤Î"
      CALL msg00( S_, 0,SE,P, 5)  ! S_(0~SE, P)
      PRINT "ɽºÂɸ(0~F=ľÁ°£°¿ô¡§0~F=²èÁÇbitĹ)"
      CALL msg0x( DV, 0,SE,P, 5)  ! DV(0~SE, P)
      !---
      CALL Qsort(0,SE)
      CALL TREE3
      !---
      PRINT
      PRINT " Encoder DHT table"
      PRINT " (¢ª)¥³¡¼¥ÉĹ1~16¤Î¡¢³Æ¸Ä¿ô"
      CALL msg0x( DH, 1,16  ,P, 3) ! DH(1~16, P)
      PRINT " ÉÑÅÙ½ç¤Î¡¢É½ºÂɸ(0~F=ľÁ°£°¿ô¡§0~F=²èÁÇbitĹ)"
      CALL msg0x( DV, 0,Tx-1,P, 3) ! DV(0~Tx-1, P)
      PRINT
   NEXT P
END SUB

SUB msg00( M(,), S,E,J, w)
   LET Tx=0
   LET w$=""
   FOR i=S TO E
      LET Tx=Tx+M(i,J)
      LET w$=w$& USING$( REPEAT$("#",w),M(i,J))
      IF MOD(i-S,16)=15 THEN LET w$=w$& crlf$
   NEXT i
   IF MOD(i-S,16)=0 THEN PRINT w$; ELSE PRINT w$
END SUB

SUB msg0x( M(,), S,E,J, w)
   LET Tx=0
   LET w$=""
   FOR i=S TO E
      LET Tx=Tx+M(i,J)
      LET w$=w$& REPEAT$(" ",w-2)& RIGHT$("0"& BSTR$(M(i,J),16),2)
      IF MOD(i-S,16)=15 THEN LET w$=w$& crlf$
   NEXT i
   IF MOD(i-S,16)=0 THEN PRINT w$; ELSE PRINT w$
END SUB

!
Page-3 ¤Ø³¤¯
 

½½¿Ê BASIC ¤Ç¡¢JPG ¥Õ¥¡¥¤¥ë¤òºî¤ë¡£

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ10·î13Æü(²Ð)22»þ43ʬ48ÉÃ
ÊÖ¿®¡¦°úÍÑ
  !½½¿Ê BASIC ¤Ç¡¢JPG ¥Õ¥¡¥¤¥ë¤òºî¤ë¡£
!
!Àè¤ËÅê¹Æ¤·¤¿¡¢¥Ç¥³¡¼¥À¡¼¤ÈÂФòÀ®¤¹¤â¤Î¤Ç¤¹¤¬¡¢º¡Êý¤Ï¥Ù¡¼¥¹¥é¥¤¥ó¤Î¤ß¤Ç¤¹¡£
!DCT ÊÑ´¹¡¢¥Ï¥Õ¥Þ¥ó¥³¡¼¥É²½ ¡ÄJPG ¥Õ¥¡¥¤¥ë¤Þ¤Ç¤ò¡¢¸«¤¨¤ë¥×¥í¥°¥é¥à¤Ç¡¢¼Â¹Ô¡£

!¥Ï¥Õ¥Þ¥ó¡¦¥³¡¼¥É¤Ë¤Ä¤¤¤Æ¤Ï¡¢É¸½à¥Æ¡¼¥Ö¥ë¤ò»È¤ï¤º¡¢
!¥é¥ó¥ì¥ó¥°¥¹¡¦ÉÑÅ٤άÄê¤È¡¢¥Ï¥Õ¥Þ¥ó¡¦¥Ä¥ê¡¼¤ÎºîÀ®¤ò¹Ô¤¤¡¢¤½¤ì¤Ë¤è¤ë
!ÀìÍѥϥեޥ󡦥ơ¼¥Ö¥ë¤Ç¡¢¥³¡¼¥É²½¤·¤Þ¤¹¡£¡ÊËÜÍè¤Î¥Ï¥Õ¥Þ¥ó¡¦¥³¡¼¥É¡£¡Ë

DEBUG ON
!------------------
!JPG.BAS  09.10.13
!------------------
!¥Æ¥­¥¹¥È¡¦¥¦¥£¥ó¥É¥¦¤Î¡¢º¸¾å°ÌÃÖ(x0,y0)¤È¡¢Éý(xw,yw)¡£
CALL SetWindowPos( WinHandle("TEXT" ),0, 15,172,500,520, 0)

SUB SetWindowPos( handle,C2, x0,y0,xw,yw, nFLG) !nFLG: 0=x0y0xwyw 1=x0y0 2=xwyw
   ASSIGN "user32.dll","SetWindowPos"
END SUB
!----------------------------------------------------------
LET FL$="baseline.jpg" ! ºï½ü¤¹¤ë¤È¡¢¥À¥¤¥¢¥í¥°¡¦¥Ü¥Ã¥¯¥¹ÆþÎÏ¡£
SET ECHO "OFF"
ASK DIRECTORY s$
IF FL$>"" THEN PRINT "¥«¥ì¥ó¥È DIR¡§"& s$ ELSE file getname FL$, "jpg"
PRINT "½ÐÎÏ¥Õ¥¡¥¤¥ë¡§"& FL$
IF FL$>"" THEN PRINT "¾å½ñ¤­¡£Ëô¤ÏºîÀ®¤µ¤ì¤Þ¤¹¡£¡Ä"& "Ok¡©[Enter]"
IF FL$>"" THEN CHARACTER INPUT k$
IF FL$="" OR k$<>CHR$(13) THEN
   PRINT "Ãæ»ß"
   STOP
END IF

OPTION ARITHMETIC NATIVE
OPTION BASE 0
OPTION CHARACTER byte
SET TEXT background "OPAQUE"
ASK BITMAP SIZE bmx,bmy
SET WINDOW 0,bmx, bmy,0
!
DIM D8(1000,1000)   !sample picture
DIM D2(1000,1000,2) !Y=D2(,,0)  Cb=D2(,,1)  Cr=D2(,,2)
DIM MH(2),MV(2)     !MCU.Ybr.H()V()
DIM HDC(2),HAC(2)   !hT.table selection
DIM QS(2),CoID(255) !qT.table selection
!
DIM U(63),V(63)         !zigzag
DIM DQ(7,7,3)           !DQT
DIM DH(16,7),DV(255,7)  !DHT
DIM B(255+1,7),L(255,7) !huffman.code & length ( MAKE_H2 )
DIM B2(2)               !Ybr D.C.À®Ê¬ starting
DIM T(7,7),X(7),XO(7)   !DDCT8X8
!
!---encorder
DIM SV(255,3)            !ZFRE0     ÉÑÅÙSV( ºÂɸ)
DIM S_(255,3)            !MAKE_DHT   ÉÑÅÙSV( ºÂɸ)--> ÉÑÅÙS_( ¹ß½çNo.) ºÂɸDV( ¹ß½çNo.)
DIM F_(255),Tr(16,255,3) !TREE3
!---lister
LET crlf$=CHR$(13)& CHR$(10)
DIM W_$(7)
LET W_$(0)="Y.DC"
LET W_$(1)="Y.AC"
LET W_$(2)="C.DC"
LET W_$(3)="C.AC"
!
SET VIEWPORT 0,0.4,0.6,1
CALL sample(DX$,DY$)     !¥µ¥ó¥×¥ë²èÁü¡£
LET DX=VAL(DX$)
LET DY=VAL(DY$)
MAT D8=ZER(DX-1,DY-1)
SET VIEWPORT 0, 1, 0, 1
SET WINDOW 0,bmx, bmy,0
SET COLOR MODE "NATIVE"
ASK PIXEL ARRAY (0,0) D8
! MAT PLOT CELLS,IN 250,250; 450,450: D8 ! check
!
LET CMO=2   !CMO=0(mono.) CMO=2(color)
LET SD=1    !encoder Î̻Ҳ½¥Æ¡¼¥Ö¥ëÄ´À° 1/SD
CALL DQTINI !DQ(,,0)~DQ(,,1)~{zigzag U()V()},MH(),MV()
LET DU =CEIL(DX/(8*MH(0)))*8*MH(0)  !Uwidth= (8X8)*2 bound by MCU size
LET DV_=CEIL(DY/(8*MV(0)))*8*MV(0)  !Vwidth= (8X8)*1
MAT D2=ZER(DU-1,DV_-1,2) !Y=D2(,,0)  Cb=D2(,,1)  Cr=D2(,,2)
!
CALL YbrRGB  ! Ybr D2()<--RGB D8()
LET MHT=1    ! flag. uncondition making huff.table
CALL DDCT8X8 ! D2() -->DCT -->Quantization
CALL ZZRL0   ! encoder
!---
PRINT "-------------------------"
PRINT "Encoder huffman Code"
FOR J=0 TO CMO+1
   CALL list_HT(W_$(J),J) ! value Sort !H2.LST
NEXT J
beep
PRINT "½ªÎ»"

!---------
SUB YbrRGB
!--------- JPG ¿§¶õ´Ö -------------------------
! | Y |   | 0.2990   +0.5870   +0.1140  | | R |
! |B-Y| = |-0.1687   -0.3313   +0.5000  | | G |
! |R-Y|   | 0.5000   -0.4187   -0.0813  | | B |
!
! | R |   | 1         0        +1.40200 | | Y |
! | G | = | 1        -0.34414  -0.71414 | |B-Y|
! | B |   | 1        +1.77200   0       | |R-Y|
!----------------------------------------------
   FOR V0=0 TO DY-1
      FOR U0=0 TO DX-1
         LET w1=   MOD(D8(U0,V0),256)      !R
         LET w2=MOD(IP(D8(U0,V0)/256),256) !G
         LET w3=    IP(D8(U0,V0)/65536)    !B
         LET D2(U0,V0,0)= 0.2990*w1+0.5870*w2+0.1140*w3 !Y
         LET D2(U0,V0,1)=-0.1687*w1-0.3313*w2+0.5000*w3 !Cb
         LET D2(U0,V0,2)= 0.5000*w1-0.4187*w2-0.0813*w3 !Cr
      NEXT U0
   NEXT V0
END SUB

!-----------
SUB DQTINI
   RESTORE
   !---DQT quantization
   FOR j=0 TO 1
      FOR V_=0 TO 7
         FOR U_=0 TO 7
            READ W
            LET DQ(U_,V_,j)=CEIL(W/SD) ! inhibit 0
         NEXT U_
      NEXT V_
   NEXT j
   !---zigzag-U()V()
   FOR V_=0 TO 7
      FOR U_=0 TO 7
         READ i
         LET U(i)=U_
         LET V(i)=V_
      NEXT U_
   NEXT V_
   !---HT selection
   MAT READ HDC !Y Cb Cr
   MAT READ HAC !Y Cb Cr
   !---QT selection
   MAT READ QS  !Y Cb Cr
   !---MCU size
   MAT MH=CON   !Y Cb Cr =1
   MAT MV=CON   !Y Cb Cr =1
   IF 0< CMO THEN
      LET MH(0)=2 !Y
      LET MV(0)=2 !Y
   END IF
END SUB

!---quantization table
!µ±ÅÙ( SMPTE 370M ).Y
!*DQTY
DATA 32, 16, 17, 18, 18, 19, 42, 44
DATA 16, 17, 18, 18, 19, 38, 43, 45
DATA 17, 18, 19, 19, 40, 41, 45, 48
DATA 18, 18, 19, 40, 41, 42, 46, 49
DATA 18, 19, 40, 41, 42, 43, 48,101
DATA 19, 38, 41, 42, 43, 44, 98,104
DATA 42, 43, 45, 46, 48, 98,109,116
DATA 44, 45, 48, 49,101,104,116,123

!---quantization table
!¿§º¹( SMPTE 370M ).Cb Cr
!*DQTC
DATA 32, 16, 17, 25, 26, 26, 42, 44
DATA 16, 17, 25, 25, 26, 38, 43, 91
DATA 17, 25, 26, 27, 40, 41, 91, 96
DATA 25, 25, 27, 40, 41, 84, 93,197
DATA 26, 26, 40, 41, 84, 86,191,203
DATA 26, 38, 41, 84, 86,177,197,209
DATA 42, 43, 91, 93,191,197,219,232
DATA 44, 91, 96,197,203,209,232,246

!---Zigzag table
DATA  0, 1, 5, 6,14,15,27,28
DATA  2, 4, 7,13,16,26,29,42
DATA  3, 8,12,17,25,30,41,43
DATA  9,11,18,24,31,40,44,53
DATA 10,19,23,32,39,45,52,54
DATA 20,22,33,38,46,51,55,60
DATA 21,34,37,47,50,56,59,61
DATA 35,36,48,49,57,58,62,63

!---HT selection
DATA 0,2,2 !DC. Y Cb Cr
DATA 1,3,3 !AC. Y Cb Cr

!---QT selection
DATA 0,1,1 ! Y Cb Cr

!==========================================
! analizing frequency SV(nnnn,ssss) for DHT
SUB ZFRE0
   MAT SV=ZER
   LET B2(0)=0 !  Y.DC( start prediction)
   LET B2(1)=0 ! Cb.DC
   LET B2(2)=0 ! Cr.DC
   !---
   FOR V09=0 TO DV_-1 STEP 8*MV(0)
      FOR U09=0 TO DU-1 STEP 8*MH(0)
      !---MCU
         FOR P=0 TO CMO ! ( 0=Y 1=Cb 2=Cr)
            FOR V0=V09 TO V09+8*MV(P)-1 STEP 8
               FOR U0=U09 TO U09+8*MH(P)-1 STEP 8
                  CALL F_BLK0
               NEXT U0
            NEXT V0
         NEXT P
         !---
      NEXT U09
   NEXT V09
   !---
   CALL MAKE_DHT !DH( ,J) DV( ,J) <--S_( ,J)
END SUB

!
Page-2 ¤Ø³¤¯
 

Re: ½½¿Ê BASIC ¤Ç¡¢JPG ¥Õ¥¡¥¤¥ë¤òºî¤ë¡£

 Åê¹Æ¼Ô¡§Åç¼1243  Åê¹ÆÆü¡§2009ǯ10·î14Æü(¿å)17»þ39ʬ17ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.646[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> !½½¿Ê BASIC ¤Ç¡¢JPG ¥Õ¥¡¥¤¥ë¤òºî¤ë¡£

¥×¥í¥°¥é¥à¤òBASIC-7.3.5¤ÇRUN¤¹¤ë¤È¡¢¥¿¥¤¥È¥ë¥Ð¡¼¤Ë

¡ÖIF FL$>"" THEN CHARACTER INPUT k$¡×

¤Èµ­ºÜ¤µ¤ì¤¿²¿¤â̵¤¤ºÙĹ¤Î¥À¥¤¥¢¥í¥°¤¬É½¼¨¤µ¤ì¡¢Ëô¡¢½ÐÎÏÍѥƥ­¥¹¥È¥¦¥¤¥ó¥É¥¦¤Ë

¥«¥ì¥ó¥È DIR¡§C:\Program Files\Decimal BASIC\BASICw32
½ÐÎÏ¥Õ¥¡¥¤¥ë¡§baseline.jpg
¾å½ñ¤­¡£Ëô¤ÏºîÀ®¤µ¤ì¤Þ¤¹¡£¡ÄOk¡©[Enter]

¤È½Ð¤Þ¤¹¤¬¡¢jpeg²½¤·¤¿¤¤¥Õ¥¡¥¤¥ë¤Î»ØÄê¤Ï¡¢¤É¤ÎÍͤˤ¹¤ë¤Î¤Ç¤·¤ç¤¦¤«¡©
 

Re: ¥¨¥é¡¼Êó¹ð

 Åê¹Æ¼Ô¡§¸Þ½½Íò¿¿¿Í  Åê¹ÆÆü¡§2009ǯ10·î14Æü(¿å)18»þ42ʬ41ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.629[¸µµ­»ö¤Ø]

ÇòÀС¡ÏÂÉס¡ÀèÀ¸¡¢»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¸¶°ø¤Ï¥¢¥»¥ó¥Ö¥é¤Çjecxz¤È¤¹¤Ù¤­¤È¤³¤í¤¬jcxz¤Ë¤Ê¤Ã¤Æ¤¤¤¿¤³¤È¤Ç¤·¤¿¡£
> ¶áÆüÃæ¤Ë½¤ÀµÈǤòºî¤ê¤Þ¤¹¡£


ÀèÆü¡¢¥¨¥é¡¼Êó¹ð¤·¤¿¤â¤Î¤Ç¤¹¡£Áᤤ²óÅú¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
»ä¤Ï¡¢¿ôÏÀ¤Î¿ôÃÍ·×»»¤ò¤¹¤ë¤Î¤¬¼ñÌ£¤Ç¡¢¤½¤ì¤ò´Êñ¤Ë·×»»¤Ç¤­¤ë½½¿ÊBASIC¤Ë¤ÏÂçÊÑ¡¢¤ªÀ¤ÏäˤʤäƤ¤¤Þ¤¹¡£
³«È¯¤·¤Æ¤¯¤À¤µ¤Ã¤¿¡£ÇòÀС¡ÏÂÉס¡ÀèÀ¸¤Ë¤ÏËÜÅö¤Ë´¶¼Õ¤·¤Æ¤Þ¤¹¡£

ÄÉ¿­

mod(3^(p-1),p)¤Î·×»»¤Ç¤¹¤¬¡¢

let s=1
for k=1 to p-1
let s=mod(s*3,p)
next k

¤È¤¹¤ì¤Ð¹â¡¹3(p-1)¤ÎÂ礭¤µ¤Î¿ô¤¬·×»»¤Ç¤­¤ë¥³¥ó¥Ô¥å¡¼¥¿¤Ç·×»»¤Ç¤­¤Þ¤¹.

¤½¤¦¤¹¤ì¤Ð¡¢»þ´Ö¤Ï¤«¤«¤ë¤â¤Î¤Î¡¢½½¿Ê¥â¡¼¥É¤Ç·×»»¤¬²Äǽ¤Ç¤¹¡£
¤â¤¦¾¯¤·¡¢¾ê;·×»»¤Î¸ø¼°¤Ê¤É¤ò¶î»È¤¹¤ì¤Ð¡¢£±£°£°£°·å¥â¡¼¥É¤ÇÍ­Íý¿ô¥â¡¼¥É¤è¤ê¤âÁ᤯·×»»¤Ç¤­¤Þ¤¹¡£

¤³¤Î¤è¤¦¤Ê¹Í褬»ä¤Ë¤âɬÍפÀ¤Ã¤¿¤È»×¤¤¤Þ¤¹¡£
 

Re: ¥¨¥é¡¼Êó¹ð

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ10·î14Æü(¿å)19»þ08ʬ17ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.648[¸µµ­»ö¤Ø]

¸Þ½½Íò¿¿¿Í¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> mod(3^(p-1),p)¤Î·×»»¤Ç¤¹¤¬¡¢

¤Ù¤­¾è¤ò£²¿ÊŸ³«¤·¤Æ·×»»¤¹¤ì¤Ð¡¢³Ý¤±»»¤Î²ó¿ô¤¬¸º¤ê¤Þ¤¹¡£
LET t0=TIME
LET p=1987829
PRINT modpow(3,p-1,p)
PRINT "·×»»»þ´Ö=";TIME-t0

LET t0=TIME
LET s=1
FOR k=1 TO p-1
   LET s=MOD(s*3,p)
NEXT k
PRINT s
PRINT "·×»»»þ´Ö=";TIME-t0

END

EXTERNAL FUNCTION modpow(a,n,b) !a^n¢áx mod b ¤Îx¤òÊÖ¤¹¡¡¢¨n¤ÏÈóÉéÀ°¿ô
IF n<0 OR n<>INT(n) THEN !ÈóÉéÀ°¿ô°Ê³°¤Ê¤é
   PRINT "modpow´Ø¿ô¤Ç¥Ñ¥é¥á¡¼¥¿¤¬ÉÔŬÅö¤Ç¤¹¡£"
   STOP
ELSE
   LET S=1
   DO WHILE n>0 !¤Ù¤­¾èn¤ò£²¿ÊŸ³«¤¹¤ë
      IF MOD(n,2)=1 THEN LET S=MOD(S*a,b) !¥Ó¥Ã¥È¤¬£±¤Ê¤é·×»»¤¹¤ë
      LET a=MOD(a*a,b)
      LET n=INT(n/2)
   LOOP
   LET modpow=S
END IF
END FUNCTION
 

Re: ½½¿Ê BASIC ¤Ç¡¢JPG ¥Õ¥¡¥¤¥ë¤òºî¤ë¡£

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ10·î14Æü(¿å)21»þ35ʬ46ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.647[¸µµ­»ö¤Ø]

Åç¼1243¤µ¤ó¤Ø

> ¤È½Ð¤Þ¤¹¤¬¡¢jpeg²½¤·¤¿¤¤¥Õ¥¡¥¤¥ë¤Î»ØÄê¤Ï¡¢¤É¤ÎÍͤˤ¹¤ë¤Î¤Ç¤·¤ç¤¦¤«¡©

¤³¤Î¥×¥í¥°¥é¥à¤Ï¡¢BMP ¤Ê¤É¤Î¾¤Î²èÁü¥Õ¥¡¥¤¥ë¤ò¡¢JPG ¤ØÊÑ´¹¤¹¤ë¤è¤¦¤ÊÌÜŪ¤Ï¡¢
»ý¤Ã¤Æ¤¤¤Þ¤»¤ó¡£¡Ê ½½¿ÊBASIC ¼«¿È¤Ç¡¢´Êñ¤Ë½ÐÍè¤Þ¤¹¤Î¤Ç¡£¡Ë

END °Ê¹ß¤Ë½ñ¤«¤ì¤Æ¤¤¤ë EXTERNAL SUB sample( ) ¡Á¤ÇºîÀ®¤µ¤ì¤¿
! ¥Þ¥ó¥Ç¥ë¥Ö¥í¡¼¡ÊComplex\mandelbm.bas ¤ÎÃ忧²þÊѡˤΥ°¥é¥Õ¤ò¡¢¥µ¥ó¥×¥ë¤È¤·¤Æ¡¢
JPG ¥Õ¥¡¥¤¥ë¤ò¡¢¸«¤¨¤ë¥×¥í¥°¥é¥à¤ÇºîÀ®¤¹¤ëÍͤˡ¢¤·¤¿¤â¤Î¤Ç¤¹¡£¡Ê¸¦µæÍѤǤ¹¡Ë

baseline.jpg ¤Ê¤ë¥Õ¥¡¥¤¥ë¤Ï¡¢½ÐÍè¤Þ¤·¤¿¤Ç¤·¤ç¤¦¤«¡©

LET FL$="baseline.jpg" ! ºï½ü¤¹¤ë¤È¡¢¥À¥¤¥¢¥í¥°¡¦¥Ü¥Ã¥¯¥¹ÆþÎÏ¡£

¡¡¡Ä¤³¤Î¹Ô¤ò½ü¤¯¤È¡¢½ÐÎÏ¥Õ¥¡¥¤¥ë̾¤Î¼êÆþÎÏÊѹ¹¤Ï¡¢¤Ç¤­¤Þ¤¹¤¬¡¦¡¦¡£
 

Re: ½½¿Ê BASIC ¤Ç¡¢JPG ¥Õ¥¡¥¤¥ë¤òºî¤ë¡£

 Åê¹Æ¼Ô¡§Åç¼1243  Åê¹ÆÆü¡§2009ǯ10·î15Æü(ÌÚ)10»þ33ʬ59ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.650[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> END °Ê¹ß¤Ë½ñ¤«¤ì¤Æ¤¤¤ë EXTERNAL SUB sample( ) ¡Á¤ÇºîÀ®¤µ¤ì¤¿
> ! ¥Þ¥ó¥Ç¥ë¥Ö¥í¡¼¡ÊComplex\mandelbm.bas ¤ÎÃ忧²þÊѡˤΥ°¥é¥Õ¤ò¡¢¥µ¥ó¥×¥ë¤È¤·¤Æ¡¢
> JPG ¥Õ¥¡¥¤¥ë¤ò¡¢¸«¤¨¤ë¥×¥í¥°¥é¥à¤ÇºîÀ®¤¹¤ëÍͤˡ¢¤·¤¿¤â¤Î¤Ç¤¹¡£¡Ê¸¦µæÍѤǤ¹¡Ë
>
> baseline.jpg ¤Ê¤ë¥Õ¥¡¥¤¥ë¤Ï¡¢½ÐÍè¤Þ¤·¤¿¤Ç¤·¤ç¤¦¤«¡©

SECOND¤µ¤ó¡¢¤´²óÅúÍ­Æñ¤¦¤´¤¶¤¤¤Þ¤¹¡£
baseline.jpg¤ÏÀµ¾ï¤ËºîÀ®¤µ¤ì¤Þ¤·¤¿¡£

¡Ö¸«¤¨¤ë¥×¥í¥°¥é¥à¡×¤È¤Ï¡¢BASIC¤Ê¤Î¤Ç¥³¡¼¥É¤¬¸«¤¨¤ë¡¢¤È¸À¤¦°ÕÌ£¤Ê¤ó¤Ç¤¹¤Í¡£
»ä¤Ï¡ÖjpegÊÑ´¹¤ÎÍͻҤ¬²èÁüŪ¤Ë¸«¤¨¤ë¤Î¤«¤Ê¡©¡×¤È¸í²ò¤·¤Æ¤¤¤Þ¤·¤¿¡£

¤Þ¤¿¡¢Á´¤Æ¤Î¥Õ¥¡¥¤¥ë¡¢Î㤨¤ÐWord¤Î¥É¥­¥å¥á¥ó¥È¥Õ¥¡¥¤¥ë¤âjpeg²èÁü²½¤·¤Æ¤·¤Þ¤¦¡¢À¨¤¤È¯ÁÛ¤Î¥×¥í¥°¥é¥à¡¢¤È¸í²ò¤·¤Æ¤¤¤Þ¤·¤¿¡£

º£¤Þ¤Ç¡¢½½¿ÊBASIC¤ÇºîÀ®¤·¤¿²èÁü¤ò¾¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë»ÈÍѤ¹¤ë¾ì¹ç¡¢½ÐÎÏ¥¦¥£¥ó
¥É¥¦¾å¤Ç¥³¥Ô¡¼¤·¡¢¤½¤ì¤ò¾¤Î¥¢¥×¥ê¥¦¥£¥ó¥É¥¦¾å¤ËŽ¤êÉÕ¤±¤Æ¤¤¤¿¤Î¤Ç¤¹¤¬¡¢¤³¤Î¥×¥í¥°¥é
¥à¤ò»È¤¦¤È¡¢jpeg²èÁü¥Õ¥¡¥¤¥ë¤¬Ê̸Ĥ˺îÀ®¤µ¤ì¤ë¤Î¤ÇÊØÍø¤Ç¤¹¤Í¡£

ÆäËLinuxÈÇBASIC¤Ç¤Ï²èÁü½ÐÎϤò¡¢Â¾¤Î¥¢¥×¥ê¤Ë¥³¥Ô¡¼Å½¤êÉÕ¤±¤¬µ¡Ç½¤·¤Ê¤¤¤Î¤Ç¡¢¤³
¤ì¤¬Í­¸ú¤Ë¤Ê¤ë¤ÈÂçÊÑÊØÍø¤Ç¤¹¡£Áᮡ¢Linux¤Ç»î¤·¤Æ¸«¤Þ¤¹¡£
 

Re: ½½¿Ê BASIC ¤Ç¡¢JPG ¥Õ¥¡¥¤¥ë¤òºî¤ë¡£

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ10·î15Æü(ÌÚ)14»þ34ʬ29ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.651[¸µµ­»ö¤Ø]

Åç¼1243¤µ¤ó¤Ø
Linux ÇÛθ¤ò¡¢¤·¤Þ¤»¤ó¤Ç¤·¤¿¡£¤¹¤ß¤Þ¤»¤ó¡£

(²¾¾Î)½½¿ÊBASIC ¥Ð¡¼¥¸¥ç¥ó´Ö¤ÎÁê°ã  http://hp.vector.co.jp/authors/VA008683/basi0000.htm
¤Ç¸«¤ë¤È¡¢WINHANDLE  ASSIGN¡¡¤¬ ¥À¥á¤Ê¤Î¤Ç¡¢ËÁƬʸ¤Î

!¥Æ¥­¥¹¥È¡¦¥¦¥£¥ó¥É¥¦¤Î¡¢º¸¾å°ÌÃÖ(x0,y0)¤È¡¢Éý(xw,yw)¡£
CALL SetWindowPos( ¡Ä )

SUB SetWindowPos( ¡Ä )
   ASSIGN ¡Ä
END SUB
!---------¡¡¡Á°Ê¾å¤Ï¡¢¤¿¤À¤Î¾þ¤ê¤Ê¤Î¤Ç¾Ã¤·¤Æ¡£¤¢¤È¡¢¤³¤Îɽ¤Ë¤¢¤ê¤Þ¤»¤ó¤¬¡¢

SET COLOR MODE "NATIVE"  ¡Ä¤³¤ì¤¬¡¢¤É¤¦¤Ç¤·¤ç¤¦¤«¡£

JPG ¤Î²òÀâ¤Ë¤Ä¤¤¤Æ¤Ï¡¢¼¡¤ÎÊý¡¹¤¬¡¢Àµ³Î¤Ç¾Ü¤·¤¤¤Ç¤¹¡£
http://hp.vector.co.jp/authors/VA032610/index.html
http://www.marguerite.jp/Nihongo/Labo/Image/PJPEG.html
¤Ç¤â¡¢ºÇ½ªÅª¤ËÍê¤ê¤Ë¤Ê¤ë¤Î¤Ï¡¢¤³¤ì¢­¤·¤«¤Ê¤¤¤è¤¦¤Ç¤¹¡£
http://www.w3.org/Graphics/JPEG/itu-t81.pdf


-----------------------------------------------
[Äɵ­] SET COLOR MODE "NATIVE"  ¡Ä¤¬¥À¥á¤Ê¾ì¹ç¡£

SET VIEWPORT 0, 1, 0, 1
SET WINDOW 0,bmx, bmy,0
! SET COLOR MODE "NATIVE"  ¢«¼è¤êµî¤ë
ASK PIXEL ARRAY (0,0) D8
  (
   )
!---------
SUB YbrRGB
   (
    )               ¡¡¡¡¡¡  ¢­¤³¤ì¤Ë¡¢º¹Âؤ¨¡£
   FOR V0=0 TO DY-1
      FOR U0=0 TO DX-1
         ASK COLOR MIX( D8(U0,V0)) w1,w2,w3 ! R,G,B (0~1)
         LET D2(U0,V0,0)= 255*( 0.2990*w1+0.5870*w2+0.1140*w3) !Y
         LET D2(U0,V0,1)= 255*(-0.1687*w1-0.3313*w2+0.5000*w3) !Cb
         LET D2(U0,V0,2)= 255*( 0.5000*w1-0.4187*w2-0.0813*w3) !Cr
      NEXT U0
   NEXT V0
 

Re: ½½¿Ê BASIC ¤Ç¡¢JPG ¥Õ¥¡¥¤¥ë¤òºî¤ë¡£

 Åê¹Æ¼Ô¡§Åç¼1243  Åê¹ÆÆü¡§2009ǯ10·î16Æü(¶â)07»þ35ʬ32ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.652[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

SECOND¤µ¤ó¡¢¤´ÂбþÍ­Æñ¤¦¤´¤¶¤¤¤Þ¤¹¡£Áá®Linux¾å¤Ç

> SUB SetWindowPos( ¡Ä )
>    ASSIGN ¡Ä
> END SUB
> !---------¡¡¡Á°Ê¾å¤Ï¡¢¤¿¤À¤Î¾þ¤ê¤Ê¤Î¤Ç¾Ã¤·¤Æ¡£

¤³¤ÎÂкö¼Â»Ü¤Ç¡¢baseline.jpg¥Õ¥¡¥¤¥ë¤¬ºîÀ®¤µ¤ì¤Þ¤·¤¿¤¬¡¢²èÁü¥¢¥×¥ê(GIMP¤äEye_of_GNOME)¤«¤é
¡Öjpg¥Õ¥¡¥¤¥ë¤Ç¤Ï¤Ê¤¤¡×
¤È¤¤¤¦¥á¥Ã¥»¡¼¥¸¤¬½Ð¤ÆÆɤ߹þ¤ßÉÔǽ¤Ç¤·¤¿¡£¤³¤Î¤¿¤á

> [Äɵ­] SET COLOR MODE "NATIVE"  ¡Ä¤¬¥À¥á¤Ê¾ì¹ç¡£
> ! SET COLOR MODE "NATIVE"  ¢«¼è¤êµî¤ë
>     )               ¡¡¡¡¡¡  ¢­¤³¤ì¤Ë¡¢º¹Âؤ¨¡£
>    FOR V0=0 TO DY-1
>
>    NEXT V0

¤ò¼Â»Ü¤·¤Þ¤·¤¿¤È¤³¤í¡¢²èÁü¥¢¥×¥ê¤«¤é
¡ÖJPEG ²èÁü¥Õ¥¡¥¤¥ë (Bogus Huffman table definition) ¤Î²ò¼á¤Ç¥¨¥é¡¼¡×
¤Î¥á¥Ã¥»¡¼¥¸¤¬½Ð¤Æ¡¢»ÄÇ°¤Ç¤¹¤¬¤ä¤Ï¤ê³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£

Ç°¤Î¤¿¤á¡¢¤³¤ÎLinux¾å¤ÇºîÀ®¤µ¤ì¤¿baseline.jpg¤òWin2000¾å¤Ç³«¤¤¤¿¤é¡¢¥­¥Á¥ó¤È³«¤±¤Þ¤·¤¿¡£¤È¸À¤¦¤³¤È¤Ï¡¢Linux²èÁü¥¢¥×¥ê¤ÎÌäÂê¤Î¤è¤¦¤Ç¤¹¡£
 

Re: ½½¿Ê BASIC ¤Ç¡¢JPG ¥Õ¥¡¥¤¥ë¤òºî¤ë¡£

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ10·î16Æü(¶â)14»þ57ʬ53ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.653[¸µµ­»ö¤Ø]

Åç¼1243¤µ¤ó¤Ø
¥Ï¥Õ¥Þ¥óɸ½à¥Æ¡¼¥Ö¥ë¤Ë¤·¤«¡¢Âбþ¤·¤Æ¤¤¤Ê¤¤¤Î¤«¤âÃΤì¤Þ¤»¤ó¡£

JPG ¤È¤·¤Æ¤Î¥µ¥¤¥º¤¬¡¢4683 --> 5140 byte ¤È ¤ä¡µ°­²½¤·¤Þ¤¹¤¬¡¢
²¼¤Ï¡¢É¸½à¤ò»È¤¦ÊýË¡¤Ç¤¹¡£¡¡¢¨ MHT ¤ò£±¤ËÌ᤹¤È¡¢ÀìÍѥơ¼¥Ö¥ë¤ò¾å½ñ¤­¤¹¤ë¡ª
!
CALL YbrRGB  ! Ybr D2()<--RGB D8()
CALL standard_DHT( DH,DV) !   ¢«¤³¤Î¹Ô¤òÁÞÆþ¡£
LET MHT=0                 !   ¢«1 ¤ò£°¤Ë´¹¤¨¤ë¡£!flag. uncondition making huff.table
CALL DDCT8X8 ! D2() -->DCT -->Quantization
CALL ZZRL0   ! encoder
!---
¡¡¡¡   ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¢­¤³¤Îʸ¤òºÇ¸åÈø¤ËÄɲá£

!------------------------
EXTERNAL SUB standard_DHT( DH(,),DV(,) )
OPTION ARITHMETIC NATIVE
FOR j=0 TO 3
   LET DH(0,j)=0
   FOR i=1 TO 16
      READ w$
      LET DH(i,j)=BVAL(w$,16)
      LET DH(0,j)=DH(0,j)+DH(i,j)
   NEXT i
   FOR i=0 TO DH(0,j)-1
      READ w$
      LET DV(i,j)=BVAL(w$,16)
   NEXT i
NEXT j
! standard DHT
! ISO/IEC 10918-1:1993(E) Huffman table-specification examples
!
!--Y.DC (K.3)
DATA  00,01,05,01,01,01,01,01,01,00,00,00,00,00,00,00
DATA  00,01,02,03,04,05,06,07,08,09,0A,0B
!--Y.AC (K.5)
DATA  00,02,01,03,03,02,04,03,05,05,04,04,00,00,01,7D
DATA  01,02,03,00,04,11,05,12,21,31,41,06,13,51,61,07
DATA  22,71,14,32,81,91,A1,08,23,42,B1,C1,15,52,D1,F0
DATA  24,33,62,72,82,09,0A,16,17,18,19,1A,25,26,27,28
DATA  29,2A,34,35,36,37,38,39,3A,43,44,45,46,47,48,49
DATA  4A,53,54,55,56,57,58,59,5A,63,64,65,66,67,68,69
DATA  6A,73,74,75,76,77,78,79,7A,83,84,85,86,87,88,89
DATA  8A,92,93,94,95,96,97,98,99,9A,A2,A3,A4,A5,A6,A7
DATA  A8,A9,AA,B2,B3,B4,B5,B6,B7,B8,B9,BA,C2,C3,C4,C5
DATA  C6,C7,C8,C9,CA,D2,D3,D4,D5,D6,D7,D8,D9,DA,E1,E2
DATA  E3,E4,E5,E6,E7,E8,E9,EA,F1,F2,F3,F4,F5,F6,F7,F8
DATA  F9,FA
!--C.DC (K.4)
DATA  00,03,01,01,01,01,01,01,01,01,01,00,00,00,00,00
DATA  00,01,02,03,04,05,06,07,08,09,0A,0B
!--C.AC (K.6)
DATA  00,02,01,02,04,04,03,04,07,05,04,04,00,01,02,77
DATA  00,01,02,03,11,04,05,21,31,06,12,41,51,07,61,71
DATA  13,22,32,81,08,14,42,91,A1,B1,C1,09,23,33,52,F0
DATA  15,62,72,D1,0A,16,24,34,E1,25,F1,17,18,19,1A,26
DATA  27,28,29,2A,35,36,37,38,39,3A,43,44,45,46,47,48
DATA  49,4A,53,54,55,56,57,58,59,5A,63,64,65,66,67,68
DATA  69,6A,73,74,75,76,77,78,79,7A,82,83,84,85,86,87
DATA  88,89,8A,92,93,94,95,96,97,98,99,9A,A2,A3,A4,A5
DATA  A6,A7,A8,A9,AA,B2,B3,B4,B5,B6,B7,B8,B9,BA,C2,C3
DATA  C4,C5,C6,C7,C8,C9,CA,D2,D3,D4,D5,D6,D7,D8,D9,DA
DATA  E2,E3,E4,E5,E6,E7,E8,E9,EA,F2,F3,F4,F5,F6,F7,F8
DATA  F9,FA
!
END SUB
 

Re: ½½¿Ê BASIC ¤Ç¡¢JPG ¥Õ¥¡¥¤¥ë¤òºî¤ë¡£

 Åê¹Æ¼Ô¡§Åç¼1243  Åê¹ÆÆü¡§2009ǯ10·î16Æü(¶â)17»þ51ʬ39ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.654[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¥Ï¥Õ¥Þ¥óɸ½à¥Æ¡¼¥Ö¥ë¤Ë¤·¤«¡¢Âбþ¤·¤Æ¤¤¤Ê¤¤¤Î¤«¤âÃΤì¤Þ¤»¤ó¡£
> JPG ¤È¤·¤Æ¤Î¥µ¥¤¥º¤¬¡¢4683 --> 5140 byte ¤È ¤ä¡µ°­²½¤·¤Þ¤¹¤¬¡¢
> ²¼¤Ï¡¢É¸½à¤ò»È¤¦ÊýË¡¤Ç¤¹¡£¡¡¢¨ MHT ¤ò£±¤ËÌ᤹¤È¡¢ÀìÍѥơ¼¥Ö¥ë¤ò¾å½ñ¤­¤¹¤ë¡ª
>¡¡°Ê²¼¾Êά

¾åµ­Âкö¼Â»Ü¤Ç¡¢Linux¾å¤Î½½¿ÊBASIC¤ÇÆ°ºîÀ®¸ù¤Ç¤¹¡ª¡ª
¤³¤ì¤ÇLinux¾å¤ÇBASIC¤òÍøÍѽÐÍè¤ëÈϰϤ¬¹­¤¬¤ê¤Þ¤·¤¿¡£
SECOND¤µ¤ó¡¢´¶¼Õ¤·¤Þ¤¹¡ª¡ª
 

Re: ½½¿Ê BASIC ¤Ç¡¢JPG ¥Õ¥¡¥¤¥ë¤òºî¤ë¡£

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ10·î17Æü(ÅÚ)16»þ12ʬ58ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.655[¸µµ­»ö¤Ø]

Åç¼1243¤µ¤ó¤Ø
¥Ï¥Õ¥Þ¥óÉä¹æÌÚ¡¢Á´¤Æ¤Î»Þ¡¢¥ª¡¼¥ë 1111¡Ä11 ¤Þ¤Ç»ÈÍѤ¹¤ë¤È¡¢
̱À¸¥Ó¥å¡¼¥¢¤ÎÃæ¤Ë¡¢¥Ç¥³¡¼¥É½ÐÍè¤Ê¤¤¤â¤Î¤¬¡¢¸«¤Ä¤«¤ê¤Þ¤·¤¿¡£
¤Ò¤ç¤Ã¤È¤¹¤ë¤È¡¢Æ±¤¸¥±¡¼¥¹¤Ç¤Ï¤Ê¤¤¤«¤È¡¦¡¦¡¦¡©

°Ê²¼¤Ï¡¢¶õÀʤò£±¤Äºî¤Ã¤Æ¡¢1111¡Ä10 ¤Ç¡¢Éä¹æ¤¬½ª¤ë¤è¤¦¤Ë¤¹¤ë±þµÞÁ¼Ã֤Ǥ¹¤¬¡¢
¤³¤Î¾õÂ֤ǡ¢MHT=1 ¤ÎÀìÍѥơ¼¥Ö¥ë£Ï£Î ¤Ë¤¹¤ë¤È¡¢¤É¤¦¤Ê¤ë¤Ç¤·¤ç¤¦¡©
Page-2 ¤Î¡¡SUB MAKE_DHT ¤Î²¼¤ÎÊý¤Ç¤¹¡£

      PRINT "ɽºÂɸ(0~F=ľÁ°£°¿ô¡§0~F=²èÁÇbitĹ)"
      CALL msg0x( DV, 0,SE,P, 5)  ! DV(0~SE, P)
      !---

      LET SE=SE+1             !¢«Í©Îî¥á¥ó¥Ð¡¼¤ò£±¤Ä²Ã¤¨¤ë¡£

      CALL Qsort(0,SE)
      CALL TREE3

      LET SE=SE-1             !¢­¤³¤³¤«¤é¡¢Í©Îî¥á¥ó¥Ð¡¼¤ò¼è½ü¤¤¤Æ¶õÀʤò£±¤Äºî¤ë¡£
      FOR w=16 TO 1 STEP -1
         IF DH(w,P)<>0 THEN EXIT FOR
      NEXT w
      LET DH(w,P)=DH(w,P)-1
      LET DH(0,P)=DH(0,P)-1   !¢«¤³¤³¤Þ¤Ç¡£

      !---
      PRINT
      PRINT " Encoder DHT table"
      PRINT " (¢ª)¥³¡¼¥ÉĹ1~16¤Î¡¢³Æ¸Ä¿ô"
 

¥«¡¼¥É¥Þ¥¸¥Ã¥¯¤Î¥×¥í¥°¥é¥à²½¤Ø¤Î¤ª´ê¤¤

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ10·î17Æü(ÅÚ)18»þ02ʬ55ÉÃ
ÊÖ¿®¡¦°úÍÑ
  °ìÁȤΥȥé¥ó¥×¤ò¼¡¤Î½ç½ø¤Ç¹½À®¤¹¤ë¡£
¥È¥Ã¥×¤«¤é¤Î½çÈÖ¤Ç
¡¡¡¡£±¡§¥Ï¡¼¥È  ¡¡£¸
¡¡¡¡£²¡§¥¹¥Ú¡¼¥É¡¡£³
¡¡¡¡£³¡§¥Ï¡¼¥È¡¡¡¡£¶
¡¡¡¡£´¡§¥À¥¤¥¢¡¡¡¡£¹
¡¡¡¡£µ¡§¥À¥¤¥¢¡¡¡¡£¶
¡ö¡¡£¶¡§¥À¥¤¥¢¡¡¡¡Q
¡¡¡¡£·¡§¥À¥¤¥¢¡¡¡¡J
¡ö¡¡£¸¡§¥¹¥Ú¡¼¥É¡¡Q
¡¡¡¡£¹¡§¥Ï¡¼¥È¡¡¡¡J
¡¡£±£°¡§¥¹¥Ú¡¼¥É¡¡£¹
¡ö£±£±¡§¥Ï¡¼¥È¡¡¡¡£µ
¡¡£±£²¡§¥À¥¤¥¢¡¡¡¡£¸
¡¡£±£³¡§¥¹¥Ú¡¼¥É¡¡£¶
¡ö£±£´¡§¥Ï¡¼¥È¡¡¡¡Q
¡ö£±£µ¡§¥À¥¤¥¢¡¡¡¡£·
¡¡£±£¶¡§¥¹¥Ú¡¼¥É¡¡K
¡¡£±£·¡§¥¯¥é¥Ö¡¡¡¡K
¡¡£±£¸¡§¥Ï¡¼¥È¡¡¡¡£¹
¡¡£±£¹¡§¥À¥¤¥¢¡¡¡¡£³
¡ö£²£°¡§¥À¥¤¥¢¡¡¡¡£µ
¡ö£²£±¡§¥À¥¤¥¢¡¡£±£°
¡ö£²£²¡§¥¹¥Ú¡¼¥É£±£°
¡¡£²£³¡§¥¯¥é¥Ö¡¡¡¡J
¡¡£²£´¡§¥¯¥é¥Ö¡¡¡¡£¹
¡ö£²£µ¡§¥Ï¡¼¥È¡¡¡¡£²
¡¡£²£¶¡§¥À¥¤¥¢¡¡¡¡A
¡ö£²£·¡§¥¹¥Ú¡¼¥É¡¡£µ
¡ö£²£¸¡§¥Ï¡¼¥È¡¡£±£°
¡¡£²£¹¡§¥¹¥Ú¡¼¥É¡¡£¸
¡¡£³£°¡§¥¯¥é¥Ö¡¡¡¡£¶
¡ö£³£±¡§¥Ï¡¼¥È¡¡¡¡K
¡ö£³£²¡§¥À¥¤¥¢¡¡¡¡K
¡ö£³£³¡§¥¹¥Ú¡¼¥É¡¡£´
¡ö£³£´¡§¥¯¥é¥Ö¡¡£±£°
¡ö£³£µ¡§¥¯¥é¥Ö¡¡¡¡£·
¡¡£³£¶¡§¥¯¥é¥Ö¡¡¡¡A
¡ö£³£·¡§¥¯¥é¥Ö¡¡¡¡£²
¡¡£³£¸¡§¥Ï¡¼¥È¡¡¡¡A
¡ö£³£¹¡§¥¹¥Ú¡¼¥É¡¡£²
¡ö£´£°¡§¥Ï¡¼¥È¡¡¡¡£´
¡ö£´£±¡§¥¹¥Ú¡¼¥É¡¡£·
¡ö£´£²¡§¥¯¥é¥Ö¡¡¡¡£´
¡¡£´£³¡§¥¯¥é¥Ö¡¡¡¡£¸
¡¡£´£´¡§¥¯¥é¥Ö¡¡¡¡£³
¡¡£´£µ¡§¥Ï¡¼¥È¡¡¡¡£³
¡ö£´£¶¡§¥À¥¤¥¢¡¡¡¡£²
¡ö£´£·¡§¥À¥¤¥¢¡¡¡¡£´
¡¡£´£¸¡§¥¹¥Ú¡¼¥É¡¡J
¡ö£´£¹¡§¥¯¥é¥Ö¡¡¡¡Q
¡ö£µ£°¡§¥Ï¡¼¥È¡¡¡¡£·
¡¡£µ£±¡§¥¹¥Ú¡¼¥É¡¡A
¡ö£µ£²¡§¥¯¥é¥Ö¡¡¡¡£µ

¤¿¤À¤·¡ö°õ¤Ïɽ¸þ¤­¤Ç¡¢Â¾¤Ï΢¸þ¤­¤Ç¥»¥Ã¥È¤¹¤ë¡£
¡ÊÁȤ߾夬¤Ã¤¿»þ¡¢¥Ï¡¼¥È¤Î£¸¤¬Î¢¸þ¤­¤Ç°ìÈÖ¾å¤Î¤¢¤ë¡£¡Ë

¡ÊÍ·¤ÓÊý¡Ë
£±¡¥±é¼Ô¤ÏÌܱ£¤·¤«¡¢¸å¤í¤ò¸þ¤¤¤Æ¤ª¤¯¡£
£²¡¥µÒ¤Ë¡¢¤³¤Î»Å¹þ¤ó¤À¥Ç¥Ã¥¯¤ò¿ô²ó¥«¥Ã¥È¡ÊǤ°Õ¤Î°ÌÃ֤Ǿ塢²¼£²¤Ä¤Ëʬ¤±¤Æ¾å²¼¤Î°ÌÃÖ´Ø·¸¤òÆþ¤ìÂؤ¨¤ë¡£¡Ë¤µ¤»¤ë¡£
£³¡¥£µ¿Í¤ÎµÒ¡ÊA,B,C,D,E)¤Ë¾å¤«¤é°ìË示¤Ä¥«¡¼¥É¤ò¼è¤é¤»¤ë¡£
   ¤³¤Î»þ¡¢¤½¤Î¥«¡¼¥É¤¬É½¸þ¤­¤«Î¢¸þ¤­¤«¤ò¸À¤Ã¤Æ¤â¤é¤¦¡£
£´¡¥ºÇ¸å¤Ë»Ä¤ê¤Î¥Ñ¥±¥Ã¥È¤Î°ìÈÖ¾å¤Ë¤¢¤ë¥«¡¼¥É¤¬É½¸þ¤­¤«Î¢¸þ¤­¤«¤ò¿Ò¤Í¤ë¡£
£µ¡¥¤³¤Î¤³¤È¤«¤é¡¢¤¤¤Þ¥Ñ¥±¥Ã¥È¤Î°ìÈÖ¾å¤Ë¤Î¤Ã¤Æ¤¤¤ë¥«¡¼¥É¤Î¼ïÎà¤È¿ô»ú¤ò¸À¤¤Åö¤Æ¤ë¡£

¡ã¸À¤¤Åö¤Æ¤ë¥«¡¼¥É¤Î¼ïÎà¤ÎȽÄêÊýË¡¡ä
µÒC,D¤¬¸À¤¦É½¡¢Î¢¤ÎÁȤ߹ç¤ï¤»¤Ç
¡ÊC,D¡Ë ¡á¡Êɽ¡¢É½¡Ë¢ª¥¯¥é¥Ö
¡¡¡¡¡¡¡¡¡á¡Êɽ¡¢Î¢¡Ë¢ª¥Ï¡¼¥È
        ¡á¡Ê΢¡¢É½¡Ë¢ª¥¹¥Ú¡¼¥É
        ¡á¡Ê΢¡¢Î¢¡Ë¢ª¥À¥¤¥¢

¡ã¸À¤¤Åö¤Æ¤ë¥«¡¼¥É¤Î¿ô»ú¤Î»»½ÐÊýË¡¡ä
£³¿Í¤ÎµÒ¡ÊA,B,E¡Ë¤ÈºÇ¸å¤Ëʹ¤¯¥Ñ¥±¥Ã¥È¥È¥Ã¥×¤Î¥«¡¼¥É¤Ë³ä¤êÅö¤Æ¤ë¥­¡¼¿ô»ú¤ò
µÒA¡¦¡¦¡¦£¸ÅÀ
µÒB¡¦¡¦¡¦£´ÅÀ
µÒE¡¦¡¦¡¦£²ÅÀ
¥Ñ¥±¥Ã¥È¤Î¥È¥Ã¥×¥«¡¼¥É¡¦¡¦¡¦£±ÅÀ
¤È¤·¤Æ¤ª¤­¡¢Î¢¸þ¤­¤Ç¤¢¤ë¥«¡¼¥É¤ËÂбþ¤¹¤ë°ÌÃ֤Υ­¡¼¿ô»ú¤Î¹ç·×¤ò¤¹¤ë¡£
¡Ê£°¡Á£±£µ¤Î¹ç·×ÃͤΤ¤¤º¤ì¤«¤Ë¤Ê¤ë¡£¡Ë¤³¤Î¤È¤­¡¢
¹ç·×Ãͤ¬£°¤«£µ¤«£±£°¤«£±£µ¤Ê¤é¡¢¸À¤¤Åö¤Æ¤ë¥«¡¼¥É¤Î¿ô»ú¡áK
£°¡ã¹ç·×Ã͡㣵¤Ê¤é¡¢¸À¤¤Åö¤Æ¤ë¥«¡¼¥É¤Î¿ô»ú¡á¹ç·×ÃÍ
£µ¡ã¹ç·×Ã͡㣱£°¤Ê¤é¡¢¸À¤¤Åö¤Æ¤ë¥«¡¼¥É¤Î¿ô»ú¡á¹ç·×ÃÍ¡Ý£±
£±£°¡ã¹ç·×Ãͤʤ顢¸À¤¤Åö¤Æ¤ë¥«¡¼¥É¤Î¿ô»ú¡á¹ç·×ÃÍ¡Ý£²
 

Re: ½½¿Ê BASIC ¤Ç¡¢JPG ¥Õ¥¡¥¤¥ë¤òºî¤ë¡£

 Åê¹Æ¼Ô¡§Åç¼1243  Åê¹ÆÆü¡§2009ǯ10·î17Æü(ÅÚ)19»þ06ʬ54ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.656[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ̱À¸¥Ó¥å¡¼¥¢¤ÎÃæ¤Ë¡¢¥Ç¥³¡¼¥É½ÐÍè¤Ê¤¤¤â¤Î¤¬¡¢¸«¤Ä¤«¤ê¤Þ¤·¤¿¡£
> °Ê²¼¤Ï¡¢¶õÀʤò£±¤Äºî¤Ã¤Æ¡¢1111¡Ä10 ¤Ç¡¢Éä¹æ¤¬½ª¤ë¤è¤¦¤Ë¤¹¤ë±þµÞÁ¼Ã֤Ǥ¹¤¬¡¢
> MHT=1 ¤ÎÀìÍѥơ¼¥Ö¥ë£Ï£Î ¤Ë¤¹¤ë¤È¡¢¤É¤¦¤Ê¤ë¤Ç¤·¤ç¤¦¡©
>
>       LET SE=SE+1             !¢«Í©Îî¥á¥ó¥Ð¡¼¤ò£±¤Ä²Ã¤¨¤ë¡£
>
>       LET SE=SE-1 ¡¡¡¡¡¡¡¡¡¡  !¢­¤³¤³¤«¤é¡¢Í©Îî¥á¥ó¥Ð¡¼¤ò¼è½ü¤¤¤Æ¶õÀʤò£±¤Äºî¤ë¡£
> ¡¡     ---¾Êά---
>       LET DH(0,P)=DH(0,P)-1   !¢«¤³¤³¤Þ¤Ç¡£

¾åµ­¥³¡¼¥É¤òÄɲä·¡¢MHT=0¤òMHT=1¤ËÊѹ¹¤·¤ÆLinux¾åBASIC¤ÇRun¤·¤Þ¤·¤¿¡£
·ë²Ì¤Ï¡¢Àµ¾ï¤Ëbaseline.jpg¤¬ºîÀ®¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
°Ê¾å¡¢¼Â»ÜÊó¹ð¤Ç¤¹¡£
 

baseline.jpg ¤¬³«¤±¤Ê¤¤¾ì¹ç¤¬¤¢¤ê¤Þ¤·¤¿¤é

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ10·î17Æü(ÅÚ)21»þ28ʬ42ÉÃ
ÊÖ¿®¡¦°úÍÑ
  Å缤µ¤ó¡¢¤´Êó¹ð¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£

¾¤ÎÊý¤Ç¡¢baseline.jpg ¤¬³«¤±¤Ê¤¤¾ì¹ç¤¬¤¢¤ê¤Þ¤·¤¿¤é¡¢¤´¾Ò²ð²¼¤µ¤¤¡£

¥Ï¥Õ¥Þ¥óÉä¹æÌڤˡ¢£±¤Ä¶õÀʤò»Ä¤µ¤Ê¤¤¤È¡¢³«¤±¤Ê¤¤¥Ó¥å¡¼¥¢¤Ï¡¢º£¤Î½ê¡¢
¥Õ¥ê¡¼¥½¥Õ¥È¤Ë£±¤Ä¤·¤«¸«¤Ä¤«¤ê¤Þ¤»¤ó¤¬¡¢Linux ¤Ë¤â¤¢¤ë¤è¤¦¤Ç¡¢²¿¸Î¤Ê¤Î¤«¤¬
²ò¤ê¤Þ¤»¤ó¡£¥Ï¥Õ¥Þ¥óÉä¹æÌڤι½ÃÛµ¬Â§¤«¤é¤Ï¡¢¶õÀʤϡ¢½ÐÍè¤Ê¤¤È¦¤Ê¤Î¤Ç¤¹¤¬¡©
 

Re: ¥¨¥é¡¼Êó¹ð

 Åê¹Æ¼Ô¡§¤¤¤¬¤é¤·¤Þ¤Ê¤È  Åê¹ÆÆü¡§2009ǯ10·î18Æü(Æü)04»þ37ʬ23ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.649[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

modpow´Ø¿ô¤Ï¤¹¤Ð¤é¤·¤¤¤Ç¤¹¤Í¡£
¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£

ÄêÍý£±

£ð¡ã£±£³£·£³£¶£µ£³¤Î¾ì¹ç

modpow(2,p-1,p)=1 ¤«¤Ä modpow(3,p-1,p)=1¤Ê¤é¤Ðp¤ÏÁÇ¿ô¤Ç¤¹¡£

ÄêÍý£²

£ð¡ã25326001¤Î¾ì¹ç

modpow(2,p-1,p)=1 ¤«¤Ä modpow(3,p-1,p)=1¡¡¤«¤Ä¡¡modpow(5,p-1,p)=1¡¡¤Ê¤é¤Ðp¤ÏÁÇ¿ô¤Ç¤¹¡£


modpow´Ø¿ô¤Ë¤è¤Ã¤Æ¡¢¹â®¤ËÁÇ¿ôȽÄ꤬¤Ç¤­¤Þ¤¹¡£
Á᤯¤½¤ì¤¬¤É¤ÎÄøÅÙÁᤤ¤Î¤«¤ä¤Ã¤Æ¤ß¤¿¤¤¤Ç¤¹¡£
 

LinuxÍÑ¿·¥Ð¡¼¥¸¥ç¥ó

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ10·î18Æü(Æü)09»þ17ʬ27ÉÃ
ÊÖ¿®¡¦°úÍÑ
  LinuxÍѤËLazarus¤òÍøÍѤ·¤¿¿·ÈǤò¸ø³«¤·¤Þ¤·¤¿¡£
ʸ»ú¥³¡¼¥É¤ÏUTF-8¤Ç¤¹¡£
http://sourceforge.jp/projects/decimalbasic/releases/?package_id=8178
¤«¤ébasic050Ja.tar.gz¤ò¥À¥¦¥ó¥í¡¼¥É¤·¤Æ¤¯¤À¤µ¤¤¡£
¼ã´³¤ÎÉÔ¶ñ¹ç¤â¤¢¤ë¤Î¤Ç¡¤¤¢¤é¤«¤¸¤á¥ê¥ê¡¼¥¹¥Î¡¼¥È¤â¤ªÆɤߤ¯¤À¤µ¤¤¡£
 

Re: LinuxÍÑ¿·¥Ð¡¼¥¸¥ç¥ó

 Åê¹Æ¼Ô¡§Åç¼1243  Åê¹ÆÆü¡§2009ǯ10·î18Æü(Æü)13»þ03ʬ25ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.661[¸µµ­»ö¤Ø]

ÇòÀС¡ÏÂÉפµ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> LinuxÍѤËLazarus¤òÍøÍѤ·¤¿¿·ÈǤò¸ø³«¤·¤Þ¤·¤¿¡£
> ʸ»ú¥³¡¼¥É¤ÏUTF-8¤Ç¤¹¡£

ÇòÀÐÀèÀ¸¡¢Áᮡ¢¿·LinuxÈǤò»îÍѤµ¤»¤Æ夭¤Þ¤·¤¿¡£
½¾ÍèÈǤǤÏËþ¤¿¤µ¤ì¤Ê¤«¤Ã¤¿¥á¥Ë¥å¡¼µ¡Ç½¤¬¡¢WindowsÈǤÈƱÍͤ˵¡Ç½¤·¤Æ¤ª¤ê¡¢ÂçÊÑ
»È¤¤°×¤¯¤Ê¤Ã¤Æ¤¤¤Þ¤·¤¿¡£
Æä˾¤ÎLinux¥¢¥×¥ê¡ÊÎ㤨¤ÐOpenOffice¡Ë¤Ø¡¢½ÐÎϥǡ¼¥¿¤Î¥³¥Ô¡¼Å½¤êÉÕ¤±¤¬²Äǽ¤Ë
¤Ê¤Ã¤¿¤Î¤Ç¡¢ÍøÍÑÌ̤dzÊÃʤθú²Ì !! ¤¬¤¢¤ê¤Þ¤¹¡£

> ¼ã´³¤ÎÉÔ¶ñ¹ç¤â¤¢¤ë¤Î¤Ç¡¤¤¢¤é¤«¤¸¤á¥ê¥ê¡¼¥¹¥Î¡¼¥È¤â¤ªÆɤߤ¯¤À¤µ¤¤¡£

»î¤·¤¿Linux¤ÎOS¤Ï¡¢Vine5.0¡¢Fedora7¡¢Fedora10¤Ç¤¹¤¬¡¢ÆüËܸìÆþÎÏÊÑ´¹¡ÖScim-Anthy¡×
¤È¤ÎÁêÀ­¤¬°­¤¤¤è¤¦¤Ç¡¢ÆüËܸì¥â¡¼¥É¤Ë¤·¤Æ¥­¡¼ÆþÎϤ¹¤ë¤È¡¢BASIC¥¦¥£¥ó¥É¥¦¤Ï¥­¡¼¤ò
Á´¤¯¼õ¤±ÉÕ¤±¤Æ¤¯¤ì¤Þ¤»¤ó¤Ç¤·¤¿¡Ê±Ñ»ú¤ÏOK¤Ç¤¹¡Ë¡£
¤³¤ì¤¬²þÁ±¤µ¤ì¤ë¤È¡¢BASIC¤Î¥×¥í¥°¥é¥à¥¨¥Ç¥£¥¿¡¼¥¦¥£¥ó¥É¥¦¤À¤±¤Ç¥×¥í¥°¥é¥à¤ÎÊÔ½¸
¤¬´°·ë¤¹¤ë¤Î¤Ç¤¹¤¬¡£
¼è¤ê´º¤¨¤º¤ÎÂбþ¤È¤·¤Æ¡¢º£¤Ï¾¤Î¥¨¥Ç¥£¥¿¡¼¤ÇÊÔ½¸¤·¤Æ¤«¤éŽ¤êÉÕ¤±¤Æ¤¤¤Þ¤¹¡£
 

Re: baseline.jpg ¤¬³«¤±¤Ê¤¤¾ì¹ç¤¬¤¢¤ê¤Þ¤·¤¿¤é

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ10·î19Æü(·î)03»þ29ʬ49ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.659[¸µµ­»ö¤Ø]

¥Ï¥Õ¥Þ¥óÉä¹æÌڤΡ¢ºÇ¸åÈø¤Ë£±¤Ä»È¤ï¤Ê¤¤»Þ¤òÀߤ±¤ë¤È¡¢¤½¤Îʬ¡¢Éä¹æÌÚ¤Î
»Þ¤Ö¤ê¤¬Áý¤¨¡¢Á´ÂΤΥӥåÈŤâÁý¤¨¡¢°µ½Ì¥³¡¼¥É¤È¤·¤Æ¤ÏÎɤ¯¤Ê¤¤¤Ç¤¹¤¬¡¢

È¿ÌÌ¡¢¥Ð¥¤¥È¡¦¥Ð¥¤¥ó¥É¤µ¤ì¤ë²èÁü¥Ç¡¼¥¿¡¼Ãæ¤Ë¡¢¸½¤ì¤ë¥ª¡¼¥ë£±¤Î·ÁÂÖ(0xff)
¤¬¸º¤Ã¤Æ¡¢Á´ÂΤΥХ¤¥È¿ô¤¬¾¯¤Ê¤¯¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¡£(0xff ¤Ï marker ¥³¡¼¥É
¤ÎÀèƬ¥Ð¥¤¥È¤È½Å¤Ê¤ë°Ù¡¢²èÁü¥Ç¡¼¥¿¡¼¤Î¹ç¿Þ¤Ë 0x00 ¤ò¸åÉÕ¤¹¤ëµ¬Â§¤¬¤¢¤ë )

¤É¤Á¤é¤òÍ¥À褹¤ë¤«¤Ï¡¢¥¨¥ó¥³¡¼¥À¡¼Â¦¤ÎÌäÂê¤Ç¡¢Ëؤɤϡ¢0xff ¤ò²¡¤¨¤ëÊý¤ò¡¢
Í¥À褷¡¢Éä¹æÌڤλޤ֤ê¤Ë¡¢µ¾À·¤òʧ¤Ã¤Æ¤¤¤ë¤è¤¦¤Ç¤¹¡£
¤À¤«¤é¤È¸À¤Ã¤Æ¡¢¥Ç¥³¡¼¥À¡¼Â¦¤¬¡¢Éä¹æÌڤ˶õ¤­¤¬Ìµ¤¤»ö¤ò¡¢ÈÝÄꤹ¤ëË¡¤Ï¡¢
¤Ê¤¤¤Ç¤·¤ç¤¦¡£

²¼¤Ï¡¢¥Ï¥Õ¥Þ¥óÉä¹æÌÚ¤ò¡¢ºîÀ®¤¹¤ëÉôʬ¤Ç¡¢¡Öbaseline.jpg ¤¬³«¤±¤Ê¤¤¾ì¹ç¡×¤Ë
º¹Âؤ¨¤Æ²¼¤µ¤¤¡£Page-3¡¡¡¡¡Ê¤½¤Î¥½¥Õ¥È¤Ï¡¢¶²¤é¤¯¥Ð¥°¤À¤È»×¤¤¤Þ¤¹¡£¡Ë

!¢«(+1) Éä¹æÌڤκDz¼¤Ë¡¢¡Ä¤Î¹Ô¡¢£²¤Ä¡£SE+1 ¤ò¡¢SE ¤ËÌ᤹¤È¶õÀʤÏ̵¤¯¤Ê¤ê¡¢
¸µ¤Î¾õÂ֤ˤ⡢Ì᤻¤Þ¤¹¡£

!-------------------
! make huffman tree
SUB TREE3
   MAT Tr=ZER
   FOR i=0 TO SE
      LET F_(i)=S_(i,P)    !¿ôÃͤò²õ¤¹¤Î¤Ç¡¢¥³¥Ô¡¼ F_(i)¤Ç¼Â¹Ô
   NEXT i
   LET F_(SE+1)=0          !¢« ¶õÀÊÍÑ
   !---minimum pair
   DO
      LET w=1e8
      FOR i=0 TO SE+1      !¢«(+1) Éä¹æÌڤκDz¼¤Ë¡¢¶õÀʤò£±¤Äºî¤ë¡£
         IF F_(i)< w THEN
            LET w=F_(i)
            LET Ad1=i ! minimum1   !ÉÑÅٺǾ®¤Îʬ´ô¥¢¥É¥ì¥¹Ad1
         END IF
      NEXT i
      LET w=1e8
      FOR i=0 TO SE+1      !¢«(+1) Éä¹æÌڤκDz¼¤Ë¡¢¶õÀʤò£±¤Äºî¤ë¡£
         IF F_(i)< w AND i<>Ad1 THEN
            LET w=F_(i)
            LET Ad2=i ! minimum2   !ÉÑÅٺǾ®¤Îʬ´ô¥¢¥É¥ì¥¹Ad2
         END IF
      NEXT i
      IF w=1e8 THEN EXIT DO        !ʬ´ô¤ÎÁȤ¬Ìµ¤¯¤Ê¤ë¤Þ¤Ç
      !---
      LET F_(Ad1)=F_(Ad1)+F_(Ad2)  !¼¡¤ÎÉÑÅٺǾ®¤ÎÁÈõ¤·¤Ï¡¢£²Ê¬´ô¹ç·×¤ò£±¤Ä¤Ë¤·¡¢
      LET F_(Ad2)=1e9              !¾Êý¤ò³°¤·¤Æ¹Ô¤Ê¤¦
      !---
      FOR Le1=16 TO 1 STEP -1      !¥¢¥É¥ì¥¹Ad1¤ÎºÇ¾å ÀáÅÀ¥ì¥Ù¥ëLe1 ¤òõ¤¹(ºÇ½é¤ÎLe1=0)
         IF Tr(Le1,Ad1,1)>0 OR Tr(Le1,Ad1,3)>0 THEN EXIT FOR
      NEXT Le1
      FOR Le2=16 TO 1 STEP -1      !¥¢¥É¥ì¥¹Ad2¤ÎºÇ¾å ÀáÅÀ¥ì¥Ù¥ëLe2 ¤òõ¤¹(ºÇ½é¤ÎLe2=0)
         IF Tr(Le2,Ad2,1)>0 OR Tr(Le2,Ad2,3)>0 THEN EXIT FOR
      NEXT Le2
      LET Le0=MAX( Le1,Le2 )+1     !ξ¼Ô²¿¤ì¤è¤ê¤â£±¤Ä¾å¤ÎÀáÅÀ¥ì¥Ù¥ë(Le0,Ad1)¤Ë¡¢
      !---
      LET Tr(Le0,Ad1,0)=Le1        !ʬ´ôÀè( ÀáÅÀ¥ì¥Ù¥ë,¥¢¥É¥ì¥¹)¤È¤·¤Æ£²Áȵ­Æþ
      LET Tr(Le0,Ad1,1)=Ad1
      LET Tr(Le0,Ad1,2)=Le2
      LET Tr(Le0,Ad1,3)=Ad2
   LOOP
   !---make DH()
   LET k=0
   CALL bitl(Le0,Ad1)    !Á´¥¢¥É¥ì¥¹¤Î nested ÃÊ¿ô¤òµá¤á¤ë¡£
   FOR Ad=0 TO SE        !nested ÃÊ¿ô¤¬Æ±¤¸ Ad ¤ÎÁí¿ô¤ò¡¢ÃÊ¿ôËè¤Ë½¸·×
      LET DH(Tr(0,Ad,1),P)=DH(Tr(0,Ad,1),P)+1
   NEXT Ad
   LET DH(0,P)=Ad
END SUB

SUB bitl(Le,Ad)          !ºÇ¾å ÀáÅÀ(Le0,Ad1)¤è¤êÁ´Ê¬´ô¤ò¡¢Äì¤Þ¤Çé¤ë
   IF 0< Le THEN
      LET k=k+1
      CALL bitl( Tr(Le,Ad,0), Tr(Le,Ad,1) ) !ʬ´ô nested 1
      CALL bitl( Tr(Le,Ad,2), Tr(Le,Ad,3) ) !ʬ´ô nested 2
      LET k=k-1
   ELSE
      LET Tr(0,Ad,1)=k   !ºÇ¾å ÀáÅÀ¤«¤éÄì¤Þ¤Ç¤Î nested ÃÊ¿ôk¤ò½ñ¤¯
   END IF
END SUB

 

Re: LinuxÍÑ¿·¥Ð¡¼¥¸¥ç¥ó

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ10·î19Æü(·î)11»þ27ʬ56ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.662[¸µµ­»ö¤Ø]

MACÍѤËÇÛÉÛ¤·¤Æ¤¤¤ëVer. 0.4.2¤òÈù½¤Àµ¤·¤¿ÈǤòVer.0.4.3¤È¤·¤ÆÇÛÉÛ¤·¤Þ¤¹¡£
SCIM¤Ë¤è¤ëÆüËܸìÆþÎϤËÂбþ¤·¤Þ¤¹¤¬¡¤ÆþÎÏ»þ¤Îµ¡Ç½¸ì¼«Æ°½¤Àµ¡Ê¾®Ê¸»ú¤òÂçʸ»ú¤ËÊÑ´¹¡Ë¤ò¥ª¥ó¤Ë¤¹¤ë¤È¡¤¥¨¥Ç¥£¥¿¤ÎÆ°ºî¤¬¤ª¤«¤·¤¯¤Ê¤ê¤Þ¤¹¡£
 

Re: LinuxÍÑ¿·¥Ð¡¼¥¸¥ç¥ó

 Åê¹Æ¼Ô¡§Åç¼1243  Åê¹ÆÆü¡§2009ǯ10·î20Æü(²Ð)07»þ21ʬ39ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.664[¸µµ­»ö¤Ø]

ÇòÀС¡ÏÂÉפµ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> MACÍѤËÇÛÉÛ¤·¤Æ¤¤¤ëVer. 0.4.2¤òÈù½¤Àµ¤·¤¿ÈǤòVer.0.4.3¤È¤·¤ÆÇÛÉÛ¤·¤Þ¤¹¡£

ÇòÀÐÀèÀ¸¡¢ÅÙ¡¹¤Î¤´¶µ¼¨Í­Æñ¤¦¤´¤¶¤¤¤Þ¤¹¡£
Áᮡ¢Vine5.0  Fedora7  Fedora10 ¾å¤Ç¡ÖBASIC-0.4.3¡×¤ò»îÍѤµ¤»¤Æ夭¤Þ¤·¤¿¡£
ÆüËܸìÆþÎϵ¡Ç½¡ÊScim-Anthy¡Ë¤ÏÀµ¾ï¤ËÆ°ºî¤·¡¢¥×¥í¤°¥é¥à¥¨¥Ç¥£¥¿¡¼¤Ç¤ÎÆþÎϤâ²Äǽ¤Ë¤Ê¤ê¤Þ¤·¤¿¡£

¤¿¤À¡¢WindowsÈÇBASIC¤ÇºîÀ®¤·¤¿¡Ö.BAS¥Õ¥¡¥¤¥ë¡×¤ò¡¢Linux¤Î¥Æ¥­¥¹¥È¥¨¥Ç¥£¥¿¡¼¡Êgedit)
¤ÇÆɤ߹þ¤ß¡Ê¥×¥ì¡¼¥ó¥Æ¥­¥¹¥È¤È¤·¤Æ³«¤±¤ë¡Ë¡¢Æɤ߹þ¤ó¤À¥×¥í¤°¥é¥à¥³¡¼¥É¤ò¥³¥Ô¡¼¤·¤Æ
¡ÖBASIC-0.5.0¡×¤ËŽ¤êÉÕ¤±¤¿¾ì¹ç¤ÏÀµ¾ï¤ËRUN½ÐÍè¤ë¤Î¤Ç¤¹¤¬¡¢¡ÖBASIC-0.4.3¡×¤ËŽ¤êÉÕ¤±
¤ÆRUN¤µ¤»¤ë¤È

¡Ê£±¡ËÁ´¤Æ¤Î¶õÇò¹Ô¤ËÂФ·¤Æ¡Öʸˡ¤Î¸í¤ê¡§¤³¤³¤Ë¤Ï½ñ¤±¤Þ¤»¤ó¡×
¡Ê£²¡ËBasic¤Ç¼«Æ°¥¤¥ó¥Ç¥ó¥È¤µ¤ì¤¿Á´¤Æ¤Î¥³¡¼¥É¤ËÂФ·¤Æ¡ÖÀ©¸æʸ»ú(chr13)¤¬´Þ¤Þ¤ì¤Æ¤¤
      ¤ë¡×

¤È¸À¤¦¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤¬½Ð¤ÆÁö¤ê¤Þ¤»¤ó¡£
¥¨¥é¡¼¤Î½Ð¤¿¹Ô¤Î½ªËö°ÌÃÖ¤ÇDELET,ENTER¤ò¹Ô¤¨¤Ð¥¨¥é¡¼¤Ï¾Ã¤¨¤Þ¤¹¤¬¡¢¥×¥í¤°¥é¥à¤Î¹Ô¿ô¤¬
¿¤¤¤È¡¢Á´¹Ô¤ËÂФ·¤Æ¤³¤Îºî¶È¤ò¹Ô¤¦¤Î¤ÏÂçÊѤǤ¹¡£

¤Á¤Ê¤ß¤Ë¡¢BASIC-050¤Ç¤ÏƱ¤¸Áàºî¤ò¤·¤Æ¤â¥¨¥é¡¼¤Ï½Ð¤º¤ËRUN½ÐÍè¤Þ¤¹¡£
¤½¤³¤Çgedit¤ÇÆɤ߹þ¤ó¤À¥³¡¼¥É¤òºÇ½é¤Ë¡ÖBASIC-0.5.0¡×¤ËŽ¤êÉÕ¤±RUN¤·¤¿¸å¤Ë¡¢
¡ÖBASIC-0.5.0¡×¤Î²èÌ̾å¤Ç¥×¥í¤°¥é¥à¥³¡¼¥É¤ò¥³¥Ô¡¼¤·¤Æ¡ÖBASIC-0.4.3¡×¤ËŽ¤êÉÕ¤±RUN¤¹
¤ë¤È¡¢¥¨¥é¡¼¤Ï½Ð¤º¤ËÀµ¾ï¤Ë´°Î»¤·¤Þ¤¹¡£
0.4.3¤Ç¤Îʸ»ú°·¤¤¤¬¡¢0.5.0¤ÈƱÍͤλÅÍͤ˽ÐÍè¤ë¤ÈÎɤ¤¤Î¤Ç¤¹¤¬¡£³«È¯ºî¶È¤Î»²¹Í¾ðÊó¤È
¤·¤Æ¤´Êó¹ðÃפ·¤Þ¤¹¡£
 

Re: LinuxÍÑ¿·¥Ð¡¼¥¸¥ç¥ó

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ10·î20Æü(²Ð)21»þ02ʬ57ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.665[¸µµ­»ö¤Ø]

Ver. 0.4.2¤È0.4.3¤Ï¡¤¥Õ¥¡¥¤¥ë¥á¥Ë¥å¡¼¤«¤éÆɤ߹þ¤ó¤À¾ì¹ç¡¤¹ÔËö¥³¡¼¥É¤ÎÄ´À°¤ò¹Ô¤¤¤Þ¤¹¡£WindowsÈǽ½¿ÊBASIC¤ÎºÇ¿·ÈÇ¤Ë¤Ï¥×¥í¥°¥é¥à¥Æ ¥­¥¹¥È¤òUTF-8¤ÇÊݸ¤¹¤ëµ¡Ç½¤¬¤Ä¤¤¤Æ¤¤¤ë¤Î¤Ç¡¤¤³¤ì¤òÍøÍѤ¹¤ë¤È¡¤Windows¤«¤éMac¡¤Linux¤Ø¥×¥í¥°¥é¥à¤ò°Ü¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
¥³¥Ô¡¼¡õ¥Ú¡¼¥¹¥È¤ÇŽ¤êÉÕ¤±¤ë¾ì¹ç¤Ë¤Ï¡¤Å½¤êÉÕ¤±¤ëÁ°¤Ë¹ÔËö¤òÄ´À°¤·¤Æ¤ª¤¤¤Æ¤¯¤À¤µ¤¤¡£
 

Re: ¥«¡¼¥É¥Þ¥¸¥Ã¥¯¤Î¥×¥í¥°¥é¥à²½¤Ø¤Î¤ª´ê¤¤

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ10·î21Æü(¿å)00»þ42ʬ22ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.657[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø

!¤¸¤Ä¤Ï¡¢¤è¤¯¤ï¤«¤é¤Ê¤¯¤Æ¡¢¼¡¤Î¤è¤¦¤Ë¾¡¼ê¤ËÁÛÁü¤·¤Æ¤ß¤Þ¤·¤¿¤¬¡¢
!¹ç¤Ã¤Æ¤¤¤ë¤Ç¤·¤ç¤¦¤«¡£

!¥Ç¥Ã¥¯¤Î¥È¥Ã¥×¤«¤é¡¢A,B,C,D,E ¤Î¥Ñ¥±¥Ã¥È½ç¤Ë¡¢ºÇ¸å¤Î£±Ëç¤ò»Ä¤·¤Æ¡¢Çۤ롣
!¤¿¤À¤·¡ö°õ¤Ïɽ¸þ¤­¤Ç¡¢Â¾¤Ï΢¸þ¤­¡£

!ºÇ¸å¤Î¥Ñ¥±¥Ã¥È¥È¥Ã¥×¤¬¡¢°Ê²¼¤Ê¤é¡¢ºÇ¸å¤Î£±Ëç¤Î¼ïÎà¤Ï¡¢
!¡ÊC,D¡Ë ¡á¡Êɽ¡¢É½¡Ë¢ª¥¯¥é¥Ö
!¡¡¡¡¡¡¡¡¡á¡Êɽ¡¢Î¢¡Ë¢ª¥Ï¡¼¥È
!        ¡á¡Ê΢¡¢É½¡Ë¢ª¥¹¥Ú¡¼¥É
!        ¡á¡Ê΢¡¢Î¢¡Ë¢ª¥À¥¤¥¢

!΢¸þ¤­¥«¡¼¥É¤Î¾ì½ê¤´¤È¤Ë¡¢ÅÀ¿ô¤ò¤Ä¤±¤Æ¹ç·×¤¹¤ë¡£
!£µ¤Ä¤Î¡¢¥Ñ¥±¥Ã¥È¥È¥Ã¥×¤Ï¡¢C,D ¡Ä£°ÅÀ
!A¡¦¡¦¡¦£¸ÅÀ
!B¡¦¡¦¡¦£´ÅÀ
!E¡¦¡¦¡¦£²ÅÀ
!ºÇ¸å¤Î¥«¡¼¥É¡¦¡¦¡¦£±ÅÀ

!¹ç·×Ãͤ¬
!£°,£µ,£±£°,£±£µ ¤Ê¤é¡¢¡¡K¡¡¡Ä13
!£°¡ã¹ç·×Ã͡㣵¤Ê¤é¡¢¡¡¡¡¹ç·×ÃÍ
!£µ¡ã¹ç·×Ã͡㣱£°¤Ê¤é¡¢¡¡¹ç·×ÃÍ¡Ý£±
!£±£°¡ã¹ç·×Ãͤʤ顢¡¡¡¡¡¡¹ç·×ÃÍ¡Ý£²

!¤¬¡¢ºÇ¸å¤Î£±Ëç¤Î¡¢¥Ê¥ó¥Ð¡¼

OPTION BASE 0
DIM s$(51),cd$(3)

LET cd$(0)="¥¯¥é¥Ö"
LET cd$(1)="¥Ï¡¼¥È"
LET cd$(2)="¥¹¥Ú¡¼¥É"
LET cd$(3)="¥À¥¤¥ä"

! s$()(1:1) ÀèƬ¤Î¿ô»ú= 1,0¡Ê΢,ɽ¡Ë

LET s$( 0)="1¥Ï¡¼¥È¡¡¡¡£¸" !¡¡¡¡£±¡§¥Ï¡¼¥È  ¡¡£¸
LET s$( 1)="1¥¹¥Ú¡¼¥É¡¡£³" !¡¡¡¡£²¡§¥¹¥Ú¡¼¥É¡¡£³
LET s$( 2)="1¥Ï¡¼¥È¡¡¡¡£¶" !¡¡¡¡£³¡§¥Ï¡¼¥È¡¡¡¡£¶
LET s$( 3)="1¥À¥¤¥¢¡¡¡¡£¹" !¡¡¡¡£´¡§¥À¥¤¥¢¡¡¡¡£¹
LET s$( 4)="1¥À¥¤¥¢¡¡¡¡£¶" !¡¡¡¡£µ¡§¥À¥¤¥¢¡¡¡¡£¶
LET s$( 5)="0¥À¥¤¥¢¡¡¡¡£Ñ" !¡ö¡¡£¶¡§¥À¥¤¥¢¡¡¡¡Q
LET s$( 6)="1¥À¥¤¥¢¡¡¡¡£Ê" !¡¡¡¡£·¡§¥À¥¤¥¢¡¡¡¡J
LET s$( 7)="0¥¹¥Ú¡¼¥É¡¡£Ñ" !¡ö¡¡£¸¡§¥¹¥Ú¡¼¥É¡¡Q
LET s$( 8)="1¥Ï¡¼¥È¡¡¡¡£Ê" !¡¡¡¡£¹¡§¥Ï¡¼¥È¡¡¡¡J
LET s$( 9)="1¥¹¥Ú¡¼¥É¡¡£¹" !¡¡£±£°¡§¥¹¥Ú¡¼¥É¡¡£¹
LET s$(10)="0¥Ï¡¼¥È¡¡¡¡£µ" !¡ö£±£±¡§¥Ï¡¼¥È¡¡¡¡£µ
LET s$(11)="1¥À¥¤¥¢¡¡¡¡£¸" !¡¡£±£²¡§¥À¥¤¥¢¡¡¡¡£¸
LET s$(12)="1¥¹¥Ú¡¼¥É¡¡£¶" !¡¡£±£³¡§¥¹¥Ú¡¼¥É¡¡£¶
LET s$(13)="0¥Ï¡¼¥È¡¡¡¡£Ñ" !¡ö£±£´¡§¥Ï¡¼¥È¡¡¡¡Q
LET s$(14)="0¥À¥¤¥¢¡¡¡¡£·" !¡ö£±£µ¡§¥À¥¤¥¢¡¡¡¡£·
LET s$(15)="1¥¹¥Ú¡¼¥É¡¡£Ë" !¡¡£±£¶¡§¥¹¥Ú¡¼¥É¡¡K
LET s$(16)="1¥¯¥é¥Ö¡¡¡¡£Ë" !¡¡£±£·¡§¥¯¥é¥Ö¡¡¡¡K
LET s$(17)="1¥Ï¡¼¥È¡¡¡¡£¹" !¡¡£±£¸¡§¥Ï¡¼¥È¡¡¡¡£¹
LET s$(18)="1¥À¥¤¥¢¡¡¡¡£³" !¡¡£±£¹¡§¥À¥¤¥¢¡¡¡¡£³
LET s$(19)="0¥À¥¤¥¢¡¡¡¡£µ" !¡ö£²£°¡§¥À¥¤¥¢¡¡¡¡£µ
LET s$(20)="0¥À¥¤¥¢¡¡£±£°" !¡ö£²£±¡§¥À¥¤¥¢¡¡£±£°
LET s$(21)="0¥¹¥Ú¡¼¥É£±£°" !¡ö£²£²¡§¥¹¥Ú¡¼¥É£±£°
LET s$(22)="1¥¯¥é¥Ö¡¡¡¡£Ê" !¡¡£²£³¡§¥¯¥é¥Ö¡¡¡¡J
LET s$(23)="1¥¯¥é¥Ö¡¡¡¡£¹" !¡¡£²£´¡§¥¯¥é¥Ö¡¡¡¡£¹
LET s$(24)="0¥Ï¡¼¥È¡¡¡¡£²" !¡ö£²£µ¡§¥Ï¡¼¥È¡¡¡¡£²
LET s$(25)="1¥À¥¤¥¢¡¡¡¡£Á" !¡¡£²£¶¡§¥À¥¤¥¢¡¡¡¡A
LET s$(26)="0¥¹¥Ú¡¼¥É¡¡£µ" !¡ö£²£·¡§¥¹¥Ú¡¼¥É¡¡£µ
LET s$(27)="0¥Ï¡¼¥È¡¡£±£°" !¡ö£²£¸¡§¥Ï¡¼¥È¡¡£±£°
LET s$(28)="1¥¹¥Ú¡¼¥É¡¡£¸" !¡¡£²£¹¡§¥¹¥Ú¡¼¥É¡¡£¸
LET s$(29)="1¥¯¥é¥Ö¡¡¡¡£¶" !¡¡£³£°¡§¥¯¥é¥Ö¡¡¡¡£¶
LET s$(30)="0¥Ï¡¼¥È¡¡¡¡£Ë" !¡ö£³£±¡§¥Ï¡¼¥È¡¡¡¡K
LET s$(31)="0¥À¥¤¥¢¡¡¡¡£Ë" !¡ö£³£²¡§¥À¥¤¥¢¡¡¡¡K
LET s$(32)="0¥¹¥Ú¡¼¥É¡¡£´" !¡ö£³£³¡§¥¹¥Ú¡¼¥É¡¡£´
LET s$(33)="0¥¯¥é¥Ö¡¡£±£°" !¡ö£³£´¡§¥¯¥é¥Ö¡¡£±£°
LET s$(34)="0¥¯¥é¥Ö¡¡¡¡£·" !¡ö£³£µ¡§¥¯¥é¥Ö¡¡¡¡£·
LET s$(35)="1¥¯¥é¥Ö¡¡¡¡£Á" !¡¡£³£¶¡§¥¯¥é¥Ö¡¡¡¡A
LET s$(36)="0¥¯¥é¥Ö¡¡¡¡£²" !¡ö£³£·¡§¥¯¥é¥Ö¡¡¡¡£²
LET s$(37)="1¥Ï¡¼¥È¡¡¡¡£Á" !¡¡£³£¸¡§¥Ï¡¼¥È¡¡¡¡A
LET s$(38)="0¥¹¥Ú¡¼¥É¡¡£²" !¡ö£³£¹¡§¥¹¥Ú¡¼¥É¡¡£²
LET s$(39)="0¥Ï¡¼¥È¡¡¡¡£´" !¡ö£´£°¡§¥Ï¡¼¥È¡¡¡¡£´
LET s$(40)="0¥¹¥Ú¡¼¥É¡¡£·" !¡ö£´£±¡§¥¹¥Ú¡¼¥É¡¡£·
LET s$(41)="0¥¯¥é¥Ö¡¡¡¡£´" !¡ö£´£²¡§¥¯¥é¥Ö¡¡¡¡£´
LET s$(42)="1¥¯¥é¥Ö¡¡¡¡£¸" !¡¡£´£³¡§¥¯¥é¥Ö¡¡¡¡£¸
LET s$(43)="1¥¯¥é¥Ö¡¡¡¡£³" !¡¡£´£´¡§¥¯¥é¥Ö¡¡¡¡£³
LET s$(44)="1¥Ï¡¼¥È¡¡¡¡£³" !¡¡£´£µ¡§¥Ï¡¼¥È¡¡¡¡£³
LET s$(45)="0¥À¥¤¥¢¡¡¡¡£²" !¡ö£´£¶¡§¥À¥¤¥¢¡¡¡¡£²
LET s$(46)="0¥À¥¤¥¢¡¡¡¡£´" !¡ö£´£·¡§¥À¥¤¥¢¡¡¡¡£´
LET s$(47)="1¥¹¥Ú¡¼¥É¡¡£Ê" !¡¡£´£¸¡§¥¹¥Ú¡¼¥É¡¡J
LET s$(48)="0¥¯¥é¥Ö¡¡¡¡£Ñ" !¡ö£´£¹¡§¥¯¥é¥Ö¡¡¡¡Q
LET s$(49)="0¥Ï¡¼¥È¡¡¡¡£·" !¡ö£µ£°¡§¥Ï¡¼¥È¡¡¡¡£·
LET s$(50)="1¥¹¥Ú¡¼¥É¡¡£Á" !¡¡£µ£±¡§¥¹¥Ú¡¼¥É¡¡A
LET s$(51)="0¥¯¥é¥Ö¡¡¡¡£µ" !¡ö£µ£²¡§¥¯¥é¥Ö¡¡¡¡£µ

FOR i=0 TO 52
   LET A=MOD(i,52)
   LET B=MOD(i+1,52)
   LET C=MOD(i+2,52)
   LET D=MOD(i+3,52)
   LET E=MOD(i+4,52)
   LET r=MOD(i+5,52)
   LET sum= VAL(s$( A )(1:1))*8+VAL(s$( B )(1:1))*4+VAL(s$( E )(1:1))*2+VAL(s$( r )(1:1))
   IF MOD(sum,5)=0 THEN
      LET N=13
   ELSEIF sum< 5 THEN
      LET N=sum
   ELSEIF 5< sum AND sum< 10 THEN
      LET N=sum-1
   ELSEIF 10< sum THEN
      LET N=sum-2
   END IF
   PRINT "·×»»¤Î¥«¡¼¥É¡§";cd$( VAL(s$( C )(1:1))*2+VAL(s$( D )(1:1)) );N
   PRINT "ºÇ¸å¤Î¥«¡¼¥É¡§";s$( r )(2:7)
   PRINT
NEXT i

!Ϣ³¤¹¤ë£¶Ë礬¡¢¥Ç¥Ã¥¯¤Î°ìÈÖ²¼¤Ë»Ä¤ì¤Ð¡¢¤½¤Î£¶Ëç¤Ï¡¢²¿ÈÖÌܤΤâ¤Î¤Ç¤â¡¢£Ï£Ë
!¤Î¤è¤¦¤Ç¤¹¤¬¡¢ºÙ¤«¤¯¥·¥ã¥Ã¥Õ¥ë¤·¤¹¤®¤ë¤È¡¢£¶Ë礬¡¢³ÎÊݤǤ­¤Ê¤¤¤«¤âÃΤì¤Þ¤»¤ó¡£

END
 

Re: ¥«¡¼¥É¥Þ¥¸¥Ã¥¯¤Î¥×¥í¥°¥é¥à²½¤Ø¤Î¤ª´ê¤¤

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ10·î21Æü(¿å)07»þ25ʬ6ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.667[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£


À½ºî¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£


> !¥Ç¥Ã¥¯¤Î¥È¥Ã¥×¤«¤é¡¢A,B,C,D,E ¤Î¥Ñ¥±¥Ã¥È½ç¤Ë¡¢ºÇ¸å¤Î£±Ëç¤ò»Ä¤·¤Æ¡¢Çۤ롣
> !¤¿¤À¤·¡ö°õ¤Ïɽ¸þ¤­¤Ç¡¢Â¾¤Ï΢¸þ¤­¡£


¤³¤ÎÉôʬ¤ÏA,B,C,D,E¤Î¿Í¤¬°ìË示¤Ä¥«¡¼¥É¤ò¤È¤ë¤³¤È¤Ç¡¢¤È¤Ã¤¿¸å¤Ï¤½¤ì°Ê¾å¤Ï¥«¡¼¥É¤Ï¤È¤ê¤Þ¤»¤ó¡£¤½¤·¤Æ»Ä¤ê¤Î¥Ñ¥±¥Ã¥È¤Ï¥Æ¡¼¥Ö¥ë¤Ë¤¢¤ê¡¢¤½¤Î°ìÈÖ¾å¤Ë¤Î¤Ã¤Æ¤¤¤ë¥«¡¼¥É¤Ë¤Ä¤¤¤Æ¡¢É½¤«Î¢¤«¤òʹ¤­¤Þ¤¹¡£
£µ¿Í¤ÎÊÖ»ö¤È¤³¤Î¾ðÊó¡Ê£¶¤Ä¤Îɽ¤«Î¢¤«¤Î¥Ç¡¼¥¿¡¼¡Ë¤«¤é¡¢¥Ñ¥±¥Ã¥È¥È¥Ã¥×¤Ë¤¢¤ë¥«¡¼¥É¤òÅö¤Æ¤ë¤È¸À¤¦»ÅÁȤߤǤ¹¡£
¤³¤ì¤Ï¡¢¸µ¤Î¥Ç¥Ã¥¯¤òǤ°Õ¤Ë¥«¥Ã¥È¤·¤Æ¤âƱ¤¸¤¯À®Î©¤·¤Þ¤¹¡£¡ÊÊ̤ˣ¶Ë礬Ϣ³¤¹¤ëɬÍפϤʤ¯¡¢Ç¤°Õ¤Î°ÌÃ֤ǥǥ寤ò£²Ê¬¤·¡¢¾å²¼¤òÆþ¤ìÂؤ¨¤ë¤³¤È¤¬²Äǽ¡Ë


¤½¤³¤Ç¡¢Ç¤°Õ¤Î°ÌÃ֤ǥǥ寤ò¥«¥Ã¥È¤¹¤ëÉôʬ¤È¡¢£¶¤Ä¤Î¥Ç¡¼¥¿¡¼¡ÊA,B,C,D,E,¥È¥Ã¥×¥«¡¼¥É¤Î΢¡¢É½¡Ë¤òɽ¼¨¤·¤Æ¤â¤é¤¤¡¢°ì±þ¤³¤Á¤é¤¬¥Ñ¥±¥Ã¥È¥È¥Ã¥×¤Ë¤¢¤ë¥«¡¼¥É¤òͽÁÛ¤·¤Þ¤¹¤«¤é¡¢¤³¤ÎÅú¤¨¤¬Àµ²ò¤Ë¤Ê¤ë¤«¤ò³Îǧ¤Ç¤­¤ë¥×¥í¥°¥é¥à¤ò¹½À®¤·¤Æ¤â¤é¤¤¤¿¤¤¤ó¤Ç¤¹¤¬¡¦¡¦¡¦
 

Re: ¥«¡¼¥É¥Þ¥¸¥Ã¥¯¤Î¥×¥í¥°¥é¥à²½¤Ø¤Î¤ª´ê¤¤

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ10·î21Æü(¿å)11»þ06ʬ38ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.668[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø

¥«¡¼¥É¤Ï¥ÉÁǿͤǡ¢¿ïʬ¤È¤ó¤Á¤ó¤«¤ó¤Ê¡¢¾õ¶·¤òÁÛÁü¤·¤Æ¤¤¤¿¤è¤¦¤Ç¤¹¡£
¿½¤·Ìõ¤Ê¤¤¡ª¤Ç¤â¡¢¥×¥í¥°¥é¥à¼«ÂΤϡ¢

s$( 0),s$( 1),s$( 2),s$( 3),s$( 4),s$( 5) ¤Î΢ɽ¤«¤é¤Î·×»»¥«¡¼¥É¡¡¡á s$( 5)¤Î¥«¡¼¥É¤Ë°ìÃ×
s$( 1),s$( 2),s$( 3),s$( 4),s$( 5),s$( 6) ¤Î΢ɽ¤«¤é¤Î·×»»¥«¡¼¥É¡¡¡á s$( 6)¤Î¥«¡¼¥É¤Ë°ìÃ×
s$( 2),s$( 3),s$( 4),s$( 5),s$( 6),s$( 7) ¤Î΢ɽ¤«¤é¤Î·×»»¥«¡¼¥É¡¡¡á s$( 7)¤Î¥«¡¼¥É¤Ë°ìÃ×
         :           :
         :           :
s$(50),s$(51),s$( 0),s$( 1),s$( 2),s$( 3) ¤Î΢ɽ¤«¤é¤Î·×»»¥«¡¼¥É¡¡¡á s$( 3)¤Î¥«¡¼¥É¤Ë°ìÃ×
s$(51),s$( 0),s$( 1),s$( 2),s$( 3),s$( 4) ¤Î΢ɽ¤«¤é¤Î·×»»¥«¡¼¥É¡¡¡á s$( 4)¤Î¥«¡¼¥É¤Ë°ìÃ×
s$( 0),s$( 1),s$( 2),s$( 3),s$( 4),s$( 5) ¤Î΢ɽ¤«¤é¤Î·×»»¥«¡¼¥É¡¡¡á s$( 5)¤Î¥«¡¼¥É¤Ë°ìÃ×

¤³¤Î¤è¤¦¤Ë¡¢¤°¤ë¤°¤ë¤È¡¢²¿ÅÙ²ó¤Ã¤Æ¤â¡¢Ï¢Â³¤Î£¶Ëç¤Ç¤¢¤ê¤µ¤¨¤¹¤ì¤Ð¡¢
°ìÃפ¹¤ë³Îǧ¤Î·×»»¤ò¤·¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢

·óÍѤǤ­¤ë¤è¤¦¤Êµ¤¤¬¤·¤Þ¤¹¡£
¾¯¤·¤¯¤é¤¤¤Ï¡¢¥·¥ã¥Ã¥Õ¥ë¤·¤Æ¤â¥È¥Ã¥×¤Î£¶Ëç¤Ï¡¢¾åµ­¤Î²¿¤ì¤«¤À¤È»×¤¤¤Þ¤¹¡¢
¾å²¼¤ò¡¢Ãæ¤Û¤É¤Ç¡¢ÆþÂؤ¨¤Æ¤â¡¢¥µ¡¼¥¯¥ë½ç½ø¤ÏƱ¤¸¤Ç¡¢Êø¤ì¤Þ¤»¤ó¤¬¡¢
ÅÓÃ椫¤éÈ´¤­¼è¤Ã¤¿¤ê¡¢£±ËçËè¤Ë¿¥¤ê¹þ¤à¥·¥ã¥Ã¥Õ¥ë¤À¤È¡¢¤É¤³¤ÇÊø¤ì¤ë¤«¡¢
±¿¡¢¤Ë¤Ê¤ê¤Þ¤¹¤Í¡£
¤¢¤È¤Ï¡¢¤´¼«¿È¤Ç¹©Éפ·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£¤¹¤ß¤Þ¤»¤ó¡£

   ------------------------
¡¡¡¡¢¨Î㤨¤Ð¡¢£²£³ËçÌܤǾ岼Æþ´¹¤¨¤¿¤È¤¹¤ë¤È

¡¡¡¡for i=0+23 to 52+23
      (
       )
    next i

    ¤È¤·¤¿¾õÂ֤Ǥ¹¡¢£²£³ËçÌܤ«¤é»Ï¤Þ¤ë¾¡¢²¿¤âÊѤê¤Þ¤»¤ó¡£
 

Re: ¥»¥ó¥¿¡¼»î¸³ÄøÅÙ¤Î¥×¥í¥°¥é¥à±é½¬

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ10·î21Æü(¿å)16»þ58ʬ14ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.496[¸µµ­»ö¤Ø]

¥Ñ¥¹¥«¥ë¤Î»°³Ñ·Á
¡¡Î߾躬ɽ¡¢Âпôɽ¡¢»°³Ñ´Ø¿ôɽ¤Î¤è¤¦¤Ë¤³¤Îɽ¤ò»È¤Ã¤¿·×»»

Ä̾ï¤Ï¡¢¿ô»ú¤¬»³¤Î·Á¤ËÇÛÃÖ¤µ¤ì¤Æ¤¤¤ë¤¬¡¢
·×»»µ¡¤ò»È¤¦¾ì¹ç¤Ï¡¢²¼¤Ë¾Ò²ð¤¹¤ë¥Ñ¥¿¡¼¥ó¤Î£²¼¡¸µÇÛÎó¤Çɽ¸½¤¹¤ë¡£
¼°¤òľÀÜŬÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë¤¬¡¢¤³¤³¤Ç¤Ïɽ·×»»¡ÊExcel¤Ê¤É¡Ë¤Ç¤ÎÀßÄêÊý¼°¤Ç¹Ô¤¦¡£
!¡ü¥Ñ¥¿¡¼¥ó£±¡¡Ãʤȱ¦¼Ð¤á¤¬¡¢¹Ô¤äÎó¤ËÃÖ¤­´¹¤ï¤ë

LET N=6 !ÃÊ¿ô
DIM P(0 TO N,0 TO N) !£²¼¡¸µÇÛÎó

MAT P=ZER
LET P(0,0)=1 !º¸µÍ¤á
FOR i=1 TO N
   LET P(i,0)=1 !comb(n,n)=comb(n,0)=1
   FOR j=1 TO i !comb(n,r)=comb(n-1,r-1)+comb(n-1,r)
      LET P(i,j)=P(i-1,j-1)+P(i-1,j) !º¸¾å¡Ü¾å
   NEXT j
NEXT i

MAT PRINT USING(REPEAT$("#### ",N+1)): P !¢¨·å¿ô¤¬Â¿¤¤¾ì¹ç¡¢#¤òÁý¤ä¤¹
PRINT


!Îã. ¥Ñ¥¿¡¼¥ó£±¤Îɽõº÷¤Ë¤è¤ë¦²[k=1,N-1]{k}¤Î·×»»
FOR k=1 TO N-1 !±¦¼Ð¤á£±ÈÖÌܤοôÎó¤Ï¡Ö¼«Á³¿ô¡×
   PRINT "+";P(k,1);
NEXT k
PRINT "=";P(K,2) !±¦²¼¡ÊK=k+1¡Ë


!Îã. ±ß¼þ¾å¤Ë£Î¸Ä¤ÎÅÀ¤ò¼è¤ê¡¢¸ß¤¤¤Ë·ëÀþ¤·¤Æʬ³ä¤µ¤ì¤ëÎΰè¤Î¿ô
FOR i=1 TO N+1
   LET s=0
   FOR k=0 TO 4 !º¸¤«¤é£µ¸Ä¤Þ¤Ç
      LET s=s+P(i-1,k)
   NEXT k
   PRINT i;"ÅÀ="; s;"¸Ä"
NEXT i

!Ê̲ò
DIM T(0 TO N)
FOR i=0 TO 4 !¥Ù¥¯¥È¥ë(1,1,1,1,1,0,¡Ä)
   LET T(i)=1
NEXT i
MAT T=P*T
MAT PRINT T;


!Îã. ¥Õ¥£¥Ü¥Ê¥Ã¥Á¿ôÎó
FOR i=0 TO N !±¦¼Ð¤á¤ÎÏÂ
   LET s=0
   FOR j=0 TO i
      LET s=s+P(i-j,j)
   NEXT j
   PRINT s;
NEXT i
PRINT


END

!¡ü¥Ñ¥¿¡¼¥ó£²¡¡º¸¼Ð¤á¤È±¦¼Ð¤á¤¬¡¢¹Ô¤äÎó¤ËÃÖ¤­´¹¤ï¤ë

LET N=4 !ÃÊ¿ô
DIM P(0 TO N,0 TO N) !£²¼¡¸µÇÛÎó

MAT P=ZER
FOR j=0 TO N !È¿»þ·×¤Þ¤ï¤ê¤Ë£´£µÅÙ²óž
   LET P(0,j)=1 !comb(n,n)=comb(n,0)=1
NEXT j
FOR i=1 TO N
   LET P(i,0)=1 !comb(n,n)=comb(n,0)=1
   FOR j=1 TO N-i !comb(n,r)=comb(n-1,r-1)+comb(n-1,r)
      LET P(i,j)=P(i,j-1)+P(i-1,j) !º¸¡Ü¾å
   NEXT j
NEXT i

MAT PRINT USING(REPEAT$("#### ",N+1)): P !¢¨·å¿ô¤¬Â¿¤¤¾ì¹ç¡¢#¤òÁý¤ä¤¹
PRINT


!Îã. £Î¿Í¤ò£é¸Ä¤Î¥°¥ë¡¼¥×¤Ëʬ¤±¤ë¾ì¹ç¤Î¿ô
!
!£³¿Í¤Ç¶¥Áö¤¹¤ë¾ì¹ç
!¡¡£³¿Í¤¬£±°Ì¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£±Ä̤ê¡Ê=comb(3,3)¡Ë
!¡¡£²¿Í¤¬£±°Ì¡¢£±¿Í¤¬£²°Ì¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£³Ä̤ê¡Ê=comb(3,2)*comb(1,1)¡Ë
!¡¡£±¿Í¤¬£±°Ì¡¢£²¿Í¤¬£²°Ì¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£³Ä̤ê¡Ê=comb(3,1)*comb(2,2)¡Ë
!¡¡£±¿Í¤¬£±°Ì¡¢£±¿Í¤¬£²°Ì¡¢£±¿Í¤¬£³°Ì¡¡¡¡£¶Ä̤ê¡Ê=comb(3,1)*comb(2,1)*comb(1,1)¡Ë
!¡¡¤·¤¿¤¬¤Ã¤Æ¡¢£±£³Ä̤ꡣ

LET c=0
FOR i=0 TO N
   LET r=0 !º¸¼Ð¤á¤ÎÏÂ
   FOR j=0 TO N-i
      LET r=r+(-1)^j*P(i,j) !³ÆÃʤκ¸¤«¤é¶ö¿ôÈÖÌܤòÉé¤Ë¤¹¤ë
   NEXT j
   LET c=c+r*i^N !½Å¤ß
NEXT i
PRINT c


!Ê̲ò
DIM B(0 TO N,0 TO N) !³ÆÃʤκ¸¤«¤é¶ö¿ôÈÖÌܤòÉé¤Ë¤¹¤ë´ðËܹÔÎó
MAT B=ZER
FOR i=0 TO N
   LET B(i,i)=(-1)^i
NEXT i
MAT B=P*B
MAT PRINT B;

DIM T(0 TO N)
MAT T=CON !º¸¼Ð¤á¤Î¿ôÎó¤ò¹ç·×¤¹¤ë
MAT T=B*T

DIM W(1,0 TO N) !½Å¤ß 0^N,1~N,2^N,3^N,¡Ä
FOR i=0 TO N
   LET W(1,i)=i^N
NEXT i
MAT PRINT W;
MAT T=W*T

MAT PRINT T; !=W*P*F*CON



!Êä­. £Î¿Í¤ò£é¸Ä¤Î¥°¥ë¡¼¥×¤Ëʬ¤±¤ë¾ì¹ç¤Î¿ô

LET N=4 !¿Í¿ô

!»Ø¿ô·¿Êì´Ø¿ô¤òÍѤ¤¤Æ¤Î²òË¡
!¡¡¿ôÎó{a0,a1,a2,¡Ä,aN,¡Ä}¤ËÂФ·¤Æ¡¢¤³¤Î¿ôÎó¤Î»Ø¿ô·¿Êì´Ø¿ôG(x)¤Ï
!¡¡¡¡G(x)=a0*x^0/0!+a1*x^1/1!+a2*x^2/2!+ ¡Ä +aN*x^N/N!+ ¡Ä
!
!£Î¿Í¤¬½çÈ֤ΰ㤦£é¸Ä¤Î¥°¥ë¡¼¥×¤Ëʬ¤«¤ì¤Æ¥´¡¼¥ë¤·¤¿¤â¤Î¤È¤·¡¢³Æ¥°¥ë¡¼¥×¤Ë¤Ä¤¤¤Æ¹Í¤¨¤ë¡£
!¾ì¹ç¤Î¿ô¡Ê½çÎó¤Î¿ô¡Ë¤ò»Ø¿ô·¿·×¿ô»Ò¤È¤·¤Æɽ¸½¤¹¤ë¤È
!¥°¥ë¡¼¥×Æâ¤Ï£Î¿Í°Ê²¼¤Ê¤é²¿¿Í¤Ç¤âµö¤µ¤ì¡¢¤½¤ÎÆâ¤Ç¤ÎʤÓÊý¤ÏÌäÂê¤È¤·¤Ê¤¤¤Î¤Ç
!¡¡x^0/0!+x^1/1!+x^2/2!+ ¡Ä +x^N/N!+ ¡Ä = EXP(x)
!¤·¤«¤·¡¢¥°¥ë¡¼¥×Æâ¤Ë¤Ï¾¯¤Ê¤¯¤È¤â£±¿Í¤Ï¤¤¤ë¤Î¤Ç
!¡¡x^1/1!+x^2/2!+ ¡Ä +x^N/N!+ ¡Ä = EXP(x)-1
!£é¸Ä¤Î¥°¥ë¡¼¥×¤Ç¤Ï»Ø¿ô·¿·×¿ô»Ò¤Ï
!¡¡(EXP(x)-1)^i
! =¦²[j=0,i]{comb(i,j)*EXP(x)^(i-j)*(-1)^j} //Æó¹àÄêÍý
! =¦²[j=0,i]{comb(i,j)*(-1)^j*EXP((i-j)*x)} //EXP´Ø¿ô¤Î»Ø¿ôÉôʬ¤ò¤Þ¤È¤á¤ë
! =¦²[j=0,i]{comb(i,j)*(-1)^j*¦²[N=0,¡ç]{(i-j)^N*x^N/N!}} //EXP´Ø¿ô¤òµé¿ôŸ³«¤¹¤ë
! =¦²[N=0,¡ç]{x^N/N!*¦²[j=0,i]{comb(i,j)*(-1)^j*(i-j)^N}}
!µá¤á¤ëÃͤϡ¢x^N/N!¤Î·¸¿ô¤Ê¤Î¤Ç
!¡¡¦²[j=0,i]{comb(i,j)*(-1)^j*(i-j)^N}}
!j=i¤Î¤È¤­¡¢comb(i,j)*(-1)^j*(i-j)^N = 0 ¤è¤ê
!¡¡¦²[j=0,i-1]{comb(i,j)*(-1)^j*(i-j)^N}}
!¥°¥ë¡¼¥×¤Ï¡¢£±¡Á£Î¤Þ¤Ç¤¢¤ë¤Î¤Ç
!¡¡¦²[i=1,N]{¦²[j=0,i-1]{comb(i,j)*(-1)^j*(i-j)^N}}}

LET f=0 !°ìÈÌ¹à ¦²[i=1,N]{¦²[j=0,i-1]{(-1)^j*comb(i,j*(i-j)^j}}
FOR i=1 TO N
   FOR j=0 TO i-1
      LET f=f+(-1)^j*comb(i,j)*(i-j)^N
   NEXT j
NEXT i
PRINT f !·ë²Ì¤òɽ¼¨¤¹¤ë


!¾å¼°¤òŸ³«¤·¤Æ¡¢i^N¤Ç¤Þ¤È¤á¤ë¤È
!¡¡¦²[i=1,N]{¦²[j=0,N-i]{(-1)^j*comb(i+j,j)*i^N}}

LET f=0 !°ìÈÌ¹à ¦²[i=1,N]{¦²[j=0,N-i]{(-1)^j*comb(i+j,j)*i^N}}
FOR i=1 TO N
   FOR j=0 TO N-i
      LET f=f+(-1)^j*comb(i+j,j)*i^N
   NEXT j
NEXT i
PRINT f !·ë²Ì¤òɽ¼¨¤¹¤ë


!¤³¤Î¼°¤ò¤è¤¯¸«¤ë¤È¡¢¥Ñ¥¹¥«¥ë¤Î»°³Ñ·Á¤Ë¤è¤ë²òË¡¤Ø
!¡¡¡¡¡§
!¡¡¡¡¡§

END
 

Re: ¥»¥ó¥¿¡¼»î¸³ÄøÅÙ¤Î¥×¥í¥°¥é¥à±é½¬

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ10·î21Æü(¿å)22»þ39ʬ39ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.670[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£



> !Îã. £Î¿Í¤ò£é¸Ä¤Î¥°¥ë¡¼¥×¤Ëʬ¤±¤ë¾ì¹ç¤Î¿ô
> !
> !£³¿Í¤Ç¶¥Áö¤¹¤ë¾ì¹ç
> !¡¡£³¿Í¤¬£±°Ì¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£±Ä̤ê¡Ê=comb(3,3)¡Ë
> !¡¡£²¿Í¤¬£±°Ì¡¢£±¿Í¤¬£²°Ì¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£³Ä̤ê¡Ê=comb(3,2)*comb(1,1)¡Ë
> !¡¡£±¿Í¤¬£±°Ì¡¢£²¿Í¤¬£²°Ì¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£³Ä̤ê¡Ê=comb(3,1)*comb(2,2)¡Ë
> !¡¡£±¿Í¤¬£±°Ì¡¢£±¿Í¤¬£²°Ì¡¢£±¿Í¤¬£³°Ì¡¡¡¡£¶Ä̤ê¡Ê=comb(3,1)*comb(2,1)*comb(1,1)¡Ë
> !¡¡¤·¤¿¤¬¤Ã¤Æ¡¢£±£³Ä̤ꡣ
¤¹¤Ê¤ï¤Á¡¢Æ±½ç¤òµö¤¹½çÎó¤ÎÁí¿ô¤òµá¤á¤ë¤³¤È¤Ç¤¹¤è¤Í¡£


¤³¤Î·×»»¤Ï°ÊÁ°¼¡¤ÎÌäÂê¤ò¹Í¤¨¤Æ¤¤¤¿¤â¤Î¤È·Ò¤¬¤ë¤³¤È¤Ëµ¤ÉÕ¤­¤Þ¤·¤¿¡£

¡ã¥Ä¥¢¡¼Î¹¹Ô´ë²è¡ä
£³¿Í¡ÊA,B,C)¤ÎµÒ¤¬¥Ä¥¢¡¼Î¹¹Ô¤ò´õ˾¤·¤Æ¤¤¤Þ¤¹¡£
ι¹Ô²ñ¼Ò¤Ï¼¡¤Î´ë²è¤¬²Äǽ¤Ç¤¹¡£
£±¡¥A,B,C¤Ç°ì½ï¤Ë¹Ô¤¯¡£
£²¡¥A,B¤ÇÂ裱¿Ø¡¢C¤À¤±¤ÇÂ裲¿Ø
£³¡¥B,C¤ÇÂ裱¿Ø¡¢A¤À¤±¤ÇÂ裲¿Ø
£´¡¥C,A¤ÇÂ裱¿Ø¡¢B¤À¤±¤ÇÂ裲¿Ø
£µ¡¥A¤ÇÂ裱¿Ø¡¢B,C¤ÇÂ裲¿Ø
£¶¡¥B¤ÇÂ裱¿Ø¡¢C,A¤ÇÂ裲¿Ø
£·¡¥C¤ÇÂ裱¿Ø¡¢A,B¤ÇÂ裲¿Ø
£¸¡¥A¤ÇÂ裱¿Ø¡¢B¤ÇÂ裲¿Ø¡¢C¤ÇÂ裳¿Ø
£¹¡¥A¤ÇÂ裱¿Ø¡¢C¤ÇÂ裲¿Ø¡¢B¤ÇÂ裳¿Ø
£±£°¡¥B¤ÇÂ裱¿Ø¡¢A¤ÇÂ裲¿Ø¡¢C¤ÇÂ裳¿Ø
£±£±¡¥B¤ÇÂ裱¿Ø¡¢C¤ÇÂ裲¿Ø¡¢A¤ÇÂ裳¿Ø
£±£²¡¥C¤ÇÂ裱¿Ø¡¢A¤ÇÂ裲¿Ø¡¢B¤ÇÂ裳¿Ø
£±£³¡¥C¤ÇÂ裱¿Ø¡¢B¤ÇÂ裲¿Ø¡¢A¤ÇÂ裳¿Ø

°Ê¾å£±£³Ä̤ê¤Î²ÄǽÀ­¤¬À¸¤Þ¤ì¤ë¡£

¤Ç¤Ï¡¢£´¿Í¤ÎµÒ¤¬¸½¤ì¤¿¤é²¿Ä̤꤬¹Í¤¨¤é¤ì¤ë¤Ç¤·¤ç¤¦¤«¡©
°ìÈ̤ˣî¿Í¤ÎµÒ¤Ê¤é¤É¤¦¤Ê¤ë¤Ç¤·¤ç¤¦¡©

¤³¤³¤Ë¾Ò²ð¤µ¤ì¤Æ¤¤¤ë¥×¥í¥°¥é¥à¤¬
¤³¤ÎÌäÂê¤Ë²òÅú¤ò¤¢¤¿¤¨¤ë¤â¤Î¤Ç¤¢¤ê¡¢¤Þ¤¿¤½¤Î°ìÈ̲½¤ò²Äǽ¤Ë¤¹¤ë¡£




> !¤³¤Î¼°¤ò¤è¤¯¸«¤ë¤È¡¢¥Ñ¥¹¥«¥ë¤Î»°³Ñ·Á¤Ë¤è¤ë²òË¡¤Ø
> !¡¡¡¡¡§
> !¡¡¡¡¡§


¡ã¼ê·×»»¤Ë¤è¤ëµ¡³£Åª»»½ÐÊýË¡¡ä
1.¤Þ¤º¥Ñ¥¹¥«¥ë¤Î»°³Ñ·Á¤«¤é¡¢£±ÈÖ±¦Ã¼¤Î¡Ê£±¡Ë¤Ï¼è¤ê½ü¤¯¡£
2.º¸Ã¼¤«¤é±¦¤Ë¶ö¿ôÈÖÌܤοô¤Ë¡Ý¤ò¤Ä¤±¤ë¡£
3.³ÆÃÊÌܤκ¸Ã¼¤«¤é±¦¼Ð¤á²¼¤Ë½ç¡¹¤Ëɽ¼¨¤µ¤ì¤Æ¤¤¤ë¿ô»ú¤ò¤¹¤Ù¤Æ²Ã¤¨¤ë¡£
4.¤³¤Î¹ç·×Ãʤοô¤Îº¸¤«¤é½ç¤Ë£´¡°£´¡¢£³¡°£´¡¢£²¡°£´¡¢£±¡°£´¤ò³Ý¤±¡¢¤¹¤Ù¤Æ¤ò²Ã¤¨¤ë¡£


¤¹¤Ê¤ï¤Á

1.   ¡¡¡¡¡¡£±¡¡(£±)
¡¡¡¡¡¡¡¡£±¡¡¡¡£²¡¡(£±)
¡¡¡¡ £±¡¡¡¡£³¡¡¡¡£³¡¡(£±)
¡¡£±¡¡¡¡£´¡¡¡¡£¶¡¡¡¡£´¡¡(£±)

2.          £±
¡¡¡¡¡¡¡¡¡¡£±¡¡¡Ý£²
¡¡¡¡¡¡¡¡£±¡¡¡Ý£³¡¡£³
¡¡¡¡¡¡£±¡¡¡Ý£´¡¡£¶¡¡¡Ý£´
        a     b    c     d

3.  a=1,b=1-4=-3,c=1-3+6=4,d=1-2+3-4=-2

4. a*4^4+b*3^4+c*2^4+d*1^4
  =1*4^4-3*3^4+4*2^4-2*1^4
  =256-243+64-2
  =75


£µ¿Í¤Î¾ì¹ç¤âƱÍͤ˷׻»¤·¤Æ¤ß¤ë¤È¡¢£µ£´£±Ä̤ê¤Ç¡¢£±¿Í¡¢£²¿Í¤Î¾ì¹ç¤â´Þ¤á¤ë¤È¡¢¼¡¤Î¤è¤¦¤Ê¿ôÎó¤È¤Ê¤ë¤Î¤¬¼ê·×»»¤Ç¼ê¤ËÆþ¤ë¡£¡Ê£¶¿Í¤Ï¤Á¤ç¤Ã¤ÈÂçÊÑ¡Ë

¡¡¡¡¡¡£± ¡¤ £³ ¡¤ £±£³ ¡¤ £·£µ ¡¤ £µ£´£± ¡¤£´£¶£¸£³¡¢ ¡¦¡¦¡¦¡¦¡¦
 

Re: ¥»¥ó¥¿¡¼»î¸³ÄøÅÙ¤Î¥×¥í¥°¥é¥à±é½¬

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ10·î22Æü(ÌÚ)19»þ50ʬ51ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.670[¸µµ­»ö¤Ø]

»³Ã椵¤ó¡¡LET f=0 !°ìÈÌ¹à ¦²[i=1,N]{¦²[j=0,i-1]{(-1)^j*comb(i,j*(i-j)^j}}
 

Re: ¥»¥ó¥¿¡¼»î¸³ÄøÅÙ¤Î¥×¥í¥°¥é¥à±é½¬

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ10·î23Æü(¶â)09»þ00ʬ36ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.672[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¥±¥¢¥ì¥¹¥ß¥¹¤Ç¤¹¡£
¼Â¹ÔÉôʬ¤Ï¡¢¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ì¤Ð¡¢¤½¤Î·ë²Ì¤Ç´Ö°ã¤¤¤¬¤ï¤«¤ê¤Þ¤¹¤¬
Ãí¼áÉôʬ¤Ï¡¢Ç¡²¿¤»¤ó¡¢¡¢¡¢
!Ê̲ò
!A={a1,a2,a3,Ž¥Ž¥Ž¥,an}¡¢B={b1,b2,b3,¡Ä,bm}¤Î¤È¤­¡¢A¤«¤éB¤Ø¤ÎÁ´¼Í¤Î¿ô
!¡¡¦²[k=0,m]{(-1)^k*comb(m,k)*(m-k)^n}
!
!¾å¼°¤Ï¡¢Êñ½ü¸¶Íý¤è¤êµá¤á¤é¤ì¤ë¡£
!µá¤á¤ëÃͤϡ¢m=1¡Án¤è¤ê¡£
!¡¡¦²[m=1,n]{¦²[k=0,m]{(-1)^k*comb(m,k)*(m-k)^n}}

LET n=5

LET f=0
FOR m=1 TO n
   FOR k=0 TO m
      LET f=f+(-1)^k*comb(m,k)*(m-k)^n
   NEXT k
NEXT m
PRINT f

END
 

Re: ¥»¥ó¥¿¡¼»î¸³ÄøÅÙ¤Î¥×¥í¥°¥é¥à±é½¬

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ10·î23Æü(¶â)12»þ39ʬ38ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.673[¸µµ­»ö¤Ø]

»³Ã椵¤ó¤Ø
¤³¤Î¥·¥ê¡¼¥º¡¢¤¤¤Ä¤â¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£ÌÜŪ³°¤Î¼õ¹ÖÀ¸¤Ç¤¹¤¬¡¢
¹â¹»»þÂå¡¢¿ô³Ø¤ÎÅÀ¿ô¤¬¡¢»ä¤Ï¶Ë¤á¤Æ°­¤¯¤Æ¡¢Éݤ¤¿ô³Ø¤ÎÀèÀ¸¤Ë¡¢Äɤ¤¤«¤±¤é¤ì¤ë»×¤¤¤Ç¤¹¡£
ºÆÍú½¤¤µ¤»¤Æ¡¢Äº¤¤¤Æ¤¤¤Þ¤¹¡£¿·¤¿¤ÊȯÁۤμø¶È¤ò´¶¼Õ¤·¤Þ¤¹¡£
½ñʪ¤ÎÊýÄø¼°¤È°Û¤Ê¤ê¡¢¡Ö¼Â¹Ôʸ¤Ë¤Ï̤ÄêµÁ¥·¥ó¥Ü¥ë¤¬Ìµ¤¤¡×¤Î¤¬¡¢½õ¤«¤ê¤Þ¤¹¡£

ÂçÄжµ¼ø¤Î¥Ö¥í¥°¤Ë¡¢»ä¤Îµº¸À¤¬ºÜ¤ê¤Þ¤·¤¿¡£2009.10.22
http://ohtsuki-yoshihiko.cocolog-nifty.com/blog/
 

½çÎó¡¢Áȹ礻¤ÎÈÖ¹æÉÕ¤±¤ÈÉü¸µ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ10·î23Æü(¶â)15»þ25ʬ41ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ¥Ñ¥º¥ë¤Î²òË¡¤Ç¡¢¶ÉÌ̤ò¥³¡¼¥É²½¤¹¤ë¤¿¤á¤Ë¤Ä¤¯¤Ã¤Æ¤ß¤Þ¤·¤¿¡£
¥Ï¥Ã¥·¥å´Ø¿ô¤Î¥µ¥Ö¥ë¡¼¥Á¥ó¤Ç¤¹¡£

»²¹Í
¡¡¥Õ¥©¥ë¥À SAMPLE Æâ¡¡PERMUTAT.BAS¡¢COMBINAT.BAS


¡ü½çÎó·¿
!½çÎó perm(n,r) Ä̤ê¤Î¥Ñ¥¿¡¼¥ó¤Ë¡¢0 ¡Á perm(n,r)-1 ¤ÎÈÖ¹æ¤ò¤Ä¤±¤ëÊýË¡

LET N=4 !£±¡Á£Î¤Þ¤Ç¤Î¿ô»ú¤ò»È¤¦
LET R=4

DATA 1,2,3,4 !½çÎó PERM(N,N)=FACT(N) ¤Î¥Æ¥¹¥È¡¦¥Ç¡¼¥¿
DATA 1,2,4,3
DATA 1,3,2,4
DATA 1,3,4,2
DATA 1,4,2,3
DATA 1,4,3,2
DATA 2,1,3,4
DATA 2,1,4,3
DATA 2,3,1,4
DATA 2,3,4,1
DATA 2,4,1,3
DATA 2,4,3,1
DATA 3,1,2,4
DATA 3,1,4,2
DATA 3,2,1,4
DATA 3,2,4,1
DATA 3,4,1,2
DATA 3,4,2,1
DATA 4,1,2,3
DATA 4,1,3,2
DATA 4,2,1,3
DATA 4,2,3,1
DATA 4,3,1,2
DATA 4,3,2,1

DIM A(R),B(R)
FOR d=1 TO PERM(N,R) !¥Ç¡¼¥¿¤òÆɤ߹þ¤à
   MAT READ A

   LET h=Perm2Num(A,N,R)
   PRINT h !·ë²Ì¤òɽ¼¨¤¹¤ë

   CALL Num2Perm(h, B,N,R) !Éü¸µ¤¹¤ë
   MAT PRINT B;
   MAT PRINT A; !¸¡»»
NEXT d

END


!ºÇ¾®´°Á´¥Ï¥Ã¥·¥å´Ø¿ô

EXTERNAL FUNCTION Perm2Num(A(),N,R) !½çÎó¥Ñ¥¿¡¼¥ó¤ËÈÖ¹æ¤òÉÕ¤±¤ë¡¡¢¨¼­½ñ¼°½ç½ø
LET v=0
FOR j=1 TO R
   LET t=A(j)
   LET v=v+perm(N-j,R-j)*(t-1)
   FOR k=j+1 TO R
      IF A(k)>t THEN LET A(k)=A(k)-1
   NEXT k
NEXT j
LET Perm2Num=v
END FUNCTION

EXTERNAL SUB Num2Perm(h, A(),N,R) !Èֹ椫¤é½çÎó¥Ñ¥¿¡¼¥ó¤òÀ¸À®¤¹¤ë¡¡¢¨¼­½ñ¼°½ç½ø
LET v=h
FOR j=1 TO R
   LET fac=perm(N-j,R-j)
   LET t=INT(v/fac)
   LET A(j)=t+1 !£±¡Á£Î
   LET v=v-fac*t
NEXT j
FOR j=R TO 1 STEP -1
   FOR k=j+1 TO R
      IF A(j)<=A(k) THEN LET A(k)=A(k)+1
   NEXT k
NEXT j
END SUB


¡üÁȹ礻·¿
!Áȹ礻 comb(n,r) Ä̤ê¤Î¥Ñ¥¿¡¼¥ó¤Ë¡¢0 ¡Á comb(n,r)-1 ¤ÎÈÖ¹æ¤ò¤Ä¤±¤ëÊýË¡

LET N=6 !£±¡Á£Î¤Þ¤Ç¤Î¿ô»ú¤ò»È¤¦
LET R=3

DATA 1,2,3 !Áȹ礻 comb(6,3)=20 ¤Î¥Æ¥¹¥È¡¦¥Ç¡¼¥¿
DATA 1,2,4 !¢¨¿ô»ú¤Ï¾®¤µ¤¤½ç
DATA 1,2,5
DATA 1,2,6
DATA 1,3,4
DATA 1,3,5
DATA 1,3,6
DATA 1,4,5
DATA 1,4,6
DATA 1,5,6
DATA 2,3,4
DATA 2,3,5
DATA 2,3,6
DATA 2,4,5
DATA 2,4,6
DATA 2,5,6
DATA 3,4,5
DATA 3,4,6
DATA 3,5,6
DATA 4,5,6

DIM A(R),B(R)
FOR d=1 TO comb(N,R) !¥Ç¡¼¥¿¤òÆɤ߹þ¤à
   MAT READ A

   LET h=Comb2Num(A,N,R)
   PRINT h !·ë²Ì¤òɽ¼¨¤¹¤ë

   CALL Num2Comb(h, B,N,R) !Éü¸µ¤¹¤ë
   MAT PRINT B;
   MAT PRINT A; !¸¡»»
NEXT d

END


!ºÇ¾®´°Á´¥Ï¥Ã¥·¥å´Ø¿ô

EXTERNAL FUNCTION Comb2Num(A(),N,R) !Áȹ礻¥Ñ¥¿¡¼¥ó¤ËÈÖ¹æ¤òÉÕ¤±¤ë¡¡¢¨¼­½ñ¼°½ç½ø
LET v=0
FOR i=R TO 1 STEP -1 !Áȹ礻¤ò¥Ó¥Ã¥È°ÌÃ֤Ȥ¹¤ë
   LET t=N-A(i)
   LET v=v+COMB(t,R-i+1)
NEXT i
LET Comb2Num=(comb(N,R)-1)-v
END FUNCTION

EXTERNAL SUB Num2Comb(h, A(),N,R) !Èֹ椫¤éÁȹ礻¥Ñ¥¿¡¼¥ó¤òÀ¸À®¤¹¤ë¡¡¢¨¼­½ñ¼°½ç½ø
LET v=comb(N,R)-h
LET m=R
FOR i=N-1 TO 0 STEP -1 !Áȹ礻¤ò¥Ó¥Ã¥È°ÌÃ֤Ȥ¹¤ë
   LET t=COMB(i,m)
   IF v>t THEN
      LET A(R-m+1)=N-i !¥Ó¥Ã¥È°ÌÃÖ(N-i-1)¤ò£±¤È¤¹¤ë
      LET m=m-1
      LET v=v-t
   END IF
NEXT i
END SUB


EXTERNAL FUNCTION Comb2Num2(A(),N,R) !Áȹ礻¥Ñ¥¿¡¼¥ó¤ËÈÖ¹æ¤òÉÕ¤±¤ë¡¡¢¨¼­½ñ¼°½ç½ø¤Ç¤Ï¤Ê¤¤
LET v=0
FOR i=R TO 1 STEP -1
   LET t=A(i)-1 !Áȹ礻¤ò¥Ó¥Ã¥È°ÌÃ֤Ȥ¹¤ë
   LET v=v+COMB(t,i)
NEXT i
LET Comb2Num2=v
END FUNCTION

EXTERNAL SUB Num2Comb2(h, A(),N,R) !Èֹ椫¤éÁȹ礻¥Ñ¥¿¡¼¥ó¤òÀ¸À®¤¹¤ë¡¡¢¨¼­½ñ¼°½ç½ø¤Ç¤Ï¤Ê¤¤
LET v=h
LET m=R
FOR i=N-1 TO 0 STEP -1 !Áȹ礻¤ò¥Ó¥Ã¥È°ÌÃ֤Ȥ¹¤ë
   LET t=COMB(i,m)
   IF t<=v THEN
      LET A(m)=i+1 !¥Ó¥Ã¥È°ÌÃÖi¤ò£±¤È¤¹¤ë
      LET m=m-1
      LET v=v-t
   END IF
NEXT i
END SUB
 

Ä©Àï¾õ

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ10·î25Æü(Æü)13»þ15ʬ46ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ¡¡*48¡¡¡¡ *90 ¡¡¡¡¡¡16¡¡¡¡¡¡59¡¡¡¡¡¡*68¡¡¡¡¡¡38¡¡¡¡¡¡ 76
¡¡ 15¡¡¡¡¡¡57¡¡¡¡¡¡*49¡¡¡¡ *92    ¡¡*79¡¡¡¡¡¡27¡¡¡¡¡¡ 65
¡¡*81¡¡¡¡¡¡35¡¡¡¡¡¡*71¡¡¡¡¡¡26¡¡¡¡¡¡ 13 ¡¡¡¡*93¡¡¡¡¡¡ 43
¡¡ 36¡¡¡¡¡¡78¡¡¡¡¡¡*28¡¡¡¡¡¡69¡¡¡¡¡¡ 56 ¡¡¡¡*50¡¡¡¡¡¡*88
¡¡*39¡¡¡¡¡¡77¡¡¡¡¡¡ 25     *72¡¡¡¡¡¡ 55¡¡¡¡¡¡47¡¡¡¡¡¡*89
¡¡ 33¡¡ ¡¡*83 ¡¡¡¡¡¡23¡¡¡¡¡¡66¡¡¡¡¡¡*61¡¡¡¡¡¡45¡¡¡¡¡¡*91

¡ö°õ¤ÏÀÖ¿§¤Ç°õ»ú¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤È¤¹¤ë¡£¡Ê̵¤¤¤Î¤Ï¹õ¿§¡Ë

¡ÊÍ·¤ÓÊý¡Ë
1.Áê¼ê¤Ë¤³¤ÎÃæ¤Î°ì¤Ä¤Î¿ô»ú¤ò¿´¤Ë»×¤Ã¤Æ¤â¤é¤¦¡£
2.¤½¤Î¿ô»ú¤Î¤¢¤ëÎó¤Î¿ô»ú¤Î¿§¤ò¾å¤«¤é¸À¤Ã¤Æ¤â¤é¤¦¡£
¡¡¤¿¤À¤·¡¢¿´¤Ë·è¤á¤¿¿ô»ú¤Ç¤Ï¡¢¤¢¤¨¤ÆµÕ¤Î¿§¤ò¸À¤¦¤³¤È¤Ë¤¹¤ë¡£
¡¡¡ÊÎ㡧£·£¸¡Ê£´¹Ô£²ÎóÌÜ¡Ë¢ªÀÖ¡¢¹õ¡¢¹õ¡¢À֡ʵաˡ¢¹õ¡¢ÀÖ¤ÈÅú¤¨¤ë¤³¤È¤Ë¤Ê¤ë¡£¡Ë
3.¤³¤ÎÅú¤¨¤Î¿§¤ÎÇÛÎó¤òʹ¤¤¤Æ¡¢Â¨ºÂ¤ËÁê¼ê¤Î¿´¤Ë»×¤Ã¤¿¿ô»ú¤òÅö¤Æ¤ë¡£
  ¡Ê¤³¤Î¥«¡¼¥É¤ÏÁê¼ê¤ËÅϤ·¤Æ¤ª¤­¡¢¤³¤Î¥«¡¼¥É¤Ï¸«¤Ê¤¤¤ÇÅö¤Æ¤ë¡£¡Ë

¤³¤ÎÍ·¤Ó¤ò²Äǽ¤Ê¤é¤·¤á¤ë¿ô»ú¤ÎÇÛÎó¤¬Ç¡²¿¤Ê¤ëˡ§¤Ç¹½À®¤µ¤ì¤Æ¤¤¤ë¤«¡¢²òÌÀ¤µ¤ì¤¿¤·¡£
¡Ê¤¢¤¨¤Æ¥¦¥½¤Î¾ðÊó¤ò´Þ¤Þ¤»¤ëÅÀ¤¬½ÅÍסË

¤É¤Ê¤¿¤«¡¢¿´¤Ë°ì¤Ä¿ô»ú¤ò»×¤¤¡¢¿§¤ÎÊó¹ð¤ò¤·¤Æ²¼¤µ¤¤¡£
¤¢¤Ê¤¿¤Î¿ô»ú¤ò¥Ô¥¿¥ê¤ÈÅö¤Æ¤Æ¤·¤ó¤¼¤Þ¤·¤ç¤¦¡£
 

Re: Ä©Àï¾õ

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ10·î26Æü(·î)07»þ21ʬ20ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.676[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹

À֤ȹõ¤Îʸ»úÎ󤫤é¤â¤È¤Î¿ô»ú¤òµá¤á¤ë¤Ë¤Ï¡¢¼¡¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡£
ÀèƬ¤«¤é11,22,44,1,2,4¤ò¥Ù¡¼¥¹¤È¤·¤Æ¡¢¹õ¤Ê¤é¤½¤Î¿ô¤ò²Ã¤¨ºÇ¸å¤Ë10¤ò²Ã¤¨¤Þ¤¹¡£
¹õ¡¢ÀÖ¡¢¹õ¡¢¹õ¡¢ÀÖ¡¢ÀÖ¡¡¤Ê¤é¤Ð  1*11+0*22+1*44+1*1+0*2+0*4+10=66

100 DEF base(j)=2^MOD(j+2,3)+2^MOD(j+2,3)*10*(1-INT(j/3.01)) ! 11,22,44,1,2,4
110 FUNCTION change(p$)
120    IF UCASE$(p$)="R" THEN
130       LET c=0
140    ELSEIF UCASE$(p$)="B" THEN
150       LET c=1
160    ELSE
170       PRINT "ERROR-2 !!"
180    END IF
190    LET change=c
200 END FUNCTION
210 INPUT PROMPT "ÀÖ¤ò""R"",¹õ¤ò""B""¤È¤·¤¿Ê¸»úÎó = ":rb$ ! Îã) brbbrr
220 IF LEN(rb$)<>6 THEN PRINT "ERROR-1 !!"
230 LET d=10
240 FOR j=1 TO 6
250    LET d=d+change(rb$(j:j))*base(j)
260 NEXT j
270 PRINT "²òÅú =";d
280 END


¼¡¤Ï¥¿¥Æ¤Î¿ô»ú¤ÎÎó¤Î¹½À®¤ò¤¹¤Ù¤Æµ­½Ò¤¹¤ë¥×¥í¥°¥é¥à¤Ç¤¹¡£
¤³¤³¤«¤é¤É¤Î¤è¤¦¤Êµ¬Â§¤Ë¤è¤ê£·¸Ä¤Î¿ôÎó¤òÃê½Ð¤·¤¿¤Î¤«¤Ï¡¢»ä¤Ë¤Ï¤ï¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£
¤¿¤Ö¤ó¿ô»ú¤¬½ÅÊ£¤·¤Ê¤¤¤è¤¦¤ËÁª¤ó¤Ç¤¤¤ë¤Î¤À¤È»×¤¤¤Þ¤¹¤¬¡¢¼¡¤Î¿ôÎó¤ÏºÎÍѤµ¤ì¤Æ¤¤¤Þ¤»¤ó¡£
   *21
   *32
   *54  (¤¹¤Ù¤ÆÀ֤ʤΤǤ³¤ì¤ò´Þ¤à¤È¥Ò¥ó¥È¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤¦¤«¤é¡©)
   *11
   *12
   *14
À¸À®¤Ç¤­¤ë¿ô»ú¤Ï10¡Á94¤Î¤¦¤Á¤Î64¸Ä(=2^6)¤Ç¤¹¤¬¡¢Â¾¤Ë¤âɽ¤Ë¸½¤ì¤Ê¤¤¿ô»ú¤¬¤¢¤ê¤Þ¤¹¡£

DIM base(6),dwn(6),check(6)
MAT READ base,dwn
FUNCTION number(q)
   LET dd=10
   FOR jj=1 TO 6
      IF jj<>q THEN
         LET dd=dd+check(jj)*base(jj)
      ELSE
         LET dd=dd+((check(jj)-1)^2)*base(jj)
      END IF
   NEXT jj
   LET number=dd
END FUNCTION
FOR n=10 TO 94
   MAT check=ZER
   LET d=10
   LET nn=n-d
   FOR j=1 TO 6 ! base¤ÎÂ礭¤¤¿ô¤«¤é°ú¤¤¤Æ¤¤¤¯
      IF nn-base(dwn(j))>=0 THEN
         LET check(dwn(j))=1
         LET d=d+base(dwn(j))
         LET nn=nn-base(dwn(j))
      END IF
   NEXT j
   IF n=d THEN
      LET check(1)=(check(1)-1)^2 ! 0,1¤ÎÆþ¤ì´¹¤¨
      FOR j=1 TO 6
         PRINT number(j);
      NEXT j
      PRINT
      FOR j=1 TO 6
         IF check(j)=0 THEN PRINT " ÀÖ "; ELSE PRINT " ¹õ ";
      NEXT j
      PRINT
   ELSE
      PRINT n;" ¤³¤Î¿ô¤ÏÀ¸À®¤Ç¤­¤Þ¤»¤ó"
   END IF
NEXT n
DATA 11,22,44,1,2,4  ! base
DATA 3,2,1,6,5,4  ! base¤Î¹ß½ç
END
 

Re: Ä©Àï¾õ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ10·î26Æü(·î)16»þ57ʬ39ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.676[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

!2^6Ä̤ê¤Î¥Ó¥Ã¥È¥Ñ¥¿¡¼¥ó¤Ï¡¢Ä̾ï0¡Á2^6-1¤Î¿ô¤ËÂбþ¤µ¤»¤ë¡£
!¤³¤ÎÌäÂê¤Ç¤Ï¡¢2^n Éôʬ¡Ê½Å¤ß¡Ë¤¬¡¢¥Ó¥Ã¥È°ÌÃÖ¤È32,16,8,4,2,1¤Î½çÈÖ¤ÇÂбþ¤¤¤Æ¤¤¤Ê¤¤¡£
!¤À¤¬¡¢¤³¤ì¤ò¤â¤È¤ËÀ¸À®¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤È²¾Äꤷ¤Æ¡¢¤É¤Î¥Ó¥Ã¥È¤ËÂбþ¤·¤Æ¤¤¤ë¤«¡¢¥°¥é¥Õ¤Ç³Îǧ¤¹¤ë¡£

!6!Ä̤ê¤Î½çÎó¤òÀ¸À®¤·¤Æ¡¢¤è¤êľÀþ¤Ë¤Ê¤ë¤â¤Î¤¬µá¤á¤ë³äÉÕ¤±¤È¤Ê¤ë¡£
!¤Þ¤À¡¢¤³¤ÎÃʳ¬¤Ç¤Ï½Å¤ß¤ÏͽÁۡʶá»÷Ã͡ˤȤʤ롣

!Àµ²ò¤Î½Å¤ß¤ò¿ä¬¤¹¤ë¤¿¤á¤Ë¥°¥é¥Õ¤ò¸¡¾Ú¤¹¤ë¡£¡Ê²¼¿Þ¡Ë
!½Å¤ß¤Ï¡¢(8,16,32,1,2,4)=(1*8,2*8,4*8,1,2,4)¡¡¢ª¡¡(1*(8+3),2*(8+3),4*(8+3),1,2,4)=(11,22,44,1,2,4)
!¤²¤¿¤Ï¡¢10¡£
DIM W(6) !½Å¤ß
DATA 32,16,8,4,2,1 !Àµ²ò 11,22,44,1,2,4
MAT READ W

!£±ÎóÌÜ 010101¡¡0:ÀÖ¡¢1:¹õ
100 DATA 1,1,0,1,0,1, 48 !µÒ¤¬Åú¤¨¤¿ÀÖ¹õ¤Î¥Ñ¥¿¡¼¥ó¡¢»×¤Ã¤Æ¤¤¤¿¿ô
    DATA 0,0,0,1,0,1, 15
    DATA 0,1,1,1,0,1, 81
    DATA 0,1,0,0,0,1, 36
    DATA 0,1,0,1,1,1, 39
    DATA 0,1,0,1,0,0, 33

    !£²ÎóÌÜ 011110
    DATA 1,1,1,1,1,0, 90
    DATA 0,0,1,1,1,0, 57
    DATA 0,1,0,1,1,0, 35
    DATA 0,1,1,0,1,0, 78
    DATA 0,1,1,1,0,0, 77
    DATA 0,1,1,1,1,1, 83

    !£³ÎóÌÜ 100011
    DATA 0,0,0,0,1,1, 16
    DATA 1,1,0,0,1,1, 49
    DATA 1,0,1,0,1,1, 71
    DATA 1,0,0,1,1,1, 28
    DATA 1,0,0,0,0,1, 25
    DATA 1,0,0,0,1,0, 23

    !£´ÎóÌÜ 101101
    DATA 0,0,1,1,0,1, 59
    DATA 1,1,1,1,0,1, 92
    DATA 1,0,0,1,0,1, 26
    DATA 1,0,1,0,0,1, 69
    DATA 1,0,1,1,1,1, 72
    DATA 1,0,1,1,0,0, 66

    !£µÎóÌÜ 001110
    DATA 1,0,1,1,1,0, 68
    DATA 0,1,1,1,1,0, 79
    DATA 0,0,0,1,1,0, 13
    DATA 0,0,1,0,1,0, 56
    DATA 0,0,1,1,0,0, 55
    DATA 0,0,1,1,1,1, 61

    !£¶ÎóÌÜ 110011
    DATA 0,1,0,0,1,1, 38
    DATA 1,0,0,0,1,1, 27
    DATA 1,1,1,0,1,1, 93
    DATA 1,1,0,1,1,1, 50
    DATA 1,1,0,0,0,1, 47
    DATA 1,1,0,0,1,0, 45

    !£·ÎóÌÜ 111000
    DATA 0,1,1,0,0,0, 76
    DATA 1,0,1,0,0,0, 65
    DATA 1,1,0,0,0,0, 43
    DATA 1,1,1,1,0,0, 88
    DATA 1,1,1,0,1,0, 89
    DATA 1,1,1,0,0,1, 91

    SET WINDOW -5,100,-5,100

    DIM P(6)
    FOR t=0 TO fact(6)-1 !½Å¤ß¤Î½çÎó¤òÀ¸À®¤¹¤ë
       CALL Num2Perm(t,P,6)

       RESTORE 100
       CLEAR
       DRAW grid(10,10)
       FOR d=1 TO 6*7 !¥µ¥ó¥×¥ë¡¦¥Ç¡¼¥¿¤è¤ê
          DIM B(6) !µÒ¤¬Åú¤¨¤¿ÀÖ¹õ¤Î¥Ñ¥¿¡¼¥ó
          MAT READ B
          READ y !»×¤Ã¤Æ¤¤¤¿¿ô

          LET x=0 !Àþ·Á¼ÌÁü
          FOR i=1 TO 6
             LET x=x+W(P(i))*B(i)
          NEXT i

          PLOT POINTS: x,y !¤è¤êľÀþ¤Ë¤Ê¤ë¤Î¤¬¸õÊ䡪
       NEXT d
       FOR i=1 TO 6 !½Å¤ß¤Î½çÎó¤òɽ¼¨¤¹¤ë
          PRINT W(P(i));
       NEXT i
       PRINT

       WAIT DELAY 0.3 !¢¨Ä´À°¤¬É¬Í×

    NEXT t

 END


 !n!¤Î½çÎó¥Ñ¥¿¡¼¥ó ¢Î 0¡Á(n!-1)¤ÎÈÖ¹æ

 EXTERNAL FUNCTION Perm2Num(A(),N) !½çÎó¥Ñ¥¿¡¼¥ó¤ËÈÖ¹æ¤òÉÕ¤±¤ë¡¡¢¨¼­½ñ¼°½ç½ø
    LET v=0
    FOR j=1 TO N-1 !¢¨N¤Ç¤Ï£°
       LET t=A(j)
       LET v=v+fact(N-j)*(t-1)
       FOR k=j+1 TO N
          IF A(k)>t THEN LET A(k)=A(k)-1
       NEXT k
    NEXT j
    LET Perm2Num=v
 END FUNCTION

 EXTERNAL SUB Num2Perm(h, A(),N) !Èֹ椫¤é½çÎó¥Ñ¥¿¡¼¥ó¤òÀ¸À®¤¹¤ë¡¡¢¨¼­½ñ¼°½ç½ø
    LET v=h
    FOR j=1 TO N
       LET fac=fact(N-j)
       LET t=INT(v/fac)
       LET A(j)=t+1 !£±¡Á£Î
       LET v=v-fac*t
    NEXT j
    FOR j=N TO 1 STEP -1
       FOR k=j+1 TO N
          IF A(j)<=A(k) THEN LET A(k)=A(k)+1
       NEXT k
    NEXT j
 END SUB
 

Hamming Code ¤ÎÍøÍÑÊýË¡

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ10·î26Æü(·î)18»þ47ʬ43ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ¸«»ö¤Ë¸«Çˤé¤ì¤Æ¤·¤Þ¤¤¤Þ¤·¤¿¡£
11,22,44,1,2,4
¤òÀ¸¤ß½Ð¤¹´Ø¿ô¤È¤·¤Æ¡¢¤è¤¯¤â¤Þ¤¢
base(j)=2^MOD(j+2,3)+2^MOD(j+2,3)*10*(1-INT(j/3.01))¡¡¡Êj=1,2,3,4,5,6)
¤Ê¤ë¤â¤Î¤ò¤Ä¤¯¤é¤ì¤Þ¤·¤¿¤Í¡Á

¸½ºß¤³¤Î¿ô»ú¤ò¥È¥é¥ó¥×¤Î»¥¤ËÃÖ¤­´¹¤¨¤Æ¤Ç¤­¤ë¹½À®¤ò»×°ÆÃæ¤Ç¤¹¡£
¤Ç¤­¤¿¤é¥¢¥Ã¥×¤·¤¿¤¤¤È»×¤¤¤Þ¤¹¡£

´Ö°ã¤Ã¤¿Éôʬ¤ò¸¡½Ð¤¹¤ëÊýË¡¤È¤·¤Æ¥Ï¥ß¥ó¥°¥³¡¼¥É¤È¤¤¤¦³µÇ°¤¬¾ðÊóÄÌ¿®¹©³Ø¤Ë¤¢¤ë¤Èʹ¤¤¤¿¤³¤È¤¬¤¢¤ê¤Þ¤¹¤¬¡¢¤³¤ì¤Ï¤³¤ÎÌäÂê¤ò²òÀϤ¹¤ë¾å¤ÇÍøÍѤǤ­¤Ê¤¤¤â¤Î¤Ê¤ó¤Ç¤·¤ç¤¦¤«¡©
¤Þ¤¿¤³¤Î¥³¡¼¥É¤òÍøÍѤ¹¤ëŬÅö¤ÊÎã¤ò¾Ò²ð¤·¤Æ失¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡©
 

¥È¥é¥ó¥×¤Ç¤Î»î¤ß

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ10·î26Æü(·î)21»þ30ʬ52ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ♦8 (3,5) ♥3 (7,3) ♣Q (0,6) ♣9 (4,5) ♥8 (5,3) ♣8 (2,6) ♠Q (6,0)
♣10(0,5) ♠7 (4,3) ♦9 (3,6) ♥5 (7,5) ♥9 (6,3) ♣J (1,6) ♠10(5,0)
♥J (6,5) ♣A (2,3) ♦J (5,6) ♣4 (1,5) ♣K (0,3) ♥6 (7,6) ♠K (3,0)
♣6 (2,4) ♠8 (6,2) ♦A (1,7) ♠9 (5,4) ♠6 (4,2) ♦3 (3,7) ♥A (7,1)
♦2 (2,7) ♠J (6,1) ♣5 (1,4) ♦5 (5,7) ♠5 (4,1) ♣7 (3,4) ♥2 (7,2)
♠3 (2,1) ♦6 (6,7) ♣3 (1,2) ♠4 (5,1) ♦4 (4,7) ♠A (3,2) ♥4 (7,4)





¤Èʤ٤¿¥«¡¼¥É¤«¤é
1.µÒ¤Ë°ì¤Ä¤Î¥«¡¼¥É¤ò¿´¤Ë»×¤Ã¤Æ¤â¤é¤¦¡£
2.¤½¤Î¥«¡¼¥É¤¬¤¢¤ëÎó¤Î¥«¡¼¥É¤Î¿§¤ò¾å¤«¤éÊó¹ð¤·¤Æ¤â¤é¤¦¤¬¡¢¤¢¤¨¤Æ¼«Ê¬¤Î¥«¡¼¥É¤Ç¤ÏÈ¿ÂФ理ÇÊó¹ð¤¹¤ë¡£
3.¤³¤ÎµÒ¤ÎÊó¹ð¤òʹ¤­½ª¤¨¤Æ¡¢Â¨ºÂ¤ËµÒ¤¬¿´¤Ë»×¤Ã¤¿¥«¡¼¥É¤òÅö¤Æ¤ë¡£



¡Ê¥·¥¹¥Æ¥à¡Ë
µÒ¤¬Êó¹ð¤¹¤ë£¶¸Ä¤Î¿§¤Î¤¦¤Á¡¢ºÇ½é¤Î£³¸Ä¤Ë£±¡¤£²¡¤£´¤Î½Å¤ß¤ò¤Ä¤±¡¢¹õ¤ÈÊó¹ð¤µ¤ì¤¿Éôʬ¤À¤±¤ò¤³¤Î¥­¡¼¿ô»ú¤ò³Ý¤±¤Æ²Ã¤¨¤¿Ãͤòa¤È¤¹¤ë¡£
Ʊ¤¸¤¯¸åȾ¤Î£³¸Ä¤Î¿§¤Ç¹õ¤ÈÊó¹ð¤¬¤¢¤Ã¤¿Éôʬ¤ËƱ¤¸¤¯£±¡¤£²¡¤£´¤Î½Å¤ß¤ò³Ý¤±¤Æ²Ã¤¨¤¿Ãͤò£â¤È¤¹¤ë¡£
¾å¤Îɽ¤ÎÃæ¤Î¡Ê¡ö¡¢¡ö¡Ë¤¬¤³¤Î·×»»¤Ç·è¤Þ¤ë(a,b)¤Ë¤Ê¤ë¡£


¡ãÁª¤ó¤À¥«¡¼¥É¤Î¥Þ¡¼¥¯¤ÎȽÄê¡ä
♦¡§ (3,5),(3,6),(5,6),(¡ö,7)

♥¡§ (5,3),(6,3),(6,5),(7,¡ö)

♣¡§ ¾å¤ÎÁȤ߹ç¤ï¤»°Ê³°¤Î¡¡(a,b)¤Ça¡ã£â¤Î»þ

♠:    ¡¡                    (a,b)¤Ça¡ä£â¤Î»þ

¡ãÁª¤ó¤À¥«¡¼¥É¤Î¿ô»ú¤Î»»½Ð¡ä
¤Û¤È¤ó¤É¤Ï(a,b)¤ÎÏÂa+b¤«¤é·è¤á¤ë¡£
¡Ê7,¡ö¡Ë¤È¡Ê¡ö,7¡Ë¤Ë´Ø¤·¤Æ¤Ï¡ö¤Ë¤¢¤ëÊý¤Î¿ô»ú¡£
(2,3),(3,2),(1,5),(5,1)¤Ïº¹|a-b|¤«¤é£±¡Ê¡áA¡Ë¤È£´
(0,5),(5,0)¢ª£±£°(£µ¤Î£²ÇܤdzФ¨¤ë¡Ë
(1,6),(6,1)¢ªJ(¾¯¤·Æüì¡Ë
(0,6),(6,0)¢ªQ(£¶¤Î£²ÇܤdzФ¨¤ë¡Ë
(0,3),(3,0)¢ªK(£³¤Ç£±£³¤È³Ð¤¨¤ë¡Ë
 

ÌÌÇò¤¤¤â¤Î¤¬¡¢¤¢¤Ã¤¿¡£

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ10·î27Æü(²Ð)08»þ06ʬ29ÉÃ
ÊÖ¿®¡¦°úÍÑ
  !¤³¤ì¤À¤±¤Ç¡¢Web ¾å¤Î ½½¿ÊBASIC ¥×¥í¥°¥é¥à¤¬Áö¤ë¡£

execute "sysya.exe" WITH("/G","/C-","http://homepage2.nifty.com/neutro/asm/bitop3.asm" )
execute "sysya.exe" WITH("/G","/C-","http://homepage2.nifty.com/neutro/asm/bitop3.dll" )
execute "sysya.exe" WITH("/G","/C-","http://homepage2.nifty.com/neutro/asm/bitop3.bas" )
!
execute "basic.exe" WITH("/NR","bitop3.bas") !¥Õ¥¡¥¤¥ë¤ò³«¤¤¤Æµ¯Æ°¡£"/OR" ¡Äµ¯Æ°¡¢¼Â¹Ô¡£

END
!sysya.exe ¤Î¥À¥¦¥ó¥í¡¼¥ÉÀè
!http://www.vector.co.jp/soft/win95/net/se394679.html
 

Re: ÌÌÇò¤¤¤â¤Î¤¬¡¢¤¢¤Ã¤¿¡£

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ10·î27Æü(²Ð)19»þ24ʬ30ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.681[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¤³¤Î»È¤¤Êý¤ò¾Ü¤·¤¯ÀâÌÀ¤·¤Æ失¤Þ¤»¤ó¤«¡©
°ì±þ¥À¥¦¥ó¥í¡¼¥É¤·¤Æ»È¤ª¤¦¤È¤·¤¿¤Î¤Ç¤¹¤¬¡¢¤É¤¦¤·¤Æ¤è¤¤¤Î¤«Ê¬¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£
½¾Íè¤Î½½¿ÊBASIC¤È¤Ê¤Ë¤¬¤É¤¦°ã¤¦¤Î¤Ç¤·¤ç¤¦¤«¡©
 

BMP¥Õ¥¡¥¤¥ë¤«¤éÀڽФ·É½¼¨

 Åê¹Æ¼Ô¡§Å¯  Åê¹ÆÆü¡§2009ǯ10·î28Æü(¿å)08»þ20ʬ1ÉÃ
ÊÖ¿®¡¦°úÍÑ
  »þ¡¹¡¢·Ç¼¨ÈĤò¸«¤Æ¤¤¤ë¤Î¤Ç¤¹¤¬ºÇ¶á¤ÎÆâÍƤι­¤µ¤È¿¼¤µ¤Ë¶Ã¤¤¤Æ¤¤¤Þ¤¹¡£
¤½¤³¤Ç¡¢¿¼¤¤Íý²ò¤ò»ý¤Ã¤Æ¤ª¤é¤ì¤ëÊý¡¹¤ÎÃηäò¤ª¼Ú¤ê¤·¤¿¤¤¤Î¤Ç¤¹¤¬

5000¡ß4500¤ÎBMP¥Õ¥¡¥¤¥ë¤¬¤¢¤ë¤Î¤Ç¤¹¤¬
¤³¤Î¥Õ¥¡¥¤¥ë¤«¤éX¤«¤éX+500,Y¤«¤éY+450¤ÎÉôʬ¤òÀڽФ·¤Æ¥°¥é¥Õ¥£¥Ã¥¯²èÌ̤Ëɽ¼¨¤·¤¿¤¤¤Î¤Ç¤¹¤¬¤Ç¡¢¤­¤Þ¤¹¤Ç¤·¤ç¤¦¤«¡©
¤³¤ì¤¬¤Ç¤­¤ë¤ÈɬÍפÊÉôʬ¤À¤±¤òÍøÍѤ·¤Æ½èÍý¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¤Î¤ÇÈó¾ï¤Ë½õ¤«¤ë¤Î¤Ç¤¹¤¬¡¢¤è¤í¤·¤¯¤ª´ê¤¤¤·¤Þ¤¹¡£
 

Re: ÌÌÇò¤¤¤â¤Î¤¬¡¢¤¢¤Ã¤¿¡£

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ10·î28Æü(¿å)17»þ11ʬ24ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.682[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø

¤³¤ì¤Ï¡¢¥×¥í¥°¥é¥à¼«¿È¤¬¡¢¥¤¥ó¥¿¡¼¥Í¥Ã¥È¾å¤Î½½¿ÊBASIC¥Ö¥í¥°¥é¥à¤ä¡¢¥Æ¥­¥¹¥È¡¢¤½¤Î¾
¤ò¡¢¼«Æ°¤ÇÆɤ߼è¤Ã¤Æ¼Â¹Ô¤¹¤ëÎã¤Ç¡¢±ó³ÖÀ©¸æ¤Ê¤É¤Î¡¢±þÍѤ¬´üÂԤǤ­¤ë¤â¤Î¤Ç¤¹¡£
¥µ¥¤¥È¤«¤é¡¢¼ê¤Ç¡¢¥³¥Ô¡¼Å½¤ê¤Ä¤±¼Â¹Ô¤Ç¤­¤ë¾õ¶·²¼¤Ç¤Ï¡¢¤¢¤Þ¤ê°ÕÌ£¤Î̵¤¤¥Ä¡¼¥ë¤Ç¤¹¡£

bitop3.bas ¤Ï¡¢²èÌ̤˽ФƤ­¤Þ¤·¤¿¤Ç¤·¤ç¤¦¤«¡©

¥À¥¦¥ó¥í¡¼¥É²òÅव¤ì¤¿ SYSYA.EXE ¤Ï¡¢¥Ñ¥¹Ì¾¤ò¾Êά¤·¤¿¤¿¤á¡¢
BASIC ¤òµ¯Æ°¤·¤¿¥Õ¥©¥ë¥À¡Ê¿¤¯¤Ï¡¢BASIC.EXE ¤ÎÍ­¤ë¾ì½ê¡Ë
¤ËƱµï¤·¤Æ¤¤¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¥ì¥¸¥¹¥È¥ê¡¼¤Ï¡¢±ø¤µ¤Ê¤¤¤è¤¦¤Ç¤¹¡£
 

Re: BMP¥Õ¥¡¥¤¥ë¤«¤éÀڽФ·É½¼¨

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ10·î28Æü(¿å)20»þ31ʬ50ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.683[¸µµ­»ö¤Ø]

ů¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

®Å٤θ¡¾Ú¤Ê¤É¡Ê²þÁ±¤Ï´üÂԤǤ­¤Ê¤¤¡Ë¤Î¥×¥í¥È¥¿¥¤¥×¤È¤·¤Æ·ÇºÜ¤·¤Þ¤¹¡£
!BMP¥Õ¥¡¥¤¥ë¡Ê°µ½Ì¤Ê¤·¡Ë²èÁü¤ÎÉôʬÎΰè¡ÊÀÚ¤ê½Ð¤·¡Ë¤òɽ¼¨¤¹¤ë
!»²¹Í http://www.kk.iij4u.or.jp/~kondo/bmp/

OPTION CHARACTER byte


LET CX1=0 !ÀÚ¤ê½Ð¤¹²èÁüÎΰè¤Îº¸¾åºÂɸ¡Ê¥Ô¥¯¥»¥ëñ°Ì¡Ë
LET CY1=0
LET CX2=640 !±¦²¼ºÂɸ
LET CY2=480

SET COLOR mode "NATIVE"
SET bitmap SIZE CX2-CX1,CY2-CY1 !¥¹¥¯¥ê¡¼¥óºÂɸ¤Ø
SET WINDOW 0,CX2-CX1-1,CY2-CY1-1,0 !²èÌ̤ò²èÁü¥µ¥¤¥º¤Ø
SET POINT STYLE 1 !¥É¥Ã¥È·Á¼°


LET BFile$=REPEAT$(CHR$(0),14) !Dim BFile As BITMAPFILEHEADER
LET BInfo$=REPEAT$(CHR$(0),40) !Dim BInfo As BITMAPINFOHEADER
LET BPalt$=REPEAT$(CHR$(0),4) !Dim BPalt As RGBQUAD


file getname f$,"BMP¥Õ¥¡¥¤¥ë|*.BMP" !¥Õ¥¡¥¤¥ë̾¤òÆÀ¤ë
IF f$="" THEN STOP


OPEN #1: NAME f$, ACCESS INPUT
LET cp=0 !Æɤ߹þ¤ß¸½ºß°ÌÃÖ

!---------- ¥Õ¥¡¥¤¥ë¥Ø¥Ã¥ÀÉô
LET p=0 !Æɤ߹þ¤ß°ÌÃÖ
CALL fseek(p) !Get #1,0,BFile¡¡¢¨VisualBasic
CALL fread(BFile$,p)

IF BFile$(1:2)="MB" THEN !BFile.bfType
   PRINT "£Â£Í£Ð¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£"
   STOP
END IF
LET bfOffBits=CVI(BFile$,10,4) !BFile.bfOffBits
PRINT "bfOffBits=";bfOffBits
PRINT


!---------- ¾ðÊó¥Ø¥Ã¥ÀÉô¡ÊWindows Bitmap¡Ë
CALL fread(BInfo$,p) !Get #1, ,BInfo

LET biWidth=CVI(BInfo$,4,4) !BInfo.biWidth
PRINT "biWidth=";biWidth
LET biHeight=CVI(BInfo$,8,4) !BInfo.biHeight
PRINT "biHeight=";biHeight
LET biBitCount=CVI(BInfo$,14,2) !BInfo.biBitCount
PRINT "biBitCount=";biBitCount
LET biCompression=CVI(BInfo$,16,4) !BInfo.biCompression
PRINT "biCompression=";biCompression
PRINT


!---------- ¾ðÊó¥Ø¥Ã¥ÀÉô¡Ê¥Ñ¥ì¥Ã¥ÈÉô¡Ë
DIM PAL(0 TO 255,4)
IF biBitCount<=8 THEN
   FOR k=0 TO 2^biBitCount-1
      CALL fread(BPalt$,p) !Get #1, ,BPalt

      !!PRINT USING "### ÈÖ¡¡": k;
      !!PRINT CVI2(BPalt$,0,1), !BPalt.rgbBlue¡¡¢¨Éä¹æ¤Ê¤·
      !!PRINT CVI2(BPalt$,1,1), !BPalt.rgbGreen
      !!PRINT CVI2(BPalt$,2,1), !BPalt.rgbRed
      !!PRINT CVI2(BPalt$,3,1) !BPalt.rgbReserved

      LET PAL(k,3)=CVI2(BPalt$,0,1)/255 !BPalt.rgbBlue¡¡¢¨Éä¹æ¤Ê¤·
      LET PAL(k,2)=CVI2(BPalt$,1,1)/255 !BPalt.rgbGreen
      LET PAL(k,1)=CVI2(BPalt$,2,1)/255 !BPalt.rgbRed
      LET PAL(k,4)=CVI2(BPalt$,3,1)/255 !BPalt.rgbReserved
   NEXT k
END IF
PRINT


IF biCompression<>0 THEN
   PRINT "°µ½Ì·Á¼°¤Ï̤¥µ¥Ý¡¼¥È¤Ç¤¹¡£"
   STOP
END IF


!---------- ²èÁü¥Ç¡¼¥¿Éô
!SET DRAW mode hidden !¤Á¤é¤Ä¤­Ëɻߤγ«»Ï

LET p=bfOffBits !¥Õ¥¡¥¤¥ëÆâ¤Î²èÁü¥Ç¡¼¥¿¤ÎÀèƬ°ÌÃÖ
CALL fseek(p)

LET L1=biWidth*biBitCount/8
LET L1b=(INT((L1-1)/4)+1)*4 !£´¥Ð¥¤¥È¶­³¦

FOR y=1 TO biHeight
   LET BData$=REPEAT$(CHR$(0),L1b) !£±¹Ôʬ¤Î²èÁü¥Ç¡¼¥¿
   CALL fread(BData$,p) !Get #1, ,BData

   IF y>=biHeight-CY2 AND y<=biHeight-CY1 THEN !ÀÚ¤ê½Ð¤·ÎΰèÆâ¤Ê¤é¡¡¢¨²¼¤«¤é³ÊǼ¤µ¤ì¤Æ¤¤¤ë

      SELECT CASE biBitCount
      CASE 1 !2¿§

         FOR x=MAX(INT((CX1-1)/8),0) TO L1b-1 !£±¹Ôʬ¤Î²èÁü¥Ç¡¼¥¿¡ÊÀÚ¤ê½Ð¤·ÎΰèÆ⺸ü¤«¤é¡Ë

         !!PRINT "(";8/biBitCount*x+1;",";y;")",
            LET b=CVI2(BData$,x,1)
            !!!PRINT right$("0000000"&BSTR$(b,2),8)

            LET t$=right$("0000000"&BSTR$(b,2),8)
            LET bb=1
            DO UNTIL bb>8
               LET xx=x*8+bb-1
               IF xx>CX2 THEN EXIT FOR !ÀÚ¤ê½Ð¤·ÎΰèÆⱦü¤Ê¤é
               IF xx>=CX1 THEN
                  IF xx<=biWidth THEN
                     LET t=VAL(t$(bb:bb))
                     SET POINT COLOR colorindex(PAL(t,1),PAL(t,2),PAL(t,3))
                     PLOT POINTS: xx - CX1, biHeight-y - CY1 !¢¨²¼¤«¤é³ÊǼ¤µ¤ì¤Æ¤¤¤ë
                  END IF
               END IF
               LET bb=bb+1
            LOOP

         NEXT x

      CASE 4 !16¿§

         FOR x=MAX(INT((CX1-1)/2),0) TO L1b-1 !£±¹Ôʬ¤Î²èÁü¥Ç¡¼¥¿¡ÊÀÚ¤ê½Ð¤·ÎΰèÆ⺸ü¤«¤é¡Ë

         !!PRINT "(";8/biBitCount*x+1;",";y;")",
            LET b=CVI2(BData$,x,1)
            !!PRINT INT(b/16); !¾å4bit
            !!PRINT MOD(b,16) !²¼4bit

            LET xx=8/biBitCount*x+1

            IF xx>CX2 THEN EXIT FOR !ÀÚ¤ê½Ð¤·ÎΰèÆⱦü¤Ê¤é
            IF xx>=CX1 THEN
               IF xx<=biWidth THEN
                  LET t=INT(b/16) !¾å4bit
                  SET POINT COLOR colorindex(PAL(t,1),PAL(t,2),PAL(t,3))
                  PLOT POINTS: xx - CX1, biHeight-y - CY1 !¢¨²¼¤«¤é³ÊǼ¤µ¤ì¤Æ¤¤¤ë
               END IF
            END IF
            IF xx+1>CX2 THEN EXIT FOR !ÀÚ¤ê½Ð¤·ÎΰèÆâ¤Ê¤é
            IF xx+1>=CX1 THEN
               IF xx<=biWidth THEN
                  LET t=MOD(b,16) !²¼4bit
                  SET POINT COLOR colorindex(PAL(t,1),PAL(t,2),PAL(t,3))
                  PLOT POINTS: xx+1 - CX1, biHeight-y - CY1 !¢¨²¼¤«¤é³ÊǼ¤µ¤ì¤Æ¤¤¤ë
               END IF
            END IF

         NEXT x

      CASE ELSE !256¿§¡¢24¥Ó¥Ã¥È¿§¡¢32¥Ó¥Ã¥È¿§

         FOR x=MAX(CX1,1) TO MIN(CX2,biWidth) !ÀÚ¤ê½Ð¤·ÎΰèÆâ

            LET t=(x-1)*biBitCount/8

            !!PRINT "(";x;",";y;")",
            !!FOR k=0 TO biBitCount/8-1
            !!   PRINT CVI2(BData$,t+k,1); !BData¡¡¢¨Éä¹æ¤Ê¤·
            !!NEXT k
            !!PRINT

            IF biBitCount=8 THEN !256¿§¤Ê¤é
               LET tt=CVI2(BData$,t+0,1)
               SET POINT COLOR colorindex(PAL(tt,1),PAL(tt,2),PAL(tt,3))
            ELSE
               LET bb=CVI2(BData$,t+0,1) !BData¡¡¢¨Éä¹æ¤Ê¤·
               LET gg=CVI2(BData$,t+1,1)
               LET rr=CVI2(BData$,t+2,1)
               SET POINT COLOR colorindex(rr/255,gg/255,bb/255)
            END IF
            PLOT POINTS: x - CX1, biHeight-y - CY1 !¢¨²¼¤«¤é³ÊǼ¤µ¤ì¤Æ¤¤¤ë

         NEXT x

      END SELECT

   END IF

NEXT y

!SET DRAW mode explicit !¤Á¤é¤Ä¤­ËɻߤνªÎ»


CLOSE #1


!¥Õ¥¡¥¤¥ë´ØÏ¢
SUB fseek(p) !Æɤ߹þ¤ß°ÌÃÖ¤òÀßÄꤹ¤ë
   IF p<cp THEN !Á°¤Ø
      SET #1: POINTER BEGIN
      LET cp=0
   END IF
   FOR i=1 TO p-cp !skip it
      CHARACTER INPUT #1: tmp$
   NEXT i
   LET cp=p !¸½ºß°ÌÃ֤ι¹¿·
END SUB
SUB fread(r$,p) !¥ì¥³¡¼¥É¤òÆɤ߹þ¤à
   FOR i=1 TO LEN(r$) !read it
      CHARACTER INPUT #1: r$(i:i)
   NEXT i
   LET p=p+LEN(r$) !¸½ºß°ÌÃ֤ι¹¿·
   LET cp=p
END SUB

END


EXTERNAL FUNCTION CVI(s$,p,m) !ʸ»úÎó¤ËËä¤á¹þ¤Þ¤ì¤¿m*8¥Ó¥Ã¥ÈÉä¹æÉÕ¤­À°¿ô¤ò¼è¤ê½Ð¤¹
OPTION CHARACTER byte
LET n=0
FOR i=1 TO m
   LET n=n+256^(i-1)*ORD(s$(p+i:p+i))
NEXT i
IF n<2^(m*8-1) THEN LET CVI=n ELSE LET CVI=n-2^(m*8)
END FUNCTION
EXTERNAL FUNCTION CVI2(s$,p,m) !ʸ»úÎó¤ËËä¤á¹þ¤Þ¤ì¤¿m*8¥Ó¥Ã¥ÈÉä¹æ¤Ê¤·À°¿ô¤ò¼è¤ê½Ð¤¹
OPTION CHARACTER byte
LET n=0
FOR i=1 TO m
   LET n=n+256^(i-1)*ORD(s$(p+i:p+i))
NEXT i
LET CVI2=n
END FUNCTION
 

Re: BMP¥Õ¥¡¥¤¥ë¤«¤éÀڽФ·É½¼¨

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ10·î29Æü(ÌÚ)03»þ05ʬ54ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.683[¸µµ­»ö¤Ø]

ů¤µ¤ó¤Ø

!½½¿ÊBASIC ¤Î¥°¥é¥Õµ¡Ç½¤À¤±¤Ç¤Î½èÍý¤Ç¤¹¤¬¡¢5000 x 4500 ¤Ï¡¢¤É¤ó¤Ê¤Ç¤·¤ç¤¦¡£

OPTION ARITHMETIC NATIVE
SET COLOR mode "NATIVE"
OPTION BASE 0
DIM D(1000,1000)
ASK directory currentD$
!
SET directory "C:\WINDOWS\ŽÃŽÞŽ½Ž¸ŽÄŽ¯ŽÌŽß" !ºÇ½é¤Ë³«¤¯directory¡Êºï½ü¡§¥Þ¥¤¥É¥­¥å¥á¥ó¥È¡Ë
FILE GETNAME file$, "BMP"
IF file$="" THEN
   PRINT "ÆþÎÏ¥Õ¥¡¥¤¥ë̵̾¤·¤Ç¡¢Ãæ»ß¡£"
   STOP
END IF
PRINT "ÆþÎÏ¥Õ¥¡¥¤¥ë¡§"& file$
!
!---¸¶²è¤ò¥í¡¼¥É¡¢¥°¥é¥ÕºÂɸ¤ò¡¢º¸¾å¤«¤é±¦²¼Êý¸þ¤Ø²èÁÇñ°Ì¤ËÀßÄê
gload file$
ASK PIXEL SIZE xw,yw
SET WINDOW 0,xw,yw,0
PRINT xw+1;"*";yw+1;"²èÁǤ趲è"
!
!---¸¶²è¤«¤é¡¢ÀڽФ·¤¿¤¤²èÁǤÎÈϰϤò½ñ¤¯
LET X0=10   !º¸
LET Y0=20   !¾å
LET X1=200  !±¦
LET Y1=200  !²¼
!
!---ÀÚ¤ê½Ð¤·
MAT D=ZER(X1-X0,Y1-Y0)
ASK PIXEL ARRAY (X0,Y0) D
!
!---ÀÚ¤ê½Ð¤·²èÁü¤Îɽ¼¨
SET bitmap SIZE X1-X0+1,Y1-Y0+1
MAT PLOT CELLS,IN 0,1;1,0 :D
PRINT "(";X0;",";Y0;")¤«¤é¡¢";"(";X1;",";Y1;")¤Þ¤Ç¤ÎÀÚ¤ê½Ð¤·²èÁü"
!
!---ÀÚ¤ê½Ð¤·²èÁü¤ÎÊݸ¤È¡¢ºÆɽ¼¨
SET directory currentD$
gsave "sample.bmp"
gload "sample.bmp"
SET bitmap SIZE 501,501

END
 

FILE GETNAME ¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ10·î29Æü(ÌÚ)03»þ39ʬ42ÉÃ
ÊÖ¿®¡¦°úÍÑ
  FILE GETNAME ¤Ç¡¢¡Ö¤¹¤Ù¤Æ¤Î¥Ô¥¯¥Á¥ã ¥Õ¥¡¥¤¥ë¡×¤òÀßÄꤹ¤ëÊýË¡¤Ï¡¢¤¢¤ê¤Þ¤¹¤«¡©  

Re: FILE GETNAME ¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ10·î29Æü(ÌÚ)07»þ16ʬ22ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.687[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> FILE GETNAME ¤Ç¡¢¡Ö¤¹¤Ù¤Æ¤Î¥Ô¥¯¥Á¥ã ¥Õ¥¡¥¤¥ë¡×¤òÀßÄꤹ¤ëÊýË¡¤Ï¡¢¤¢¤ê¤Þ¤¹¤«¡©

¤¹¤Ù¤Æ¤Î²èÁü¥Õ¥¡¥¤¥ë¤Ï»ØÄê¤Ç¤­¤Þ¤»¤ó¤Î¤Ç¡¢É¬Íפʤâ¤Î¤òÎóµó¤·¤Æ¤¯¤À¤µ¤¤¡£
µ­½Ò¤Ï¡¢Win32API¤Ë½àµò¤·¤Þ¤¹¡£
!¥Õ¥£¥ë¥¿Éôʬ¤Îµ­½Ò
file getname s$, "²èÁü¥Õ¥¡¥¤¥ë|*.BMP;*.GIF;*.JPG"

!file getname s$, "*.BMP;*.GIF" !¡Ö¥Õ¥¡¥¤¥ë¤Î¼ïÎà¡×¤Î̾¾Î¤¬¤Ê¤¤¤Î¤Ç¡¢£Î£Ç
!file getname s$, "BMP;GIF" !¸Ä¡¹¤Î¡Ö¥Õ¥¡¥¤¥ë̾¡×¡Ê³ÈÄ¥»ÒÉÕ¤­¥Õ¥¡¥¤¥ë»ØÄê¡Ë¤¬¤Ê¤¤¤Î¤Ç¡¢£Î£Ç

END
!¥Õ¥¡¥¤¥ë¤Î¼ïÎà¤òʬÎष¤¿¥Õ¥£¥ë¥¿Éôʬ¤Îµ­½Ò
file getname s$, "²èÁü¥Õ¥¡¥¤¥ë|*.BMP;*.GIF|¥Ô¥¯¥Á¥ã¥Õ¥¡¥¤¥ë|*.JPG"

END
 

Re: BMP¥Õ¥¡¥¤¥ë¤«¤éÀڽФ·É½¼¨

 Åê¹Æ¼Ô¡§Å¯  Åê¹ÆÆü¡§2009ǯ10·î29Æü(ÌÚ)08»þ23ʬ15ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.686[¸µµ­»ö¤Ø]

»³Ã椵¤ó¤Ø
¸«»ö¤ÊÄ´ºº¤È²òÀϤò¤·¤Æ¤¯¤À¤µ¤Ã¤Æ¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
»ÄÇ°¤Ê¤¬¤é½èÍý»þ´Ö¤¬³Ý¤«¤ê²á¤®¤ë¤è¤¦¤Ê¤Î¤Ç»È¤¦¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£

SECOND¤Ø
Àµ¤Ë¤³¤ì¤Ç¤¹¡ª¡ª¡ª
¸«»ö¤Ë»ØÄêÈϰϤ¬É½¼¨¤Ç¤­¤Þ¤·¤¿¡£
ÀڽФ·ÊýË¡¤¬¤ï¤«¤é¤ºÇº¤ó¤Ç¤¤¤¿¤Î¤Ç¤¹¤¬¤³¤ó¤Ê»È¤¤Êý¤¬¤¢¤Ã¤¿¤È¤ÏÃΤê¤Þ¤»¤ó¤Ç¤·¤¿¡£
¿§¡¹¡¢Ä´¤Ù¤Æ¤¤¤¿¤Î¤Ç¤¹¤¬API¤ÇBMP¤Î»ØÄêÈϰϤò¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤½¤¦¤À¤Ã¤¿¤Î¤Ç¤¹¤¬»ÈÍÑÎ㤬¸«¤Ä¤«¤é¤º°·¤¤¤­¤ì¤Þ¤»¤ó¤Ç¤·¤¿¡£

¤³¤ì¤Çû»þ´Ö¤Ç½èÍý¤¬²Äǽ¤È¤Ê¤Ã¤ÆÈó¾ï¤Ë½õ¤«¤ê¤Þ¤·¤¿¡£
ËÜÅö¤Ë¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
 

Re: ¥»¥ó¥¿¡¼»î¸³ÄøÅÙ¤Î¥×¥í¥°¥é¥à±é½¬

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ10·î29Æü(ÌÚ)10»þ19ʬ2ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.670[¸µµ­»ö¤Ø]

Ê佬¡¡Æó¹à·¸¿ô¡¢Æó¹àÄêÍý¡¢¥Ñ¥¹¥«¥ë¤Î»°³Ñ·Á
!¡ü¥Ñ¥¿¡¼¥ó£²¡¡º¸¼Ð¤á¤È±¦¼Ð¤á¤¬¡¢¹Ô¤ÈÎó¤ËÃÖ¤­´¹¤ï¤ë

!¢¨³Ê»Ò¾õ·ÐÏ©¤Î·ÐÏ©¤Î¿ô¤Ê¤É¤òµá¤á¤ë¾ì¹ç¤Ê¤É¡¢ÇÛÎóÁ´ÂΤòËä¤á¤Æ¤ª¤¯¤Î¤¬¤è¤¤¡£

LET M=20 !¹Ô
LET N=6 !Îó

DIM P(0 TO M,0 TO N) !£²¼¡¸µÇÛÎó

MAT P=ZER
FOR j=0 TO N !È¿»þ·×¤Þ¤ï¤ê¤Ë£´£µÅÙ²óž
   LET P(0,j)=1 !comb(n,n)=comb(n,0)=1
NEXT j
FOR i=1 TO M
   LET P(i,0)=1 !comb(n,n)=comb(n,0)=1
   FOR j=1 TO N !comb(n,r)=comb(n-1,r-1)+comb(n-1,r)
      LET P(i,j)=P(i,j-1)+P(i-1,j) !º¸¡Ü¾å¡¡¢¨É½·×»»Excel¤Ç¤Ï¡¢¥ª¡¼¥È¥Õ¥£¥ëµ¡Ç½
   NEXT j
NEXT i

MAT PRINT USING(REPEAT$("###### ",N+1)): P !¢¨·å¿ô¤¬Â¿¤¤¾ì¹ç¡¢#¤òÁý¤ä¤¹
PRINT


!Îã. Ϣ³¤¹¤ë¼«Á³¿ô¤ÎÀÑÏÂ
!¡¡1*2+2*3+3*4+ ¡Ä +n*(n+1)=¦²[k=1,n]{k*(k+1)}
!¡¡1*2*3+2*3*4+3*4*5+ ¡Ä +n*(n+1)*(n+2)=¦²[k=1,n]{k*(k+1)*(k+2)}
!¡¡¡¡¡¡¡§
!¡¡¡¡¡¡¡§
!
!¡¡comb(n,r)=n*(n-1)*(n-2)* ¡Ä *(n-r+1)/r!¤è¤ê¡¢r!*comb(n+r-1,r)=n*(n+1)*(n+2)* ¡Ä *(n+r-1)
!
!¥Ñ¥¹¥«¥ë¤Î»°³Ñ·Á¤Ç¤Ï¡¢
!¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¢­£Ò
!¡¡comb(n-1,0) comb(n,1) comb(n+1,2) comb(n+2,3) comb(n+4,4) ¡Ä
!¡¡1¡¡¡¡¡¡¡¡¡¡ 1¡¡¡¡¡¡¡¡ 1¡¡¡¡¡¡¡¡¡¡ 1¡¡¡¡¡¡¡¡¡¡ 1
!¡¡1¡¡¡¡¡¡¡¡¡¡ 2¡¡¡¡¡¡¡¡ 3¡¡¡¡¡¡¡¡¡¡ 4¡¡¡¡¡¡¡¡¡¡ 5
!¡¡1¡¡¡¡¡¡¡¡¡¡ 3¡¡¡¡¡¡¡¡ 6¡¡¡¡¡¡¡¡¡¡ 10¡¡¡¡¡¡¡¡¡¡15
!¡¡1¡¡¡¡¡¡¡¡¡¡ 4¡¡¡¡¡¡¡¡ 10¡¡N-1 ¢ª¡¡20¡¡¡¡¡¡¡¡¡¡35
!¡¡1¡¡¡¡¡¡¡¡¡¡ 5¡¡¡¡¡¡¡¡ 15¡¡¡¡¡¡¡¡¡¡35¡¡¡¡¡¡¡¡¡¡70
!¡¡1¡¡¡¡¡¡¡¡¡¡ 6¡¡¡¡¡¡¡¡ 21¡¡¡¡¡¡¡¡¡¡56¡¡¡¡¡¡¡¡¡¡126
!¡¡1¡¡¡¡¡¡¡¡¡¡ 7¡¡¡¡¡¡¡¡ 28¡¡¡¡¡¡¡¡¡¡84¡¡¡¡¡¡¡¡¡¡210
!
!¡¡±¦¼Ð¤á£òÃʤοôÎó comb(n+(r-1),r) ¤ÎϤϡ¢£ò¡Ü£±ÃÊ¡£

LET N=15
LET R=2 !£²¤Ä¤Î¾ì¹ç
PRINT fact(R)*P(N-1,R+1)


LET s=0 !¸¡»»
FOR k=1 TO N
   LET s=s+k*(k+1) !¦²[k=1,n]{k*(k+1)}
NEXT k
PRINT s


END

!¡ü7^2009¤Î²¼£´·å

OPTION ARITHMETIC RATIONAL !¿·åÀ°¿ô

!7*7=49=50-1¤è¤ê¡¢7^2000=(50-1)^1000
!¤³¤ì¤òÆó¹àÄêÍý¤ÇŸ³«¤¹¤ë¤È¡¢
!¡¡¹à comb(1000,r)*50^r*(-1)^(1000-r)¡¢r=0,1,2,3,¡Ä
!¤ÎϤȤʤ롣

!r=4°Ê¾å¡¢50^r¤¬10000¤Ç³ä¤êÀÚ¤ì¤ë¤«¤é¡¢²¼£´·å¤Ï¤¹¤Ù¤Æ£°¤È¤Ê¤ë¡£
LET s=0

!r=3,2,1,0¤Î¤È¤­
FOR r=3 TO 0 STEP -1
   LET s=s + comb(1000,r)*50^r*(-1)^(1000-r)
NEXT r

PRINT MOD(s*7^9,10^5) !»Ä¤ê7^9¤ò²ÃÌ£¤·¤Æ

END
 

Re: FILE GETNAME ¤Ë¤Ä¤¤¤Æ

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ10·î29Æü(ÌÚ)13»þ16ʬ28ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.688[¸µµ­»ö¤Ø]

»³Ã椵¤ó¤Ø

½õ¤«¤ê¤Þ¤·¤¿¡¢È¾¤Ð¤¢¤­¤é¤á¤Æ¤¤¤Þ¤·¤¿¤Î¤Ç¡¢´¶·ã¤Ç¤¹¡£¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
º£¸å¤â¤ª¤Í¤¬¤¤¤·¤Þ¤¹¡£
 

Ä©Àï¾õ£²

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ10·î30Æü(¶â)13»þ40ʬ17ÉÃ
ÊÖ¿®¡¦°úÍÑ
  £°¡Á£±£µ¤«¤é°ì¤Ä¤Î¿ô¤ò¿´¤Ë·è¤á¤Æ¤â¤é¤¦¡£
A¡ÁE¥«¡¼¥É¤ò¸«¤»¤Æ¡¢¤½¤Î¿ô¤¬¤¢¤ë¡¢¤Ê¤·¤òÅú¤¨¤Æ¤â¤é¤¦¡£
¤µ¤Æ¤½¤Î¥«¡¼¥É¤òÅö¤Æ¤ë»ÅÁȤߤȤϡ©


¡ãA¥«¡¼¥É¡ä
£±£±¡¡¡¡£±£°¡¡¡¡£±£²
£±£µ¡¡¡¡¡¡£´¡¡¡¡¡¡£°
£±£±¡¡¡¡¡¡£·¡¡¡¡£±£°

¡ãB¥«¡¼¥É¡ä
¡¡£³¡¡¡¡¡¡£¹¡¡¡¡¡¡£·
¡¡£¸¡¡¡¡¡¡£²¡¡¡¡£±£²
£±£³¡¡¡¡¡¡£¹¡¡¡¡£±£´

¡ãC¥«¡¼¥É¡ä
¡¡£·¡¡¡¡¡¡£¹¡¡¡¡¡¡£°
£±£²¡¡¡¡¡¡£±¡¡¡¡¡¡£³
£±£±¡¡¡¡¡¡£¸¡¡¡¡£±£´

¡ãD¥«¡¼¥É¡ä
£±£²¡¡¡¡£±£´¡¡¡¡¡¡£µ
£±£³¡¡¡¡¡¡£µ¡¡¡¡£±£µ
¡¡£¸¡¡¡¡¡¡£°¡¡¡¡£±£´

¡ãE¥«¡¼¥É¡ä
¡¡£¹¡¡¡¡£±£°¡¡¡¡£±£±
£±£°¡¡¡¡¡¡£¶¡¡¡¡£±£´
£±£³¡¡¡¡¡¡£°¡¡¡¡£±£µ
 

Re: Ä©Àï¾õ£²

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ10·î30Æü(¶â)15»þ01ʬ36ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.692[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

½Å¤ß(A,B,C,D,E)=(4,2,1,5,6)¡¢¡Ö¤¢¤ë¡×¤Î¾ì¹ç¤Ë²Ã»»¤¹¤ë¡£¤¿¤À¤·¡¢¹ç·×£±£¶¢ª£°¤È¤¹¤ë¡£
A,B,C,D,E
1,0,1,1,1, 0
0,0,1,0,0, 1¡¡¢«
0,1,0,0,0, 2¡¡¢«
0,1,1,0,0, 3
1,0,0,0,0, 4¡¡¢«
0,0,0,1,0, 5¡¡¢«
0,0,0,0,1, 6¡¡¢«
1,1,1,0,0, 7
0,1,1,1,0, 8
0,1,1,0,1, 9
1,0,0,0,1, 10
1,0,1,0,1, 11
1,1,1,1,0, 12
0,1,0,1,1, 13
0,1,1,1,1, 14
1,0,0,1,1, 15
 

Hamming Code

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ10·î30Æü(¶â)15»þ56ʬ37ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  !£Ç£Á£É¤µ¤ó¤Î¡¢Åê¹Æ¤Ë¤¢¤ê¤Þ¤·¤¿ ¥Ï¥ß¥ó¥°¡¦¥³¡¼¥É ¤Ë¤Ä¤¤¤Æ¤Î¼Â¸³¡£

! ¥³¡¼¥É¼«¿È¤¬¡¢£±bit ¤Þ¤Ç¤Î¸í¤ê¥Ó¥Ã¥È¤ò¡¢ÆÃÄꤹ¤ë»ÅÁȤߤò¡¢Æ°¤«¤·¤Æ¤ß¤Þ¤¹¡£
! http://www1.seaple.ne.jp/tomizawa/err-correct.doc  ¤Ë¾Ü¤·¤¤ÀâÌÀ¤¬¤¢¤ê¤Þ¤¹¡£

! ¥Ç¡¼¥¿¡¼¤¬½Ä¤Ë¿­¤Ó¤ë Îó¥Ù¥¯¥È¥ë¤Ï¡¢É½¼¨¤ÎÆñ¤¬¤¢¤ê¡¢¹ÔÎó¤Ï¡¢µÕ¤Ë¤·¤Æ¤¤¤Þ¤¹¡£
!¡¡¥×¥í¥°¥é¥à¤Ï¡¢¾éĹ¥Ó¥Ã¥È£´¤Ç¤ÎºÇÂçÁ´Ä¹£±£´¥Ó¥Ã¥È ¤Î¾ì¹ç¤ÎÎã¤Ç¤¹¡£

DIM M(1,14), h(14,4), bcc(1,4)

PRINT "--- ¥Ñ¥ê¥Æ¥£ ¹ÔÎó h"
MAT READ h
DATA 0,0,0,1  !  1  ! 0 ¤Ï ¥¨¥é¡¼Ìµ¤·¤ÎͽÌóÃÍ¡£
DATA 0,0,1,0  !  2
DATA 0,0,1,1  !  3
DATA 0,1,0,0  !  4
DATA 0,1,0,1  !  5
DATA 0,1,1,0  !  6
DATA 0,1,1,1  !  7
DATA 1,0,0,0  !  8
DATA 1,0,0,1  !  9
DATA 1,0,1,0  ! 10
DATA 1,0,1,1  ! 11
DATA 1,1,0,0  ! 12
DATA 1,1,0,1  ! 13
DATA 1,1,1,0  ! 14  !¥ª¡¼¥ë£±¤Î¡¢15 ¤â»ÈÍѤǤ­¤Ê¤¤¡£(¢¨Ãí)

MAT PRINT h;
PRINT "¾å¤Î¡¢14 x 4 ¤Î¹ÔÎó h ¤ò¡¢"
PRINT
PRINT "¥á¥Ã¥»¡¼¥¸¡¦¥Ç¡¼¥¿¡¼ 14bitĹ"
PRINT "     ¡Ê£±¹Ô 14 Îó ¤Î¥Ù¥¯¥È¥ë¡Ë¤Ë¾è¤º¤ë¤È¡¢"
PRINT "  ¥Á¥§¥Ã¥¯¡¦¥Ç¡¼¥¿¡¼  4bitĹ"
PRINT "      ¡Ê£±¹Ô 4 Îó ¤Î¥Ù¥¯¥È¥ë¡Ë¤¬½ÐÍè¤ë¡£"
PRINT

MAT READ M                        ! ¥á¥Ã¥»¡¼¥¸¡¦¥Ç¡¼¥¿¡¼ 14bitĹ
DATA 1,1,0,1,0,0,1,1,0,1, 0,0,0,0 ! º¸ 10bitĹ ¤¬¡¢Ç¤°Õ¤Ç¡¢Å¬Åö¤ËÊѤ¨¤Æ¤ß¤ë¤È¤è¤¤¡£

! ¥á¥Ã¥»¡¼¥¸¡¦¥Ç¡¼¥¿¡¼ 14bitĹ ¤ò¡¢¹Ô¥Ù¥¯¥È¥ë( m1,m2,m3,,,m14 ) ¤È¤·¤Æ¡¢
! ¹ÔÎó h ¤ò±¦¤ËÃÖ¤¤¤Æ¾è¤º¤ë¤È¡¢bcc1,bcc2,bcc3,bcc4¡¡¡Ä£´Í×ÁǤιԥ٥¯¥È¥ë¡¢
! ¥Á¥§¥Ã¥¯¡¦¥Ç¡¼¥¿¡¼ ¤¬¤Ç¤­¤ë¡£¤³¤Î»þ¤ÎÀÑϤη׻»¤Ï¡¢
! £±¥Ó¥Ã¥ÈÉý¤Î·å¾å¤ê̵¤·¡£ ÇÓ¾ŪÏÀÍýÏ xor ¤ä¡¢Modulo2 ¤ÎÏ =MOD( ¡Ä ,2)
! ¤Ç¹Ô¤¤¡¢£´Í×ÁǤϡ¢£´bit ¤È¤·¤Æµá¤á¤ë¡£¤³¤ì¤¬¾ï¤Ë¡¢0000 ¤È¤Ê¤ë¾ò·ï¤¬É¬ÍפǤ¹¡£
!
! ¤½¤Î¤¿¤á¤Ë¡¢¼¡¤Î¤è¤¦¤ÊÂå¿ô¼°¤ò²ò¤¯¡£²Ã»»¤Ï¡¢·å¾å¤ê̵¤·¤Î£±¥Ó¥Ã¥ÈÉý( modulo 2)
!¡Ö¹ÔÎó¾è»»¤Ç·×»»¤¹¤ë²áÄø¡¢±¦(º¸¡©)£¹£°ÅÙ²ó¤·¤¿¾õÂÖ¡×
!
!(1) 0= m1   +m3   +m5   +m7   +m9    +m11    +m13
!(2) 0=    m2+m3      +m6+m7      +m10+m11        +m14
!(3) 0=          m4+m5+m6+m7              +m12+m13+m14
!(4) 0=                      m8+m9+m10+m11+m12+m13+m14
!
!(3)+(4)     0=m4+m5+m6+m7+m8+m9+m10 +m11   ¡ÊƱ¤¸¤â¤Î¤ò²Ã»»¤¹¤ë¤È£°¤Ë¤Ê¤ë¡£¡Ë
!(1)+(2)+(3) 0=m1+m2+m4+m7+m9+m10    +m12
!(1)+(3)+(4) 0=m1+m3+m4+m6+m8+m10    +m13
!(2)+(3)+(4) 0=m2+m3+m4+m5+m8+m9     +m14
!
! 14 bit ¤Î±¦Ã¼ 4bit ¤ò¡¢²¼¤ÎÍͤ˽¾Â°¤µ¤»¤ë¤È¡¢º¸ 10bit ¤Ï¡¢¼«Í³¤Ë
! Áª¤ó¤Ç¤â¡¢¾å¤Î¡¢0000 ¤È¤Ê¤ë¾ò·ï¤ò¡¢Ëþ¤¿¤¹»ö¤¬¤Ç¤­¤ë¡£

LET M(1,11)=MOD( M(1,4)+M(1,5)+M(1,6)+M(1,7)+M(1,8)+M(1,9)+M(1,10) ,2)
LET M(1,12)=MOD( M(1,1)+M(1,2)+M(1,4)+M(1,7)+M(1,9)+M(1,10) ,2)
LET M(1,13)=MOD( M(1,1)+M(1,3)+M(1,4)+M(1,6)+M(1,8)+M(1,10) ,2)
LET M(1,14)=MOD( M(1,2)+M(1,3)+M(1,4)+M(1,5)+M(1,8)+M(1,9) ,2)

!-----¥¨¥é¡¼¡¦¥Ó¥Ã¥È¤ò¡¢½çÈÖ¤ËÃÖ¤¤¤Æ¤ß¤ë¡££°¡§¥¨¥é¡¼Ìµ¤·¤«¤é£±¡Á£±£´¤Þ¤Ç
FOR j=0 TO 14
   CALL error(j)
NEXT j

SUB error(j)
   PRINT "-------------------------------------"
   PRINT "¸¶·Á¤Î¥á¥Ã¥»¡¼¥¸¡¦¥Ç¡¼¥¿¡¼"
   MAT PRINT M;
   IF j<>0 THEN
      LET back=M(1,j)
      PRINT "º¸¤«¤é";j;"ÈÖÌܤΥӥåȤ¬¡¢È¿Å¾¤¹¤ë¤È"
      IF M(1,j)=1 THEN LET M(1,j)=0 ELSE LET M(1,j)=1
   ELSE
      PRINT "Á´¥Ó¥Ã¥Èȿž¤Ê¤±¤ì¤Ð¡¢"
   END IF
   MAT PRINT M;
   !---
   CALL check
   !---
   PRINT "¥Á¥§¥Ã¥¯¡¦¥Ç¡¼¥¿¡¼¤â";bcc(1,1)*8+bcc(1,2)*4+bcc(1,3)*2+bcc(1,4);"¤Ë¤Ê¤ë¡££²¿Ê¿ô"
   MAT PRINT bcc;
   IF j<>0 THEN LET M(1,j)=back !¸µ¤ØÌ᤹
END SUB

SUB check
   MAT bcc=M*h
   FOR i=1 TO 4
      LET bcc(1,i)=MOD( bcc(1,i), 2)
   NEXT i
END SUB

END

!(¢¨Ãí)
! ½ñʪ¤Î¡¢2^(m¡§¾éĹ¥Ó¥Ã¥È) >= (n¡§¥Ç¡¼¥¿¡¼¥Ó¥Ã¥È)+(m¡§¾éĹ¥Ó¥Ã¥È)+1 ¤Î¼°¤«¤é¤Ï¡¢
! m=4 ¤Î¾ì¹ç¡¢n=11 ¤Þ¤Ç¤È¤Ê¤ë¤¬¡¢Ê¸Ãæ¤Î¡Ö!¥ª¡¼¥ë£±¤Î¡¢15¡×¤ò»ÈÍѤ¹¤ë»ö¤ËÁêÅö¤·¡¢
! ¥á¥Ã¥»¡¼¥¸¡¦¥Ç¡¼¥¿¡¼¤ÎÃæ¤Ë m4+m5+m6+m7+m8+m9+m10+m11=0 ¤Î¾ò·ï¤¬È¯À¸¤¹¤ë¡£
!¡¡(m¡§¾éĹ¥Ó¥Ã¥È)¤ò±Û¤¨¤Æ¡¢À©Ìó¤¬Æþ¤ê¡¢11bit ¤¬¡¢¼«Í³¤ËÁª¤Ù¤Ê¤¤·ë²Ì¤È¤Ê¤Ã¤¿¡£
! ¼°¤ÎÅù¹æ¤Ï¡¢³°¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¤«¡©
 

¤É¤³¤Þ¤Ç¤âÀºÅÙ¤ò¹â¤á¤Æ

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ10·î30Æü(¶â)23»þ43ʬ8ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ·×»»µ¡¤Ë¤Æ
¡Ê¡Êlog(640320^3+744))/¦Ð¡Ë^2
¤Ï·×»»¤Ç¤­¤Þ¤¹¤«¡©
¤½¤·¤Æ¤Þ¤¿¡¢¤½¤ÎÃͤò¿®¤¸¤Þ¤¹¤«¡©

¤µ¤é¤Ëe¡°(¦Ð*¢å163)¤â·×»»¤Ç¤­¤Þ¤¹¤«¡©¡Êe¤Ï¼«Á³Âпô¤ÎÄì¡Ë
 

Re: ¤É¤³¤Þ¤Ç¤âÀºÅÙ¤ò¹â¤á¤Æ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ10·î31Æü(ÅÚ)07»þ36ʬ45ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.695[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

1000·å¥â¡¼¥É¤Ç¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£
DECLARE EXTERNAL FUNCTION LOG
DECLARE EXTERNAL FUNCTION EXP

PRINT ((LOG(640320^3+744))/PI)^2 !163 ?
PRINT EXP(PI*SQR(163)) !640320^3+744 ?

END

MERGE "log.lib"
MERGE "exp.lib"

!((LOG(640320^3+744))/PI)^2=163.000000000000000000000000000023216777¡Ä
!EXP(PI*SQR(163))=262537412640768743.999999999999250072¡Ä
 

´°Á´Ê¤ÌÌ»»

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ10·î31Æü(ÅÚ)17»þ48ʬ17ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¡¡¡¡¡¡  ☐☐☐
¡¡☓¡¡¡¡☐☐☐
¡¡¡¡-------------
¡¡¡¡¡¡¡¡☐☐☐
¡¡¡¡¡¡☐☐☐
¡¡¡Ü☐☐☐
¡¡---------------
    ☐☐☐☐☐

¤ÎʤÌÌ»»¤Ç☐¤Ë¤Ï£°¡Á£¹¤Î¿ô»ú¤¬³Æ¡¹£²²ó¤º¤ÄÆþ¤ê¤Þ¤¹¡£
¤³¤Î£³·å¤É¤¦¤·¤Î³Ý¤±»»¤Ï¤Ê¤Ë¤«Ãµ¤»¤Þ¤¹¤«¡©
 

Re: ´°Á´Ê¤ÌÌ»»

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ10·î31Æü(ÅÚ)19»þ32ʬ26ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.697[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£
No. 1
¡¡179
¡ß224
-----
¡¡716
 358
358
-----
40096

²òÀϤ˻Ȥä¿¥×¥í¥°¥é¥à¤ò·ÇºÜ¤·¤Þ¤¹¡£»²¹Í¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£
!Ãî¿©¤¤»»

!¡¡¡¡¢¢¢¢¢¢¡¡¢« i¡¡Èï¾è¿ô
!¡¡£ø¢¢¢¢¢¢¡¡¢« j¡¡¾è¿ô
!¡¡--------
!¡¡¡¡¢¢¢¢¢¢¡¡¢« a¡¡ÅÓÃæ·ë²Ì£±
!¡¡¢¢¢¢¢¢¡¡¡¡¢« b¡¡ÅÓÃæ·ë²Ì£²
!¢¢¢¢¢¢¡¡¡¡¡¡¢« c¡¡ÅÓÃæ·ë²Ì£³
!----------
!¢¢¢¢¢¢¢¢¢¢¡¡¢« d¡¡·ë²Ì


LET t0=TIME


DEF fnFIG(x,n)=MOD(INT(x/10^n),10) !n·åÌܤοô¤òÆÀ¤ë¡¡¢¨0:°ì¤Î°Ì¡¢1:½½¤Î°Ì¡¢2:É´¤Î°Ì¡¢¡Ä

LET ANSWER_COUNT=0 !²òÅú¿ô

DIM nm(0 TO 9),nm_sav(0 TO 9) !£°¡Á£¹¤Î¿ô»ú¤Î½ÅÊ£¤ò³Îǧ¤¹¤ë

FOR i=100 TO 999 !Èï¾è¿ô
   MAT nm=ZER

   FOR k=0 TO 2 !½ÅÊ£¥Á¥§¥Ã¥¯¡¡¢¨£²¤Ä¤º¤Ä
      LET t=fnFIG(i,k) !³Æ·å¤Î¿ô»ú¤òÆÀ¤ë
      IF nm(t)=2 THEN GOTO 200 !´û¤Ë£²¤Ä¤¢¤ë¡ª
      LET nm(t)=nm(t)+1
   NEXT k


   FOR j=100 TO 999 !¾è¿ô
      MAT nm_sav=nm !save it

      FOR k=0 TO 2 !½ÅÊ£¥Á¥§¥Ã¥¯
         LET t=fnFIG(j,k)
         IF nm(t)=2 THEN GOTO 100
         LET nm(t)=nm(t)+1
      NEXT k


      LET a=i*MOD(j,10) !¾è¿ô¤Î°ì¤Î°Ì¤È¤ÎÀÑ
      IF a<100 OR a>999 THEN GOTO 100 !ÅÓÃæ·ë²Ì£±¤Ï£³·å¤Î¿ô¡©
      FOR k=0 TO 2 !½ÅÊ£¥Á¥§¥Ã¥¯
         LET t=fnFIG(a,k)
         IF nm(t)=2 THEN GOTO 100
         LET nm(t)=nm(t)+1
      NEXT k


      LET b=i*MOD(INT(j/10),10) !¾è¿ô¤Î½½¤Î°Ì¤È¤ÎÀÑ
      IF b<100 OR b>999 THEN GOTO 100 !ÅÓÃæ·ë²Ì£²¤Ï£³·å¤Î¿ô¡©
      FOR k=0 TO 2 !½ÅÊ£¥Á¥§¥Ã¥¯
         LET t=fnFIG(b,k)
         IF nm(t)=2 THEN GOTO 100
         LET nm(t)=nm(t)+1
      NEXT k


      LET c=i*INT(j/100) !¾è¿ô¤ÎÉ´¤Î°Ì¤È¤ÎÀÑ
      IF c<100 OR c>999 THEN GOTO 100 !ÅÓÃæ·ë²Ì£³¤Ï£³·å¤Î¿ô¡©
      FOR k=0 TO 2 !½ÅÊ£¥Á¥§¥Ã¥¯
         LET t=fnFIG(c,k)
         IF nm(t)=2 THEN GOTO 100
         LET nm(t)=nm(t)+1
      NEXT k


      LET d=i*j !Èï¾è¿ô*¾è¿ô=¾è»»·ë²Ì
      IF d<10000 OR d>99999 THEN GOTO 100 !·ë²Ì¤Ï£µ·å¤Î¿ô¡©
      FOR k=0 TO 4 !½ÅÊ£¥Á¥§¥Ã¥¯
         LET t=fnFIG(d,k)
         IF nm(t)=2 THEN GOTO 100
         LET nm(t)=nm(t)+1
      NEXT k


      LET ANSWER_COUNT=ANSWER_COUNT+1 !²òÅú¿ô
      PRINT "No.";ANSWER_COUNT

      PRINT USING "¡¡###":i !·ë²Ì¤Îɽ¼¨
      PRINT USING "¡ß###":j
      PRINT "-----"
      PRINT USING "¡¡###":a
      PRINT USING " ### ":b
      PRINT USING "###  ":c
      PRINT "-----"
      PRINT USING "#####":d
      PRINT


100       !continue
          MAT nm=nm_sav !restore it
       NEXT j

200    !continue
    NEXT i


    PRINT "·×»»»þ´Ö=";TIME-t0

 END
 

¥°¥Ã¥É¥¹¥¿¥¤¥ó¤ÎÄêÍý¤Î¸¡¾Ú

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ10·î31Æü(ÅÚ)20»þ10ʬ12ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ʤÌÌ»»¤Ï¤¹¤°¤Ë¸«Çˤé¤ì¤Æ¤·¤Þ¤¤¤Þ¤·¤¿¡£
¤½¤³¤Ç¡¢¼¡¤ÎÄêÍý¤¬¤É¤³¤Þ¤Ç·×»»µ¡¤Ç³Îǧ²Äǽ¤«¤ª´ê¤¤¤·¤Þ¤¹¡£

Ǥ°Õ¤Î¼«Á³¿ô¤ò°ì¤ÄÁª¤Ö¡ÊÎ㡧£±£°£·£·¡Ë
¤³¤ì¤ò£²¿Ê¿ô¤Çɽ¤¹¡£¡Ê1077=2^10+2^5+2^4+2^2+1)
¤µ¤é¤Ë»Ø¿ô¤â£²¿Êɽ¼¨¤¹¤ë¡£(=2^(2^3+2)+2(2^2+1)+2^(2^2)+2^2+1)
»Ø¿ôÉôʬ¤Ë»Ä¤ë£³¤â¤µ¤é¤Ë£²¤ÎÎß¾è·Á¤Çɽ¤¹¡£(=2^(2^(2+1)+2)+2(2^2+1)+2^(2^2)+2^2+1)¡¦¡¦­¡

¤³¤¦¤·¤Æ½ñ¤­´¹¤¨¤¿·Á­¡¤ËÂФ·¤Æ¡¢¼¡¤Îµ¬Â§¤ò¸ò¸ß¤Ë·«¤êÊÖ¤¹¡£
(A)¡¡´ðÄì¤ò£±Â礭¤¯¤¹¤ë¡£
(B)¡¡(A)¤Ç½ÐÍ褿¿ô¤«¤é£±¤ò°ú¤¯¡£

Îã¤òÍѤ¤¤ë¤È
(A)¡§3^(3^(3+1)+3)+3^(3^3+1)+3^(3^3)+3^3+1
(B): 3^(3^(3+1)+3)+3^(3^3+1)+3^(3^3)+3^3
(A): 4^(4^(4+1)+4)+4^(4^4+1)+4^(4^4)+4^4
(B): 4^(4^(4+1)+4)+4^(4^4+1)+4^(4^4)+3*4^3+3*4^2+3*4+3
(A): 5^(5^(5+1)+5)+5^(5^5+1)+5^(5^5)+3*5^3+3*5^2+3*5+3
(B): 5^(5^(5+1)+5)+5^(5^5+1)+5^(5^5)+3*5^3+3*5^2+3*5+2
¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦
¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦
¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦
¤È·«¤êÊÖ¤·¤Æ¤¤¤¯¤È¿ô¤Ï̵¸Â¤ËÂ礭¤¯¤Ê¤ë°õ¾Ý¤ò¤¢¤¿¤¨¤ë¤¬¡¢¤¤¤Ä¤«¤ÏºÇÂçÃͤË㤷¡¢¤½¤Î¸å¤Ï¤É¤ó¤É¤ó¾®¤µ¤¯¤Ê¤Ã¤Æ¤¤¤­ºÇ¸å¤Ï¥¼¥í¤Ë¤Ê¤ë¤é¤·¤¤¡£
¡Ê¥°¥Ã¥É¥¹¥¿¥¤¥ó¤ÎÄêÍý¡Ë
¤³¤ì¤ò³Î¤«¤á¤Æ¤â¤é¤¤¤¿¤¤¡£
 

Re: ¥°¥Ã¥É¥¹¥¿¥¤¥ó¤ÎÄêÍý¤Î¸¡¾Ú

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ11·î 1Æü(Æü)10»þ10ʬ0ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.699[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£
!¥°¥Ã¥É¥¹¥¿¥¤¥ó¤ÎÄêÍý¡ÊR.L.Goodstein¡Ë

!¥¦¥£¥­¥Ú¥Ç¥£¥¢¤è¤ê
!http://www.cwi.nl/~tromp/pearls.html#goodstein ¤ÎRubyÈǤò°Ü¿¢

FUNCTION s(b,e,n)
   IF n=0 THEN LET s=0 ELSE LET s=MOD(n,b)*(b+1)^s(b,0,e)+s(b,e+1,INT(n/b))
END FUNCTION
FUNCTION g(b,n)
   IF n=0 THEN LET g=b ELSE LET g=g(b+1,s(b,0,n)-1)
END FUNCTION
DEF f(n)=g(2,n) !¼«Á³¿ô£î¤ËÂФ¹¤ë£°¤Ë¤Ê¤ë¤È¤­¤ÎÄì¤òÊÖ¤¹

PRINT f(0) !f(0)=2,f(1)=3,f(2)=5,f(3)=7
PRINT f(1)
PRINT f(2)
PRINT f(3)

PRINT f(4) !f(4)=3*2^402653211-1¡¡¢¨¥¹¥¿¥Ã¥¯¡¦¥ª¡¼¥Ð¡¼¥Õ¥í¡¼

END

¥¹¥¿¥Ã¥¯¡¦¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¬²óÈò¤Ç¤­¤ì¤Ð¤¤¤¤¤Î¤Ç¤¹¤¬¡¢¡¢¡¢¡ÊºÆµ¢½èÍý¤ò·«¤êÊÖ¤·½èÍý¤ËÃÖ¤­´¹¤¨¤ë¡Ë

¤Þ¤¿¡¢¿ôÃÍ·×»»¤À¤ÈµðÂç¤Ê¿ô¤ò°·¤¦¤³¤È¤Ë¤Ê¤ë¤Î¤Ç¡¢¿ô¼°·×»»¡ÊÂå¿ô·×»»¡Ë¤ò¹Ô¤¨¤Ð²Äǽ¤«¤È»×¤¤¤Þ¤¹¡£
 

¥Þ¥¸¥Ã¥¯¤Ø¤Î¸¶Íý¤òµá¤á¤Æ

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ11·î 1Æü(Æü)12»þ48ʬ46ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¼¡¡¹¤È½ÐÂꤷ¤Æ¿½¤·Ìõ¤¢¤ê¤Þ¤»¤ó¤¬¡¢¼¡¤Î¸½¾Ý¤Ë¤Ä¤¤¤Æ¤ÎÄ´ºº¤ò¤ª´ê¤¤¤·¤Þ¤¹¡£

£±¤«¤é£î¤Þ¤Ç¤Î¿ô»ú¤¬½ñ¤«¤ì¤¿£îËç¤Î¥«¡¼¥É¤¬¤¢¤ê¡¢¤³¤ì¤ò½½Ê¬¤Ë¥·¥ã¥Ã¥Õ¥ë¤¹¤ë¡£
¥È¥Ã¥×¤¢¤ë¥«¡¼¥É¤òÄ´¤Ù¤½¤Î¿ô»ú¤À¤±¥«¡¼¥É¤òÈ´¤­½Ð¤·¡¢½çÈÖ¤òµÕ¤Ë¤·¤Æ¸µ¤ËÌ᤹¡£
¤³¤ì¤ò·«¤êÊÖ¤·¤Æ¤¤¤¯¤È¡¢É¬¤º£±¤¬¥È¥Ã¥×¤Ë½Ð¸½¤¹¤ë¡£
¤³¤ì¤Þ¤Ç¤Ë¤«¤«¤ë¼ê¿ô¤¬ºÇĹ¤Ë¤Ê¤ë¤Î¤Ï²¿¼ê¤«¤«¤ë¤«¤òÄ´¤Ù¤¿¤¤¡£
¤Þ¤¿¡¢ºÇĹ¼ê¿ô¤¬¤«¤«¤ë½é´ü½çÎó¤¬ÃΤꤿ¤¤¡£
£îËç¤Î¾ì¹ç¤Ëʬ¤±¤Æ¡Ê¾¯¤Ê¤¯¤È¤â£±£³Ëç¤Þ¤Ç¤Ï¡Ë·ë²Ì¤¬ÃΤꤿ¤¤¤Î¤Ç¤è¤í¤·¤¯¤ª´ê¤¤¤·¤Þ¤¹¡£
 

Re: ¥Þ¥¸¥Ã¥¯¤Ø¤Î¸¶Íý¤òµá¤á¤Æ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ11·î 1Æü(Æü)14»þ46ʬ51ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.701[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

£±£³¤Î³¬¾è¤Ï¡¢¥Þ¥·¥ó¥Ñ¥ï¡¼¤¬¤¤¤ê¤Þ¤¹¤¬¡¢¡¢¡¢
LET t0=TIME


LET N=9 !Ëç¿ô

DIM P(N) !£±¡Á£Î¤Þ¤Ç¤Î¥«¡¼¥É

LET cmax=0
FOR i=N*fact(N-2) TO fact(N)-1 !½çÎó¤òÀ¸À®¤¹¤ë¡¡¢¨£°¡ÁN*(N-2)!-1ÈÖÌܤνçÎó¤Ï¡¢1*****¡¢21****
!FOR i=0 TO fact(N)-1 !½çÎó¤òÀ¸À®¤¹¤ë

   CALL Num2Perm(i, P,N)
   !!!MAT PRINT P; !debug

   LET c=0 !²ó¿ô
   DO UNTIL P(1)=1 !¥È¥Ã¥×¤Î¥«¡¼¥É¤¬¡Ö£±¡×¤Þ¤Ç
      CALL reverse(P,(P(1))) !¥È¥Ã¥×¤Î¥«¡¼¥É¤Î¿ô»ú¤À¤±¥«¡¼¥É¤òÈ´¤­½Ð¤·¡¢½çÈÖ¤òµÕ¤Ë¤·¤Æ¸µ¤ËÌ᤹
      LET c=c+1
   LOOP
   !!!PRINT "²ó¿ô=";c !debug
   IF c>cmax THEN !ºÇÂç¤Î¤â¤Î¤òµ­Ï¿¤¹¤ë
      LET cmax=c
      LET i_sav=i
   END IF

NEXT i

PRINT "ºÇÂç¤Î²ó¿ô=";cmax
CALL Num2Perm(i_sav, P,N) !½çÎó¤òºÆ¸½¤¹¤ë
MAT PRINT P;


PRINT "·×»»»þ´Ö=";TIME-t0

END


EXTERNAL SUB reverse(A(),N) !£±¡Á£Î¤Þ¤Ç¤ÎʤӤòµÕ½ç¤Ë¤¹¤ë
FOR i=1 TO INT(N/2) !¸ò´¹°ÌÃÖ¤ÏȾʬ¤Þ¤Ç¡¡¢¨Á´Éô¤¹¤ë¤È¸µ¤ËÌá¤ë
   swap A(i),A(N-i+1) !Ãæ±û¤«¤éÂоΤʰÌÃ֤ɤ¦¤·
NEXT i
END SUB

EXTERNAL SUB Num2Perm(h, A(),N) !Èֹ椫¤é½çÎó¥Ñ¥¿¡¼¥ó¤òÀ¸À®¤¹¤ë¡¡¢¨¼­½ñ¼°½ç½ø
LET v=h
FOR j=1 TO N
   LET fac=fact(N-j)
   LET t=INT(v/fac)
   LET A(j)=t+1 !£±¡Á£Î
   LET v=v-fac*t
NEXT j
FOR j=N-1 TO 1 STEP -1
   FOR k=j+1 TO N
      IF A(j)<=A(k) THEN LET A(k)=A(k)+1
   NEXT k
NEXT j
END SUB
 

Re: ¥Þ¥¸¥Ã¥¯¤Ø¤Î¸¶Íý¤òµá¤á¤Æ

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ11·î 2Æü(·î)06»þ07ʬ35ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.702[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

N=11¤Þ¤ÇÄ´ºº¤·¤Þ¤·¤¿¤¬¡¢N=12,13¤Ç¤Ï¶Ëü¤Ë»þ´Ö¤¬¤«¤«¤Ã¤Æ¤¤¤ë¤è¤¦¤Ç¤¹¡£
¡ÊÁ´¥Ñ¥¿¡¼¥ó¤òÄ´ºº¤·¤Æ¤¤¤ë¤«¤é¤Ê¤ó¤Ç¤·¤ç¤¦¤Í¡Ë
Ä´¤Ùʪ¤ò¤·¤Æ¤¤¤¿¤é¡¢ºÇĹ¼ê¿ô¤¬È½ÌÀ¤·¤Þ¤·¤¿¡£
¤½¤³¤Ç¤³¤Î¥Ç¡¼¥¿¤òÍøÍѤ·¤Æ¡¢¤½¤Î¼ê¿ô¤¬¤«¤«¤ë½é´ü½çÎó¤¬ÃΤꤿ¤¤¤Î¤Ç¥×¥í¥°¥é¥à¤ò½¤Àµ¤·¤Æ失¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡©
¿ʬ»þ´Ö¤ÎÀáÌ󤬲Äǽ¤Ë¤Ê¤ë¤È»×¤¦¤ó¤Ç¤¹¤¬¡£

¡¡¡¡¡¡¡¡¡¡¡ãºÇĹ¼ê¿ô¡ä
N¡á£±£²¡¦¡¦¡¦¡¦£¶£µ²ó
N¡á£±£³¡¦¡¦¡¦¡¦£¸£°²ó
N¡á£±£´¡¦¡¦¡¦£±£°£±²ó
N¡á£±£µ¡¦¡¦¡¦£±£±£³²ó
N¡á£±£¶¡¦¡¦¡¦£±£³£¹²ó
 

Re: ¥Þ¥¸¥Ã¥¯¤Ø¤Î¸¶Íý¤òµá¤á¤Æ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ11·î 2Æü(·î)08»þ07ʬ3ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.703[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

Àè¤Î¥×¥í¥°¥é¥à¤Ï¡¢¤¹¤Ù¤Æ¤Î¥Ñ¥¿¡¼¥ó¤Î¡Ö³«»Ï¡ÊÍðÎó¡Ë¢ª½ªÎ»¡ÊÀ°Îó¡Ë¡×¤òÄ´¤Ù¤Æ¤¤¤Þ¤¹¡£
¤³¤ì¤ò¡Ö½ªÎ»¢ª³«»Ï¡×¤ËÊѹ¹¤·¤Þ¤·¤¿¡£
¤¤¤ï¤æ¤ëÉýÍ¥Àèõº÷¤Ç¡¢¡Ö¤É¤³¤Þ¤Ç¼ê¿ô¤¬Áý¤ä¤»¤ë¤«¡ÊºÇ¿¼ê¿ô¡Ë¡×¤È¤¤¤¦¤³¤È¤Ç¤¹¡£

ËÜÌäÂê¤Ç¤Ï¡ÖµÕ¤ÎÁàºî¡×¤¬²Äǽ¤Ç¡¢´°Á´À°Îó 1,2,3,4,¡Ä ¤«¤é¸ò´¹¤ò»Ï¤á¤Þ¤¹¡£

¤³¤ì¤Ç¤â£±£³Ëç¤Ï¡¢¡¢¡¢

¤È¤³¤í¤Ç¡¢£±£²Ëç¤Ï£¶£µ²ó¤Ç¤¹¤«¡©

LET t0=TIME


LET N=13 !£±¡Á£Î¤Î¥«¡¼¥É

DIM P(N)
FOR i=1 TO N !´°Á´À°Îó 1,2,3,4,¡Ä
   LET P(i)=i
NEXT i

LET cmax=0 !ºÇ¿¼ê¿ô
DIM P_sav(N) !¤½¤ÎʤÓ
MAT P_sav=P
CALL try(P,N,0,cmax,P_sav)

PRINT "ºÇÂç¤Î²ó¿ô=";cmax
MAT PRINT P_sav;


PRINT "·×»»»þ´Ö=";TIME-t0

END


EXTERNAL SUB reverse(A(),N) !£±¡Á£ÎÈÖÌܤޤǤÎʤӤòµÕ½ç¤Ë¤¹¤ë
FOR i=1 TO INT(N/2) !¸ò´¹°ÌÃÖ¤ÏȾʬ¤Þ¤Ç¡¡¢¨Á´Éô¤¹¤ë¤È¸µ¤ËÌá¤ë
   swap A(i),A(N-i+1) !Ãæ±û¤«¤éÂоΤʰÌÃ֤ɤ¦¤·
NEXT i
END SUB

EXTERNAL SUB try(P(),N,c,cmax,P_sav())
DIM W(N)
MAT W=P
FOR i=2 TO N !¸ò´¹¤Ç¤­¤Ê¤¯¤Ê¤ë¤Þ¤Ç
   MAT P=W
   IF P(i)=i THEN !iÈÖÌܤΥ«¡¼¥É¤¬¿ô»úi¤Ê¤é¸ò´¹²Äǽ¡ª¡¡¢¨µÕ¤ÎÁàºî
      CALL reverse(P,i) !¥È¥Ã¥×¤Î¥«¡¼¥É¤Î¿ô»ú¤À¤±¥«¡¼¥É¤òÈ´¤­½Ð¤·¡¢½çÈÖ¤òµÕ¤Ë¤·¤Æ¸µ¤ËÌ᤹
      IF c+1>cmax THEN !ºÇÂç¤Î¤â¤Î¤òµ­Ï¿¤¹¤ë
         LET cmax=c+1
         MAT P_sav=P
      END IF
      CALL try(P,N,c+1,cmax,P_sav) !¼¡¤Ø
   END IF
NEXT i
END SUB



!WindowsMe¡¢Pentium­·700MHz¡¢192MB¤Ë¤Æ¡¢½½¿ÊBASIC¡¡£²¿Ê¥â¡¼¥É¤Ç¼Â¹Ô¡£
!
!ºÇÂç¤Î²ó¿ô= 80
! 2  9  4  5  11  12  10  1  8  13  3  6  7
!
!·×»»»þ´Ö= 1528.79¡¡¡¡¢«Ìó25.5ʬ
 

´Ö°ã¤¤¤Îȯ¸«

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ11·î 2Æü(·î)09»þ03ʬ13ÉÃ
ÊÖ¿®¡¦°úÍÑ
  http://www.research.att.com/~njas/sequences/index.html?q=0%2C1%2C2%2C4%2C7%2C10%2C16%2C22%2C30%2C38%2C51%2C&language=japanese&go=%E6%A4%9C%E7%B4%A2
¤Î¥µ¥¤¥È¤ÇÄ´¤Ù¤¿¤Î¤Ç¤¹¤¬¡¢N¡á£±£²¤Î»þ¤ÎÃͤ¬´Ö°ã¤Ã¤Æ¤¤¤Þ¤¹¤è¤Í¡£
¤³¤³¤Ï£¶£³²ó¤Ç¤¢¤ë¤Ù¤­¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¤Í¡£
¤³¤Î¥×¥í¥°¥é¥à¤Ï³ÊÃʤËÄ´ºº»þ´Ö¤¬Ã»½Ì¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
ÃΤꤿ¤¤¤³¤È¤¬²ò¤Ã¤Æ¤¦¤ì¤·¤¤¤Ç¤¹¡£
¤É¤¦¤â¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
 

Re: ´Ö°ã¤¤¤Îȯ¸«

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ11·î 2Æü(·î)12»þ52ʬ42ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.705[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

£±£²Ëç¤Ï£¶£µ¼ê¤¬Àµ¤·¤¤¤ß¤¿¤¤¡©¡ª

ºÇ¿¼ê¿ô¤Ë¤Ê¤ë¾ì¹ç¤Ï¡¢¤³¤ÎÁàºî¤Î·ë²Ì¤È¤·¤Æ¡¢¡Ö´°Á´À°Îó¡×¤Ë¤Ê¤ë¤Î¤¬Â¿¤¤¤Ç¤¹¡£
¤·¤«¤·¡¢¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤â¤¢¤ë¤è¤¦¤Ç¤¹¡£
£²²óÌÜ¤Î¥×¥í¥°¥é¥à¤Ï¡¢´°Á´À°Î󤫤é¤ÎŸ³«¤Ç¤¹¤«¤é¡¢È´¤±¤¬¤¢¤ë¤È»×¤¤¤Þ¤¹¡£

¤³¤Á¤é¤Ë£¶Ëç¤Î¾ì¹ç¤¬µ­ºÜ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
»²¹Í¥µ¥¤¥È¡¡http://www.research.att.com/~njas/sequences/A000376

¡Ê¾¯¤·²þ½¤¤·¤Æ¡Ë£²²óÌÜ¤Î¥×¥í¥°¥é¥à¤Ç¤Ï¡¢ºÇ¸å¤Î£±¤Ä¤ò¸«¤Ä¤±¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£

¤·¤¿¤¬¤Ã¤Æ¡¢£±£²¡¢£±£µ¡¢£±£¶Ëç¤Ê¤É¤â¤½¤¦¤Ê¤ë¤Î¤Ç¤Ï¡¢¡¢¡¢¡©¡¡¡¡Á´¥Ñ¥¿¡¼¥ó¸¡º÷Ã桪
 

!¢¡Â³¡Ö¥Ñ¥½¥³¥ó¤¬Áê¼ê¤Î¥ª¥»¥í¡¦¥²¡¼¥à¡×Ver7.0

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ11·î 3Æü(²Ð)02»þ12ʬ8ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  !¢¡Â³¡Ö¥Ñ¥½¥³¥ó¤¬Áê¼ê¤Î¥ª¥»¥í¡¦¥²¡¼¥à¡×Ver7.0

!¥³¥ó¥Ô¥å¡¼¥¿¡¼¤ÎÂǤļê¤ò¤æ¤Ã¤¯¤ê³Îǧ¤¹¤ë¡¢¤Ë²Ã¤¨¡¢
!ÂжɤÎÊݸ¡¢ÅÓÃæ¤ÎÊüÃÖ¡¢ºÆ¸½·Ñ³¡¢¤Ê¤É¤¬¡¢½ÐÍè¤ë¤è¤¦¤Ë¤·¤¿¡£
!µ¯Æ°¤¹¤ë¤È¡¢¤³¤ì¤Þ¤Ç¤Î·Ð²á¤ò ¥×¥ì¥¤¥Ð¥Ã¥¯¤·¡¢
!
!Á°²ó¤Î½ªÎ»ÅÀ¤Þ¤ÇÁö¤Ã¤Æ¤«¤é¡¢ÆþÎϾõÂ֤Ȥʤê¤Þ¤¹¡£Æ±»þ¤ËÄɵ­µ­Ï¿¤ò»Ï¤á¤Þ¤¹¡£
!¿·µ¬¤Ë»Ï¤á¤¿¤¤»þ¤Ï¡¢·Ð²á¥Õ¥¡¥¤¥ë(oth_70.log)¤ò¡¢ºï½ü¤·¤Æ¤«¤é¡¢µ¯Æ°¤¹¤ë¡£

!ʸ¤¬Ä¹¤¯·Ç¼¨ÈĤò°µÇ÷¤·¤Þ¤¹¤Î¤Ç¡¢¥À¥¦¥ó¥í¡¼¥É¤·¤Æ²¼¤µ¤¤¡£
!sysya.exe ¤ò¤ª»ý¤Á¤ÎÊý¤Ï¡¢¤³¤Î¤Þ¤Þ¡¢Áö¤é¤»¤ë¤È¡¢¼«Æ°¥À¥¦¥ó¥í¡¼¥É¡¢Êݸ¡¢¼Â¹Ô¤·¤Þ¤¹¡£

!sysya.exe ¤ò»È¤ï¤Ê¤¤Êý¤Ï¡¢¼ê¤Ç¡¢²¼¤Î URL¡¦¥Õ¥¡¥¤¥ë¤ò¡¢¥À¥¦¥ó¥í¡¼¥É¡£
!KOMA76.bas  oth35p.dll ¤Î£²¥Õ¥¡¥¤¥ë¡£¥½¡¼¥¹.asm ¤¬ÆþÍѤÊÊý¤Ï¡¢oth35p.asm ¤Þ¤Ç¡£
!oth35p.dll ¤Ï¡¢KOMA76.bas ¤ÈƱ¤¸¥Õ¥©¥ë¥À¡¼¤ËÃÖ¤­¤Þ¤¹¡£
!¥ì¥¸¥¹¥È¥ê¡¼¤Ï»ÈÍѤ»¤º¡¢±ø¤·¤Þ¤»¤ó¡£DownLoad »þ¤Î·Ù¹ð¤Ï¡¢¤´¿´Çۤʤ¯¡£

!¡¡Level 5 ¤Ç¡¢¾¡¤Æ¤¿¸æÊý¤Ï¡¢LOG ¥Õ¥¡¥¤¥ë¤ò·Ç¼¨¤·¤Æĺ¤¯¤È¡¢Â¾¤Î¿Í¤â¡¢
!¡¡ÂжɤΥץ쥤¥Ð¥Ã¥¯¤ò¡¢Âθ³¤Ç¤­¤Þ¤¹¡£
!¡¡»Ø¤·¼ê¤ò¡¢Ì᤹¡ÖÂԤä¿¡ª¡×¤Ï¡¢·Ð²á¥Õ¥¡¥¤¥ë¤ò¡¢Éôʬºï½ü¤·¡¢µ¯Æ°¤·¤Ê¤ª¤¹¤È¡¢
!¡¡¤¤¤¯¤é¤Ç¤â¡¢Ì᤻¤Þ¤¹¤¬¡¢È¿Â§¤Ç¤¹¡£

!¤³¤Î¥×¥í¥°¥é¥à¤Ï¡¢uBASIC ÍѤΡ¢¾®»³¥ª¥»¥í¤ò¡¢½½¿ÊBASIC ¤Ë°Ü¿¢¤·¡¢¼êÆþ¤ì¤·¤¿¤â¤Î¡£


execute "sysya.exe" WITH("/G","/C-","http://homepage2.nifty.com/neutro/asm/oth35p.asm" )
execute "sysya.exe" WITH("/G","/C-","http://homepage2.nifty.com/neutro/asm/oth35p.dll" )
execute "sysya.exe" WITH("/G","/C-","http://homepage2.nifty.com/neutro/asm/KOMA76.bas" )
!
execute "basic.exe" WITH("/OR","KOMA76.bas") !¥Õ¥¡¥¤¥ë¤ò³«¤¤¤Æµ¯Æ° ¼Â¹Ô¡£"/NR" µ¯Æ°¤Þ¤Ç¡£

END
!sysya.exe ¤Î¥À¥¦¥ó¥í¡¼¥ÉÀè
!http://www.vector.co.jp/soft/win95/net/se394679.html
 

Ãî¿©¤¤»»

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ11·î 3Æü(²Ð)14»þ33ʬ34ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ³ä¤ê»»¤Î¥µ¥ó¥×¥ë¡¦¥×¥í¥°¥é¥à¤Ç¤¹¡£

¥¢¥ë¥´¥ê¥º¥à
¡¦¡Ö½ü¿ô¡×¾ì¹ç¤Î¿ô¡ß¡Ö¾¦¡×¾ì¹ç¤Î¿ô¡¡¤Î¸¡»»¤ò¹Ô¤¤¤Þ¤¹¡£
¡¦½ü¿ô¡¢¾¦¡¢Èï½ü¿ô¤¬Â·¤Ã¤¿¤È¤³¤í¤Ç¡¢É®»»¤ÇÅÓÃæ·ë²Ì¤ò¸¡¾Ú¤·¤Æ¤¤¤­¤Þ¤¹¡£
!Ãî¿©¤¤»»

!¡¡a ½ü¿ô¡¡¡¡¡¡¡¡¢¢¢¢£¸¢¢¢¢¡¡¢« b¡¡¾¦
!¡¡¡¡¡¡¡¡¡¡------------------
!¡¡¡¡¢¢¢¢¡¡¡Ë¢¢¢¢¢¢¢¢¢¢¢¢¢¢¡¡¢« c¡¡Èï½ü¿ô
!¡¡¡¡¡¡¡¡¡¡¡¡¢¢¢¢¢¢¡¡¡¡¡¡¡¡¡¡¢« d
!¡¡¡¡¡¡¡¡¡¡¡¡----------
!¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¢¢¢¢¡¡¡¡¡¡¢« e
!¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¢¢¢¢¡¡¡¡¡¡¢« f
!¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡----------
!¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¢¢¢¢¢¢¡¡¢« g
!¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¢¢¢¢¢¢¡¡¢« h
!¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡--------
!¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£´¡¡¢« ;¤ê


LET t0=TIME


DEF fnFIG(x,n)=MOD(INT(x/10^n),10) !n·åÌܤοô¤òÆÀ¤ë¡¡¢¨0:°ì¤Î°Ì¡¢1:½½¤Î°Ì¡¢2:É´¤Î°Ì¡¢¡Ä

LET ANSWER_COUNT=0 !²òÅú¿ô

FOR a=10 TO 99 !½ü¿ô

   FOR b=10000 TO 99999 !¾¦

      IF fnFIG(b,2)<>8 THEN GOTO 100 !¾¦¤ÎÉ´¤Î°Ì¤Ï£¸¤«¡©

      LET c=b*a + 4 !¢¨Í¾¤ê¤ò²Ã»»¤¹¤ë
      IF c<1000000 OR c>9999999 THEN GOTO 100 !Èï½ü¿ôc¤Ï£··å¤Î¿ô¡©


      LET d=fnFIG(b,4)*a !ÅÓÃæ·ë²Ìd
      IF d<100 OR d>999 THEN GOTO 100 !£³·å¤Î¿ô¡©

      LET w=INT(c/10000) !¢¨É®»»¤ò»²¾È

      LET e=(w-d)*100+fnFIG(c,3)*10+fnFIG(c,2) !ÅÓÃæ·ë²Ìe
      IF e<10 OR e>99 THEN GOTO 100 !£²·å¤Î¿ô¡©

      LET f=fnFIG(b,2)*a !ÅÓÃæ·ë²Ìf
      IF f<10 OR f>99 THEN GOTO 100 !£²·å¤Î¿ô¡©

      LET g=(e-f)*100+fnFIG(c,1)*10+fnFIG(c,0) !ÅÓÃæ·ë²Ìg
      IF g<100 OR g>999 THEN GOTO 100 !£³·å¤Î¿ô¡©

      LET h=fnFIG(b,0)*a !ÅÓÃæ·ë²Ìh
      IF h<100 OR h>999 THEN GOTO 100 !£³·å¤Î¿ô¡©

      IF g-h<>4 THEN GOTO 100 !;¤ê¤Ï£´¤«¡©


      LET ANSWER_COUNT=ANSWER_COUNT+1 !²òÅú¿ô
      PRINT "No.";ANSWER_COUNT

      !·ë²Ì¤Îɽ¼¨
      PRINT USING "¡¡¡¡¡¡¡¡#####": b !¾¦
      PRINT       "¡¡¡¡-----------"
      PRINT USING " ## ) #######": a,c !½ü¿ô¡¢Èï½ü¿ô
      PRINT USING "¡¡¡¡¡¡###": d
      PRINT       "¡¡¡¡¡¡-----"
      PRINT USING "¡¡¡¡¡¡¡¡ ##": e
      PRINT USING "¡¡¡¡¡¡¡¡ ##": f
      PRINT       "¡¡¡¡¡¡¡¡----"
      PRINT USING "¡¡¡¡¡¡¡¡¡¡###": g
      PRINT USING "¡¡¡¡¡¡¡¡¡¡###": h
      PRINT       "¡¡¡¡¡¡¡¡------"
      PRINT       "¡¡¡¡¡¡¡¡¡¡¡¡4"
      PRINT

100       !continue
       NEXT b

200    !continue
    NEXT a


    PRINT "·×»»»þ´Ö=";TIME-t0

 END

»²¹Í¡¡¤«¤±»»¡¡
No.698 [¸µµ­»ö¤Ø]
 

Ê¿Êý¾®Ä®»»

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ11·î 5Æü(ÌÚ)08»þ43ʬ58ÉÃ
ÊÖ¿®¡¦°úÍÑ
  £±¡Á£¹¤Î¿ô¤Î½çÎó¤À¤«¤é¡¢£¹¡ªÄ̤ꡣ¤³¤ì¤Ï¥Ñ¥½¥³¥ó¤Ç¤â¡¢¤¢¤Þ¤ê̵Íý¤Î¤Ê¤¤·×»»²ó¿ô¤Ç¤¢¤ë¡£
¾ì¹ç¤Î¿ô¤ò¸º¤é¤·¤Æ¡¢¥Þ¥·¥ó¥Ñ¥ï¡¼¤ËÍê¤é¤Ê¤¤¡¢Éé²Ù¤Î¾¯¤Ê¤¤½èÍý¤ò¸¡Æ¤¤·¤Æ¤ß¤è¤¦¡£

¡üÊ¿Êý¾®Ä®
¡¡¢¢¢¢¢¢^2=¢¢¢¢¢¢¢¢¢¢¢¢¡¡¡¡¤¿¤À¤·¡¢¢¢¤Ï£±¡Á£¹¤¬£±¸Ä¤º¤Ä
LET t0=TIME


DEF fnFIG(x,n)=MOD(INT(x/10^n),10) !n·åÌܤοô¤òÆÀ¤ë¡¡¢¨0:°ì¤Î°Ì¡¢1:½½¤Î°Ì¡¢2:É´¤Î°Ì¡¢¡Ä

LET N=9 !£±¡Á£¹¤Î¿ô»ú
LET R=3 !º¸Êդηå¿ô

DIM P(R),NM(0 TO 9)
FOR i=0 TO perm(N,R)-1
   CALL Num2Perm(i, P,N,R) !º¸ÊÕ¤ò»»½Ð¤¹¤ë
   LET x=0
   FOR k=1 TO R !¥Û¡¼¥Ê¡¼Ë¡
      LET x=x*10+P(k)
   NEXT k

   LET y=x*x !±¦ÊÕ¤ò»»½Ð¤¹¤ë¡¡¢¨x^2=y¤è¤ê

   MAT NM=ZER !½ÅÊ£¤·¤Æ¤¤¤Ê¤¤¤«³Îǧ¤¹¤ë
   LET NM(0)=1 !£°
   FOR k=1 TO R !º¸ÊÕ¦
      LET NM(P(k))=1 !»ÈÍÑÃæ
   NEXT k
   FOR k=0 TO N-R-1 !±¦ÊÕ¦
      LET t=fnFIG(y,k)
      IF NM(t)=1 THEN EXIT FOR !½ÅÊ£¡ª
      LET NM(t)=1
   NEXT k
   IF k>N-R-1 THEN PRINT x;"^ 2 =";y !·ë²Ì¤òɽ¼¨¤¹¤ë

NEXT i


PRINT "·×»»»þ´Ö=";TIME-t0

END


EXTERNAL SUB Num2Perm(h, A(),N,R) !Èֹ椫¤é½çÎó¥Ñ¥¿¡¼¥ó¤òÀ¸À®¤¹¤ë¡¡¢¨¼­½ñ¼°½ç½ø
LET v=h
FOR j=1 TO R
   LET fac=PERM(N-j,R-j)
   LET t=INT(v/fac)
   LET A(j)=t+1 !£±¡Á£Î
   LET v=v-fac*t
NEXT j
FOR j=R-1 TO 1 STEP -1
   FOR k=j+1 TO R
      IF A(j)<=A(k) THEN LET A(k)=A(k)+1
   NEXT k
NEXT j
END SUB

¤½¤Î¾¤ÎÎã
¡¡Ê¬¿ô¾®Ä®
¡¡¡¡¢¢¢¢¢¢¢¢¡¿¢¢¢¢¢¢¢¢¢¢¡á£±¡¿¡û¡¡¡¡¤¿¤À¤·¡¢¢¢¤Ï£±¡Á£¹¤¬£±¸Ä¤º¤Ä¡¢¡û¤Ï£²¡Á£¹

¡¡¥Ò¥ó¥È¡¡£¹¡ª ¢ª £´¡ª¡£¡¡Ê¬Êì=¡û¡ßʬ»Ò¡£


¡üÊ¿Êý¾®Ä®
¡¡¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢=¡û¡û¡û¡û¡û^2¡¡¡¡¤¿¤À¤·¡¢¢¢¤Ï£±¡Á£¹¤¬£±¸Ä¤º¤Ä¡¢¡û¤Ï£°¡Á£¹
LET t0=TIME


DEF fnFIG(x,n)=MOD(INT(x/10^n),10) !n·åÌܤοô¤òÆÀ¤ë¡¡¢¨0:°ì¤Î°Ì¡¢1:½½¤Î°Ì¡¢2:É´¤Î°Ì¡¢¡Ä

LET N=9 !£±¡Á£¹¤Î¿ô»ú

DIM NM(0 TO 9)
FOR i=INT(SQR(123456789)) TO INT(SQR(987654321))
   LET x=i*i !±¦ÊÕ¤ò»»½Ð¤¹¤ë¡¡¢¨x=i^2¤è¤ê

   MAT NM=ZER !½ÅÊ£¤·¤Æ¤¤¤Ê¤¤¤«³Îǧ¤¹¤ë
   LET NM(0)=1
   FOR k=1 TO N !º¸ÊÕ¦
      LET t=fnFIG(x,k-1)
      IF NM(t)=1 THEN EXIT FOR !½ÅÊ£¡ª
      LET NM(t)=1
   NEXT k
   IF k>N THEN PRINT x;"=";i;"^ 2" !·ë²Ì¤òɽ¼¨¤¹¤ë

NEXT i


PRINT "·×»»»þ´Ö=";TIME-t0

END
 

¾®Ä®Ê¬¿ô¤Îõº÷

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ11·î 5Æü(ÌÚ)19»þ45ʬ16ÉÃ
ÊÖ¿®¡¦°úÍÑ
  1
    bunnsi   7932
------------------  =  1/2
    bunnbo  15864

2
    bunnsi   7692
------------------  =  1/2
    bunnbo  15384

3
    bunnsi   6792
------------------  =  1/2
    bunnbo  13584

4
    bunnsi   7923
------------------  =  1/2
    bunnbo  15846

5
    bunnsi   9273
------------------  =  1/2
    bunnbo  18546

6
    bunnsi   7293
------------------  =  1/2
    bunnbo  14586

7
    bunnsi   9327
------------------  =  1/2
    bunnbo  18654

8
    bunnsi   6927
------------------  =  1/2
    bunnbo  13854

9
    bunnsi   9267
------------------  =  1/2
    bunnbo  18534

10
    bunnsi   7329
------------------  =  1/2
    bunnbo  14658

11
    bunnsi   6729
------------------  =  1/2
    bunnbo  13458

12
    bunnsi   7269
------------------  =  1/2
    bunnbo  14538



1
    bunnsi   5832
------------------  =  1/3
    bunnbo  17496

2
    bunnsi   5823
------------------  =  1/3
    bunnbo  17469



1
    bunnsi   3942
------------------  =  1/4
    bunnbo  15768

2
    bunnsi   4392
------------------  =  1/4
    bunnbo  17568

3
    bunnsi   7956
------------------  =  1/4
    bunnbo  31824

4
    bunnsi   5796
------------------  =  1/4
    bunnbo  23184



1
    bunnsi   9723
------------------  =  1/5
    bunnbo  48615

2
    bunnsi   2973
------------------  =  1/5
    bunnbo  14865

3
    bunnsi   9627
------------------  =  1/5
    bunnbo  48135

4
    bunnsi   9237
------------------  =  1/5
    bunnbo  46185

5
    bunnsi   2937
------------------  =  1/5
    bunnbo  14685

6
    bunnsi   2967
------------------  =  1/5
    bunnbo  14835

7
    bunnsi   2697
------------------  =  1/5
    bunnbo  13485

8
    bunnsi   6297
------------------  =  1/5
    bunnbo  31485

9
    bunnsi   3297
------------------  =  1/5
    bunnbo  16485

10
    bunnsi   7629
------------------  =  1/5
    bunnbo  38145

11
    bunnsi   3729
------------------  =  1/5
    bunnbo  18645

12
    bunnsi   2769
------------------  =  1/5
    bunnbo  13845
 

¾®Ä®Ê¬¿ô¤Îõº÷¤Î³¤­

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ11·î 5Æü(ÌÚ)19»þ49ʬ2ÉÃ
ÊÖ¿®¡¦°úÍÑ
  1
    bunnsi   2943
------------------  =  1/6
    bunnbo  17658

2
    bunnsi   4653
------------------  =  1/6
    bunnbo  27918

3
    bunnsi   5697
------------------  =  1/6
    bunnbo  34182



1
    bunnsi   7614
------------------  =  1/7
    bunnbo  53298

2
    bunnsi   5274
------------------  =  1/7
    bunnbo  36918

3
    bunnsi   2394
------------------  =  1/7
    bunnbo  16758

4
    bunnsi   5976
------------------  =  1/7
    bunnbo  41832

5
    bunnsi   4527
------------------  =  1/7
    bunnbo  31689

6
    bunnsi   2637
------------------  =  1/7
    bunnbo  18459

7
    bunnsi   5418
------------------  =  1/7
    bunnbo  37926




1
    bunnsi   9321
------------------  =  1/8
    bunnbo  74568

2
    bunnsi   7421
------------------  =  1/8
    bunnbo  59368

3
    bunnsi   9421
------------------  =  1/8
    bunnbo  75368

4
    bunnsi   5921
------------------  =  1/8
    bunnbo  47368

5
    bunnsi   9531
------------------  =  1/8
    bunnbo  76248

6
    bunnsi   9541
------------------  =  1/8
    bunnbo  76328

7
    bunnsi   6741
------------------  =  1/8
    bunnbo  53928

8
    bunnsi   7941
------------------  =  1/8
    bunnbo  63528

9
    bunnsi   5371
------------------  =  1/8
    bunnbo  42968

10
    bunnsi   4591
------------------  =  1/8
    bunnbo  36728

11
    bunnsi   4691
------------------  =  1/8
    bunnbo  37528

12
    bunnsi   5791
------------------  =  1/8
    bunnbo  46328

13
    bunnsi   6791
------------------  =  1/8
    bunnbo  54328

14
    bunnsi   7312
------------------  =  1/8
    bunnbo  58496

15
    bunnsi   8932
------------------  =  1/8
    bunnbo  71456

16
    bunnsi   8942
------------------  =  1/8
    bunnbo  71536

17
    bunnsi   9352
------------------  =  1/8
    bunnbo  74816

18
    bunnsi   9182
------------------  =  1/8
    bunnbo  73456

19
    bunnsi   5892
------------------  =  1/8
    bunnbo  47136

20
    bunnsi   7123
------------------  =  1/8
    bunnbo  56984
 

¾®Ä®Ê¬¿ô¤Îõº÷¤Î³¤­¡Ê£²¡Ë

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ11·î 5Æü(ÌÚ)19»þ50ʬ56ÉÃ
ÊÖ¿®¡¦°úÍÑ
  21
    bunnsi   9523
------------------  =  1/8
    bunnbo  76184

22
    bunnsi   8953
------------------  =  1/8
    bunnbo  71624

23
    bunnsi   8954
------------------  =  1/8
    bunnbo  71632

24
    bunnsi   7364
------------------  =  1/8
    bunnbo  58912

25
    bunnsi   8174
------------------  =  1/8
    bunnbo  65392

26
    bunnsi   8394
------------------  =  1/8
    bunnbo  67152

27
    bunnsi   7894
------------------  =  1/8
    bunnbo  63152

28
    bunnsi   9156
------------------  =  1/8
    bunnbo  73248

29
    bunnsi   9316
------------------  =  1/8
    bunnbo  74528

30
    bunnsi   7416
------------------  =  1/8
    bunnbo  59328

31
    bunnsi   9416
------------------  =  1/8
    bunnbo  75328

32
    bunnsi   5916
------------------  =  1/8
    bunnbo  47328

33
    bunnsi   5237
------------------  =  1/8
    bunnbo  41896

34
    bunnsi   3187
------------------  =  1/8
    bunnbo  25496

35
    bunnsi   9158
------------------  =  1/8
    bunnbo  73264

36
    bunnsi   8439
------------------  =  1/8
    bunnbo  67512

37
    bunnsi   5839
------------------  =  1/8
    bunnbo  46712

38
    bunnsi   6839
------------------  =  1/8
    bunnbo  54712

39
    bunnsi   4769
------------------  =  1/8
    bunnbo  38152

40
    bunnsi   6479
------------------  =  1/8
    bunnbo  51832

41
    bunnsi   8179
------------------  =  1/8
    bunnbo  65432

42
    bunnsi   4589
------------------  =  1/8
    bunnbo  36712

43
    bunnsi   4689
------------------  =  1/8
    bunnbo  37512

44
    bunnsi   5789
------------------  =  1/8
    bunnbo  46312

45
    bunnsi   6789
------------------  =  1/8
    bunnbo  54312

46
    bunnsi   8419
------------------  =  1/8
    bunnbo  67352




1
    bunnsi   8361
------------------  =  1/9
    bunnbo  75249

2
    bunnsi   6471
------------------  =  1/9
    bunnbo  58239

3
    bunnsi   6381
------------------  =  1/9
    bunnbo  57429


¤òȯ¸«¤·¤Þ¤·¤¿¡£
 

¥¢¥é¥Ó¥¢¿ô»ú¤ò´Á¿ô»ú¤ËÊÑ´¹¤¹¤ë

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ11·î 7Æü(ÅÚ)20»þ08ʬ30ÉÃ
ÊÖ¿®¡¦°úÍÑ
 
!¥¢¥é¥Ó¥¢¿ô»ú¡Ê1,2,3,¡Ä¡Ë¤ò´Á¿ô»ú¡Ê°ì,Æó,»°,¡Ä¡Ë¤ËÊÑ´¹¤¹¤ë¡ÊExcel½àµò¡Ë

LET n1$="¡»°ìÆ󻰻͸ÞÏ»¼·È¬¶å" !´Á¿ô»ú
LET f1$="ÀéÉ´½½¡¡" !°Ì
LET f2$="Ô¶µþÃû²¯Ëü¡¡" !£´·å¤º¤Ä¤Î°Ì

LET n2$="¡»°íÆõ»²»Í¸àÏ»¼·È¬¶å" !Âç»ú
LET f3$="ïôÉ´½¦¡¡" !°Ì
LET f4$="Ô¶µþÃû²¯èß¡¡" !£´·å¤º¤Ä¤Î°Ì

LET n3$="£°£±£²£³£´£µ£¶£·£¸£¹" !¿ô»ú

FUNCTION NumberString$(x,p) !¥¢¥é¥Ó¥¢¿ô»ú¡Ê1,2,3,¡Ä¡Ë¤ò´Á¿ô»ú¡Ê°ì,Æó,»°,¡Ä¡Ë¤ËÊÑ´¹¤¹¤ë
   IF x<0 OR x<>INT(x) THEN
      PRINT "ÈóÉé¤ÎÀ°¿ô¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£"; x
      STOP
   ELSE
      LET w$=""

      SELECT CASE p
      CASE 1 !´Á¿ô»ú¤Çɽµ­¤¹¤ë
         LET a=x
         IF a=0 THEN
            LET w$="¡»"
         ELSE
            LET i=LEN(f2$)
            DO UNTIL a=0 !¾å°Ì¤Î¿ô»ú¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç
               LET aa=MOD(a,10000) !¡Ö¡ÄÃû²¯Ëü¡¡¡×¤Î£´·å¤º¤Ä
               IF aa<>0 THEN
                  LET ww$=f2$(i:i)
                  IF ww$<>"¡¡" THEN LET w$=ww$&w$

                  LET k=LEN(f1$)
                  DO UNTIL aa=0 !³Æ¡ÖÀéÉ´½½¡¡¡×¤Î°Ì
                     LET ww$=f1$(k:k)
                     IF ww$="¡¡" THEN LET ww$=""

                     LET t=MOD(aa,10) !°ì¤Î°Ì¤«¤é
                     IF t=0 THEN !¥¼¥í¡¦¥µ¥×¥ì¥¹
                     ELSEIF k<LEN(f1$) AND t=1 THEN !£±¡¦¥µ¥×¥ì¥¹
                        LET w$=ww$&w$
                     ELSE
                        LET w$=n1$(t+1:t+1)&ww$&w$
                     END IF

                     LET aa=INT(aa/10) !¼¡¤Ø
                     LET k=k-1
                  LOOP
               END IF

               LET a=INT(a/10000) !¼¡¤Ø
               LET i=i-1
            LOOP
         END IF

      CASE 2 !Âç»ú¤Î´Á¿ô»ú¤Çɽµ­¤¹¤ë
         LET a=x
         IF a=0 THEN
            LET w$="¡»"
         ELSE
            LET i=LEN(f4$)
            DO UNTIL a=0 !¾å°Ì¤Î¿ô»ú¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç
               LET aa=MOD(a,10000) !¡Ö¡ÄÃû²¯Ëü¡¡¡×¤Î£´·å¤º¤Ä
               IF aa<>0 THEN
                  LET ww$=f4$(i:i)
                  IF ww$<>"¡¡" THEN LET w$=ww$&w$

                  LET k=LEN(f3$)
                  DO UNTIL aa=0 !³Æ¡ÖÀéÉ´½½¡¡¡×¤Î°Ì
                     LET ww$=f3$(k:k)
                     IF ww$="¡¡" THEN LET ww$=""

                     LET t=MOD(aa,10) !°ì¤Î°Ì¤«¤é
                     IF t=0 THEN !¥¼¥í¡¦¥µ¥×¥ì¥¹
                     !!!ELSEIF k<LEN(f3$) AND t=1 THEN !£±¡¦¥µ¥×¥ì¥¹
                     !!!   LET w$=ww$&w$
                     ELSE
                        LET w$=n2$(t+1:t+1)&ww$&w$
                     END IF

                     LET aa=INT(aa/10) !¼¡¤Ø
                     LET k=k-1
                  LOOP
               END IF

               LET a=INT(a/10000) !¼¡¤Ø
               LET i=i-1
            LOOP
         END IF

      CASE 3 !¿ôÃͤò¤½¤Î¤Þ¤Þ´Á¿ô»ú¤Çɽµ­¤¹¤ë
         LET a=x
         IF a=0 THEN
            LET w$="£°"
         ELSE
            DO UNTIL a=0 !¾å°Ì¤Î·å¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç
               LET t=MOD(a,10)+1 !°ì¤Î°Ì¤«¤é
               LET w$=n1$(t:t)&w$
               LET a=INT(a/10) !¼¡¤Ø
            LOOP
         END IF

      CASE 4 !½½,É´,Àé,Ëü¤Ê¤É¤ò´Á¿ô»ú¤Çɽµ­¤¹¤ë
         LET a=x
         IF a=0 THEN
            LET w$="¡»"
         ELSE
            LET i=LEN(f2$)
            DO UNTIL a=0 !¾å°Ì¤Î¿ô»ú¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç
               LET aa=MOD(a,10000) !¡Ö¡ÄÃû²¯Ëü¡¡¡×¤Î£´·å¤º¤Ä
               IF aa<>0 THEN
                  LET ww$=f2$(i:i)
                  IF ww$<>"¡¡" THEN LET w$=ww$&w$

                  LET k=LEN(f1$)
                  DO UNTIL aa=0 !³Æ¡ÖÀéÉ´½½¡¡¡×¤Î°Ì
                     LET ww$=f1$(k:k)
                     IF ww$="¡¡" THEN LET ww$=""

                     LET t=MOD(aa,10) !°ì¤Î°Ì¤«¤é
                     IF t=0 THEN !¥¼¥í¡¦¥µ¥×¥ì¥¹
                     ELSEIF k<LEN(f1$) AND t=1 THEN !£±¡¦¥µ¥×¥ì¥¹
                        LET w$=ww$&w$
                     ELSE
                        LET w$=n3$(t+1:t+1)&ww$&w$
                     END IF

                     LET aa=INT(aa/10) !¼¡¤Ø
                     LET k=k-1
                  LOOP
               END IF

               LET a=INT(a/10000) !¼¡¤Ø
               LET i=i-1
            LOOP
         END IF

      CASE ELSE
      END SELECT

      LET NumberString$=w$ !·ë²Ì¤òÊÖ¤¹
   END IF
END FUNCTION


!!!PRINT NumberString$(1732050807568877,2) !¢¨1000·å¥â¡¼¥É¡¢Í­Íý¿ô¥â¡¼¥É

PRINT NumberString$(1234567890,1) !½½Æ󲯻°Àé»ÍÉ´¸Þ½½Ï»Ëü¼·ÀéȬɴ¶å½½
PRINT NumberString$(1234567890,2) !°í½¦Æõ²¯»²ïô»ÍÉ´¸à½¦Ï»èß¼·ïôȬɴ¶å½¦
PRINT NumberString$(1234567890,3) !°ìÆ󻰻͸ÞÏ»¼·È¬¶å¡»
PRINT NumberString$(1234567890,4) !½½£²²¯£³À飴ɴ£µ½½£¶Ëü£·À飸ɴ£¹½½

END
 

¥Ù¥Ã¥»¥ë´Ø¿ô

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ11·î 9Æü(·î)01»þ52ʬ53ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  !¥Ù¥Ã¥»¥ë´Ø¿ô¤Ç¤¹¤¬¡¢¤³¤Î¥ê¥¹¥È¤Ï¡¢£ø¤ÎÈϰϤ¬¡¢¼Â¿ô¤Þ¤Ç¤Ç¡¢
!Ê£ÁÇ¿ô¤¬»ÈÍѤǤ­¤Þ¤»¤ó¡£³ÈÄ¥¤Ç¤­¤ëÊý¡¢¤ª´ê¤¤¤·¤Þ¤¹¡£
!
!¢¨½½¿ÊBASIC ¤Ë¤â ¥Ù¥Ã¥»¥ë´Ø¿ô¡¢ÊÑ·Á¥Ù¥Ã¥»¥ë´Ø¿ô£±¼ï¤òÆâÊñ½ÐÍè¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£
!-------------------------------
OPTION ARITHMETIC NATIVE
OPTION BASE 0
SET TEXT background "opaque"
DIM col(5)
MAT READ col
DATA 4,10,2, 8,8,8 !Red darkGreen Blue  Gray Gray Gray

!-----
CALL window_i
CALL G_besseli !ÊÑ·Á¥Ù¥Ã¥»¥ë´Ø¿ô£±¼ï In(x)
WAIT DELAY .5
CALL window_j
CALL G_besselj !¥Ù¥Ã¥»¥ë´Ø¿ô£±¼ï Jn(x)

SUB window_i
   CLEAR
   LET h=4
   LET l=-1.5
   LET xr=4
   SET WINDOW -.1*xr,xr, l,h
   DRAW grid(xr/8,h/8)
   ASK PIXEL SIZE (0,0; xr,0) j,i
   LET dx=xr/j !pitch
END SUB

SUB window_j
   CLEAR
   LET h=1
   LET l=-1
   LET xr=20
   SET WINDOW -.1*xr,xr, l,h
   DRAW grid(xr/4,h/5)
   ASK PIXEL SIZE (0,0; xr,0) j,i
   LET dx=xr/j !pitch
END SUB

!-------
SUB G_besseli
   FOR n=0 TO 2
      SET LINE COLOR col(n)
      SET TEXT COLOR col(n)
      PLOT TEXT,AT .13*xr,h-.08*(h-l)-.04*(h-l)*n :"ÊÑ·Á¥Ù¥Ã¥»¥ë´Ø¿ô£±¼ï "& STR$(n)& "¼¡"
      FOR x=dx TO xr+dx STEP dx
         LET y=besseli(n,x)
         PLOT LINES: x,y; ! PEN-on
         IF FP(x)< dx THEN PRINT USING"##.## ###.######":x,y
      NEXT x
      PLOT LINES !PEN-off
      PRINT
   NEXT n
END SUB

SUB G_besselj
   FOR n=0 TO 2
      SET LINE COLOR col(n)
      SET TEXT COLOR col(n)
      PLOT TEXT,AT .13*xr,h-.08*(h-l)-.04*(h-l)*n :"¥Ù¥Ã¥»¥ë´Ø¿ô£±¼ï "& STR$(n)& "¼¡"
      FOR x=dx TO xr+dx STEP dx
         LET y=besselj(n,x)
         PLOT LINES: x,y; ! PEN-on
         IF FP(x)< dx THEN PRINT USING"##.## ###.######":x,y
      NEXT x
      PLOT LINES !PEN-off
      PRINT
   NEXT n
END SUB

!-------
FUNCTION besseli(n,x)
   LET m=2*INT( (6+MAX(n,1.5*x)+9*1.5*x/(1.5*x+2))/2)
   LET w=0
   FOR k=1 TO m
      LET w=w+Tki(k)
   NEXT k
   LET besseli=EXP(x)*Tki(n)/(Tki(0)+2*w)
END FUNCTION

FUNCTION Tki(i)
   LET t2=0
   LET t1=1e-9
   LET t0=2*(m+1)/x*t1+t2
   FOR kp1=m TO i+1 STEP -1
      LET t2=t1
      LET t1=t0
      LET t0=2*kp1/x*t1+t2
   NEXT kp1
   LET Tki=t0
END FUNCTION

!-------
FUNCTION besselj(n,x)
   LET m=2*INT( (6+MAX(n,1.5*x)+9*1.5*x/(1.5*x+2))/2)
   LET w=0
   FOR k=1 TO m/2
      LET w=w+Tk(k*2)
   NEXT k
   LET besselj=Tk(n)/(Tk(0)+2*w)
END FUNCTION

FUNCTION Tk(i)
   LET t2=0
   LET t1=1e-9
   LET t0=2*(m+1)/x*t1-t2
   FOR kp1=m TO i+1 STEP -1
      LET t2=t1
      LET t1=t0
      LET t0=2*kp1/x*t1-t2
   NEXT kp1
   LET Tk=t0
END FUNCTION

END
 

¼­½ñ¼°½ç½ø¤Ç¼¡¤Î½çÎó¤òÊÖ¤¹

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ11·î10Æü(²Ð)09»þ11ʬ43ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.675[¸µµ­»ö¤Ø]

!¼­½ñ¼°½ç½ø¤Ç¼¡¤Î½çÎó¤òÊÖ¤¹

LET N=4
DIM A(N)
DATA 1,2,3,4
!!!DATA 4,3,2,1 !¡¡¢¨Á°¤Î½çÎó¡¡¢«¢«¢«¢«¢«
MAT READ A
MAT PRINT A;

FOR i=1 TO fact(N)
   CALL NextPerm(A,N,rc)
   PRINT i
   IF rc=0 THEN
      PRINT "¤¢¤ê¤Þ¤»¤ó¡£"
      STOP
   END IF
   MAT PRINT A;
NEXT i

END


EXTERNAL SUB NextPerm(A(),N, rc) !¼­½ñ¼°½ç½ø¤Ç¼¡¤Î½çÎó¤òÊÖ¤¹
LET i=N-1 !½çÎó¤ò±¦¤«¤éº¸¤Ë¤ß¤Æ¡¢Áý²ÃÎ󤫤鸺¾¯Îó¤ËÊѤï¤ë°ÌÃÖi¤òõ¤¹
DO WHILE i>0 AND A(i)>=A(i+1) !£°¤ÏÈÖ¿Í
!!!DO WHILE i>0 AND A(i)<=A(i+1) !£°¤ÏÈÖ¿Í¡¡¢¨Á°¤Î½çÎó¡¡¢«¢«¢«¢«¢«
   LET i=i-1
LOOP
IF i=0 THEN !A(1)>A(2)>A(3)> ¡Ä >A(N)¤Ê¤é¡¡Îã. N=4¡¢4,3,2,1
   LET rc=0 !´°Î»
   EXIT SUB
END IF

LET j=N !¤½¤Î°ÌÃÖi¤è¤ê±¦¤Ç¡¢A(i)°Ê¾å¤ÇºÇ¾®¤Î¿ôA(j)¤òõ¤¹
DO WHILE A(i)>=A(j)
!!!DO WHILE A(i)<=A(j) !¡¡¢¨Á°¤Î½çÎó¡¡¢«¢«¢«¢«¢«
   LET j=j-1
LOOP
LET t=A(i) !A(i)¤ÈA(j)¤ò¸ò´¹¤¹¤ë
LET A(i)=A(j)
LET A(j)=t

LET i=i+1 !(i+1)¤«¤éN¤Þ¤Ç¤ÎÈϰϤòµÕ½ç¤Ë¤¹¤ë
LET j=N
DO WHILE i<j
   LET t=A(i) !swap it
   LET A(i)=A(j)
   LET A(j)=t
   LET i=i+1
   LET j=j-1
LOOP
LET rc=1 !̤λ
END SUB
£²²Õ½ê½¤Àµ¤¹¤ë¤³¤È¤Ç¡¢£±¤ÄÁ°¤Î½çÎó¤òÀ¸À®¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£
 

ȿžÁàºî¤Ë¤è¤ë¥Ö¥í¥Ã¥¯°ÜÆ°

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ11·î10Æü(²Ð)09»þ29ʬ32ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¤¢¤ì¡Á¤§¡ª¡¡¥«¡¼¥É¤Îʤӽç¤òȿž¤·¤Æ¤¤¤ë¤Î¤Ë¡¢¡¢¡¢

!ȿžÁàºî¤Ë¤è¤ë¥Ö¥í¥Ã¥¯°ÜÆ°

LET N=15 !Ëç¿ô
DIM A(N) !¥«¡¼¥É¤ÎʤÓ

PRINT "£²Ê¬³ä¤Î¾ì¹ç"
FOR i=1 TO N !À°Îó
   LET A(i)=i
NEXT i
MAT PRINT A;

LET p=5 !°ÌÃÖ
CALL reverse(A,1,p-1) !Á°È¾Éôʬ¤Î¤ß
MAT PRINT A;
CALL reverse(A,p,N) !¸åȾÉôʬ¤Î¤ß
MAT PRINT A;
CALL reverse(A,1,N) !Á´ÂΤÇ
MAT PRINT A;

PRINT



PRINT "£³Ê¬³ä¤Î¾ì¹ç"

FOR i=1 TO N !À°Îó
   LET A(i)=i
NEXT i
MAT PRINT A;

LET p=7 !°ÌÃÖ
LET q=12
CALL reverse(A,1,p-1) !Á°È¾Éôʬ¤Î¤ß
MAT PRINT A;
CALL reverse(A,p,q-1) !Ãæ±ûÉôʬ¤Î¤ß
MAT PRINT A;
CALL reverse(A,q,N) !¸åȾÉôʬ¤Î¤ß
MAT PRINT A;
CALL reverse(A,1,N) !Á´ÂΤÇ
MAT PRINT A;


END


EXTERNAL SUB reverse(A(),L,R) !»ØÄꤵ¤ì¤¿ÈϰϤÎʤӤòµÕ½ç¤Ë¤¹¤ë
LET i=L !º¸Ã¼
LET j=R !±¦Ã¼

DO WHILE i<j !¸ò´¹°ÌÃÖ¤ÏȾʬ¤Þ¤Ç¡¡¢¨Á´Éô¤¹¤ë¤È¸µ¤ËÌá¤ë
   LET t=A(i) !swap it
   LET A(i)=A(j)
   LET A(j)=t

   LET i=i+1 !¼¡¤Ø
   LET j=j-1
LOOP
END SUB
 

Re: ¥Ù¥Ã¥»¥ë´Ø¿ô

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ11·î11Æü(¿å)11»þ19ʬ29ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.714[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¥µ¥¤¥È¤ò¸¡º÷¤·¤Æ¤ß¤Þ¤·¤¿¤¬¡¢Ê£ÁÇÊÑ¿ô¤Ç¤Î¼ÂÎã¡ÊÀâÌÀ¡¢¥µ¥ó¥×¥ë¤Ê¤É¡Ë¤¬¤Û¤È¤ó¤É¤¢¤ê¤Þ¤»¤ó¡£
ËܳÊŪ¤Ê·×»»¤Ï¤ï¤«¤ê¤Þ¤»¤ó¡¢¡¢¡¢
!Jn(z)=(1/¦Ð)*¢é[0,¦Ð]{cos(n*¦È-z*sin¦È)}d¦È ÀÑʬɽ¼¨¤è¤ê¡¢¿ôÃÍÀÑʬ¤Çµá¤á¤ë

!¡Ê¸¡»»¤Ë»È¤Ã¤¿¡Ë»²¹Í¥µ¥¤¥È¡¡http://keisan.casio.jp/

OPTION ARITHMETIC COMPLEX

LET j=SQR(-1) !µõ¿ôñ°Ì

DEF SIN(z)=(EXP(j*z)-EXP(-j*z))/(2*j) !»°³Ñ´Ø¿ô
DEF COS(z)=(EXP(j*z)+EXP(-j*z))/2

FUNCTION complexbessel(n,z) !£±¼ï¥Ù¥Ã¥»¥ë´Ø¿ô Jn(x+i*y)
   LET div=1000 !ʬ³ä¿ô
   LET u=0
   LET h=PI/div
   LET a=0
   FOR i=1 TO div !¿ôÃÍÀÑʬ¤ÎÂæ·Á¸ø¼°
      LET u=u+( COS(n*a-z*SIN(a)) + COS(n*(a+h)-z*SIN(a+h)) )/2
      LET a=h*i
   NEXT i
   LET complexbessel=h*u/PI
END FUNCTION


SET WINDOW -0.1*20,20, -1,1 !ɽ¼¨ÈÏ°Ï
DRAW grid(20/4,1/5)

LET dx=0.2 !¥°¥é¥Õ¤ÎÉÁ²è´Ö³Ö
FOR n=0 TO 2
   SET LINE COLOR n+2
   SET TEXT COLOR n+2
   PLOT TEXT,AT .13*20,1-.08*2-.04*2*n :"¥Ù¥Ã¥»¥ë´Ø¿ô£±¼ï "& STR$(n)& "¼¡"
   FOR x=0 TO 20 STEP dx
      LET y=Re( complexbessel(n,COMPLEX(x,0)) ) !¼Â¿ô
      PLOT LINES: x,y;
      IF FP(x)< dx THEN PRINT USING"##.## ###.######": x,y
   NEXT x
   PLOT LINES
   PRINT
NEXT n

END
 

Re: ¥Ù¥Ã¥»¥ë´Ø¿ô

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ11·î11Æü(¿å)11»þ56ʬ51ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.714[¸µµ­»ö¤Ø]

!Á°²ó¤Î¥Ù¥Ã¥»¥ë´Ø¿ô¤Ë¤Ä¤¤¤Æ¡¢ÊÑ¿ô m ¤ò¡¢
!ÀäÂÐÃͽèÍý¤¹¤ë¤À¤±¤Ç¡¢£ø¤ÎÈϰϤò¡¢Ê£ÁÇ¿ô¤Þ¤Ç³ÈÄ¥¤Ç¤­¤ë»ö¤¬Ê¬¤Ã¤¿¡£
!
! Jn( complex(x,0) )= complex(0,1)^(-n) *In( complex(0,x) )
! In( complex(x,0) )= complex(0,1)^(-n) *Jn( complex(0,x) ) !¢«Ê¸¤Ï¤³¤Î¥Æ¥¹¥È¾õÂÖ¡£
!-------------------------------

OPTION ARITHMETIC COMPLEX
OPTION BASE 0
SET TEXT background "opaque"
DIM col(5)
MAT READ col
DATA 4,10,2, 8,8,8 !Red darkGreen Blue  Gray Gray Gray

!-----
CALL window_i
CALL G_besselj !¥Ù¥Ã¥»¥ë´Ø¿ô£±¼ï Jn(x)¡¡¡Äµõ¿ôÆþÎÏ
WAIT DELAY .5
CALL G_besseli !ÊÑ·Á¥Ù¥Ã¥»¥ë´Ø¿ô£±¼ï In(x)

SUB window_i
   CLEAR
   LET h=4
   LET l=-1.5
   LET xr=4
   SET WINDOW -.1*xr,xr, l,h
   DRAW grid(xr/8,h/8)
   ASK PIXEL SIZE (0,0; xr,0) j,i
   LET dx=xr/j !pitch
END SUB

SUB window_j
   CLEAR
   LET h=1
   LET l=-1
   LET xr=20
   SET WINDOW -.1*xr,xr, l,h
   DRAW grid(xr/4,h/5)
   ASK PIXEL SIZE (0,0; xr,0) j,i
   LET dx=xr/j !pitch
END SUB

!-------
SUB G_besseli
   FOR n=0 TO 2
      SET LINE COLOR col(n)
      SET TEXT COLOR col(n)
      PLOT TEXT,AT .13*xr,h-.08*(h-l)-.04*(h-l)*n :"ÊÑ·Á¥Ù¥Ã¥»¥ë´Ø¿ô£±¼ï "& STR$(n)& "¼¡"
      FOR t=dx TO xr+dx STEP dx
         LET x=t
         LET y=besseli(n,x)
         ! LET x=COMPLEX(0,t)
         ! LET y=COMPLEX(0,1)^(-n)*besseli(n,x)
         PLOT LINES: ABS(x),y; ! PEN-on
         IF FP(t)< dx THEN PRINT x;y
      NEXT t
      PLOT LINES !PEN-off
      PRINT
   NEXT n
END SUB

SUB G_besselj
   FOR n=0 TO 2
      SET LINE COLOR col(n+3)
      SET TEXT COLOR col(n+3)
      PLOT TEXT,AT .13*xr,h-.08*(h-l)-.04*(h-l)*n :"¥Ù¥Ã¥»¥ë´Ø¿ô£±¼ï "& STR$(n)& "¼¡¡¡¡¡"
      FOR t=dx TO xr+dx STEP dx
      ! LET x=t
      ! LET y=besselj(n,x)
         LET x=COMPLEX(0,t)
         LET y=COMPLEX(0,1)^(-n)*besselj(n,x)
         PLOT LINES: ABS(x),y; ! PEN-on
         IF FP(t)< dx THEN PRINT x;y
      NEXT t
      PLOT LINES !PEN-off
      PRINT
   NEXT n
END SUB

!-------
FUNCTION besseli(n,x)
   IF x=0 THEN LET x=1e-32 !£°¤ÎÊݸî( ¾ì¹ç¤Ë¤è¤ê³°¤¹)
   LET m=2*INT( (6+MAX(n,1.5*ABS(x))+9*1.5*ABS(x)/(1.5*ABS(x)+2))/2 )
   LET w=0
   FOR k=1 TO m
      LET w=w+Tki(k,x)
   NEXT k
   LET besseli=EXP(x)*Tki(n,x)/(Tki(0,x)+2*w)
END FUNCTION

FUNCTION Tki(i,x)
   LET t2=0
   LET t1=1e-9
   LET t0=2*(m+1)/x*t1+t2
   FOR kp1=m TO i+1 STEP -1
      LET t2=t1
      LET t1=t0
      LET t0=2*kp1/x*t1+t2
   NEXT kp1
   LET Tki=t0
END FUNCTION

!-------
FUNCTION besselj(n,x)
   IF x=0 THEN LET x=1e-32 !£°¤ÎÊݸî( ¾ì¹ç¤Ë¤è¤ê³°¤¹)
   LET m=2*INT( (6+MAX(n,1.5*ABS(x))+9*1.5*ABS(x)/(1.5*ABS(x)+2))/2 )
   LET w=0
   FOR k=1 TO m/2
      LET w=w+Tk(k*2,x)
   NEXT k
   LET besselj=Tk(n,x)/(Tk(0,x)+2*w)
END FUNCTION

FUNCTION Tk(i,x)
   LET t2=0
   LET t1=1e-9
   LET t0=2*(m+1)/x*t1-t2
   FOR kp1=m TO i+1 STEP -1
      LET t2=t1
      LET t1=t0
      LET t0=2*kp1/x*t1-t2
   NEXT kp1
   LET Tk=t0
END FUNCTION

END
 

Re: ¥Ù¥Ã¥»¥ë´Ø¿ô

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ11·î11Æü(¿å)12»þ05ʬ34ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.717[¸µµ­»ö¤Ø]

»³Ã椵¤ó¤Ø
¤¤¤ì¤Á¤¬¤¤¤Ë¤Ê¤Ã¤¿¤è¤¦¤Ç¡Ä ¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£ÌäÂê¤Ï²ò·è¤·¤Æ¤¤¤Þ¤·¤¿¡£¤Û¤Ã¤È¤·¤Þ¤·¤¿
 

!ƳÀþ¤ÎɽÈé¸ú²Ì¤Ë¤è¤ëÅÅήʬÉÛ

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ11·î11Æü(¿å)15»þ55ʬ47ÉÃ
ÊÖ¿®¡¦°úÍÑ
  !ƳÀþ¤ÎɽÈé¸ú²Ì¤Ë¤è¤ëÅÅήʬÉÛ

!ÅÅÇÈ»þ·×¤Ê¤É¤Ë»È¤¦¥Ð¡¼¥¢¥ó¥Æ¥Ê¤Î´¬Àþ¤Ë¤Ä¤¤¤Æ¡¢¥¨¥Ê¥á¥ëÀþ¤È¡¢¥ê¥Ã¥ÄÀþ
!( ºÙÀþ¤ò¿¿ô«¤Í¤¿¸¨´¬Àþ)¤Ç¡¢Â»¼º¤Ë¡¢¤É¤Î¤¯¤é¤¤º¹¤¬¤¢¤ë¤«¤ò¡¢Ä´¤Ù¤Þ¤¹¡£

!ÊÑ·Á¥Ù¥Ã¥»¥ë´Ø¿ô£±¼ï£°¼¡¤ò»ÈÍѤ·¤Æ¡¢Æ³ÂÎÃÇÌ̤ÎȾ·Â¤´¤È¤ÎÅÅή̩ÅÙʬÉÛ¤Î
!¥°¥é¥Õ¤ò½ñ¤­¤Þ¤¹¡£¤³¤ì¤ò¸«¤ë¤È¡¢£´£°£ë£È£ú¤°¤é¤¤¤Ê¤é¡¢0.5¦Õmm ñÀþ¤Î
!¥¨¥Ê¥á¥ëÀþ¤Ç¤â¡¢Â礷¤Æ°ã¤ï¤Ê¤¤¤è¤¦¤Ç¤¹¡£
!
!---------------
OPTION ARITHMETIC COMPLEX

!Ⱦ·Âr(m)¤ÎÅÅή̩ÅÙIr(A/m^2) ¡¿ ɽÈéȾ·Âa(m)¤ÎÅÅή̩ÅÙIa(A/m^2)

!Ir/Ia= I0( k*r )/ I0( k*a )  ¡¦¡¦¡¦I0(z) ÊÑ·Á¥Ù¥Ã¥»¥ë´Ø¿ô£±¼ï£°¼¡
! k=¢å(j*2*¦Ð*¼þÇÈ¿ô*u*g)     ¡¦¡¦¡¦j=µõ¿ô
LET u=PI*4*1e-7 !H/m Æ©¼§Î¨ !Ƽ
LET g=58*1e6    !S/m ƳÅÅΨ !Ƽ

SET bitmap SIZE 640, 400
CLEAR
SET COLOR MIX(15) .4, .4, .4
SET COLOR MIX( 0) .4, .4, .4
SET AREA COLOR 1
DIM col(6),frq(6)
MAT READ col
DATA 4,   6,   2,   7,    3,     5 ! red yellow blue magenta green cyan
MAT READ frq
DATA 10e3,40e3,60e3,100e3,1e6,10e6
!
LET a=0.5*1e-3  !m   ƳÀþȾ·Â.(1mm¦Õ)
SET VIEWPORT 100/640,300/640, 100/640,300/640
CALL msub00
LET a=a/2       !m   ƳÀþȾ·Â.(.5mm¦Õ)
SET VIEWPORT 350/640,550/640, 100/640,300/640
CALL msub00
!
SET VIEWPORT 0/640,640/640, 0/640,400/640
SET WINDOW 0,16, 10,0
SET TEXT COLOR 1
PLOT TEXT,AT 4,.5:"ɽÈé¸ú²Ì¤Ë¤è¤ë¥¨¥Ê¥á¥ëÀþ(Ƽ)¤ÎÅÅή̩ÅÙʬÉÛ"
PLOT TEXT,AT 4,1.3 ,USING"¦Õ= %.##mm": a*4000
PLOT TEXT,AT 10.25,1.3 ,USING"¦Õ= %.##mm": a*2000
PLOT TEXT,AT     3,2:"ɽÈé¡¡¢«¡¡Ãæ¿´¡¡¢ª¡¡É½Èé"
PLOT TEXT,AT 9.25,2:"ɽÈé¡¡¢«¡¡Ãæ¿´¡¡¢ª¡¡É½Èé"
PLOT AREA:.5,2.5;2,2.5;2,7.5;.5,7.5
FOR ch=1 TO 6
   SET TEXT COLOR col(ch)
   IF frq(ch)< 1e6 THEN LET w$=STR$(frq(ch)/1e3)& "KHz" ELSE LET w$=STR$(frq(ch)/1e6)& "MHz"
   PLOT TEXT,AT .8, 3+.6*ch: w$
NEXT ch

!------
SUB msub00
   SET WINDOW -a*1.01,a*1.01, -0.01,+1.01
   PLOT AREA:-a*1.01,-0.01;a*1.01,-0.01;a*1.01,1.01;-a*1.01,1.01
   DRAW axes0( a/5, 0.2)
   ASK PIXEL SIZE(-a,0;a,0) j,i
   LET dr=2*a/j
   PRINT USING "¦Õ= %.##mm": a*2000
   FOR ch=1 TO 6
      CALL skin
   NEXT ch
END SUB

SUB skin
   SET LINE COLOR col(ch)
   LET k=SQR( COMPLEX(0,1)*2*PI*frq(ch)*u*g )
   LET Iaa= ABS( besseli(0,k*a) ) !ɽÌÌÅÅή̩ÅÙ A/m^2
   !---
   FOR r=dr TO a STEP dr
      LET ra= ABS( besseli(0,k*r))/Iaa
      IF r=dr THEN
         IF frq(ch)< 1e6 THEN LET w$=STR$(frq(ch)/1e3)& "KHz" ELSE LET w$=STR$(frq(ch)/1e6)& "MHz"
         PRINT right$("  "& w$,6);" ";
         PRINT USING$("###.########",ra*100);"%" !ÅÅή̩ÅÙÈæ¡ÊÃæ¿´¡¿É½ÌÌ¡Ë
      ELSE
         PLOT LINES:xb,yb; r,ra
         PLOT LINES:-xb,yb;-r,ra
      END IF
      LET xb=r
      LET yb=ra
   NEXT r
END SUB

!------ ÊÑ·Á¥Ù¥Ã¥»¥ë´Ø¿ô£±¼ï£°¼¡
FUNCTION besseli(n,x)
   LET m=2*INT( (6+MAX(n,1.5*ABS(x))+9*1.5*ABS(x)/(1.5*ABS(x)+2))/2)
   LET w=0
   FOR kk=1 TO m
      LET w=w+Tki(kk,x)
   NEXT kk
   LET besseli=EXP(x)*Tki(n,x)/(Tki(0,x)+2*w)
END FUNCTION

FUNCTION Tki(i,x)
   LET t2=0
   LET t1=1e-9
   LET t0=2*(m+1)/x*t1+t2
   FOR kp1=m TO i+1 STEP -1
      LET t2=t1
      LET t1=t0
      LET t0=2*kp1/x*t1+t2
   NEXT kp1
   LET Tki=t0
END FUNCTION

END

!¢¨½½¿ÊBASIC ¤Ë¤â ¥Ù¥Ã¥»¥ë´Ø¿ô¡¢ÊÑ·Á¥Ù¥Ã¥»¥ë´Ø¿ô£±¼ï¤òÆ⢽ÐÍè¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£
 

Re: ¥»¥ó¥¿¡¼»î¸³ÄøÅÙ¤Î¥×¥í¥°¥é¥à±é½¬

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ11·î12Æü(ÌÚ)10»þ40ʬ28ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.690[¸µµ­»ö¤Ø]

³¬¾è¿Ê¿ô¤È½çÎó¤È¤Î´Ø·¸

Ä̾ï¤Î¿Ê¿ôÊÑ´¹¤Ç¤Ï¡¢³Æ·å¤Î½Å¤ß¤Ï°ìÄê¤È¤Ê¤ë¡£
¤¿¤È¤¨¤Ð¡¢£²¿Ê¿ô¤Ê¤é£²¤È¤Ê¤ë¤Î¤Ç¡¢³Æ·å¤Î¿ô¤Ï¡Ö£²¤Ç³ä¤Ã¤¿Í¾¤ê¤È¾¦¡×¤ò·«¤êÊÖ¤¹¤³¤È¤Çµá¤Þ¤ë¡£
¤³¤ì¤¬¡¢j=1¡ÁN ¤È¤¹¤ë¤³¤È¤ÇƱÍͤ˻»½Ð¤Ç¤­¤ë¡£

¤³¤Î´Ø·¸¤ò»È¤Ã¤Æ¡¢¡Ê¥Ñ¥º¥ë¤Î²òË¡¤Ê¤É¤Ç¡Ë
¡¦½çÎó¤ÎÉä¹æ²½¡¢Éü¹æ²½ -¡¡¶ÉÌ̤ʤɤΥѥ¿¡¼¥ó¤Îµ­Ï¿¡¢À¸À®
¡¦Íð¿ôÎó¤ÎÀ¸À® - 0¡Á(N!-1)¤ÎÈϰϤÎÍð¿ô¤«¤é¡¢½çÎó¤òÉü¹æ²½¤¹¤ë
¤ÈÍøÍѤǤ­¤ë¡£
LET N=4 !N·å¤Î³¬¾è¿Ê¿ô

DIM A(N) !³Æ·å¤ÎÃÍ¡¢½çÎó

FOR i=0 TO FACT(N)-1 !¾ì¹ç¤Î¿ô
   PRINT "i="; i !·ë²Ì¤òɽ¼¨¤¹¤ë

   CALL Num2Factoradic(i, A,N) !³¬¾è¿Ê¿ô¤Ø
   MAT PRINT A;
   PRINT Factoradic2Num(A,N) !¸¡»»


   CALL Num2PermFactorial(i,A,N) !½çÎó¤Ø
   MAT PRINT A;
   PRINT PermFactorial2Num(A,N) !¸¡»»
NEXT i

END


EXTERNAL FUNCTION Factoradic2Num(A(),N) !N·å¤Î³¬¾è¿Ê¿ô¤ËÂФ·¤Æ¡¢ÈóÉéÀ°¿ô¤òµá¤á¤ë
FOR j=N TO 1 STEP -1
   LET v=v*j+A(N-j+1) !³¬¾è¿Ê¿ô¤Î³Æ·å¤ÎÃÍ¡¡A[1..N]=(N-1)! ¡Ä 3! 2! 1! 0!
NEXT j
LET Factoradic2Num=v
END FUNCTION

EXTERNAL SUB Num2Factoradic(K, A(),N) !ÈóÉéÀ°¿ôK¤ËÂФ·¤Æ¡¢N·å¤Î³¬¾è¿Ê¿ô¤òµá¤á¤ë
LET v=K
FOR j=1 TO N
   LET A(N-j+1)=MOD(v,j) !³¬¾è¿Ê¿ô¤Î³Æ·å¤ÎÃÍ¡¡A[1..N]=(N-1)! ¡Ä 3! 2! 1! 0!
   LET v=INT(v/j)
NEXT j
END SUB



!n!¤Î½çÎó¥Ñ¥¿¡¼¥ó ¢Î 0¡Á(n!-1)¤ÎÈÖ¹æ

EXTERNAL FUNCTION PermFactorial2Num(A(),N) !½çÎó¥Ñ¥¿¡¼¥ó¤ËÈÖ¹æ¤òÉÕ¤±¤ë¡¡¢¨¼­½ñ¼°½ç½ø
FOR j=1 TO N-1 !³¬¾è¿Ê¿ô¤Î³Æ·å¤ÎÃÍ¡Ü£±¡¡A[1..N]=(N-1)! ¡Ä 3! 2! 1! 0!
   FOR k=j+1 TO N
      IF A(k)>=A(j) THEN LET A(k)=A(k)-1
   NEXT k
NEXT j
LET v=0
FOR j=N TO 1 STEP -1 !ÈóÉé¤Î10¿Ê¿ôÀ°¿ô¤Ø
   LET v=v*j+A(N-j+1)-1
NEXT j
LET PermFactorial2Num=v
END FUNCTION

EXTERNAL SUB Num2PermFactorial(h, A(),N) !Èֹ椫¤é½çÎó¥Ñ¥¿¡¼¥ó¤òÀ¸À®¤¹¤ë¡¡¢¨¼­½ñ¼°½ç½ø
LET v=h !ÈóÉé¤Î10¿Ê¿ôÀ°¿ô¤ò³¬¾è¿Ê¿ô¤Ø
FOR j=1 TO N
   LET A(N-j+1)=MOD(v,j)+1 !³¬¾è¿Ê¿ô¤Î³Æ·å¤ÎÃÍ¡Ü£±¡¡A[1..N]=(N-1)! ¡Ä 3! 2! 1! 0!
   LET v=INT(v/j)
NEXT j
FOR j=N-1 TO 1 STEP -1 !½çÎó¥Ñ¥¿¡¼¥ó¤Ø
   FOR k=j+1 TO N
      IF A(k)>=A(j) THEN LET A(k)=A(k)+1
   NEXT k
NEXT j
END SUB


Á°½Ð¤Î¡Ö½çÎó¡¢Áȹ礻¤ÎÈÖ¹æÉÕ¤±¤ÈÉü¸µ ¡×¤Î¥×¥í¥°¥é¥à¤Ç¤Ï¡¢Ëè²óFACT(N)¤äPERM(N,R)¤ò·×»»¤·¤Æ¤¤¤¿¡£
¤«¤±»»¤ò¹â®¤Ë·×»»¤Ç¤­¤ë¤¬¡¢¡Ö¤è¤êŬÀڤʽèÍý¡×¤È¤¤¤¦¤³¤È¤Ç½¤Àµ¤·¤Æ¤ª¤¯¡£
¤¤¤¯¤Ä¤«¤Î¥Ñ¥º¥ë¤Î²òË¡¤Ç¿¾¯·×»»¤¬Â®¤¯¤Ê¤ë¡£
EXTERNAL FUNCTION Perm2Num(A(),N,R) !½çÎó¥Ñ¥¿¡¼¥ó¤ËÈÖ¹æ¤òÉÕ¤±¤ë¡¡¢¨¼­½ñ¼°½ç½ø
FOR j=1 TO R-1 !(³¬¾è)¿Ê¿ô¤Î³Æ·å¤ÎÃÍ¡Ü£±¡¡A[1..R]=PERM(N-1,R-1) ¡Ä PERM(N-j,R-j) ¡Ä PERM(N-R,0)
   FOR k=j+1 TO R
      IF A(k)>=A(j) THEN LET A(k)=A(k)-1
   NEXT k
NEXT j
LET v=0
FOR j=R TO 1 STEP -1 !ÈóÉé¤Î10¿Ê¿ôÀ°¿ô¤Ø
   LET v=v*(N-R+j)+A(R-j+1)-1
NEXT j
LET Perm2Num=v
END FUNCTION

EXTERNAL SUB Num2Perm(h, A(),N,R) !Èֹ椫¤é½çÎó¥Ñ¥¿¡¼¥ó¤òÀ¸À®¤¹¤ë¡¡¢¨¼­½ñ¼°½ç½ø
LET v=h !ÈóÉé¤Î10¿Ê¿ôÀ°¿ô¤ò(³¬¾è)¿Ê¿ô¤Ø
FOR j=1 TO R
   LET A(R-j+1)=MOD(v,N-R+j)+1 !(³¬¾è)¿Ê¿ô¤Î³Æ·å¤ÎÃÍ¡Ü£±¡¡A[1..R]=PERM(N-1,R-1) ¡Ä PERM(N-j,R-j) ¡Ä PERM(N-R,0)
   LET v=INT(v/(N-R+j))
NEXT j
FOR j=R-1 TO 1 STEP -1 !½çÎó¥Ñ¥¿¡¼¥ó¤Ø
   FOR k=j+1 TO R
      IF A(k)>=A(j) THEN LET A(k)=A(k)+1
   NEXT k
NEXT j
END SUB
 

Re: ¥¢¥é¥Ó¥¢¿ô»ú¤ò´Á¿ô»ú¤ËÊÑ´¹¤¹¤ë

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ11·î14Æü(ÅÚ)13»þ43ʬ40ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.713[¸µµ­»ö¤Ø]

´Á¿ô»ú¤ËÊÑ´¹¤¹¤ë´Ø¿ô¤ò³ÈÄ¥¤µ¤»¤Æ¤¤¤¿¤À¤­¤Þ¤·¤¿¡£
p=5 ¤È¤·¤Æ¡¢£±£²²¯£³£´£µ£¶Ëü£·£¸£°£°¤È¤¤¤¦·Á¼°¤òÉղä·¤Þ¤·¤¿¡£
¤Þ¤¿¡¢¾®¿ô¤Î´Á¿ô»úÊÑ´¹¤â¤Ç¤­¤ë¤è¤¦¤Ë¤·¤Þ¤·¤¿¡£

!¥¢¥é¥Ó¥¢¿ô»ú¡Ê1,2,3,¡Ä¡Ë¤ò´Á¿ô»ú¡Ê°ì,Æó,»°,¡Ä¡Ë¤ËÊÑ´¹¤¹¤ë NumberString2$(x,p)¡ÊExcel½àµò¤Ç¤Ï¤Ê¤¤¡Ë
!¥¢¥é¥Ó¥¢¿ô»ú¾®¿ôÉô¡Ê.123¡Ä¡Ë¤ò´Á¿ô»ú¡Ê°ìʬÆóÎÒ»°ÌӡġˤËÊÑ´¹¤¹¤ë NumberString3$(x,p)¡ÊÆÈΩ¤·¤ÆÍøÍѲġË

LET n1$="¡»°ìÆ󻰻͸ÞÏ»¼·È¬¶å" !´Á¿ô»ú
LET f1$="ÀéÉ´½½¡¡" !°Ì
LET f2$="Ô¶µþÃû²¯Ëü¡¡" !£´·å¤º¤Ä¤Î°Ì

LET n2$="¡»°íÆõ»²»Í¸àÏ»¼·È¬¶å" !Âç»ú
LET f3$="ïôÉ´½¦¡¡" !°Ì
LET f4$="Ô¶µþÃû²¯èß¡¡" !£´·å¤º¤Ä¤Î°Ì

LET n3$="£°£±£²£³£´£µ£¶£·£¸£¹" !¿ô»ú

DIM ff$(25)
FOR i=1 TO 25
   READ IF MISSING THEN EXIT FOR : ff$(i)
NEXT i
!DATA ³ä,ʬ,ÎÒ,ÌÓ,»å,¹ú,Èù,Á¡,º»,¿Ð,Ô¼,ÞÝ,Çù,ÌϸÒ,íõ½ä,¿ÜçÌ,½Ö©,ÃÆ»Ø,ÑëÆá,Ï»ÆÁ,µõ¶õ,À¶¾ô,°¤ÍêÌí,°¤ËàÍå,ÞºÜѼäÀÅ !³ä¹çɽµ­
DATA ʬ,ÎÒ,ÌÓ,»å,¹ú,Èù,Á¡,º»,¿Ð,Ô¼,ÞÝ,Çù,ÌϸÒ,íõ½ä,¿ÜçÌ,½Ö©,ÃÆ»Ø,ÑëÆá,Ï»ÆÁ,µõ¶õ,À¶¾ô,°¤ÍêÌí,°¤ËàÍå,ÞºÜѼäÀÅ !ËÜÍèɽµ­
!"Ô¼"°Ê¹ß¤Ï½ôÀ⤢¤ê

FUNCTION NumberString2$(x,p) !¥¢¥é¥Ó¥¢¿ô»ú¡Ê1,2,3,¡Ä¡Ë¤ò´Á¿ô»ú¡Ê°ì,Æó,»°,¡Ä¡Ë¤ËÊÑ´¹¤¹¤ë
   IF x<0 THEN
      PRINT "ÈóÉé¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£"; x
      STOP
   ELSE
      LET w$=""

      SELECT CASE p
      CASE 1 !´Á¿ô»ú¤Çɽµ­¤¹¤ë
         LET a=INT(x) !!
         IF a=0 THEN
            LET w$="¡»"
         ELSE
            LET i=LEN(f2$)
            DO UNTIL a=0 !¾å°Ì¤Î¿ô»ú¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç
               LET aa=MOD(a,10000) !¡Ö¡ÄÃû²¯Ëü¡¡¡×¤Î£´·å¤º¤Ä
               IF aa<>0 THEN
                  LET ww$=f2$(i:i)
                  IF ww$<>"¡¡" THEN LET w$=ww$&w$

                  LET k=LEN(f1$)
                  DO UNTIL aa=0 !³Æ¡ÖÀéÉ´½½¡¡¡×¤Î°Ì
                     LET ww$=f1$(k:k)
                     IF ww$="¡¡" THEN LET ww$=""

                     LET t=MOD(aa,10) !°ì¤Î°Ì¤«¤é
                     IF t=0 THEN !¥¼¥í¡¦¥µ¥×¥ì¥¹
                     ELSEIF k<LEN(f1$) AND t=1 THEN !£±¡¦¥µ¥×¥ì¥¹
                        LET w$=ww$&w$
                     ELSE
                        LET w$=n1$(t+1:t+1)&ww$&w$
                     END IF

                     LET aa=INT(aa/10) !¼¡¤Ø
                     LET k=k-1
                  LOOP
               END IF

               LET a=INT(a/10000) !¼¡¤Ø
               LET i=i-1
            LOOP
         END IF

      CASE 2 !Âç»ú¤Î´Á¿ô»ú¤Çɽµ­¤¹¤ë
         LET a=INT(x) !!
         IF a=0 THEN
            LET w$="¡»"
         ELSE
            LET i=LEN(f4$)
            DO UNTIL a=0 !¾å°Ì¤Î¿ô»ú¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç
               LET aa=MOD(a,10000) !¡Ö¡ÄÃû²¯Ëü¡¡¡×¤Î£´·å¤º¤Ä
               IF aa<>0 THEN
                  LET ww$=f4$(i:i)
                  IF ww$<>"¡¡" THEN LET w$=ww$&w$

                  LET k=LEN(f3$)
                  DO UNTIL aa=0 !³Æ¡ÖÀéÉ´½½¡¡¡×¤Î°Ì
                     LET ww$=f3$(k:k)
                     IF ww$="¡¡" THEN LET ww$=""

                     LET t=MOD(aa,10) !°ì¤Î°Ì¤«¤é
                     IF t=0 THEN !¥¼¥í¡¦¥µ¥×¥ì¥¹
                     !!!ELSEIF k<LEN(f3$) AND t=1 THEN !£±¡¦¥µ¥×¥ì¥¹
                     !!!   LET w$=ww$&w$
                     ELSE
                        LET w$=n2$(t+1:t+1)&ww$&w$
                     END IF

                     LET aa=INT(aa/10) !¼¡¤Ø
                     LET k=k-1
                  LOOP
               END IF

               LET a=INT(a/10000) !¼¡¤Ø
               LET i=i-1
            LOOP
         END IF

      CASE 3 !¿ôÃͤò¤½¤Î¤Þ¤Þ´Á¿ô»ú¤Çɽµ­¤¹¤ë
         LET a=INT(x) !!
         IF a=0 THEN
            LET w$="¡»" !!
         ELSE
            DO UNTIL a=0 !¾å°Ì¤Î·å¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç
               LET t=MOD(a,10)+1 !°ì¤Î°Ì¤«¤é
               LET w$=n1$(t:t)&w$
               LET a=INT(a/10) !¼¡¤Ø
            LOOP
         END IF

      CASE 4 !½½,É´,Àé,Ëü¤Ê¤É¤ò´Á¿ô»ú¤Çɽµ­¤¹¤ë
         LET a=INT(x) !!
         IF a=0 THEN
            LET w$="£°" !!
         ELSE
            LET i=LEN(f2$)
            DO UNTIL a=0 !¾å°Ì¤Î¿ô»ú¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç
               LET aa=MOD(a,10000) !¡Ö¡ÄÃû²¯Ëü¡¡¡×¤Î£´·å¤º¤Ä
               IF aa<>0 THEN
                  LET ww$=f2$(i:i)
                  IF ww$<>"¡¡" THEN LET w$=ww$&w$

                  LET k=LEN(f1$)
                  DO UNTIL aa=0 !³Æ¡ÖÀéÉ´½½¡¡¡×¤Î°Ì
                     LET ww$=f1$(k:k)
                     IF ww$="¡¡" THEN LET ww$=""

                     LET t=MOD(aa,10) !°ì¤Î°Ì¤«¤é
                     IF t=0 THEN !¥¼¥í¡¦¥µ¥×¥ì¥¹
                     ELSEIF k<LEN(f1$) AND t=1 THEN !£±¡¦¥µ¥×¥ì¥¹
                        LET w$=ww$&w$
                     ELSE
                        LET w$=n3$(t+1:t+1)&ww$&w$
                     END IF

                     LET aa=INT(aa/10) !¼¡¤Ø
                     LET k=k-1
                  LOOP
               END IF

               LET a=INT(a/10000) !¼¡¤Ø
               LET i=i-1
            LOOP
         END IF

      CASE 5 !! Ãû,²¯,Ëü¤Ê¤É¤ò´Á¿ô»ú¤Çɽµ­¤¹¤ë
         LET a=INT(x)
         IF a=0 THEN
            LET w$="£°"&w$
         ELSE
            LET i=LEN(f2$)
            DO UNTIL a=0 !¾å°Ì¤Î¿ô»ú¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç
               LET aa=MOD(a,10000) !¡Ö¡ÄÃû²¯Ëü¡¡¡×¤Î£´·å¤º¤Ä
               IF aa<>0 THEN
                  LET ww$=f2$(i:i)
                  IF ww$<>"¡¡" THEN LET w$=ww$&w$
                  DO UNTIL aa=0 !³Æ¡ÖÀéÉ´½½¡¡¡×¤Î°Ì
                     LET t=MOD(aa,10) !°ì¤Î°Ì¤«¤é
                     LET w$=n3$(t+1:t+1)&w$
                     LET aa=INT(aa/10) !¼¡¤Ø
                  LOOP
               END IF
               LET a=INT(a/10000) !¼¡¤Ø
               LET i=i-1
            LOOP
         END IF !!

      CASE ELSE
      END SELECT

      IF x<>INT(x) THEN !!
         IF INT(x)=0 THEN
            LET w$=""
         ELSEIF p=1 OR p=2 OR p=4 THEN
            LET w$=w$&"¡¦"
         END IF
         LET w$=w$&NumberString3$(FP(x),p) ! ¾®¿ôÉôÊÑ´¹
      END IF !!

      LET NumberString2$=w$ !·ë²Ì¤òÊÖ¤¹
   END IF
END FUNCTION

!³¤¯
 

Re: ¥¢¥é¥Ó¥¢¿ô»ú¤ò´Á¿ô»ú¤ËÊÑ´¹¤¹¤ë

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ11·î14Æü(ÅÚ)13»þ45ʬ21ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.713[¸µµ­»ö¤Ø]

!³¤­
FUNCTION NumberString3$(x,p) !¥¢¥é¥Ó¥¢¿ô»ú¾®¿ôÉô¡Ê.123¡Ä¡Ë¤ò´Á¿ô»ú¡Ê°ìʬÆóÎÒ»°ÌӡġˤËÊÑ´¹¤¹¤ë
   IF x<=0 OR x>=1 THEN
      PRINT "Àµ¤Î¾®¿ô(0<x<1)¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£"; x
      STOP
   END IF
   LET b=x
   LET ww$=""
   LET k=1
   SELECT CASE p
   CASE 1 !´Á¿ô»ú¤Çɽµ­¤¹¤ë(°ìʬÆóÎÒ»°ÌÓ)
      DO UNTIL b=0 !¾®¿ô¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç
         LET t=INT(10*b)
         WHEN EXCEPTION IN
            LET ff2$=ff$(k) ! ÇÛÎóź»ú¥ª¡¼¥Ð¡¼¤ÇÎ㳰ȯÀ¸
            IF t<>0 THEN LET ww$=ww$&n1$(t+1:t+1)&ff2$
         USE
            LET ww$=ww$&n1$(t+1:t+1) ! t=0¤òɽµ­
         END WHEN
         LET b=10*b-t !¼¡¤Ø
         LET k=k+1
      LOOP
   CASE 2 !Âç»ú¤Î´Á¿ô»ú¤Çɽµ­¤¹¤ë(°íʬÆõÎÒ»²ÌÓ)
      DO UNTIL b=0 !¾®¿ô¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç
         LET t=INT(10*b)
         WHEN EXCEPTION IN
            LET ff2$=ff$(k)
            IF t<>0 THEN LET ww$=ww$&n2$(t+1:t+1)&ff$(k)
         USE
            LET ww$=ww$&n2$(t+1:t+1)
         END WHEN
         LET b=10*b-t !¼¡¤Ø
         LET k=k+1
      LOOP
   CASE 3 !¿ôÃͤò¤½¤Î¤Þ¤Þ´Á¿ô»ú¤Çɽµ­¤¹¤ë(¡¦°ìÆó»°)
      LET ww$="¡¦" ! Ãæ¹õ
      DO UNTIL b=0 !¾®¿ô¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç
         LET t=INT(10*b)
         LET ww$=ww$&n1$(t+1:t+1)
         LET b=10*b-t !¼¡¤Ø
      LOOP
   CASE 4 !ʬ,ÎÒ,ÌÓ,»å¤Ê¤É¤ò´Á¿ô»ú¤Çɽµ­¤¹¤ë(£±Ê¬£²ÎÒ£³ÌÓ)
      DO UNTIL b=0 !¾®¿ô¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç
         LET t=INT(10*b)
         WHEN EXCEPTION IN
            LET ff2$=ff$(k)
            IF t<>0 THEN LET ww$=ww$&n3$(t+1:t+1)&ff$(k)
         USE
            LET ww$=ww$&n3$(t+1:t+1)
         END WHEN
         LET b=10*b-t !¼¡¤Ø
         LET k=k+1
      LOOP
   CASE 5 !Á´³Ñ¿ô»ú¤Çɽµ­¤¹¤ë(¡¥£±£²£³)
      LET ww$="¡¥" ! Á´³Ñ¥Ô¥ê¥ª¥É
      DO UNTIL b=0 !¾®¿ô¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç
         LET t=INT(10*b)
         LET ww$=ww$&n3$(t+1:t+1)
         LET b=10*b-t !¼¡¤Ø
      LOOP
   CASE ELSE
   END SELECT
   LET NumberString3$=ww$ !·ë²Ì¤òÊÖ¤¹
END FUNCTION

!!!PRINT NumberString2$(1732050807568877,2) !¢¨1000·å¥â¡¼¥É¡¢Í­Íý¿ô¥â¡¼¥É

PRINT NumberString2$(1234567890.1204,1) !½½Æ󲯻°Àé»ÍÉ´¸Þ½½Ï»Ëü¼·ÀéȬɴ¶å½½¡¦°ìʬÆóÎһͻå
PRINT NumberString2$(1234567890.1204,2) !°í½¦Æõ²¯»²ïô»ÍÉ´¸à½¦Ï»)èß¼·ïôȬɴ¶å½¦¡¦°íʬÆõÎһͻå
PRINT NumberString2$(1234567890.1204,3) !°ìÆ󻰻͸ÞÏ»¼·È¬¶å¡»¡¦°ìÆó¡»»Í
PRINT NumberString2$(1234567890.1204,4) !½½£²²¯£³À飴ɴ£µ½½£¶Ëü£·À飸ɴ£¹½½¡¦£±Ê¬£²ÎÒ£´»å
PRINT NumberString2$(1234567890.1204,5) !£±£²²¯£³£´£µ£¶Ëü£·£¸£¹£°¡¥£±£²£°£´
PRINT
DIM x(4)
FOR p=1 TO 5
   PRINT NumberString2$(PI,p)
NEXT p
PRINT
LET x(1)=5000021007
LET x(2)=.023006
LET x(3)=48130000000
LET x(4)=7.31650080029041875E23 !¢¨1000·å¥â¡¼¥É¡¢Í­Íý¿ô¥â¡¼¥É
FOR p=1 TO 5
   FOR ii=1 TO 4
      PRINT NumberString2$(x(ii),p),
   NEXT ii
   PRINT
NEXT p
END
 

´Á¿ô»ú¤ò¥¢¥é¥Ó¥¢¿ô»ú¤ËÊÑ´¹¤¹¤ë

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ11·î15Æü(Æü)10»þ23ʬ21ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.722[¸µµ­»ö¤Ø]

Á°½Ð¤Î´Ø¿ôNumberString2$(x,p)¤ÎµÕ´Ø¿ô¤È¤·¤Æ¡¢´Á¿ô»ú¤ò¿ôÃͤˤ·¤ÆÊÖ¤¹´Ø¿ô¤Ç¤¹¡£(¹ÔÈÖ¹æ¤Ïºï½ü²Ä)
ÍÍ¡¹¤Ê·Á¼°¤Î´Á¿ô»ú¤òȽÊ̤·¤Þ¤¹¡£°ú¿ô¤Îʸ»úÎó¤Ë¤Ï´Á¿ô»ú¡¢Á´³ÑȾ³Ñ»»ÍÑ¿ô»ú¤¬»È¤¨¤Þ¤¹¡£
¾®¿ôÅÀ¤Ë¤Ï¡¢Á´³ÑȾ³Ñ¤Î¥Ô¥ê¥ª¥É¤ÈÁ´³ÑÃæÅÀ¤¬»È¤¨¤Þ¤¹¡£
¥¨¥é¡¼½èÍý¤Ï½½Ê¬¤Ç¤Ï¤Ê¤¯¡¢¸í¤Ã¤¿Ê¸»úÎó¤Ç¤â¥¨¥é¡¼¤Ë¤Ê¤é¤ºÅ¬Åö¤Ê¿ôÃͤòÊÖ¤·¤Æ¤·¤Þ¤¦¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£

!´Á¿ô»ú¤ò¿ôÃͤËÊÑ´¹¤¹¤ë´Ø¿ô String_to_Num(a$)
10 DIM nk$(4,0 TO 9),f1$(3),f2$(5),ff$(25)
20 DATA £°,£±,£²,£³,£´,£µ,£¶,£·,£¸,£¹  ! nk$
30 DATA ¡»,°ì,Æó,»°,»Í,¸Þ,Ï»,¼·,Ȭ,¶å  ! nk$
40 DATA Îí,°í,Æõ,»²,æè,¸à,Φ,¼¿,»«,¶ê  ! nk$
50 DATA ¡û,Ôå,ìÈ,ÒÔ,£´,£µ,£¶,¼Á,£¸,£¹  ! nk$
60 DATA Àé,É´,½½        ! f1$
70 DATA Ô¶,µþ,Ãû,²¯,Ëü  ! f2$(5)
80 !DATA ³ä,ʬ,ÎÒ,ÌÓ,»å,¹ú,Èù,Á¡,º»,¿Ð,Ô¼,ÞÝ,Çù,ÌϸÒ,íõ½ä,¿ÜçÌ,½Ö©,ÃÆ»Ø,ÑëÆá,Ï»ÆÁ,µõ¶õ,À¶¾ô,°¤ÍêÌí,°¤ËàÍå,ÞºÜѼäÀÅ !³ä¹çɽµ­
90 DATA ʬ,ÎÒ,ÌÓ,»å,¹ú,Èù,Á¡,º»,¿Ð,Ô¼,ÞÝ,Çù,ÌϸÒ,íõ½ä,¿ÜçÌ,½Ö©,ÃÆ»Ø,ÑëÆá,Ï»ÆÁ,µõ¶õ,À¶¾ô,°¤ÍêÌí,°¤ËàÍå,ÞºÜѼäÀÅ !ËÜÍèɽµ­
   ! "Ô¼"°Ê¹ß¤Ï½ôÀ⤢¤ê
100 MAT READ nk$,f1$,f2$
110 FOR i=1 TO 25
120    READ IF MISSING THEN EXIT FOR : ff$(i)
130 NEXT i

140 LET a$="½½¼·²¯¸ÞÀéÆó½½È¬Ëü»°É´»Í½½Ï»" ! NumberString2$(x,p)¤Çp=1¤Î¾ì¹ç
    !LET a$="°í½¦Æõ²¯Ï»èß¼·ïôȬɴ¶å½¦¡¦¸àʬϻÎÒ¼·ÌÓȬ»å" ! p=2
    !LET a$="°ìÆ󻰻͸ÞÏ»¼·È¬¶å¡»¡¦°ìÆó¡»»Í" ! p=3
    !LET a$="£¸É´£³Ëü£¹À飶ɴ½½¡¦£´»å£µ¹ú£¸º»" ! p=4
    !LET a$="£±£²²¯£³£´£µ£¶Ëü£·£¸£¹£°¡¥£±£²£°£´" ! p=5
    !LET a$="3É´2½½4Ëü9Àé5½½7"  ! Ⱦ³Ñ¿ô»ú¤â²Ä
    !LET a$="-420.18"  ! Ä̾ï¤ÎVAL´Ø¿ô¤È¤·¤Æ¤âµ¡Ç½¤¹¤ë
    !LET a$="Ȭʬ»²ÎÒÏ»»å°í¹ú"
    !LET a$="¡¥£·ÎÒ£¸ÌÓ£¹íõ½ä"
    !LET a$="£°.£¶£´£·£´"
    !LET a$="»²¡¦°íʬ»ÍÎÒ°íÌÓ¸à»å¶å¹úÆõÈùÏ»Á¡¸àº»»²¿Ð¸àԼȬÞݶåÇù¼·ÌϸҶåíõ½ä" !¦Ð(10¿Ê15·å¥â¡¼¥É)
    !LET a$=a$&"»²¿ÜçÌÆõ½Ö©»²ÃÆ»ØȬÑëÆá»ÍÏ»ÆÁÏ»µõ¶õÆõÀ¶¾ôÏ»°¤ÍêÌí»Í°¤ËàÍ廲޺ÜѼäÀÅ»²È¬»²Æõ¼·" !¦Ð³¤­(1000·å¥â¡¼¥É)

150 PRINT a$
160 PRINT String_to_Num(a$)

170 FUNCTION String_to_Num(w$)
180    DO
190       LET i=MAX(POS(w$," "),POS(w$,"¡¡"))
200       LET w$(i:i)=""
210    LOOP UNTIL i=0
220    FOR i=1 TO LEN(w$)
230       FOR p=1 TO 4  ! Á´³Ñ¿ô»ú/´Á¿ô»ú¤òȾ³Ñ»»ÍÑ¿ô»ú¤Ë
240          FOR j=0 TO 9
250             IF w$(i:i)=nk$(p,j) THEN LET w$(i:i)=STR$(j)
260          NEXT j
270       NEXT p
280       IF w$(i:i)="ïô" OR w$(i:i)="ÐÂ" THEN LET w$(i:i)="Àé"
290       IF w$(i:i)="ïù" OR w$(i:i)="ÐÑ" THEN LET w$(i:i)="É´"
300       IF w$(i:i)="½¦" THEN LET w$(i:i)="½½"
310    NEXT i
320    LET i=POS(w$,"èß")
330    IF i>0 THEN LET w$(i:i)="Ëü"
340    LET i=POS(w$,"6ÆÁ")
350    IF i>0 THEN LET w$(i:i+1)="Ï»ÆÁ"
360    LET pt=POS(w$,"¡¥")+POS(w$,".")+POS(w$,"¡¦")
370    IF pt>0 THEN
380       LET w$(pt:pt)="."
390       LET len_int=pt-1  ! À°¿ôÉôʸ»ú¿ô
400    ELSE
410       LET len_int=LEN(w$)
420    END IF
       ! print w$
       !
430    WHEN EXCEPTION IN
440       LET num=VAL(w$)
450       LET String_to_Num=num ! "°ìÆ󻰻͸ޡ¦Ï»¼·"(¿ô»ú¤Î¤ß)
460       EXIT FUNCTION
470    USE
480    END WHEN
       !
490    LET num=i_val(w$)  ! À°¿ôÉôÊÑ´¹
       !
500    IF pt>0 THEN
510       LET f$=w$(pt:LEN(w$))
520       WHEN EXCEPTION IN
530          LET num=num+VAL(f$)
540          LET String_to_Num=num ! "£±£²Ëü£³£´£µ£¶¡¥£·£¸"(¾®¿ôÉô¤¬¿ô»ú¤Î¤ß)
550       USE
560          LET String_to_Num=num+f_val(f$(2:LEN(f$))) ! "½½Æ󡦻°Ê¬»ÍÎÒ"(À°¿ô¾®¿ô¤¢¤ê)
570       END WHEN
580    ELSEIF num=0 AND LEN(w$)>=2 THEN
590       LET String_to_Num=f_val(w$) ! "°ìʬÆóÎÒ»°Ìӻͻå"(¾®¿ôÉô¤Î¤ß)
600    ELSE
610       LET String_to_Num=num ! "É´Æó½½»°"(À°¿ôÉô¤Î¤ß)
620    END IF
630 END FUNCTION
    !
640 FUNCTION i_val(w$)  ! À°¿ôÉôÊÑ´¹
650    LET num=0
660    LET k0=1
670    FOR i=1 TO SIZE(f2$)
680       LET k2=POS(w$,f2$(i),k0+1)  ! Ô¶,µþ,Ãû,²¯,Ëü
690       IF k2>0 THEN
700          LET num=num+val1000(w$(k0:k2-1))*10000^(SIZE(f2$)-i+1) ![ÀéÉ´½½°ì]¤Î4·å
710          LET k0=k2+1
720       END IF
730    NEXT i
740    IF k0<=len_int THEN  ! ºÇ²¼°Ì4·å
750       LET num=num+val1000(w$(k0:len_int))
760    END IF
770    LET i_val=num
780 END FUNCTION
    !
790 FUNCTION val1000(aa$)  ! [ÀéÉ´½½°ì]¤Î4·åÊÑ´¹
800    WHEN EXCEPTION IN
810       LET aa=VAL(aa$)
820       LET val1000=aa
830       EXIT FUNCTION
840    USE
850    END WHEN
860    LET aa=0
870    LET kk=1
880    FOR j=1 TO 3
890       LET k1=POS(aa$,f1$(j),kk) ! Àé,É´,½½
900       IF k1>0 THEN
910          WHEN EXCEPTION IN
920             LET aa=aa+VAL(aa$(k1-1:k1-1))*10^(4-j)
930          USE
940             LET aa=aa+10^(4-j)  ! ·¸¿ô"1"¤Î¾Êά»þ(3ÀéÉ´4½½5¤Ê¤É)
950          END WHEN
960          LET kk=k1+1
970       END IF
980    NEXT j
990    IF kk=LEN(aa$) THEN LET aa=aa+VAL(aa$(kk:kk)) ! °ì
1000    LET val1000=aa
1010 END FUNCTION
     !
1020 FUNCTION f_val(f$)  ! ¾®¿ôÉôÊÑ´¹
1030    LET frac=0
1040    LET k0=1
1050    FOR i=1 TO SIZE(ff$)
1060       IF ff$(i)<>"" THEN
1070          LET fd=POS(f$,ff$(i),k0+1)
1080          IF fd>0 THEN
1090             LET frac=frac+VAL(f$(fd-1:fd-1))*10^(-i)
1100             LET k0=fd+LEN(ff$(i))
1110             LET k3=i
1120          END IF
1130       END IF
1140    NEXT i
1150    WHEN EXCEPTION IN
1160       IF k0<=LEN(f$) THEN
1170          LET frac=frac+VAL(f$(k0:LEN(f$)))*10^(-(k3+LEN(f$)-k0+1))
1180       END IF
1190    USE
1200    END WHEN
1210    LET f_val=frac
1220 END FUNCTION
     !
1230 END
 

Ubasic¤«¤é½½¿ÊBASIC¤Ø¤Î¤ª´ê¤¤

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ11·î16Æü(·î)15»þ45ʬ28ÉÃ
ÊÖ¿®¡¦°úÍÑ
  220   point -10:word -40:M=1850:dim C(M):C(0)=1:S=1/2+14#i
250   for K=1 to M:for J=K to 1 step -1:C(J)=(C(J)+C(J-1))/2:next:next
300   ' find zeta zero
330   repeat
350     Z=fnZeta(S):H=Z/S:W=fnZeta(S+H):S+=H/(1-W/Z)
360     print using(8,20),S
380   until abs(Z)<1/10^18
390   end
800   ' zeta function
810   fnZeta(X)
820   local J,U
830   for J=1 to M:U+=(-1)^(J-1)*C(J)/J^X:next:U/=1-2^(1-X)
880   return(U)



¤ÎUbasic¥×¥í¥°¥é¥à¤ò½½¿ÊBASIC¤Ø½ñ¤­Ä¾¤·¤Æ失¤Þ¤»¤ó¤«¡©
 

Re: Ubasic¤«¤é½½¿ÊBASIC¤Ø¤Î¤ª´ê¤¤

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ11·î16Æü(·î)17»þ45ʬ59ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.725[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø

!ľÌõ¤Ç¤¹¡£ÀºÅ٤ϡ¢¤«¤Ê¤êÍî¤Á¤Þ¤¹¡£uBASIC ¤ÎÍ­¸ú·å(Ìó2600·å)

OPTION ARITHMETIC COMPLEX
OPTION BASE 0
!                                 !point -10 !ÊÑ¿ô¤Î¾®¿ôÉô 10*4.8·å  ÀßÄêÉԲġ£
!                                 !word -40  !ÊÑ¿ô¤ÎŤµ   40*4.8·å  ÀßÄêÉԲġ£
LET M=1850                                   !¢¨Ã»¤¯¤Æ¤âÆâÉô·×»»¤Ï¾ï¤Ë2600·å¡£
DIM C(M)
LET C(0)=1
LET S=COMPLEX(1/2,14)             !S=1/2+14#i
FOR K=1 TO M
   FOR J=K TO 1 STEP -1
      LET C(J)=(C(J)+C(J-1))/2
   NEXT J
NEXT K
!' find zeta zero
DO                                !repeat
   LET Z=Zeta(S)                  !Z=fnZeta(S)
   LET H=Z/S
   LET W=Zeta(S+H)                !W=fnZeta(S+H)
   LET S=S+H/(1-W/Z)              !S+=H/(1-W/Z)
   PRINT S                        !print using(8,20),S
   ! PRINT USING "########.#################### ########.####################":re(S),im(S);
   ! PRINT "#i"
LOOP UNTIL ABS(Z)< 1e-12 ! 1e-14  !until abs(Z)< 1/10^18  !½½¿ÊBASIC¤Ç ^18¤Ï̵Íý¡£
STOP                              !END

!' zeta function
FUNCTION Zeta(X)                  !fnZeta(X) ¢¨'fn'¤Ï¡¢¥æ¡¼¥¶¡¼ÄêµÁ´Ø¿ô ÀÜƬ¸ì
   local J,U
   FOR J=1 TO M
      LET U=U+(-1)^(J-1)*C(J)/J^X !U+=(-1)^(J-1)*C(J)/J^X
   NEXT J
   LET U=U/(1-2^(1-X))            !U/=1-2^(1-X)
   LET Zeta=U                     !return(U)
END FUNCTION

END

! uBASIC ¤Ç¤Î¼Â¹Ô·ë²Ì¡£
!run
!       0.50758974993024427495     +14.13558444989598483799#i
!       0.49997720386661645733     +14.13471625740151952033#i
!       0.49999999984206884658     +14.13472514154016738957#i
!       0.50000000000000000001     +14.13472514173469379043#i
!       0.50000000000000000000     +14.13472514173469379046#i
!OK
 

Re: Ubasic¤«¤é½½¿ÊBASIC¤Ø¤Î¤ª´ê¤¤

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ11·î17Æü(²Ð)10»þ33ʬ24ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.725[¸µµ­»ö¤Ø]

1000·å¥â¡¼¥É¤Ç¼Â¹Ô¤Ç¤­¤ë¤è¤¦¤Ë¤·¤Þ¤·¤¿¡£
Ê£ÁÇ¿ô¤Ï¼ÂÉô¤ÈµõÉô¤òʬ¤±¤Æ·×»»¤·¤Æ¤¤¤Þ¤¹¡£Ä¶±Û´Ø¿ô¤Ï50·å¤ÎÀºÅ٤Ƿ׻»¤·¤Æ¤¤¤Þ¤¹¡£

·ë²Ì
        .50844135172596863716       14.13022666245748735689
        .49997302379385895921       14.13474225141619583149
        .49999999977346757559       14.13472514196906007421
        .50000000000000000000       14.13472514173469379049
        .50000000000000000000       14.13472514173469379046
745 ÉÃ

OPTION ARITHMETIC DECIMAL_HIGH
220 ! point -10:word -40
    DECLARE EXTERNAL FUNCTION LOG,EXP
    DECLARE FUNCTION SIN,COS
    PUBLIC NUMERIC prec
    print time$
    LET t0=time
    LET prec=50 ! ÀºÅÙ
    LET M=1850
    DIM C(0 TO M),L(M),inv_fac(0 TO prec+1),S(2),Z(2),H(2),W(2),SH(2)
    LET C(0)=1
    LET S(1)=1/2
    LET S(2)=14
250 for K=1 to M
       LET L(K)=LOG(K)
       for J=K to 1 step -1
          LET C(J)=(C(J)+C(J-1))/2 ! C(K)=2^(-K)?
       next J
    next K
    LET inv_fac(0)=1 ! ³¬¾è¤ÎµÕ¿ô
    FOR i=1 TO prec+1
       LET inv_fac(i)=inv_fac(i-1)/i
    NEXT i
300 !' find zeta zero
330 DO ! repeat
350    CALL fnZeta(S,Z)
       LET H(1)=(Z(1)*S(1)+Z(2)*S(2))/(S(1)^2+S(2)^2) ! H=Z/S
       LET H(2)=(Z(2)*S(1)-Z(1)*S(2))/(S(1)^2+S(2)^2)
       MAT SH=S+H
       CALL fnZeta(SH,W) ! W=fnZeta(S+H)
       LET SH(1)=1-(W(1)*Z(1)+W(2)*Z(2))/(Z(1)^2+Z(2)^2)
       LET SH(2)=-(W(2)*Z(1)-W(1)*Z(2))/(Z(1)^2+Z(2)^2)
       LET S(1)=S(1)+(H(1)*SH(1)+H(2)*SH(2))/(SH(1)^2+SH(2)^2) ! S+=H/(1-W/Z)
       LET S(2)=S(2)+(H(2)*SH(1)-H(1)*SH(2))/(SH(1)^2+SH(2)^2)
360    print using "-"&REPEAT$("#",7)&"."&REPEAT$("#",20)&" -"&REPEAT$("#",7)&"."&REPEAT$("#",20):S(1),S(2)
380 LOOP until SQR(Z(1)^2+Z(2)^2)<1/10^18
    print int(time-t0);"ÉÃ"
390 !¡¡end
800 !' zeta function
810 SUB fnZeta(X(),U())
820    local J
       MAT U=ZER
830    for J=1 to M
          LET p1=EXP(X(1)*L(J))*COS(X(2)*L(J))
          LET p2=EXP(X(1)*L(J))*SIN(X(2)*L(J))
          LET pp=1/(p1^2+p2^2)
          LET U(1)=U(1)+(-1)^(J-1)*C(J)*p1*pp ! U+=(-1)^(J-1)*C(J)/J^X
          LET U(2)=U(2)-(-1)^(J-1)*C(J)*p2*pp
       next J
       LET p1=1-EXP((1-X(1))*L(2))*COS(-X(2)*L(2))
       LET p2=-EXP((1-X(1))*L(2))*COS(-X(2)*L(2))
       LET pp=1/(p1^2+p2^2)
       LET u1=(U(1)*p1+U(2)*p2)*pp
       LET U(2)=(U(2)*p1-U(1)*p2)*pp ! U/=1-2^(1-X)
       LET U(1)=u1
880 END SUB ! return(U)
    !
    FUNCTION SIN(x)
       LET x=MOD(x,2*PI)
       LET sum=0
       FOR i=0 TO prec/2
          LET sum=sum+(-1)^i*x^(2*i+1)*inv_fac(2*i+1)
       NEXT i
       LET SIN=sum
    END FUNCTION
    FUNCTION COS(x)
       LET x=MOD(x,2*PI)
       LET sum=0
       FOR i=0 TO prec/2
          LET sum=sum+(-1)^i*x^(2*i)*inv_fac(2*i)
       NEXT i
       LET COS=sum
    END FUNCTION
END
!
! 1000·å¥â¡¼¥É¤ÇÍøÍѤ¹¤ëÂпô´Ø¿ô(½½¿ÊBASICźÉÕ"\BASICw32\Library\log.LIB"»²¾È)
EXTERNAL FUNCTION LOG(x)
    OPTION ARITHMETIC DECIMAL_HIGH
    IF x<=0 THEN
       CAUSE EXCEPTION 3004
    ELSEIF x<1 THEN
       LET log=-log(1/x)
    ELSEIF x>3 THEN
       LET log=2*log(SQR(x))
    ELSE         ! 1<=x<=3
       LET h=(x-1)/(x+1)   ! 0<=h<=0.5
       LET t=0
       LET n=1
       LET k=h
       LET h2=H^2
       DO
          LET t=t+k/n
          LET n=n+2
          LET k=k*h2
       LOOP UNTIL k<=eps(0)*10^(1000-prec) ! ÀºÅÙprec
       LET log=2*t
    END IF
END FUNCTION
!
! 1000·å¥â¡¼¥É¤ÇÍøÍѤ¹¤ë»Ø¿ô´Ø¿ô(½½¿ÊBASICźÉÕ"\BASICw32\Library\exp.LIB"»²¾È)
EXTERNAL FUNCTION EXP(x)
    OPTION ARITHMETIC DECIMAL_HIGH
    FUNCTION s(y,n)
       LET t=y*x/n
       IF ABS(t)<=EPS(0)*10^(1000-prec) THEN ! ÀºÅÙprec
          LET s=y+t
       ELSE
          LET s=y+s(t,n+1)
       END IF
    END FUNCTION
    LET EXP=s(1,1)
END FUNCTION
 

Re: Ubasic¤«¤é½½¿ÊBASIC¤Ø¤Î¤ª´ê¤¤

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ11·î17Æü(²Ð)11»þ36ʬ42ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.725[¸µµ­»ö¤Ø]

¤ß¤Ê¤µ¤ó¡¢¥ê¡¼¥Þ¥óͽÁۤˤϤޤäƤ¤¤Þ¤¹¤Í¡©¡ª
!¥ê¡¼¥Þ¥ó¤Î¥¼¡¼¥¿´Ø¿ô
!¦Æ(s)=1/(1-2^(1-s))*­ô[m=0,¡ç]{2^(-(m+1))*­ô[j=0,m]{(-1)^j*comb(m,j)*(j+1)^(-s)}}

LET t0=TIME


LET M=50 !1850
DIM C(0 TO M) !­ô2^(-(M+1))*­ôcomb(M,J)
LET C(0)=1
FOR K=1 TO M !¥Ñ¥¹¥«¥ë¤Î»°³Ñ·Á¤ÎMÃʤè¤ê¡¢Æó¹à·¸¿ôcomb(m,j)¤òµá¤á¤ë
   FOR J=K TO 1 STEP -1
      LET C(J)=(C(J)+C(J-1))/2 !¢¨2^(-(m+1))¤â²ÃÌ£¤¹¤ë
   NEXT J
NEXT K
FUNCTION fnZeta(S) !¥ê¡¼¥Þ¥ó¤Î¥¼¡¼¥¿´Ø¿ô
   local J,U
   LET U=0
   FOR J=0 TO M
      LET U=U+(-1)^J*C(J)/(J+1)^S
   NEXT J
   LET U=U/(1-2^(1-S))
   LET fnZeta=U
END FUNCTION


PRINT C(M) !debug

PRINT fnZeta(2) - PI*PI/6


PRINT "·×»»»þ´Ö=";TIME-t0

END

»ä¤â¡¢¼Â¿ô¤ÎÈϰϤǷ׻»¤µ¤»¤Æ¤ß¤Æ¡¢Â¿·å¤ÎÊ£ÁÇ¿ô·×»»¤Î¼ÂÁõ¤ò¹Í¤¨¤è¤¦¤È¤·¤¿¤Î¤Ç¤¹¤¬¡¢
¹ÓÅĹÀÆ󤵤󤬤¹¤Ç¤ËÃå¼ê¤µ¤ì¤¿¤è¤¦¤Ç¡¢¡¢¡¢

1000·å¥â¡¼¥É¤Ç¤ÏÆó¹à·¸¿ô¤òµá¤á¤ë¤Î¤Ë¡¢¶ìÀ路¤Æ¤¤¤ë¤è¤¦¤Ç»þ´Ö¤¬¤«¤«¤Ã¤Æ¤¤¤Þ¤¹¡£

10¿Ê¥â¡¼¥É¤ä2¿Ê¥â¡¼¥É¤äÊ£ÁÇ¿ô¥â¡¼¥É¤Î£±£··åÄøÅ٤Ǥϡ¢M=50¤Ç½½Ê¬¤Ç¤·¤ç¤¦¡£
£µ£°·åÀºÅ٤ξì¹ç¤Ï¡¢M=100¤Ç½½Ê¬¤Ç¤·¤ç¤¦¡£
 

Âè2·Ç¼¨ÈÄÅê¹Æµ­»ö¥ê¥¹¥È¤Î¥¹¥ì¥Ã¥ÉºîÀ®

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ11·î19Æü(ÌÚ)11»þ50ʬ30ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ¥¹¥ì¥Ã¥É¤¬»È¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¤Î¤Ç¡¢Âè2·Ç¼¨ÈĤÎÅê¹Æµ­»ö¥ê¥¹¥È¤òºîÀ®¤·¤Þ¤·¤¿¡£
Åê¹Æµ­»ö¤Î¸Å¤¤½ç¤Ëʤ٤¿¥ê¥¹¥È¤Ç¤¹¡£
¥¿¥¤¥È¥ëÉôʬ¤ò¥¯¥ê¥Ã¥¯¤¹¤ì¤Ð¡¢¤½¤ÎÅê¹Æµ­»ö¤Ë¥ê¥ó¥¯¤·¤Þ¤¹¡£

·Ç¼¨ÈĤΥ½¡¼¥¹¤ò¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤Ë¤·¡¢²¼¤Î¥×¥í¥°¥é¥à¤ÇÅê¹ÆɽÂêÉôʬ¤òÃê½Ð¤·ºîÀ®¤·¤Þ¤·¤¿¡£

»²¹Í¾ðÊó¡Ä¡Ä¥¹¥ì¥Ã¥É¤Ø¤ÎÅê¹Æµ­»ö¤Ï¡¢Åê¹Æ¼ÔËܿͤǤâ¸å¤«¤éÊÔ½¸¤Ï¤Ç¤­¤Ê¤¤¤è¤¦¤Ç¤¹¡£
ÄûÀµ¡Ä¡Ä¥¹¥ì¥Ã¥É¤Ø¤ÎÅê¹Æµ­»ö¤â¡¢Åê¹Æ¼ÔËܿͤˤè¤ëÊÔ½¸¡¦ºï½ü¤¬²Äǽ¤Ç¤¹¡£

LET t1$="<H2><A NAME=""CID" ! ID No.
LET t1=LEN(t1$)
LET t2$=""" HREF=""http://6317.teacup.com/basic/bbs/" ! ID No.
LET t2=LEN(t2$)
LET t3$=""" CLASS=""Kiji_Title"">" ! ¥¿¥¤¥È¥ë
LET t3=LEN(t3$)
LET t4$="</A></H2>"
LET t4=LEN(t4$)
!
LET p1$="&nbsp;Åê¹Æ¼Ô¡§<SPAN CLASS=""Kiji_Author"">" ! Åê¹Æ¼Ô
LET p1=LEN(p1$)
LET p2$="</SPAN>"
LET p2=LEN(p2$)
LET p3$="<A HREF=" ! mailto
LET p3=LEN(p3$)
LET p4$=""">"
LET p4=LEN(p4$)
LET p5$="</A>"
LET p5=LEN(p4$)
!
LET d1$="&nbsp;Åê¹ÆÆü¡§" ! Åê¹ÆÆü»þ
LET d1=LEN(d1$)
LET d2$="Æü(" ! ÍËÆü
LET d2=LEN(d2$)
!
LET l1$="&gt; <A HREF=""http://6317.teacup.com/basic/bbs/" ! ¸µµ­»ö No.
LET l1=LEN(l1$)
LET l2$=">No." ! ¸µµ­»ö No.
LET l2=LEN(l2$)
LET l3$="[¸µµ­»ö¤Ø]</A><BR><BR>"
LET l3=LEN(l3$)
!
LET finput$="source.txt"
LET foutput$="boardlist.txt"
OPEN #1 : NAME finput$ ,ACCESS INPUT
!
DIM c$(1000)
LET k=0
DO
   LINE INPUT #1 , IF MISSING THEN EXIT DO : a$
   IF a$(1:l1)=l1$ THEN  ! ¸µµ­»ö¤¢¤ê
      LET ps=POS(a$,l2$,l1+1)
      LET ps2=POS(a$,l3$,ps+l2)
      LET s$=s$&" "&a$(ps:ps2-1)
   ELSEIF a$(1:t1)=t1$ THEN
      IF s$<>"" THEN
         LET k=k+1
         LET c$(k)=s$&"</SMALL>"
      END IF
      CALL title
   END IF
LOOP
IF s$<>"" THEN
   LET k=k+1
   LET c$(k)=s$&"</SMALL>"
END IF
CLOSE #1
!
OPEN #2 : NAME foutput$ ,ACCESS OUTPUT
SET #2 : POINTER END
FOR i=k TO 1 STEP -1
   PRINT #2 : c$(i)
NEXT i
CLOSE #2
!
SUB title
   LET s$="<A HREF=""http://6317.teacup.com/basic/bbs/"
   LET id$=a$(t1+1:POS(a$,"""",t1+1)-1)
   LET s$=id$&"  "&s$&id$&"""><B><BIG>"
   LET ps=POS(a$,t3$,t1+2)
   LET ps2=POS(a$,t4$,ps+t3)
   LET s$=s$&a$(ps+t3:ps2-1)&"</BIG></B></A>   Åê¹Æ¼Ô¡§<FONT COLOR=""#555555""><STRONG>"
   LINE INPUT #1 : a$
   IF a$(1:p1)=p1$ THEN
      IF a$(p1+1:p1+p3)=p3$ THEN
         LET s$=s$&a$(POS(a$,p4$,p1+p3+1)+p4:POS(a$,p5$,p1+p3+3)-1)&"</STRONG></FONT><SMALL>"
      ELSE
         LET s$=s$&a$(p1+1:POS(a$,p2$,p1+1)-1)&"</STRONG></FONT><SMALL>"
      END IF
   END IF
   LINE INPUT #1 : a$
   LINE INPUT #1 : a$
   IF a$(1:d1)=d1$ THEN
      LET s$=s$&"   "&a$(d1+1:POS(a$,d2$,d1+2))
   END IF
END SUB
END
 

¤³¤Î¸½¾Ý¤òºÆ¸½¤·¤Æ²¼¤µ¤¤

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ11·î19Æü(ÌÚ)14»þ15ʬ35ÉÃ
ÊÖ¿®¡¦°úÍÑ
  http://web2.incl.ne.jp/yaoki/psychic.swf
¤Çµ¯¤³¤ë¸½¾Ý¤òbasicÈÇ¤Ç¥×¥í¥°¥é¥à¤òÁȤó¤ÇÍߤ·¤¤¤ó¤Ç¤¹¡£
¸¶Íý¤Ï´Êñ¤Ç¤¹¤¬¡¢ºÇ½é¤Ï¤È¤Æ¤â¤Ó¤Ã¤¯¤ê¤·¤Þ¤·¤¿¡£
¤¹¤³¤·¤º¤Ä¼êľ¤·¤·¤Ê¤¬¤é¡¢¤â¤Ã¤ÈÌÌÇò¤¤¤â¤Î¤Ë¤·¤Æ¤¤¤­¤¿¤¤¤Î¤Ç¡¦¡¦¡¦
 

Re: ¤³¤Î¸½¾Ý¤òºÆ¸½¤·¤Æ²¼¤µ¤¤

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ11·î19Æü(ÌÚ)17»þ37ʬ23ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.745[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¡ü¸½¾Ý¤Î³Îǧ
FOR i=10 TO 99 !£²·å¤Î¿ô¤òÇ°¤¸¤ë
   LET a=INT(i/10) !½½¤Î°Ì¤È°ì¤Î°Ì¤Î£²¤Ä¤Î¿ô»ú¤ò­¤¹
   LET b=MOD(i,10) !£²·å¤Î¿ô»ú¤«¤é­¤·¤¿Åú¤¨¤ò°ú¤¯
   LET s=i-(a+b) !Åú¤¨¡¡s=(10*a+b)-(a+b)=9*a¡¡¡è£¹¤ÎÇÜ¿ô

   PRINT i;s !£¹¤ÎÇÜ¿ô¤ÏƱ¤¸¥Þ¡¼¥¯¤Ë¤·¤Æ¡¢¾ï¤Ë¤³¤Î¥Þ¡¼¥¯¤òɽ¼¨¤¹¤ì¤Ð¤è¤¤¡£
   !¤¿¤À¡¢Â¿¾¯¤Ï¤º¤ì¤ë¤è¤¦¤Ë°Û¤Ê¤ë¥Þ¡¼¥¯¤âɽ¼¨¤¹¤ë
NEXT i

END


¡üÀêÀ±½Ñ¤Î¥·¥ó¥Ü¥ë¥Þ¡¼¥¯¤¬É½¼¨¤Ç¤­¤ë¤«
¡¡¥ï¡¼¥×¥íWord¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ì¤Ð¡¢¥Õ¥©¥ó¥ÈWingdings¤Ï¤¢¤ë¤È»×¤¤¤Þ¤¹¡£
RANDOMIZE
SET bitmap SIZE 501,501
SET WINDOW -0.5,10.5,10,-1

LET z$="c" !£¹¤ÎÇÜ¿ô¤ÏƱ¤¸¥Þ¡¼¥¯

!!!SET TEXT font "MSÌÀÄ«",12
FOR y=0 TO 9 !¿ô»ú
   FOR x=0 TO 9
      PLOT TEXT ,AT x,y: STR$(10*y+x)
   NEXT x
NEXT y
SET TEXT font "Wingdings",18 !¢¨Â礭¤µ¤ÏÄ´À°¤¬É¬ÍפǤ¢¤ë
FOR y=0 TO 9 !ÀêÀ±½Ñ¤Î¥·¥ó¥Ü¥ë
   FOR x=0 TO 9
      IF MOD(10*y+x,9)=0 THEN !£¹¤ÎÇÜ¿ô¤Ê¤é
         PLOT TEXT ,AT x+0.3,y+0.3: z$
      ELSE
         PLOT TEXT ,AT x+0.3,y+0.3: CHR$(INT(RND*40)+ORD("T")) !T¡Áz
      END IF
   NEXT x
NEXT y


INPUT PROMPT "²¿¤«Ê¸»ú¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡£":t$ !¥À¥ß¡¼ÆþÎÏ¡ª¡ª¡ª


SET TEXT font "Wingdings",256 !¢¨Â礭¤µ¤ÏÄ´À°¤¬É¬ÍפǤ¢¤ë
SET TEXT JUSTIFY "center","half"
PLOT TEXT ,AT 5,4.5: z$

END
 

Ê£ÁÇ¿ô¤Î·×»»

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ11·î20Æü(¶â)09»þ17ʬ31ÉÃ
ÊÖ¿®¡¦°úÍÑ
  Ê£ÁÇ¿ô¥â¡¼¥É¤ò¥µ¥Ý¡¼¥È¤¹¤ë½½¿ÊBASIC¤Ç¤Ï¡¢¤¢¤Þ¤êɬÍ×À­¤Ï¤Ê¤¤¤È»×¤¤¤Þ¤¹¤¬¡¢
¥¢¥ë¥´¥ê¥º¥à¤ÎÊÙ¶¯¤È¤·¤Æ»²¹Í¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£

¥µ¥ó¥×¥ë¤Ï1000·å¥â¡¼¥É¤Ç¤¹¤¬¡¢¼ý«ȽÄê¤ÎÀºÅÙ¤òÍî¤È¤¹¤³¤È¤Ç¡¢
10¿Ê¤ä2¿Ê¥â¡¼¥É¤Ç¤â¼Â¹Ô¤Ç¤­¤Þ¤¹¡£¤½¤Î¾ì¹ç¤Ï¡¢Ê£ÁÇ¿ô¥â¡¼¥É¤ÈƱ¤¸¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¤¬¡¢¡¢¡¢

¥µ¥ó¥×¥ë¡¡¥ê¡¼¥Þ¥ó¤Î¥¼¡¼¥¿´Ø¿ô¤ÎÎíÅÀ
!Ê£ÁÇ¿ô¤Î·×»»

LET t0=TIME


!¥ê¡¼¥Þ¥ó¤Î¥¼¡¼¥¿´Ø¿ô
!¡¡¦Æ(s)=1/(1-2^(1-s))*­ô[m=0,¡ç]{2^(-(m+1))*­ô[j=0,m]{(-1)^j*comb(m,j)*(j+1)^(-s)}}

LET M=100 !ÀºÅÙ20·åÄøÅÙ¡¡¡¡¢¨ÀºÅÙ1000·åÄøÅ٤ϡ¢3000

DIM C(0 TO M) !­ô2^(-(M+1))*­ôcomb(M,J)
LET C(0)=1
FOR K=1 TO M !¥Ñ¥¹¥«¥ë¤Î»°³Ñ·Á¤ÎMÃʤè¤ê¡¢Æó¹à·¸¿ôcomb(m,j)¤òµá¤á¤ë
   FOR J=K TO 1 STEP -1
      LET C(J)=(C(J)+C(J-1))/2 !¢¨2^(-(m+1))¤â²ÃÌ£¤¹¤ë
   NEXT J
NEXT K
PRINT C(M) !debug

SUB fnZeta(ReS,ImS, ReZ,ImZ) !¥ê¡¼¥Þ¥ó¤Î¥¼¡¼¥¿´Ø¿ô
   local J
   local ReU,ImU,ReT1,ImT1,ReT2,ImT2
   LET ReU=0 !LET U=0
   LET ImU=0
   FOR J=M TO 0 STEP -1
      CALL CompPow(J+1,0, ReS,ImS, ReT1,ImT1) !LET U=U+(-1)^J*C(J)/(J+1)^S
      CALL CompDiv((-1)^J*C(J),0, ReT1,ImT1, ReT2,ImT2)
      CALL CompAdd(ReU,ImU, ReT2,ImT2, ReU,ImU)
   NEXT J
   CALL CompPow(2,0, 1-ReS,-ImS, ReT1,ImT1) !LET fnZeta=U/(1-2^(1-S))
   CALL CompDiv(ReU,ImU, 1-ReT1,ImT1, ReZ,ImZ)
END SUB


!¥¼¡¼¥¿´Ø¿ô¤ÎÎíÅÀ¤Î·×»»¡ÊRiemann zeta zeros¡Ë

LET ReS=1/2 !Èó¼«ÌÀ¤ÊÎíÅÀ¡¡1/2+14*i
LET ImS=14 !1/2+t*i¡¡t=14, 21, 25, 30, 33, 38, 41, 43, 48, 50, ¡Ä ÉÕ¶á

!¥Ë¥å¡¼¥È¥óË¡¤ÇÎíÅÀ¤òµá¤á¤ë
!¡¡sn+1 = sn-¦Æ(sn)/¦Æ'(sn)¡¢¦Æ'(sn)¢â(¦Æ(sn+h)-¦Æ(sn))/h  h¤ÏÈù¾®¤ÊÃͤè¤ê
!¡¡sn+1 = sn-¦Æ(sn)*h/(¦Æ(sn+h)-¦Æ(sn)) = sn+h/(1-¦Æ(sn+h)/¦Æ(sn)) ¤È¤Ê¤ë¡£
!¡¡h=¦Æ(sn)/sn ¤È¤·¤Æ¡¢¼ý«¤ÎȽÄê¤Ë¤Ï¦Æ(s)¤ÎÀäÂÐÃͤò»ÈÍѤ¹¤ë¡£
DO
   CALL fnZeta(ReS,ImS, ReZ,ImZ) !LET Z=fnZeta(S)
   CALL CompDiv(ReZ,ImZ,ReS,ImS, ReH,ImH) !LET H=Z/S
   CALL fnZeta(ReS+ReH,ImS+ImH, ReW,ImW) !LET W=fnZeta(S+H)
   CALL CompDiv(ReW,ImW, ReZ,ImZ, ReT1,ImT1) !LET S=S+H/(1-W/Z)
   CALL CompDiv(ReH,ImH, 1-ReT1,-ImT1, ReT2,ImT2)
   CALL CompAdd(ReS,ImS, ReT2,ImT2, ReS,ImS)

   PRINT USING "####.####################   ####.####################": ReS,ImS !PRINT S
LOOP UNTIL CompABS(ReZ,ImZ)<1/10^18 !LOOP UNTIL ABS(Z)<1/10^18
!¼ý«¤¹¤ë¤Þ¤Ç¡¡¢¨ÀºÅÙ¤ÏÄ´À°¤¬É¬ÍפǤ¢¤ë¡£10¿Ê¥â¡¼¥É¡¢2¿Ê¥â¡¼¥É¤Ç¤Ï1/10^8ÄøÅÙ


PRINT "·×»»»þ´Ö=";TIME-t0

END


!Ê£ÁÇ¿ô¤Î·×»»

EXTERNAL FUNCTION CompRe(x,y) !¼ÂÉô (x+y*i)¡¢x,y¤Ï¼Â¿ô¡¢i¤Ïµõ¿ôñ°Ì
LET CompRe=x
END FUNCTION

EXTERNAL FUNCTION CompIm(x,y) !µõÉô Im(x+y*i)
LET CompIm=y
END FUNCTION

EXTERNAL SUB CompConj(x1,y1, x,y) !¶¦ÌòÊ£ÁÇ¿ô
LET xx=x1
LET yy=-y1
LET x=xx
LET y=yy
END SUB

EXTERNAL FUNCTION CompABS(x,y) !ÀäÂÐÃÍ |x+y*i|
!a'=MAX(ABS(a),ABS(b))¡¢b'=MIN(ABS(a),ABS(b))¤È¤·¤Æ¡¢SQR(a*a+b*b)=a'*SQR(1+(b'/a')^2)¤òµá¤á¤ë¡£
IF x=0 THEN
   LET r=ABS(y)
ELSEIF y=0 THEN
   LET r=ABS(x)
ELSEIF ABS(y)>ABS(x) THEN
   LET t=x/y
   LET r=ABS(y)*SQR(1+t*t)
ELSE
   LET t=y/x
   LET r=ABS(x)*SQR(1+t*t)
END IF
LET CompABS=r
END FUNCTION

EXTERNAL FUNCTION CompARG(x,y) !ÊÐ³Ñ¦È (-¦Ð,¦Ð]
IF x>0 THEN !Â裱¾Ý¸Â¡¢Â裴¾Ý¸Â
   LET r=ATN2(y/x)
ELSE
   IF x<0 THEN
      IF y>=0 THEN !Â裲¾Ý¸Â
         LET r=ATN2(y/x)+PI
      ELSE !Â裳¾Ý¸Â
         LET r=ATN2(y/x)-PI
      END IF
   ELSE !x=0
      IF y>0 THEN !¡ç
         LET r=PI/2
      ELSE
         IF y<0 THEN !-¡ç
            LET r=-PI/2
         ELSE !y=0
            PRINT "ARG´Ø¿ô¤ÏÉÔÄê¤Ç¤¹¡£"
            STOP
         END IF
      END IF
   END IF
END IF
LET CompARG=r
END FUNCTION


!±é»»´ØÏ¢¡¡¤Ù¤­¾è

EXTERNAL SUB CompPow(x1,y1, x2,y2, x,y) !¤Ù¤­¾è (x1+y1*i) ^ (x2+y2*i) ¢ª x+y*i
CALL CompLOG(x1,y1, s,t) !z1^z2=exp(log(z1)*z2)¤è¤ê
CALL CompMul(s,t, x2,y2, a,b)
CALL CompEXP(a,b, x,y)
END SUB


!±é»»´ØÏ¢¡¡»Í§±é»»¡¢´Ø¿ô¤Ê¤É

EXTERNAL SUB CompAdd(x1,y1, x2,y2, x,y) !²Ã»» (x1+y1*i) + (x2+y2*i) ¢ª x+y*i
LET xx=x1+x2 !¼ÂÉô
LET yy=y1+y2 !µõÉô
LET x=xx
LET y=yy
END SUB

EXTERNAL SUB CompSub(x1,y1, x2,y2, x,y) !¸º»» (x1+y1*i) - (x2+y2*i) ¢ª x+y*i
LET xx=x1-x2
LET yy=y1-y2
LET x=xx
LET y=yy
END SUB

EXTERNAL SUB CompMul(x1,y1, x2,y2, x,y) !¾è»» (x1+y1*i) * (x2+y2*i) ¢ª x+y*i
LET xx=x1*x2-y1*y2 !´Ý¤á¸íº¹Âкö
LET yy=x1*y2+y1*x2
LET x=xx
LET y=yy
END SUB

EXTERNAL SUB CompDiv(x1,y1, x2,y2, x,y) !½ü»» (x1+y1*i) / (x2+y2*i) ¢ª x+y*i
IF x2=0 AND y2=0 THEN
   PRINT "£°¤Ç¤Ï³ä¤ì¤Þ¤»¤ó¡£"
   STOP
END IF
IF ABS(x2)>=ABS(y2) THEN !¾å°Ì·å¤¢¤Õ¤ìÂкö
   LET w=y2/x2
   LET tt=x2+y2*w
   LET xx=(x1+y1*w)/tt
   LET yy=(y1-x1*w)/tt
ELSE
   LET w=x2/y2
   LET tt=x2*w+y2
   LET xx=(x1*w+y1)/tt
   LET yy=(y1*w-x1)/tt
END IF
LET x=xx
LET y=yy
END SUB


EXTERNAL SUB CompSQR(x1,y1, x,y) !Ê¿Êýº¬
LET SQRT05=SQR(1/2) !0.707106781186547524
LET r=CompABS(x1,y1) !r=SQR(x1*x1+y1*y1)
LET w=SQR(r+ABS(x1))
IF x1>=0 THEN
   LET x=SQRT05*w
   LET y=SQRT05*y1/w
ELSE
   LET x=SQRT05*ABS(y1)/w
   IF y1>=0 THEN LET y=SQRT05*w ELSE LET y=-SQRT05*w
END IF
END SUB

EXTERNAL SUB CompEXP(x1,y1, x,y) !»Ø¿ô´Ø¿ô
DECLARE EXTERNAL FUNCTION EXP,SIN,COS !´Ø¿ô¤Î¥ª¡¼¥Ð¡¼¥í¡¼¥É
LET t=EXP(x1) !EXP(x+i*y)=EXP(x)*EXP(i*y)=EXP(x)*(COS(y)+i*SIN(y))
LET xx=t*COS(y1)
LET yy=t*SIN(y1)
LET x=xx
LET y=yy
END SUB

EXTERNAL SUB CompLOG(x1,y1, x,y) !Âпô´Ø¿ô
DECLARE EXTERNAL FUNCTION LOG !´Ø¿ô¤Î¥ª¡¼¥Ð¡¼¥í¡¼¥É
LET xx=0.5*LOG(x1*x1+y1*y1) !LOG(r)+i*¦È¡¢-¦Ð<¦È<=¦Ð
LET yy=CompARG(x1,y1)
LET x=xx
LET y=yy
END SUB


!Êä½õ¥ë¡¼¥Á¥ó¡¡¢¨Â¿·å¤Î´Ø¿ô

EXTERNAL FUNCTION ATN2(x) !¥¢¡¼¥¯¥¿¥ó¥¸¥§¥ó¥È (-¦Ð/2,¦Ð/2)
IF x>1 THEN
   LET cSGN=1
   LET x=1/x
ELSEIF x<-1 THEN
   LET cSGN=-1
   LET x=1/x
ELSE
   LET cSGN=0
END IF
LET a=0
FOR i=1500 TO 1 STEP -1 !¢¨·«¤êÊÖ¤·²ó¿ô¤ÏÄ´À°¤¬É¬ÍפǤ¢¤ë
   LET a0=a
   LET a=(i*i*x*x)/(2*i+1 + a)
   IF ABS(a-a0)<=EPS(0) THEN EXIT FOR
NEXT i
IF cSGN>0 THEN
   LET ATN2=PI/2-x/(1+a)
ELSEIF cSGN<0 THEN
   LET ATN2=-PI/2-x/(1+a)
ELSE
   LET ATN2=x/(1+a)
END IF
END FUNCTION


MERGE "EXP.LIB" !»Ø¿ô´Ø¿ô¡¡¢¨µé¿ôŸ³«¤Ç´Ø¿ô¤ò·×»»¤¹¤ë
MERGE "LOG.LIB" !Âпô´Ø¿ô
MERGE "TRIGONOM.LIB" !»°³Ñ´Ø¿ô¡ÊÀµ¸¹¡¤Í¾¸¹¡¤ÀµÀÜ¡Ë
 

Re: Ê£ÁÇ¿ô¤Î·×»»

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ11·î20Æü(¶â)09»þ21ʬ31ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.747[¸µµ­»ö¤Ø]

³¤­¡¡¡¡¢¨É¬Íפ˱þ¤¸¤ÆÄɲ䷤Ƥ¯¤À¤µ¤¤¡£
!±é»»´ØÏ¢¡¡¤Ù¤­¾è¡¢´Ø¿ô¤Ê¤É

EXTERNAL SUB CompPowN(x1,y1, n, x,y) !¤Ù¤­¾è (x1+y1*i) ^ n ¢ª x+y*i
DECLARE EXTERNAL FUNCTION SIN,COS !´Ø¿ô¤Î¥ª¡¼¥Ð¡¼¥í¡¼¥É
LET r=CompABS(x1,y1) !r,¦È
LET th=CompARG(x1,y1)
LET t=r^n !z^n=r^n*(COS(n*¦È)+i*SIN(n*¦È))¡¢r=SQR(x1*x1+y1*y1)
LET x=t*COS(n*th)
LET y=t*SIN(n*th)
END SUB

EXTERNAL SUB CompNPow(n, x1,y1, x,y) !¤Ù¤­¾è n ^ (x1+y1*i) ¢ª x+y*i
DECLARE EXTERNAL FUNCTION LOG !´Ø¿ô¤Î¥ª¡¼¥Ð¡¼¥í¡¼¥É
CALL CompMul(LOG(n),0, x1,y1, a,b) !n^z1=exp(log(n)*z1)¤è¤ê
CALL CompEXP(a,b, x,y)
END SUB


EXTERNAL SUB CompSIN(x1,y1, x,y) !»°³Ñ´Ø¿ô¡¡Àµ¸¹
DECLARE EXTERNAL FUNCTION EXP,SIN,COS !´Ø¿ô¤Î¥ª¡¼¥Ð¡¼¥í¡¼¥É
!sin(x+yi)
!={exp(x*i-y)-exp(-x*i+y)}/(2*i)¡¡ ¢¨sin(z)=(exp(i*z)-exp(-i*z))/(2*i)¤è¤ê
!={exp(-y)*(cos(x)+i*sin(x))-exp(y)*(cos(x)-i*sin(x))}/(2*i)¡¡¢¨exp(i*x)=cos(x)+i*sin(x)¤è¤ê
!={(exp(y)-exp(-y))*(-cos(x)) + (exp(y)+exp(-y))*sin(x)*i}/(2*i)
!={(exp(y)-exp(-y))*cos(x)*i + (exp(y)+exp(-y))*sin(x)}/2

LET e=EXP(y1)
LET f=1/e
LET yy=0.5*(e-f)*COS(x1)
LET xx=0.5*(e+f)*SIN(x1)
LET x=xx
LET y=yy
END SUB

EXTERNAL SUB CompCOS(x1,y1, x,y) !»°³Ñ´Ø¿ô¡¡Í¾¸¹
DECLARE EXTERNAL FUNCTION EXP,SIN,COS !´Ø¿ô¤Î¥ª¡¼¥Ð¡¼¥í¡¼¥É
LET e=EXP(y1) !(exp(i*z)+exp(-i*z))/2
LET f=1/e
LET yy=0.5*(f-e)*SIN(x1)
LET xx=0.5*(f+e)*COS(x1)
LET x=xx
LET y=yy
END SUB

EXTERNAL SUB CompTAN(x1,y1, x,y) !»°³Ñ´Ø¿ô¡¡ÀµÀÜ
DECLARE EXTERNAL FUNCTION EXP,SIN,COS !´Ø¿ô¤Î¥ª¡¼¥Ð¡¼¥í¡¼¥É
LET e=EXP(2*y1)
LET f=1/e
LET d=COS(2*x1)+0.5*(e+f)
LET x=SIN(2*x1)/d
LET y=(e-f)/d
END SUB

!µÕ»°³Ñ´Ø¿ô
!¡¡ArcSin(z)=-i*LOG(SQR(1-z^2)+z*i)
!¡¡ArcCos(z)=-i*LOG(z+i*SQR(1-z^2))
!¡¡ArcTan(z)=i/2*LOG((i+z)/(i-z))


EXTERNAL SUB CompSinh(x1,y1, x,y) !ÁжÊÀþÀµ¸¹
DECLARE EXTERNAL FUNCTION EXP,SIN,COS !´Ø¿ô¤Î¥ª¡¼¥Ð¡¼¥í¡¼¥É
LET e=EXP(x1)
LET f=1/e
LET xx=0.5*(e-f)*COS(y1)
LET yy=0.5*(e+f)*SIN(y1)
LET x=xx
LET y=yy
END SUB

EXTERNAL SUB CompCosh(x1,y1, x,y) !ÁжÊÀþ;¸¹
DECLARE EXTERNAL FUNCTION EXP,SIN,COS !´Ø¿ô¤Î¥ª¡¼¥Ð¡¼¥í¡¼¥É
LET e=EXP(x1)
LET f=1/e
LET xx=0.5*(e+f)*COS(y1)
LET yy=0.5*(e-f)*SIN(y1)
LET x=xx
LET y=yy
END SUB

EXTERNAL SUB ComppTanh(x1,y1, x,y) !ÁжÊÀþÀµÀÜ
DECLARE EXTERNAL FUNCTION EXP,SIN,COS !´Ø¿ô¤Î¥ª¡¼¥Ð¡¼¥í¡¼¥É
LET e=EXP(2*x1)
LET f=1/e
LET d=0.5*(e+f)+COS(2*y1)
LET y=SIN(2*y1)/d
LET x=0.5*(e-f)/d
END SUB
 

Re: ¤³¤Î¸½¾Ý¤òºÆ¸½¤·¤Æ²¼¤µ¤¤

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ11·î20Æü(¶â)10»þ59ʬ13ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.746[¸µµ­»ö¤Ø]

½½¿ÊBASIC¤Ç°·¤¨¤ëȾ³Ñʸ»ú¤Ç¤¹¡£¥Õ¥©¥ó¥È¤òÀÚ¤êÂؤ¨¤ë¤³¤È¤Ç³¨Ê¸»ú¤¬É½¼¨¤Ç¤­¤Þ¤¹¡£
ÅÐÏ¿¤µ¤»¤Æ¤¤¤ë¥Õ¥©¥ó¥È¤Ë°Í¸¤·¤Þ¤¹¡£
!ASCII,JIS¥³¡¼¥Éɽ

SET bitmap SIZE 501,501
SET WINDOW -1.5,16.5,16,-2

FOR i=0 TO 15 !¹ÔÈÖ¹æ
   PLOT TEXT ,AT -1,i: BSTR$(i,16)
NEXT i
FOR i=0 TO 15 !ÎóÈÖ¹æ
   PLOT TEXT ,AT i,-1: BSTR$(i,16)
NEXT i

SET TEXT COLOR 4
FOR c=32 TO 255 !ʸ»ú¤Îɽ¼¨
   WHEN EXCEPTION IN
      PLOT TEXT ,AT MOD(c,16),INT(c/16): CHR$(c)
   USE
      PRINT c !»ÈÍÑÉԲĥ³¡¼¥É¡¡¢¨MS´Á»ú¡Ê2¥Ð¥¤¥Èʸ»ú¡Ë¤ÎÀèƬ
   END WHEN
NEXT c

SET TEXT font "Wingdings",12
!SET TEXT font "symbol",12
SET TEXT COLOR 1
FOR c=32 TO 255 !¥Õ¥©¥ó¥È¤Îɽ¼¨
   WHEN EXCEPTION IN
      PLOT TEXT ,AT MOD(c,16)+0.2,INT(c/16)+0.4: CHR$(c)
   USE
      PRINT c
   END WHEN
NEXT c

END
 

!£²³¬ÈùʬÊýÄø¼°¤Î¡¢¥ë¥ó¥²¥¯¥Ã¥¿ÉÁ²è¡£

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ11·î21Æü(ÅÚ)09»þ27ʬ17ÉÃ
ÊÖ¿®¡¦°úÍÑ
  !£²³¬ÈùʬÊýÄø¼°¤Î¡¢¥ë¥ó¥²¥¯¥Ã¥¿ÉÁ²è¡£

!¥Ù¥Ã¥»¥ë¤ÎÈùʬÊýÄø¼°¤Î¾ì¹ç¡£

!x^2*(d2y/dx2)+x*(dy/dx)+(x^2-a^2)*y=0 ¡Ä¥Ù¥Ã¥»¥ë
!x^2*(d2y/dx2)+x*(dy/dx)-(x^2+a^2)*y=0 ¡ÄÊÑ·Á¥Ù¥Ã¥»¥ë
!-------------------------------
OPTION ARITHMETIC NATIVE
OPTION BASE 0
SET TEXT background "opaque"
DIM col(4), y0(4)
MAT READ col
DATA 4,10,2,14, 12 ! £°¼¡ ¡Á£´¼¡¤Î¿§Ê¬¤±
!-----------------------------------------------------------------------
!0Çò 1¹õ   2ÀÄ      3 ÎР     4ÀÖ    5¿å ¿§    6²« ¿§        7ÀÖ»ç
!    8³¥¿§ 9Ç»¤¤ÀÄ 10Ç»¤¤ÎÐ 11ÀÄÎÐ 12¤¨¤ÓÃã 13¥ª¥ê¡¼¥Ö¿§ 14Ç»¤¤»ç 15¶ä¿§
!-----------------------------------------------------------------------

SUB Dji( oddy,ody, iddy,idy,y)
   LET oddy=-( x*idy +(sj*x^2-a^2)*y)/x^2 ! ddy=(d2y/dx2) :sj=1(¥Ù¥Ã¥»¥ë)
   LET ody=-(x^2*iddy+(sj*x^2-a^2)*y)/x   ! dy=  (dy/dx)  :sj=-1(ÊÑ·Á¥Ù¥Ã¥»¥ë)
END SUB

SUB RungeKutta
   CALL Dji( oddy1,ody1, iddy, idy, y)
   CALL Dji( oddy2,ody2, iddy, idy+oddy1*dx/2, y+ody1*dx/2)
   CALL Dji( oddy3,ody3, iddy, idy+oddy2*dx/2, y+ody2*dx/2)
   CALL Dji( oddy4,ody4, iddy, idy+oddy3*dx  , y+ody3*dx  )
   LET  y=y+(ody1+2*ody2+2*ody3+ody4)*dx/6
   LET idy=idy+(oddy1+2*oddy2+2*oddy3+oddy4)*dx/6
   LET iddy=oddy4
END SUB

LET dx=.0005               !pitch
LET y0(0)=1                !£ù¤Î½é´üÃÍ
LET y0(1)= 0.708248*dx
LET y0(2)=-1.2017  *dx^2
LET y0(3)=-0.015   *dx^3
LET y0(4)= 0.00615 *dx^4
!-----
LET sj=-1
LET m$="ÊÑ·Á"
CALL window_
CALL Rk_bessel  !ÊÑ·Á¥Ù¥Ã¥»¥ë¤ÎÈùʬÊýÄø¼°( ¥ë¥ó¥²¥¯¥Ã¥¿ÉÁ²è )
CALL fn_bessel  !ÊÑ·Á¥Ù¥Ã¥»¥ë´Ø¿ô£±¼ï In(x)
WAIT DELAY 2
!-----
LET sj=1
LET m$=""
CALL window_
CALL Rk_bessel  !  ¥Ù¥Ã¥»¥ë¤ÎÈùʬÊýÄø¼°( ¥ë¥ó¥²¥¯¥Ã¥¿ÉÁ²è )
CALL fn_bessel  !  ¥Ù¥Ã¥»¥ë´Ø¿ô£±¼ï Jn(x)

SUB window_
   CLEAR
   IF sj=1 THEN  !----¥Ù¥Ã¥»¥ë
      LET h=1
      LET l=-1
      LET xr=20
      SET WINDOW -3,xr, l, h
      DRAW grid(xr/4,h/5)
   ELSEIF sj=-1 THEN  !----ÊÑ·Á¥Ù¥Ã¥»¥ë
      LET h=4
      LET l=-1.5
      LET xr=4
      SET WINDOW -0.3,xr, l, h
      DRAW grid(xr/8,h/8)
   END IF
   ASK PIXEL SIZE(0,0;xr,0) px,py
   LET ss=Xr/px
END SUB

!-------------------- ÈùʬÊýÄø¼°¤Î¥ë¥ó¥²¥¯¥Ã¥¿ÉÁ²è
SUB Rk_bessel
   SET TEXT COLOR 4
   PLOT TEXT,AT (.325+.225*sj)*xr,.9*h-(.2-.04*sj)*(h-l) :"¥ë¥ó¥²¥¯¥Ã¥¿ÉÁ²è"
   FOR a=0 TO 4
      LET y=y0(a)
      LET idy=0
      LET iddy=0
      SET LINE COLOR "gray" !col(a+4)
      SET TEXT COLOR "gray" !col(a+4)
      PLOT TEXT,AT .1*xr,.9*h-.04*(h-l)*a :m$& "¥Ù¥Ã¥»¥ë¤ÎÈùʬÊýÄø¼° "& STR$(a)& "¼¡"
      !------------
      FOR x=dx TO xr+dx STEP dx
         PLOT LINES: x,y; ! PEN-on
         IF FP(x)< dx THEN PRINT USING"##.## ###.######":x,y
         CALL RungeKutta
      NEXT x
      !------------
      PLOT LINES !PEN-off
      PRINT
   NEXT a
END SUB

!********************* ²ò¤Î¥Ù¥Ã¥»¥ë´Ø¿ô¤ò½Å¤Í¤Æ¾È¹ç¤¹¤ë¡£
SUB fn_bessel
   SET TEXT COLOR 1
   PLOT TEXT,AT (.325+.225*sj)*xr,.9*h-(.2-.04*sj)*(h-l) :"´Ø¿ô¤Ç¡¢½Å¤Í½ñ¤­"
   FOR n=0 TO 4
      SET LINE COLOR col(n)
      SET TEXT COLOR col(n)
      PLOT TEXT,AT .1*xr,.9*h-.04*(h-l)*n :m$& "¥Ù¥Ã¥»¥ë´Ø¿ô£±¼ï "& STR$(n)& "¼¡¡¡¡¡"
      !------------²èÁÇ´Ö³Ö¤ÎStep
      FOR x=dx TO xr+ss STEP ss
         PLOT LINES: x,bessel(n,x); ! PEN-on
         IF FP(x)< ss AND dx< x THEN PRINT USING"##.## ###.######":IP(x),bessel(n,IP(x))
      NEXT x
      !------------
      PLOT LINES !PEN-off
      PRINT
   NEXT n
END SUB

!------- ¥Ù¥Ã¥»¥ë´Ø¿ô¡¡ÊÑ·Á¥Ù¥Ã¥»¥ë´Ø¿ô
FUNCTION bessel(n,x)
   LET m=2*INT( (6+MAX(n,1.5*ABS(x))+9*1.5*ABS(x)/(1.5*ABS(x)+2))/2)
   LET w=0
   IF sj=1 THEN      !---- ¥Ù¥Ã¥»¥ë´Ø¿ô Jn(x)
      FOR k=1 TO m/2
         LET w=w+Tk(k*2,x)
      NEXT k
      LET bessel=Tk(n,x)/(Tk(0,x)+2*w)
   ELSEIF sj=-1 THEN !---- ÊÑ·Á¥Ù¥Ã¥»¥ë´Ø¿ô In(x)
      FOR k=1 TO m
         LET w=w+Tk(k,x)
      NEXT k
      LET bessel=EXP(x)*Tk(n,x)/(Tk(0,x)+2*w)
   END IF
END FUNCTION

FUNCTION Tk(i,x)
   LET t2=0
   LET t1=1e-9
   LET t0=2*(m+1)/x*t1-sj*t2
   FOR kp1=m TO i+1 STEP -1
      LET t2=t1
      LET t1=t0
      LET t0=2*kp1/x*t1-sj*t2
   NEXT kp1
   LET Tk=t0
END FUNCTION

END
 

¤Á¤ç¤Ã¤ÈÉÔ»×µÄ

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ11·î22Æü(Æü)23»þ23ʬ1ÉÃ
ÊÖ¿®¡¦°úÍÑ
  LET s=0
FOR  k=1 TO 100
   LET s=s+1/k^2
   LET t=s+1/k
   PRINT USING "#.##########" : s;
   PRINT USING "####.##########" : t
NEXT K
END



!S¤ÏñĴÁý²Ã¤Ç¤¢¤ë¤Î¤ËÂФ·¡¢T¤¬Ã±Ä´¸º¾¯¤Ç¤¢¤ë¤Î¤¬¤Ê¤ó¤«ÉԻ׵Ĥ˴¶¤¸¤Æ¤·¤Þ¤¦¡©
 

¹­µÁÀÑʬ¤Î·×»»¤Î¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ11·î22Æü(Æü)23»þ33ʬ53ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¢é0¡Á¡ç¡Êe^(-t)/(1-e^(-t))-e^(-t)/t)dt
¤Î·×»»¤ò¤¹¤ë¤Î¤Ï¡¢¤É¤¦¤ä¤Ã¤¿¤é¤¤¤¤¤«¶µ¤¨¤Æ¤¯¤À¤µ¤¤¡£
 

Re: ¹­µÁÀÑʬ¤Î·×»»¤Î¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ11·î23Æü(·î)10»þ37ʬ28ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.752[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¿ôÃÍÀÑʬ
¡¡0.5772156649015328606¡Ä¡¡¥ª¥¤¥é¡¼¤ÎÄê¿ô¦Ã

!Ⱦ̵¸Â¶è´ÖÀÑʬ¡¡¢é[0,¡ç]{EXP(-x)*f(x)}dx
DEF F(X)=1/(1-EXP(-X)) - 1/X
LET S=0
FOR I=1 TO 20
   READ X,W
   LET  S=S+W*F(X)
NEXT I
PRINT S
DATA   .0705398896919888, 1.6874680185111386E-01 !¥¬¥¦¥¹¡¦¥é¥²¡¼¥ë§¤Î·¸¿ô¡ÊʬÅÀ¡¢½Å¤ß¡Ë
DATA   .3721268180016114, 2.9125436200606828E-01 !£²£°¼¡¥é¥²¡¼¥ë¿¹à¼°¤è¤ê
DATA   .9165821024832736, 2.6668610286700129E-01
DATA  1.7073065310283439, 1.6600245326950684E-01
DATA  2.7491992553094321, 7.4826064668792371E-02
DATA  4.0489253138508869, 2.4964417309283221E-02
DATA  5.6151749708616165, 6.2025508445722368E-03
DATA  7.4590174536710633, 1.1449623864769082E-03
DATA  9.5943928695810968, 1.5574177302781197E-04
DATA 12.0388025469643163, 1.5401440865224916E-05
DATA 14.8142934426307400, 1.0864863665179824E-06
DATA 17.9488955205193760, 5.3301209095567148E-08
DATA 21.4787882402850110, 1.7579811790505820E-09
DATA 25.4517027931869055, 3.7255024025123209E-11
DATA 29.9325546317006120, 4.7675292515781905E-13
DATA 35.0134342404790000, 3.3728442433624384E-15
DATA 40.8330570567285711, 1.1550143395003988E-17
DATA 47.6199940473465021, 1.5395221405823436E-20
DATA 55.8107957500638989, 5.2864427255691578E-24
DATA 66.5244165256157538, 1.6564566124990233E-28
END
 

¤³¤ì¤¬¤½¤¦¤À¤Ã¤¿¤Î¤«¡ª

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ11·î23Æü(·î)21»þ05ʬ4ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¤³¤ó¤ÊÀÑʬ¤ÎÃͤò¥×¥í¥°¥é¥à¤Ç·×»»¤µ¤»¤ëÍýÏÀ¤¬Gauss-Laguerre¸ø¼°¤Ç¡¢Â¾¤Î¥¿¥¤¥×¤Ë¤Ï
Gauss-Legendre¸ø¼°¤äGauss-Hermite¸ø¼°¡¢¤Ê¤É¤â¤¢¤ê¡¢¤½¤ì¤¾¤ì¤Î¿¹à¼°¤ÎÎíÅÀ¤ÈŬÅö¤Ê½Å¤ß´Ø¿ô¤È¤ÎÁȤ߹ç¤ï¤»¤ÇÄêÀÑʬ¤ÎÃͤò¿ôÃÍÀÑʬ¤Ç¤­¤ë¤³¤È¤òÃΤê¤Þ¤·¤¿¡£
¡Ê̾Á°¤Ïʹ¤¤¤¿¤³¤È¤Ï¤¢¤ê¤Þ¤·¤¿¤¬¡¢¤³¤ì¤¬¤¤¤Ä¤É¤ó¤Ê¾ìÌ̤ǻȤ¦¤â¤Î¤«¸¡Æ¤¤â¤Ä¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£¤³¤ÎÎã¤Ç½é¤á¤Æ¤½¤ì¤¬²¿¤¿¤ë¤Î¤«¤¬¡¢¤ª¤Ü¤í¤²¤Ë´¶¤¸¤ë¤³¤È¤¬¤Ç¤­¤Þ¤·¤¿¡£¡Ë
ÀìÌç²È¤ÎÊý¤Ë¤È¤Ã¤Æ¤Ï¾ï¼±Åª¤Ê»ö¤«¤â¤·¤ì¤Þ¤»¤ó¤¬¡¢»ä¤Ë¤È¤Ã¤Æ¤Ï¥°¥Ã¤ÈÀ¤³¦¤¬¹­¤¬¤Ã¤¿´¶³Ð¤Ç¤·¤¿¡£
¤½¤ì¤Ë¤·¤Æ¤â¡¢¥³¥ó¥Ô¥å¡¼¥¿¤¬½Ð¸½¤¹¤ëÍÚ¤«Á°¤«¤é¤½¤Î·×»»¼êÃʤò¹Í¤¨¤Ä¤¤¤Æ¤¤¤ëÀè¿Í¤ÎÃηäÎÀ¨¤µ¤Ë¶Ãò¤·¤Þ¤¹¡£
¤Ä¤Þ¤é¤Ê¤¤¼ÁÌä¤Ë¤âÃúÇ«¤ËÂбþ¤·¤Æ¤â¤é¤¨¤Æ¤¤¤Ä¤â¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£

http://¸ø¼°

 

Re: ¥»¥ó¥¿¡¼»î¸³ÄøÅÙ¤Î¥×¥í¥°¥é¥à±é½¬

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ11·î24Æü(²Ð)11»þ33ʬ59ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.721[¸µµ­»ö¤Ø]

¥¤¥ë¥ß¥Í¡¼¥·¥ç¥ó¡ÊÅžþ¡Ë¤Îµ¨Àá¤Ë¤Ê¤ê¤Þ¤·¤¿¡£¡¡¤½¤³¤Ç¡¢£Î¸Ä¤ÎÅŵå¤ÇÍ·¤ó¤Ç¤ß¤Þ¤·¤ç¤¦¡£
!£Î¸Ä¤ÎÅŵå

!£±¡Á£Î¤ÎÈÖ¹æ¤ÎÉÕ¤¤¤¿Åŵ夬¤¢¤ë¡£
!³ÆÅŵå¤Ë¤Ï¥¹¥¤¥Ã¥Á¤¬¤¢¤ê¡¢ÅÀÅô¡¿¾ÃÅô¡ÊON/OFF¡Ë¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
!1¡å£é¡å£Î¤ËÂФ·¤Æ¡¢£é²óÌܤˣé¤ÎÇÜ¿ô¤ÎÅŵå¤ÎÅÀÅô¡¿¾ÃÅô¡ÊON/OFF¡Ë¤µ¤»¤ë¡£
!¤¹¤Ù¤Æ¾ÃÅô¤Î¾õÂÖ¤«¤é»Ï¤á¤Æ¡¢ºÇ¸å¤ËÅÀÅô¡ÊON¡Ë¤·¤Æ¤¤¤ëÅŵå¤Î¿ô¤Ï¡©

!ÇÜ¿ô¡¢Ìó¿ô¤Î¸Ä¿ô¡¢¥¨¥é¥È¥¹¥Æ¥Í¥¹¤ÎäÁ¡¢ÁÇ¿ô

SET bitmap SIZE 601,601
SET WINDOW -1,50,50,-1

LET N=2009 !¸Ä¿ô

DIM A(N)
MAT A=ZER !Á´¾ÃÅô¡¡¢ÍÇÜ¿ô¡¢Ìó¿ô¤Î¸Ä¿ô
!!!MAT A=CON !Á´ÅÀÅô¡¡¢Í¥¨¥é¥È¥¹¥Æ¥Í¥¹¤ÎäÁ¡¢ÁÇ¿ô

FOR i=1 TO N !£é²óÌÜ

   FOR k=1 TO N !ÇÜ¿ô¤Ë¤¢¤¿¤ëÅŵå¤ËÂФ·¤Æ
      LET t=k*i
      IF t>N THEN EXIT FOR

      LET A(t)=MOD(A(t)+1,2) !ÅÀÅô¡¿¾ÃÅô
      !!!LET A(t)=A(t)+1 !¥«¥¦¥ó¥¿¡¡¢ÍÌó¿ô¤Î¸Ä¿ô
      !!!LET A(t)=0 !¾ÃÅô¤Î¤ß¡¡¢Í¥¨¥é¥È¥¹¥Æ¥Í¥¹¤ÎäÁ¡¢ÁÇ¿ô
   NEXT k

   !MAT PRINT A; !debug
   SET DRAW mode hidden !¤Á¤é¤Ä¤­Ëɻ߳«»Ï
   CLEAR
   FOR p=0 TO N-1
      IF A(p+1)=1 THEN
         DRAW disk WITH SCALE(0.5)*SHIFT(MOD(p,50),INT(p/50))
      ELSE
         DRAW circle WITH SCALE(0.5)*SHIFT(MOD(p,50),INT(p/50))
      END IF
   NEXT p
   PLOT TEXT ,AT 2,48: STR$(i)&"¤ÎÇÜ¿ô"
   SET DRAW mode explicit !¤Á¤é¤Ä¤­Ëɻ߽ªÎ»
NEXT i


LET c=0 !ÅÀÅô¤·¤Æ¤¤¤ë¸Ä¿ô
FOR i=1 TO N
   IF A(i)=1 THEN LET c=c+1
NEXT i
PRINT c;"¸Ä"


PRINT INT(SQR(N)) !¸¡»»¡¡Ê¿Êý¿ô¤Î¿ô

END


¤Þ¤¿¡¢»þ¹ï¤´¤È¤ËÅžþ¤ò¡ÊÀµ¸¹ÇÈ¡¢ÉÔÅù¼°¤ÎÎΰè¤Ê¤É¤Î¡Ë¿ôÍýŪÁàºî¤¬²Äǽ¤Ç¤¹¡£
ÅŻҹ©ºî¤Õ¡Á¤Ë¥×¥í¥°¥é¥à¤·¤Æ¤ß¤Þ¤·¤¿¡£
!Äê¿ô
LET Vcc=1 !¥×¥é¥¹ÅŸ»
LET GND=0 !GNDÅÅ°Ì

LET ON_=GND !¥¢¥Î¡¼¥É:Vcc
LET OFF_=Vcc

LET h=8 !¹ÔÊý¸þ¤ÎÅŵå¤Î¿ô
LET w=5*h !ÎóÊý¸þ

DIM L(h,w) !Åŵå¤Î¾õÂÖ
MAT L=ZER !Á´¾ÃÅô

SET bitmap SIZE w*20+1,h*20+1 !´ðÈפÎÂ礭¤µ
SET WINDOW 0,w+1,h+1,0
DRAW grid(2,2)

DIM P(h,w)

!¡ü¥Õ¥í¡¼¡¢¥·¥Õ¥È·¿
LET m=8
FOR x=1 TO w !½é´ü¾õÂÖ
   LET v=(m-1)-MOD(x-1,m) !¤Î¤³¤®¤êÇÈ
   FOR y=1 TO h
      LET L(y,x)=v
   NEXT y
NEXT x
MAT PRINT L;

FOR t=1 TO 50 !¶îÆ°²óÏ©
   FOR y=1 TO h !£°¤È£±¤ËÉü¹æ²½¤¹¤ë
      FOR x=1 TO w
         LET L(y,x)=MOD(L(y,x)+1,m) !±¦Êý¸þ¤Ø°ÜÆ°¤µ¤»¤ë¡¡(k+1) mod m

         !!!IF L(y,x)=m-1 THEN LET P(y,x)=ON_ ELSE LET P(y,x)=OFF_ !ƻϩ¹©»ö
         IF L(y,x)>=m-3 THEN LET P(y,x)=ON_ ELSE LET P(y,x)=OFF_ !ƻϩ¹©»ö£²
      NEXT x
   NEXT y

   DRAW LEDmatrix(P,h,w) !Åŵå¤ò¸÷¤é¤»¤ë
   WAIT DELAY 0.3
NEXT t


!¡ü¥·¥ã¥Ã¥¿¡¼·¿
LET m=8
FOR x=1 TO w !½é´ü¾õÂÖ
!!!LET v=(m-1)-MOD(x-1,m) !¥Ñ¥¿¡¼¥ó£±
   LET v=(m-1)-MOD(x-1,m)-INT((x-1)/m) + INT(m/2) !¥Ñ¥¿¡¼¥ó£²
   FOR y=1 TO h
      LET L(y,x)=v
   NEXT y
NEXT x
MAT PRINT L;

!!!LET m=m+1!¥Ñ¥¿¡¼¥ó£±
LET m=m+1 + INT(m/2) !¥Ñ¥¿¡¼¥ó£²
LET n=m
FOR t=1 TO 50 !¶îÆ°²óÏ©
   LET n=MOD(n-1,m)
   FOR y=1 TO h !£°¤È£±¤ËÉü¹æ²½¤¹¤ë
      FOR x=1 TO w
         IF L(y,x)>=n THEN LET P(y,x)=ON_ ELSE LET P(y,x)=OFF_ !ïçÃÍ
      NEXT x
   NEXT y

   DRAW LEDmatrix(P,h,w) !Åŵå¤ò¸÷¤é¤»¤ë
   WAIT DELAY 0.3
NEXT t


!ÅÅ»ÒÉôÉÊ¡ÊÇÛÃÖ¤ÈÇÛÀþ¡Ë

PICTURE LEDmatrix(L(,),m,n) !m¹ÔnÎó¥Þ¥È¥ê¥¯¥¹
   SET DRAW mode hidden !¤Á¤é¤Ä¤­Ëɻ߳«»Ï
   CLEAR
   FOR x=1 TO n !¥À¥¤¥Ê¥ß¥Ã¥¯ÅÀÅô¡Ê¸Ä¡¹¤ËÅÀÅô¤µ¤»¤ë¡Ë
      FOR y=1 TO m
         DRAW LED(Vcc,L(y,x)) WITH SHIFT(x,y)
      NEXT y
   NEXT x
   SET DRAW mode explicit !¤Á¤é¤Ä¤­Ëɻ߽ªÎ»
END PICTURE

!ÅÅ»ÒÉôÉʡʲ¼°Ì¡Ë

!  a ¨¢
!¡¡¡¡¢§¢ª
!¡¡k £Ô
!¡¡¡¡¨¢
PICTURE LED(a,k) !ȯ¸÷¥À¥¤¥ª¡¼¥É¤òɽ¼¨¤¹¤ë
   IF a=1 AND k=0 THEN
      DRAW disk WITH SCALE(0.5) !ÅÀÅô
   ELSE
      DRAW circle WITH SCALE(0.5) !¾ÃÅô
   END IF
END PICTURE

END
 

Re: ¹­µÁÀÑʬ¤Î·×»»¤Î¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ11·î25Æü(¿å)14»þ14ʬ32ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.753[¸µµ­»ö¤Ø]

Æó½Å»Ø¿ô´Ø¿ô·¿¤Ç¿ôÃÍÀÑʬ¤·¤Æ¤ß¤Þ¤·¤¿¡£
OPTION ARITHMETIC NATIVE

!£²½Å»Ø¿ô´Ø¿ô·¿¿ôÃÍÀÑʬ¡ÊDouble Exponential formula¡Ë
!¡¡¢é[0,¡ç]f(x)dx¡¡È¾Ìµ¸ÂÎΰè(0,¡ç)¤ÎÀÑʬ
!
!¡¡x=EXP(t-EXP(-t))¤È¤¹¤ë¤È¡¢dx/dt=EXP(t-EXP(-t))*(1+EXP(-t))
!¡¡Í¿¼°=¢é[-¡ç,¡ç]{f(EXP(t-EXP(-t)))*EXP(t-EXP(-t))*(1+EXP(-t))}dt

DEF f(x)=EXP(-x)/(1-EXP(-x)) - EXP(-x)/x !¢é[0,¡ç]f(x)dx = 0.5772156649015328606¡Ä¡¡¥ª¥¤¥é¡¼¤ÎÄê¿ô¦Ã

LET N=36 !ʬ³ä¿ô
LET h=1/6

LET s=0
FOR j=-N/2 TO N/2
   LET t=j*h
   LET v=EXP(-t)
   LET x=EXP(t-v)
   LET s=s + f(x)*x*(1+v)
NEXT j
LET s=h*s

PRINT s !·ë²Ì¤òɽ¼¨¤¹¤ë



!£²½Å»Ø¿ô´Ø¿ô·¿¿ôÃÍÀÑʬ¡ÊDouble Exponential formula¡Ë
!¡¡¢é[0,¡ç]f(x)dx¡¡È¾Ìµ¸ÂÎΰè(0,¡ç)¤ÎÀÑʬ
!
!¡¡x=EXP(PI*SINH(t))¤È¤¹¤ë¤È¡¢dx/dt=EXP(PI*SINH(t))*PI*COSH(t)
!¡¡Í¿¼°=PI*¢é[-¡ç,¡ç]{f(EXP(PI*SINH(t)))*EXP(PI*SINH(t))*COSH(t)}dt

DEF g(x)=1/(1+x^6) !¢é[0,¡ç]g(x)dx = PI/3

LET N=64 !ʬ³ä¿ô
LET h=1/8

LET s=0
FOR j=-N/2 TO N/2
   LET t=j*h
   LET x=EXP(PI*SINH(t))
   LET s=s + g(x)*x*COSH(t)
NEXT j
LET s=h*PI*s

PRINT s !·ë²Ì¤òɽ¼¨¤¹¤ë

PRINT PI/3 !¸¡»»



!£²½Å»Ø¿ô´Ø¿ô·¿¿ôÃÍÀÑʬ¡ÊDouble Exponential formula¡Ë
!¡¡¢é[-1,1]f(x)dx
!
!¡¡x=TANH(PI/2*SINH(t))¤È¤¹¤ë¤È¡¢dx/dt=PI/2*COSH(t)/COSH(PI/2*SINH(t))^2
!¡¡Í¿¼°=PI/2*¢é[-¡ç,¡ç]{f(TANH(PI/2*SINH(t)))*COSH(t)/COSH(PI/2*SINH(t))^2}dt

DEF f2(x)=SQR(1-x^2)/(2-x) !¢é[-1,1]f(x)dx = PI*(2-SQR(3))

LET N=64 !ʬ³ä¿ô
LET h=1/8

LET s=0
FOR j=-N/2 TO N/2
   LET t=j*h
   LET v=PI/2*SINH(t)
   LET s=s + f2(TANH(v))*COSH(t)/COSH(v)^2
NEXT j
LET s=h*PI/2*s

PRINT s !·ë²Ì¤òɽ¼¨¤¹¤ë

PRINT PI*(2-SQR(3)) !¸¡»»


END
 

¥Ï¥¤¥¦¥§¥¤

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ11·î25Æü(¿å)19»þ06ʬ2ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  !ÂçÉý¤Ë ²þÄû¤·¡¢ÆäËÏ©Ì̤ÎÉÁ²è¤ò²þÁ±¤·¤¿¡¢¤¬¡¢¼¡¤ÎÌäÂ꤬²ò¤±¤Ê¤¤¡£
!¸«¤¨±£¤ì¤¹¤ëÏ©Ì̤Î΢¦¤ò¡¢Ê̤ʿ§¤ÇÅɤë¤Ë¤Ï¡¢¤É¤¦¤¹¤ì¤Ð¡¢¤è¤¤¤«¡©
!------------
! ¥Ï¥¤¥¦¥§¥¤
!------------
!SET bitmap SIZE 671,671
DIM Mp(4,4)         !»ëÅÀ¤«¤é¤ÎÈï¼ÌÂΤÎÁêÂкÂɸ¡Ê°ìÅÀÅê±ÆÍÑ¡Ë
DIM Xz(4,4),zY(4,4) !XY_XzÊÑ´¹, XY_zYÊÑ´¹
DIM XYz(4,4)        !XYÊ¿Ì̤ÎzÊ¿¹Ô°ÜÆ°
!
!¢¨Åê±ÆÌ̤Î΢¦¤Ë¡¢ÁàºîÂоݤ¬Í­¤ë¤Î¤Ç¡¢ºÂɸ¤Ïº¸¼ê·Ï¡Ê£Ú¼´¤¬Î¢¸þ¤­¡Ë¤Ç¤¹¡£
!¡¡Åê±ÆÌ̤ò¡¢¼ÖξÁ°±ïd ¤ËÃÖ¤­¡¢Z=1.5 ¡¢»ëÅÀ Z=0 ¤¬ ¼êÁ°¡£
!¡¡»ëÅÀ Z=0 ¤òĺÅÀ¤Ë¡¢Åê±ÆÌÌ Z=1.5 ¤Ø °ìÅÀÅê±Æ¡£ÌÌÃæ¿´¤«¤é¡Þ£±¤ò²èÌ̤Ȥ·¡¢
!¡¡³°³¦Ì̤ò¡¢Åê±ÆÌÌ Á°Êý+170 ¤«¤é¡¢Åê±ÆÌÌ Z=1.5 ¤Þ¤Ç¤ò¡¢±ü¤«¤éÉÁ¤¯¡£
!-------------------------------------------------------------------------
!      °ìÅÀÅê±ÆÍÑ Mp
!
!¸¶²è_¹Ô¥Ù¥¯¥È¥ë     Mp           ɽ¼¨_¹Ô¥Ù¥¯¥È¥ë
!     (X,Y,Z,1)|1   0   0   0| ¢ª¡ÊX+x,Y+y, * ,Z+z) ¤Î£´ÎóÌÜ Z+z ¤Ç½Ì¾®¡£
!              |0   1   0   0|                               ¢­
!              |0   0   0   1|      ºÂɸ (X+x)/(Z+z),(Y+y)/(Z+z) ¤ÎÉÁÅÀ·²¡£
!              |x   y   0   z|      * °õ¤Ï¡ÖºÇ½ªÅªÉ½¼¨¤Ç̵¸ú¡×¤Î£úºÂɸ¡£
MAT READ Mp
DATA 1,0,0,0   !¾®Ê¸»ú x y z ¤Ï¡¢»ëÅÀ¤«¤é¡¢Æ»Ï©º¸Ã¼¤ÎÁêÂкÂɸ¡£
DATA 0,1,0,0
DATA 0,0,0,1   !ÊÑ·Á»Ø¼¨ MAT ʸ¤Ç¸ú²Ì¤¹¤ë¡£
DATA 0,0,0,0
!-------------------------------------------------------------------------
!¡¡Æ»Ï©¤Ê¤É¡¢²èÌ̤˿âľ¤Ê¹­¤¬¤ê¤Ï¡¢°Ê²¼¤Î Xz zY XYz ¹ÔÎó¤ò¡¢Àè¤ËÄ̤·¤Þ¤¹¡£
!¡¡¾å¤Î¸¶²è¤Î Z ¤ÏÄ̾¤Ç¤¹¤¬¡¢°Ê²¼¤ÎÍÍ¤Ë ÊÑ·Á¤ò¹Ô¤Ê¤¦¤È¡¢È¯À¸¤·¤Þ¤¹¡£
!-------------------------------------------------------------------------
!¡ãÏ©ÌÌ¡ä¤Î¸¶²èÍÑ Xz   ¡¡XYÊ¿ÌÌ¢ª XZÊ¿Ì̤Ȥ·¤ÆÉÁ¤¯¡£
!
!¸¶²è_¹Ô¥Ù¥¯¥È ¥ë                   ¿·¤·¤¤¸¶²è_¹Ô¥Ù¥¯¥È¥ë
!     (X,Y,0,1)|1    0    0   0| ¢ª¡ÊX+Y*dxdz, Y*dydz, Y, 1)
!              |dxdz dydz 1   0|
!              |0    0    0   0|    dxdz: £Ú¼´¥«¡¼¥Ö¤ÎÈùʬ dx/dz
!              |0    0    0   1|    dydz: £Ú¼´¥Ô¥Ã¥Á¤ÎÈùʬ dy/dz
MAT READ Xz
DATA 1,0,0,0
DATA 0,0,1,0
DATA 0,0,0,0
DATA 0,0,0,1
!-------------------------------------------------------------------------
!¡ã·úʪ¡ä¤Î¸¶²èÍÑ zY     XYÊ¿ÌÌ¢ª ZYÊ¿Ì̤Ȥ·¤ÆÉÁ¤¯¡£
!
!¸¶²è_¹Ô¥Ù¥¯¥È ¥ë                   ¿·¤·¤¤¸¶²è_¹Ô¥Ù¥¯¥È¥ë
!     (X,Y,0,1)|dxdz 0    1   0| ¢ª¡ÊX*dxdz+x, Y, X, 1)
!              |0    1    0   0|
!              |0    0    0   0|    dxdz: £Ú¼´¥«¡¼¥Ö¤ÎÈùʬ dx/dz
!              |x    0    0   1|       x: ZYÊ¿Ì̤ΣøºÂɸ
MAT READ zY
DATA 0,0,1,0
DATA 0,1,0,0
DATA 0,0,0,0
DATA 0,0,0,1
!-------------------------------------------------------------------------
!¡ã·úʪ¡ä¤Î¸¶²èÍÑ XYz     XYÊ¿Ì̤ΠZ¼´°ÜÆ°¡£
!
!¸¶²è_¹Ô¥Ù¥¯¥È ¥ë                       ¿·¤·¤¤¸¶²è_¹Ô¥Ù¥¯¥È¥ë
!     (X,Y,0,1)|1        0    0   0| ¢ª¡ÊX+(dxdz)*z, Y, z, 1)
!              |0        1    0   0|
!              |0        0    0   0|    dxdz: £Ú¼´¥«¡¼¥Ö¤ÎÈùʬ dx/dz
!              |(dxdz)*z 0    z   1|       z: Z¼´ °ÜÆ°º¹Ê¬
MAT READ XYz
DATA 1,0,0,0
DATA 0,1,0,0
DATA 0,0,0,0
DATA 0,0,0,1
!-------------------------------------------------------------------------
!
DEF v(t)=v0+a*t                   !®ÅÙ
DEF I_v(t)=v0*t+a*t*t/2           !°ÜÆ°µ÷Î¥ ¢év(t)dt
!
DEF yaw(z)= 10*SIN((z-2)*0.1)      !¥«¡¼¥Ö¡¢²£¤ÎÊк¹  x(z)
DEF d_yaw(z)= COS((z-2)*0.1)      !¥«¡¼¥Ö¡¢Èùʬ·¸¿ô dx/dz
DEF pitch(z)= 5*SIN(z*0.1)         !¥Ô¥Ã¥Á¡¢½Ä¤ÎÊк¹  y(z)
DEF d_pitch(z)= 0.5*COS(z*0.1)     !¥Ô¥Ã¥Á¡¢Èùʬ·¸¿ô dy/dz
!
SET WINDOW -1,1,-1,1              !²èÌÌ¥¹¥±¡¼¥ë¡Þ£±
LET v0=15                         !½é®ÅÙ
LET a=-v0^2/2/100                 !¸ºÂ®²Ã®ÅÙ, -v0^2/2/°ÜÆ°µ÷Î¥
LET t0=TIME
DO
   LET t=TIME-t0
   IF t>tb+0.15 THEN
      LET tb=t
      LET d=I_v(t)                !¼ÖξÁ°±ïd ¤Î£úºÂɸ
      PRINT USING "»þ´Ö=###.## ®ÅÙ=###.##  Áö¹Ôµ÷Î¥=###.##":t,v(t),d
      SET DRAW mode hidden        !΢¥Ú¡¼¥¸¤Ë½ñ¤¯
      CALL Animation              ! ÉÁ²è
      SET DRAW mode explicit      !΢¥Ú¡¼¥¸¤Îɽ¼¨
   END IF
   MOUSE POLL msx,msy,mlb,mrb
LOOP UNTIL v(t)<=0 OR mrb=1

SUB Animation
!----sky
   SET AREA COLOR 17
   PLOT AREA:-1,0; 1,0; 1,1; -1,1
   !----ground
   SET AREA COLOR 42
   PLOT AREA:-1,0; 1,0; 1,-1; -1,-1
   !----guide message
   SET TEXT COLOR 1
   SET TEXT FONT "",11
   PLOT TEXT,AT.35,.9:"±¦¥¯¥ê¥Ã¥¯ÊÝ»ý Stop"
   SET TEXT COLOR 0
   SET TEXT FONT "",90
   !----
   LET ss=5/2
   FOR i=IP((d+170)/ss)*ss TO d STEP -ss
      LET Mp(4,1)=  yaw(i)-yaw(d)  -1.5 !Åê±ÆÌÌÃæ¿´Àþ¤«¤é    Æ»Ï©º¸Ã¼¤Î£øºÂɸ
      LET Mp(4,2)=pitch(i)-pitch(d)-1.5 !Åê±ÆÌÌÃæ¿´Àþ¤«¤é    Æ»Ï©º¸Ã¼¤Î£ùºÂɸ
      LET Mp(4,4)=       i-d       +1.5 !Åê±ÆÌ̤θåÊý1.5 ¤«¤éƻϩº¸Ã¼¤Î£úºÂɸ
      !----
      ! 1                 ,0                     ,0         ,      0|
      ! 0                 ,1                     ,0         ,      0|
      ! 0                 ,0                     ,0         ,      1|
      ! yaw(i)-yaw(d)-1.5 ,pitch(i)-pitch(d)-1.5 ,0         ,i-d+1.5|
      !----
      IF MOD(i,10)=0 THEN
         DRAW Building( 0-2,-9, -3,20,-2  ) WITH Mp   !x,y, W,H,D
         DRAW Building( 6+2,-9, -3,19, 2.5) WITH Mp   !x,y, W,H,D
         DRAW Sign WITH Mp
      END IF
      IF MOD(i,10)=5 THEN DRAW Tree WITH Mp
      DRAW Road(-.993*ss) WITH Mp
   NEXT i
END SUB

!¥Ñ¡¼¥Ä¤Î¥µ¥¤¥º¡£
!²èÌÌ( Åê±ÆÌÌ Z=1.5¡§¼ÖξÁ°±ïd )¤Ç¡¢É½¼¨ÇÜΨ 1/Z ( ¼ÂÉý£³¢ª ÉÁ²èÉý£²)

!¸¶²èºÂɸ¤Ç¡¢Æ»Ï©º¸Ã¼£ø£ù£ú( 0 ,  0  ,1.5)= ²èÌ̺¸²¼³Ñ(-1,-1)
!¸¶²èºÂɸ¤Ç¡¢º¸¼ÖÀþ¾å£ø£ù£ú(1.5, 1.5 ,1.5)= ²èÌÌÃæ¿´ÅÀ( 0, 0) ¡ÄÅê±ÆÃæ¿´

PICTURE Building(x,y,w,h,d1)
   IF d-i<=w THEN
   !---back plane
      LET zY(1,1)=d_yaw(i+w/2)     !£Ú¼´¥«¡¼¥Ö¤ÎÈùʬ dx/dz
      LET zY(4,1)=x+d1             !ZYÊ¿Ì̤ΣøºÂɸ
      DRAW Wall((y),w,h) WITH zY
      !---facade
      LET zY(4,1)=x                !ZYÊ¿Ì̤ΣøºÂɸ
      DRAW Wall((y),w,h) WITH zY
      !---side plane
      LET XYz(4,1)=d_yaw(i+w/2)*w  !£Ú¼´¥«¡¼¥Ö¤Ë¤è¤ë£ø°ÜÆ°º¹Ê¬
      LET XYz(4,3)=w               !£Ú¼´ °ÜÆ°º¹Ê¬
      DRAW Side(x,y,h,d1) WITH XYz
   END IF
END PICTURE
!
PICTURE Wall(y,w,h)
   SET AREA COLOR 8  !gray
   PLOT AREA: 0,y; w,y; w,y+h; 0,y+h       !(Z,Y)Ê¿Ì̤Ȥ·¤ÆÉÁ¤¯¡£
   FOR y=y+h-.5 TO y+1 STEP -2.5
      PLOT LINES: 0,y; w,y                    ! (Z,Y)Ê¿Ì̤Ȥ·¤ÆÉÁ¤¯¡£
   NEXT y
END PICTURE
!
PICTURE Side(x,y,h,d1)
   SET AREA COLOR 16 !dark gray
   PLOT AREA: x,y; x+d1,y; x+d1,y+h; x,y+h !°ÜÆ°Á°(X,Y)Ê¿Ì̤Ȥ·¤ÆÉÁ¤¯¡£
END PICTURE

PICTURE Road(e)
   IF e< d-i THEN LET e=d-i
   LET Xz(2,1)=d_yaw(i+e/2)     !£Ú¼´¥«¡¼¥Ö¤ÎÈùʬ dx/dz
   LET Xz(2,2)=d_pitch(i+e/2)   !£Ú¼´¥Ô¥Ã¥Á¤ÎÈùʬ dy/dz
   DRAW Surface(e) WITH Xz
END PICTURE
!
PICTURE Surface(e)
   SET AREA COLOR 15
   PLOT AREA: 0,0; 6,0; 6,e; 0,e           !(X,Z)Ê¿Ì̤Ȥ·¤ÆÉÁ¤¯¡£
   !---center line
   SET AREA COLOR 0
   PLOT AREA: 2.9,0; 2.9,e; 3.1,e; 3.1,0   !(X,Z)Ê¿Ì̤Ȥ·¤ÆÉÁ¤¯¡£
   !---joint line
   PLOT LINES: 0  ,0; 2.9,0
   PLOT LINES: 3.1,0; 6  ,0
END PICTURE

PICTURE Tree
   SET AREA COLOR 12 !´´
   PLOT AREA:-0.075,0; 0.075,0; 0.025,3;-0.025,3
   SET AREA COLOR 10
   FOR w=1 TO 7      !ÍÕ
      DRAW disk WITH SCALE(0.3+0.05-RND*0.1)*SHIFT(0.4-RND*0.8, 2.7+0.325-RND*0.75)
   NEXT W
END PICTURE

PICTURE Sign
   IF MOD(i,50)=0 THEN SET AREA COLOR 2 ELSE SET AREA COLOR 4
   PLOT AREA:-0.025,0; 0.025,0; 0.025,2;-0.025,2 !pole
   DRAW disk WITH SCALE(0.5)*SHIFT(0,2)          !plate
   !PLOT TEXT,AT -.35,1.74,USING ">%%":STR$(i)    !sign
   CALL Plot_7segment(0 ,2 ,0.15 ,STR$(i))       !sign( PLOT TEXT ¤¬½Å¤¤»þ)
END PICTURE

SUB Plot_7segment(x,y,s,i$)   !ʸ»úÎóÃæ¿´(x,y) ʸ»ú¤Î²£Éý(s) ¿ô»ú¤Îʸ»úÎó(i$)
   SET LINE COLOR 0
   SET LINE width 9/(i-d+1.5) !°ìÅÀÅê±Æ¡¦½Ì¾®¤ÎÊä½þ¡£(ÀþÉý¤Ï MAT ʸ¤Ç½Ì¤Þ¤Ê¤¤)
   LET w=LEN(i$)
   LET s1=s      ! y¼´¢¬:s1=s  y¼´¢­:s1=-s
   LET s2=s/2
   LET x=x-(w-1)*s2*1.6
   FOR p=1 TO w
      SELECT CASE VAL(i$(p:p))
      CASE 0
         PLOT LINES:x-s2,y+s;x-s2,y-s;x+s2,y-s;x+s2,y+s;x-s2,y+s
      CASE 1
         PLOT LINES:x,y-s;x,y+s
      CASE 2
         PLOT LINES:x-s2,y+s1;x+s2,y+s1;x+s2,y;x-s2,y;x-s2,y-s1;x+s2,y-s1
      CASE 3
         PLOT LINES:x-s2,y-s;x+s2,y-s;x+s2,y+s;x-s2,y+s
         PLOT LINES:x-s2,y;x+s2,y
      CASE 4
         PLOT LINES:x-s2,y+s1;x-s2,y;x+s2,y
         PLOT LINES:x+s2,y+s1;x+s2,y-s1
      CASE 5
         PLOT LINES:x+s2,y+s1;x-s2,y+s1;x-s2,y;x+s2,y;x+s2,y-s1;x-s2,y-s1
      CASE 6
         PLOT LINES:x+s2,y+s1;x-s2,y+s1;x-s2,y-s1;x+s2,y-s1;x+s2,y;x-s2,y
      CASE 7
         PLOT LINES:x-s2,y+s1;x+s2,y+s1;x+s2,y-s1
      CASE 8
         PLOT LINES:x-s2,y;x-s2,y-s;x+s2,y-s;x+s2,y+s;x-s2,y+s;x-s2,y;x+s2,y
      CASE 9
         PLOT LINES:x+s2,y;x-s2,y;x-s2,y+s1;x+s2,y+s1;x+s2,y-s1;x-s2,y-s1
      CASE ELSE
      END SELECT
      LET x=x+s*1.6
   NEXT p
   SET LINE width 1
   SET LINE COLOR 1
END SUB

END
 

SECOND¤µ¤ó¤Ø¤¢¤ê¤¬¤È¤¦

 Åê¹Æ¼Ô¡§kikiriri  Åê¹ÆÆü¡§2009ǯ11·î25Æü(¿å)20»þ36ʬ1ÉÃ
ÊÖ¿®¡¦°úÍÑ
  kikiriri¤è¤ê

ÌÌÇò¤¤¥×¥í¥°¥é¥à¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
Áᮼ¹Ԥ·¤Æ¤ß¤Þ¤·¤¿¡£
Îɤ«¤Ã¤¿¤Ç¤¹¡£
 

ÄûÀµ¡§¥¹¥ì¥Ã¥É¤Ø¤ÎÅê¹Æ¤âÊÔ½¸²Äǽ

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ11·î26Æü(ÌÚ)12»þ19ʬ0ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.744[¸µµ­»ö¤Ø]

°ÊÁ°¤ËÅê¹Æ¤·¤¿µ­»ö¤Ç¡Ø¥¹¥ì¥Ã¥É¤Ø¤ÎÅê¹Æµ­»ö¤Ï¡¢Åê¹Æ¼ÔËܿͤǤâ¸å¤«¤éÊÔ½¸¤Ï¤Ç¤­¤Ê¤¤¤è¤¦¤Ç¤¹¡£¡Ù¤È½ñ¤­¤Þ¤·¤¿¤¬´Ö°ã¤¨¤Æ¤Þ¤·¤¿¡£

¥¹¥ì¥Ã¥É¤Ø¤ÎÅê¹Æµ­»ö¤â¡¢Åê¹Æ¼ÔËܿͤˤè¤ëÊÔ½¸¡¦ºï½ü¤¬²Äǽ¤Ç¤¹¡£

¤Þ¤¿»²¹Í¾ðÊó¤È¤·¤Æ¡¢Åê¹Æµ­»ö¤Ë¤ÏÅê¹Æ½ç¤Ëµ­»öÈֹ椬Éղ䵤ì¤Þ¤¹¤¬¡¢¤½¤ÎÈÖ¹æ¤Ï¥¹¥ì¥Ã¥É¤Ø¤ÎÅê¹Æ¤â´Þ¤ó¤ÇÉղ䵤ì¤Þ¤¹¡£
 

Re: ¹­µÁÀÑʬ¤Î·×»»¤Î¥×¥í¥°¥é¥à

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ11·î26Æü(ÌÚ)17»þ57ʬ39ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.757[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

£²½Å»Ø¿ô´Ø¿ô·¿¿ôÃÍÀÑʬ
¤È¤¤¤¦¥Æ¥¯¥Ë¥Ã¥¯¤È¤Æ¤â»²¹Í¤Ë¤Ê¤ê¤Þ¤¹¡£
Îò»Ë¤òÆɤó¤Ç¤¤¤¿¤é¡¢°ËÍý¡¢¿¹¸ý¡¢¹âß·¤Ë¤è¤ëIMT¸ø¼°¤¬È¯Å¸¤Îü½ï¤Ç¤¢¤ë¤È½ñ¤¤¤Æ¤¢¤ê¤Þ¤·¤¿¡£
¤³¤ÎÃæ¤Î¿¹¸ý¡Ê¤¿¤Ö¤ó¿¹¸ýÈË°ì»á¤Î¤³¤È¤«¡©¡Ë¤µ¤ó¤Ï¡¢¤º¤Ã¤ÈÁ°¤ËNHK¥³¥ó¥Ô¥å¡¼¥¿¹ÖºÂ¤ò¤µ¤ì¤Æ¤¤¤¿Êý¤Ç¤Ï¤Ê¤¤¤«¤È»×¤ï¤ì¤Þ¤¹¤¬¡¢»ä¤¬¹â¹»»þÂå¡Ê¤â¤¦£³£° ¿ôǯ¤âÁ°¤Ë¤Ê¤ê¤Þ¤¹¤¬¡¦¡¦¡¦¡Ë¤³¤ÎÈÖÁȤò¤ß¤Æ¤³¤Î¿Í¤ÎËܼÁ¤òŪ³Î¤ËÀâÌÀ¤µ¤ì¤ëÏä·Êý¤Ë¤È¤Æ¤âÌ¥ÎϤòÊú¤¤¤¿¤³¤È¤ò»×¤¤¤À¤·¤Þ¤¹¡£
¤è¤¯¤â¤Þ¤¢¤³¤ó¤ÊÃÖ´¹¹½Â¤¤òȯ¸«¤·¡¢½¾Íè¤ÎÊýË¡¤Ç¤Ïµá¤á¤Ë¤¯¤¤ÀÑʬÃͤò·×»»µ¡¤È¤¤¤¦Æ»¶ñ¤ò½½Æóʬ¤Ë³èÍѤǤ­¤ëÆ»¶Ú¤ò³«¤¯¤³¤È¤¬¤Ç¤­¤ë¤â¤Î¤À¤È´¶¿´¤¤¤¿¤·¤Þ¤¹¡£
¤Þ¤À¤Þ¤À¡¢¤ï¤ì¤ï¤ì¤¬ÃΤé¤Ê¤¤¹½Â¤¤¬±£¤ì¤Æ¤ª¤ê¡¢Ã¯¤«¤¬¤½¤ÎÈëÌ©¤ò˽¤¯¤³¤È¤Çº£¤Þ¤Ç¤Ë¤Ê¤¤¥Ö¥ì¥¤¥¯¥¹¥ë¡¼¤Î¶áÆ»¤òÄ󶡤Ǥ­¤ë¤Î¤Ç¤·¤ç¤¦¤Í¡£
¤Ä¤¯¤Å¤¯¸¦µæ¼Ô¤ÎÃ챤Èõµæ¿´¤ÎÀ¨¤µ¤Ë¶Ãس¤¹¤ë¤Ð¤«¤ê¤Ç¤¹¡£
 

¥ì¥È¥í¡¦¥²¡¼¥à¤Î¤«¤é¤¯¤ê

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ11·î27Æü(¶â)13»þ02ʬ5ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ¥¤¥ó¥Ù¡¼¥À¡¼¤Î°ÜÆ°¡¢¹¶·â¤òºÆ¸½¤·¤Æ¤ß¤Þ¤·¤¿¡£¡Ê²þ½¤ÈÇ¡Ë
®ÅÙÄ´À°¤¬É¬Íפʤ顢WAITÌ¿Îá¤ò¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£
¤Þ¤¿¡¢¥Þ¥¦¥¹¤Îº¸¥Ü¥¿¥ó¤Î²¡²¼¤Ç¥¤¥ó¥Ù¡¼¥À¡¼¤ò¾ÃÌǤǤ­¤Þ¤¹¡£
!¥¤¥ó¥Ù¡¼¥À¡¼¡¦¥²¡¼¥à

DEF V2W(x)=4*x !²¾ÁÛ²èÌ̤κÂɸ¤òʪÍý²èÌ̤κÂɸ¤Ø
DEF W2V(x)=INT(x/4) !¤½¤ÎµÕ

PICTURE DOT !ʪÍý²èÌ̤˥ɥåȤòɽ¼¨¤¹¤ë
   PLOT AREA: -2,-2; 2,-2; 2,2; -2,2 !4x4
END PICTURE

LET vx=180 !²¾ÁÛ²èÌ̤ÎÂ礭¤µ¡¡150¡ß180¥É¥Ã¥È
LET vy=150

SET bitmap SIZE V2W(vx)+1,V2W(vy)+1 !ʪÍý²èÌ̤ÎÂ礭¤µ
SET WINDOW 0,V2W(vx),V2W(vy),0 !¥¹¥¯¥ê¡¼¥óºÂɸ

RANDOMIZE


!------------------------------ ÃÆ
DATA "* " !¥³¥Þ£±¡¡ÃÆ£±
DATA " *"
DATA "* "

DATA " *" !¥³¥Þ£²
DATA "* "
DATA " *"

DIM bm$(1,2) !ÃÆ¡¡3¡ß2¥É¥Ã¥È
CALL ReadPattern(1,3, bm$)

LET NumOfBeam=5 !ÃÆ¡¡ºÇÂç¿ô£µ
DIM BM(NumOfBeam,3)
MAT BM=(-1)*CON

!------------------------------ ¥¤¥ó¥Ù¡¼¥À¡¼
LET m=8 !m¡ßn¥É¥Ã¥È
LET n=11

DATA "**       **" !¥³¥Þ£±¡¡µ¡ÂΣ°
DATA "*         *"
DATA "           "
DATA "           "
DATA "           "
DATA "           "
DATA "*         *"
DATA "**       **"

DATA "           " !¥³¥Þ£²
DATA "*  *   *  *"
DATA " *  * *  * "
DATA "  *     *  "
DATA "**       **"
DATA "  *     *  "
DATA " *  * *  * "
DATA "*  *   *  *"

DATA "  *     *  " !¥³¥Þ£±¡¡µ¡ÂΣ±
DATA "*  *   *  *"
DATA "* ******* *"
DATA "*** *** ***"
DATA "***********"
DATA " ********* "
DATA "  *     *  "
DATA " *       * "

DATA "  *     *  " !¥³¥Þ£²
DATA "   *   *   "
DATA "  *******  "
DATA " ** *** ** "
DATA "***********"
DATA "* ******* *"
DATA "* *     * *"
DATA "   ** **   "

DATA "    ***    " !¥³¥Þ£±¡¡µ¡ÂΣ²
DATA "   *****   "
DATA "  *******  "
DATA " ** *** ** "
DATA " ********* "
DATA "   *   *   "
DATA "  * * * *  "
DATA " * *   * * "

DATA "    ***    " !¥³¥Þ£²
DATA "   *****   "
DATA "  *******  "
DATA " ** *** ** "
DATA " ********* "
DATA "  * *** *  "
DATA " *       * "
DATA "  *     *  "

DATA "           " !¥³¥Þ£±¡¡µ¡ÂΣ³
DATA "    ***    "
DATA " ********* "
DATA "**  ***  **"
DATA "***********"
DATA "   *****   "
DATA "  ** * **  "
DATA "**       **"

DATA "           " !¥³¥Þ£²
DATA "    ***    "
DATA " ********* "
DATA "**  ***  **"
DATA "***********"
DATA "   ** **   "
DATA "  *     *  "
DATA "   *   *   "

DIM ptn$(4,2) !¥Ñ¥¿¡¼¥ó¡Ê£±µ¡¡ß£²¥³¥Þ¡Ë¤ÇÆɤ߹þ¤à
CALL ReadPattern(4,m, ptn$)

SUB ReadPattern(n,l, ptn$(,))
   FOR k=1 TO n !³Æµ¡ÂÎ
      FOR j=1 TO 2 !³Æ¥³¥Þ
         LET v$=""
         FOR i=1 TO l
            READ s$
            LET v$=v$&s$
         NEXT i
         LET ptn$(k,j)=v$ !ÅÐÏ¿¤¹¤ë
      NEXT j
   NEXT k
END SUB

!------------------------------ ÊÔÂâ
LET p=6 !p¡ßq
LET q=8
DIM F(p+1,q) !0°Ê¾å:À¸Â¸¥Õ¥é¥°¡¢¥Ñ¥¿¡¼¥óÈÖ¹æ
MAT F=ZER
DATA  4, 4, 4, 4, 4, 4, 4, 4 !¥Ñ¥¿¡¼¥óÈֹ桡¢¨¶ö¿ô
DATA  4, 4, 4, 4, 4, 4, 4, 4
DATA  6, 6, 6, 6, 6, 6, 6, 6
DATA  6, 6, 6, 6, 6, 6, 6, 6
DATA  2, 2, 2, 2, 2, 2, 2, 2
DATA  2, 2, 2, 2, 2, 2, 2, 2
DATA  6, 6, 6, 6, 6, 6, 6, 6 !ÀèƬ¤ÎÈÖ¹æ
MAT READ F

LET ox=n+2 !µ¡ÂΤδֳÖ
LET oy=m+2
LET lx=vx-ox*q !ÊÔÂâ¤Îº¸¾å°ÌÃÖ
LET ly=4


PICTURE BLOCK(v$,m,n) !¥¤¥ó¥Ù¡¼¥À¡¼¤Ê¤É¤ò°ÌÃÖ(0,0)-(n,m)¤Ëɽ¼¨¤¹¤ë
   FOR i=0 TO m-1 !m¡ßn¥É¥Ã¥È
      FOR j=0 TO n-1
         LET k=i*n+j+1
         IF v$(k:k)<>" " THEN DRAW DOT WITH SHIFT(V2W(j),V2W(i))
      NEXT j
   NEXT i
END PICTURE


LET DX=-1 !°ÜÆ°Êý¸þ
LET FLG=0 !µ¡ÂΤÎÆ°ºî
LET Invaded=0 !¿¯Î¬¾õ¶·
DO !¥²¡¼¥à¥ë¡¼¥×

!------------------------------ Åö¤êȽÄê¡Ê²¾¡Ë
   MOUSE POLL mx,my,left,right !¥Þ¥¦¥¹¤Î¾õÂÖ¤òÆÀ¤ë
   IF left=1 THEN !º¸¥Ü¥¿¥ó²¡²¼¤Ê¤é
      LET x=W2V(mx)-lx !ÊÔÂâ¤ÎÎΰèÆâ¤Ê¤é
      LET y=W2V(my)-ly
      IF x<0 OR x>=ox*q OR y<0 OR y>=oy*p THEN
      ELSE
         LET xx=MOD(x,ox) !µ¡ÂÎÆâ¤Ê¤é
         LET yy=MOD(y,oy)
         IF xx<n AND yy<m THEN
            LET xx=INT(x/ox)+1 !³ºÅö¤¹¤ëµ¡ÂΤòÇúȯ¢ª¾ÃÌǤ¹¤ë
            LET yy=INT(y/oy)+1
            IF F(yy,xx)>=2 THEN LET F(yy,xx)=1
         END IF
      END IF
   END IF


   !------------------------------ ÉÁ²è½èÍýËè¡Ê¥Õ¥ì¡¼¥à¤òɽ¼¨¤¹¤ë¡Ë
   SET DRAW mode hidden !¤Á¤é¤Ä¤­Ëɻ߳«»Ï
   CLEAR
   LET CntOfEnemy=0
   FOR x=1 TO q !¥¤¥ó¥Ù¡¼¥À¡¼·²¤òɽ¼¨¤¹¤ë
      IF F(p+1,x)>0 THEN !¤³¤ÎÎó¤Ëµ¡ÂΤ¬Â¸ºß¤¹¤ë¤Ê¤é

         LET xx=lx+ox*(x-1)

         LET F(p+1,x)=0
         FOR y=1 TO p
            LET ptn=F(y,x) !À¸Â¸¤Ê¤é
            IF ptn>=0 THEN
               LET idx=INT(ptn/2) !¥Ñ¥¿¡¼¥ó¤òÁªÂò¤¹¤ë
               LET koma=MOD(ptn,2)
               DRAW BLOCK(ptn$(idx+1,koma+1),m,n) WITH SHIFT(V2W(xx),V2W(ly+oy*(y-1)))
               IF ptn=1 THEN
                  LET F(y,x)=-1 !Çúȯ¢ª¾ÃÌÇ
               ELSE
                  LET F(y,x)=MOD(ptn+1,2)+idx*2 !¤Ñ¤¿¤Ñ¤¿¥¢¥Ë¥á¡¼¥·¥ç¥ó

                  LET F(p+1,x)=y !ÀèƬ¤ÎÈÖ¹æ¤ò¹¹¿·¤¹¤ë

                  IF ly+oy*(y-1)>vy*2/3 THEN LET Invaded=1 !¿¯Î¬¤·¤¿¤Ê¤é
               END IF
               LET CntOfEnemy=CntOfEnemy+1 !µ¡ÂΤοô
            END IF
         NEXT y

         IF F(p+1,x)>0 THEN !¤³¤ÎÎó¤Ëµ¡ÂΤ¬¤¢¤ì¤Ð
            IF FLG=0 THEN !ÀÞ¤êÊÖ¤·¤ò³Îǧ¤¹¤ë
               IF xx<=0 OR xx+n>=vx THEN LET FLG=1 !º¸Ã¼¡¢±¦Ã¼¤Ê¤é
            END IF

            IF RND<0.1 THEN !ÃƤòȯ¼Í¤¹¤ë
               FOR y=1 TO NumOfBeam !̤ȯ¼Í¤òõ¤¹
                  IF BM(y,3)<0 THEN
                     LET BM(y,1)=xx+INT(n/2)
                     LET BM(y,2)=ly+oy*(F(p+1,x)-1)+INT(m/2)
                     LET BM(y,3)=0 !»ÈÍÑÃæ

                     EXIT FOR !£±Îó¤Ë£±¤Ä¤º¤Ä
                  END IF
               NEXT y
            END IF
         END IF

      END IF
   NEXT x

   FOR y=1 TO NumOfBeam !ÃƤòɽ¼¨¤¹¤ë
      LET ptn=BM(y,3)
      IF ptn>=0 THEN !»ÈÍÑÃæ¤Ê¤é
         DRAW BLOCK(bm$(1,ptn+1),3,2) WITH SHIFT(V2W(BM(y,1)),V2W(BM(y,2)))
         LET BM(y,3)=MOD(ptn+1,2) !¤Ñ¤¿¤Ñ¤¿¥¢¥Ë¥á¡¼¥·¥ç¥ó
      END IF
   NEXT y
   SET DRAW mode explicit !¤Á¤é¤Ä¤­Ëɻ߽ªÎ»


   !------------------------------ °ÜÆ°½èÍý¡Ê¼¡¤Î¥Õ¥ì¡¼¥à¤Ø¡Ë
   SELECT CASE FLG !¥¤¥ó¥Ù¡¼¥À¡¼¤ò°ÜÆ°¤µ¤»¤ë
   CASE 0
      LET lx=lx+DX !²£¤Ø°ÜÆ°¤µ¤»¤ë
   CASE 1
      LET ly=ly+2 !ÀÞ¤êÊÖ¤·¤ÎÆ°ºî¡Ê¹ß²¼¤µ¤»¤ë¡Ë
      LET FLG=2
   CASE ELSE
      LET DX=-DX !¹ß²¼¸å¡¢£±¤ÄÎ¥¤¹
      LET lx=lx+DX
      LET FLG=0
   END SELECT

   FOR i=1 TO NumOfBeam !ÃƤò°ÜÆ°¤µ¤»¤ë
      IF BM(i,3)>=0 THEN !»ÈÍÑÃæ¤Ê¤é
         LET BM(i,2)=BM(i,2)+3 !¹ß²¼¤µ¤»¤ë
         IF BM(i,2)>vy THEN LET BM(i,3)=-1 !²¼Ã¼¤Ê¤é
      END IF
   NEXT i

   !!!WAIT DELAY 0.3

LOOP UNTIL CntOfEnemy=0 OR Invaded=1 !µ¡ÂÎÁ´ÌǤޤÇ


END
 

Re: ¥ì¥È¥í¡¦¥²¡¼¥à¤Î¤«¤é¤¯¤ê

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ11·î27Æü(¶â)14»þ48ʬ15ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.762[¸µµ­»ö¤Ø]

²û¤«¤·¤¤¥²¡¼¥à¤Ç¤¹¡£¡Ö¥¯¥ê¥Ã¥¯¤·¤Æ¤âÃƤ¬È¯¼Í¤µ¤ì¤Ê¤¤¡×¤È»×¤¤¤Þ¤·¤¿¤¬¡¢¥¤¥ó¥Ù¡¼¥À¡¼¤òľÀÜ¥¯¥ê¥Ã¥¯¤¹¤ë¤Î¤Ç¤¹¤Í¡£
ÊÔÂâ¤Î¤¹¤°±¦Â¦¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡Öź»ú¤¬Èϰϳ°¡×¤Î¥¨¥é¡¼¤¬À¸¤¸¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£
Åö¤êȽÄê¤Î¥ë¡¼¥Á¥ó¤Ç xx=9 ¤Î¤È¤­ IF F(yy,xx)>=2 THEN LET F(yy,xx)=1 ¤¬¥¨¥é¡¼¤È¤Ê¤ë¤è¤¦¤Ç¤¹¡£
x=104 ¤ò²óÈò¤¹¤ì¤Ð¤è¤¤¤Î¤Ç¡¢IF x<0 OR x>ox*q OR y<0 OR y>oy*p THEN ¤ò
IF x<0 OR x>=ox*q OR y<0 OR y>oy*p THEN ¤È¤¹¤ë¤Î¤Ï¤É¤¦¤Ç¤·¤ç¤¦¤«¡£
 

Re: ¥ì¥È¥í¡¦¥²¡¼¥à¤Î¤«¤é¤¯¤ê

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ11·î27Æü(¶â)15»þ57ʬ17ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.763[¸µµ­»ö¤Ø]

¹ÓÅĹÀÆ󤵤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> x=104 ¤ò²óÈò¤¹¤ì¤Ð¤è¤¤¤Î¤Ç¡¢IF x<0 OR x>ox*q OR y<0 OR y>oy*p THEN ¤ò
> IF x<0 OR x>=ox*q OR y<0 OR y>oy*p THEN ¤È¤¹¤ë¤Î¤Ï¤É¤¦¤Ç¤·¤ç¤¦¤«¡£

£Ø¤ÎÃͤÏ[0,ox*q)¤Ç¤¹¤Í¡£
£Ù¤ÎÃͤˤĤ¤¤Æ¤â¡¢Æ±¤¸¤³¤È¤¬¸À¤¨¤ë¤È»×¤¤¤Þ¤¹¤Î¤Ç¡¢
¡¡IF x<0 OR x>=ox*q OR y<0 OR y>=oy*p THEN
¤È¤·¤Æ¤¯¤À¤µ¤¤¡£
 

¤³¤Î±ÇÁü¤ò¸«¤Æ¤Û¤·¤¤¡£

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ11·î28Æü(ÅÚ)11»þ55ʬ54ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¤Ê¤Ä¤«¤·¤¤¥²¡¼¥à¤¬¤³¤ó¤Ê»ÅÁȤߤǺî¤é¤ì¤Æ¤¤¤¿¤Î¤«¤È»×¤¤¤Þ¤·¤¿¡£
¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤ò¸«¤Æ¤¤¤¿¤é¡¢²¼µ­¤Î¤È¤³¤í¤Î±ÇÁü¤Ë¶Ã¤­¤Þ¤·¤¿¡£
¤³¤ó¤Ê¤â¤Î¤¬¥×¥í¥°¥é¥à¤ÇÁȤá¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡©
°ìÉô¤ÎÉôʬ¤Î¹½À®¤Ç¤âºî¤Ã¤Æ¤Û¤·¤¤¤Ç¤¹¡£

http://vimeo.com/5595869
 

¥ì¥È¥í¡¦¥²¡¼¥à¤Î¤«¤é¤¯¤ê¡Ê¥Ö¥í¥Ã¥¯Êø¤·¡Ë

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ11·î28Æü(ÅÚ)19»þ14ʬ17ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.762[¸µµ­»ö¤Ø]

!¥Ö¥í¥Ã¥¯Êø¤·

DEF V2W(x)=4*x !²¾ÁÛ²èÌ̤κÂɸ¤òʪÍý²èÌ̤κÂɸ¤Ø
DEF W2V(x)=INT(x/4) !¤½¤ÎµÕ

PICTURE DOT !ʪÍý²èÌ̤˥ɥåȤòɽ¼¨¤¹¤ë
   PLOT AREA: -2,-2; 2,-2; 2,2; -2,2 !4x4
END PICTURE

LET vx=100 !²¾ÁÛ²èÌ̤ÎÂ礭¤µ¡¡120¡ß100¥É¥Ã¥È
LET vy=120

SET bitmap SIZE V2W(vx)+1,V2W(vy)+1 !ʪÍý²èÌ̤ÎÂ礭¤µ
SET WINDOW 0,V2W(vx),V2W(vy),0 !¥¹¥¯¥ê¡¼¥óºÂɸ

RANDOMIZE


!------------------------------ ¥Ö¥í¥Ã¥¯
LET lx=5 !º¸¾å¤ÎºÂɸ
LET ly=20

LET ox=10 !´Ö³Ö
LET oy=6

LET p=5 !p¡ßq¸Ä
LET q=INT(vx/ox)-2

DIM B(0 TO p-1,0 TO q-1) !1:Í­¡¢0:̵
MAT B=2*CON
DIM BC(2) !¾×ÆͲó¿ô¤Î¿§¡Ê¥ë¥Ã¥¯¥¢¥Ã¥×¥Æ¡¼¥Ö¥ë¡Ë
DATA 4,10
MAT READ BC


!------------------------------ ÊÉ
LET wx1=lx-1 !º¸¾å¤ÎºÂɸ
LET wy1=ly-15
LET wx2=wx1+ox*q !±¦²¼¤ÎºÂɸ
LET wy2=vy-5


!------------------------------ ¥Ñ¥Ã¥É
LET px=x !º¸¾å¤ÎºÂɸ
LET pw=5 !Éý¤ÎȾʬ


!------------------------------ ¥Ü¡¼¥ë
LET dx=3 !°ÜÆ°Êý¸þ
LET dy=5

LET x1=INT((wx2-wx1)/2) !ȯ¼Í°ÌÃÖ
LET y1=ly+oy*p + 10

LET x=x1 !¸½ºß¤Î°ÌÃÖ
LET y=y1


LET k=0
LET NumOfBlock=p*q !¥Ö¥í¥Ã¥¯¤ÎÁí¿ô
LET NumOfPad=3 !¥Ñ¥Ã¥É¤Î»Ä¤ê¿ô

DO !¥²¡¼¥à¥ë¡¼¥×

!------------------------------ Åö¤êȽÄê
   IF (x<=wx1 AND x1<>wx1) THEN !º¸Â¦¤ÎÊÉ¡¡¢¨£²½Å¾×ÆÍËÉ»ß
   !!!IF x<=wx1 THEN !º¸Â¦¤ÎÊÉ
      LET k=0 !¥Ü¡¼¥ë¤Îµ¯ÅÀ
      LET x1=wx1
      LET y1=y-INT((wx1-x)*dy/dx) !°ÌÃÖ¤òÊäÀµ¡¡¢¨ÊɤΤ¹¤êÈ´¤±
      LET x=x1 !¥Ü¡¼¥ë¤Î°ÌÃÖ
      LET y=y1
      LET dx=-dx !¥Ü¡¼¥ë¤ÎÈ¿¼Í
   END IF
   IF (x>=wx2 AND x1<>wx2) THEN !±¦Â¦¤ÎÊÉ
   !!!IF x>=wx2 THEN !±¦Â¦¤ÎÊÉ
      LET k=0
      LET x1=wx2
      LET y1=y-INT((x-wx2)*dy/dx)
      LET x=x1
      LET y=y1
      LET dx=-dx
   END IF

   LET xx=x-lx !¥Ö¥í¥Ã¥¯¤ÎÎΰ賰¤Ê¤é
   LET yy=y-ly
   IF xx<0 OR xx>=ox*q OR yy<0 OR yy>=oy*p THEN

      IF (y<=wy1 AND y1<>wy1) THEN !¾å¦¤ÎÊÉ
      !!!IF y<=wy1 THEN !¾å¦¤ÎÊÉ
         LET k=0
         LET x1=x-INT((wy1-y)*dx/dy)
         LET y1=wy1
         LET x=x1
         LET y=y1
         LET dy=-dy
      END IF

      IF ABS(x-px)<=pw AND (y>=wy2 AND y1<>wy2) THEN !¥Ñ¥Ã¥É
      !!!IF ABS(x-px)<=pw AND y>=wy2 THEN !¥Ñ¥Ã¥É
         LET k=0
         LET x1=x-INT((y-wy2)*dx/dy)
         LET y1=wy2
         LET x=x1
         LET y=y1
         LET dy=-dy
      END IF
      IF y>=vy THEN !¥ß¥¹¡ª¡ª¡ª
         LET NumOfPad=NumOfPad-1
         LET x=x1 !¥Ü¡¼¥ë¤Î°ÌÃÖ
         LET y=y1
         LET px=x !¥Ñ¥Ã¥É¤Î°ÌÃÖ
         WAIT DELAY 1
      END IF

   ELSE !ÎΰèÆâ¤Ê¤é

   !¢¨¥Ö¥í¥Ã¥¯¤ò¸ü¤¯¤¹¤ë¤È¥Ü¡¼¥ë¤¬ÆâÉô¤ËÆþ¤Ã¤¿¾õÂ֤ˤʤäơ¢²¿½Å¤Ë¤â¾×Æͤ·¤¿¤³¤È¤Ë¤Ê¤ë¡£
      LET xx=INT(xx/ox) !³ºÅö¤¹¤ë¥Ö¥í¥Ã¥¯¤Î°ÌÃÖ¤ò»»½Ð¤¹¤ë
      LET yy=INT(yy/oy)
      IF B(yy,xx)>0 THEN !¾ÃÌǤµ¤»¤ë
         LET B(yy,xx)=B(yy,xx)-1
         IF B(yy,xx)=0 THEN LET NumOfBlock=NumOfBlock-1

         LET k=0
         LET x1=x
         LET y1=y
         LET dy=-dy
      END IF

   END IF


   !------------------------------ ÉÁ²è½èÍýËè¡Ê¥Õ¥ì¡¼¥à¤òɽ¼¨¤¹¤ë¡Ë
   SET DRAW mode hidden !¤Á¤é¤Ä¤­Ëɻ߳«»Ï
   CLEAR

   SET AREA COLOR 1
   FOR xx=wx1 TO wx2 !¾å¦¤ÎÊɤòɽ¼¨¤¹¤ë
      DRAW DOT WITH SHIFT(V2W(xx),V2W(wy1))
   NEXT xx
   FOR yy=wy1 TO wy2
      DRAW DOT WITH SHIFT(V2W(wx1),V2W(yy)) !º¸Â¦¡¢
      DRAW DOT WITH SHIFT(V2W(wx2),V2W(yy)) !±¦Â¦
   NEXT yy

   FOR yy=0 TO p-1 !¥Ö¥í¥Ã¥¯
      FOR xx=0 TO q-1
         LET c=B(yy,xx)
         IF c>0 THEN !¸ºß¤¹¤ë¤Ê¤é
            SET AREA COLOR BC(c) !¥ë¥Ã¥¯¥¢¥Ã¥×¥Æ¡¼¥Ö¥ë¤ò»²¾È¤¹¤ë
            DRAW BLOCK(oy-1,ox-1) WITH SHIFT(V2W(lx+ox*xx),V2W(ly+oy*yy))
         END IF
      NEXT xx
   NEXT yy

   SET AREA COLOR 1
   DRAW BLOCK(2,2*pw) WITH SHIFT(V2W(px-pw),V2W(wy2)) !¥Ñ¥Ã¥É¡¡¢¨Ãæ¿´¤ÎºÂɸ¤Ç

   SET AREA COLOR 2
   DRAW BLOCK(3,3) WITH SHIFT(V2W(x-1),V2W(y-1)) !¥Ü¡¼¥ë¡¡¢¨Ãæ¿´¤ÎºÂɸ¤Ç

   SET DRAW mode explicit !¤Á¤é¤Ä¤­Ëɻ߽ªÎ»


   !------------------------------ °ÜÆ°½èÍý¡Ê¼¡¤Î¥Õ¥ì¡¼¥à¤Ø¡Ë
   IF ABS(dy)<ABS(dx) THEN !x¤ÎÊý¤¬Áýʬ¤¬Â¿¤¤
   !¢¢¢¢¢¢¢£
   !¢¢¢£¢£¢¢¡¡¡¡y=l*x+m ¤Î¼°¤È¤·¤Æ¹Í¤¨¤ë
   !¢£¢¢¢¢¢¢
      LET k=k+SGN(dx) !¡Þ£±¡¡°ÜÆ°ÎÌ¡¡¢¨Äã²òÁüÅÙ¤À¤È¥«¥¯¥«¥¯Æ°¤¯¤è¤¦¤Ë¸«¤¨¤ë
      !!!LET k=k+SGN(dx)*3 !¡Þ£³¡¡°ÜÆ°ÎÌ
      LET x=x1+k
      LET y=y1+INT(k*dy/dx)
   ELSE !y¤ÎÊý¤¬Áýʬ¤¬Â¿¤¤
   !¢¢¢¢¢£
   !¢¢¢£¢¢¡¡¡¡x=l*y+m ¤Î¼°¤È¤·¤Æ¹Í¤¨¤ë
   !¢¢¢£¢¢
   !¢£¢¢¢¢
      LET k=k+SGN(dy) !¡Þ£±¡¡°ÜÆ°ÎÌ
      !!!LET k=k+SGN(dy)*3 !¡Þ£³¡¡°ÜÆ°ÎÌ
      LET x=x1+INT(k*dx/dy)
      LET y=y1+k
   END IF

   LET px=x !¥Ñ¥Ã¥É°ÌÃ֤ϥܡ¼¥ë¤Î¿¿²¼


   !!!WAIT DELAY 0.2

LOOP UNTIL NumOfPad=0 OR NumOfBlock=0 !¥Ñ¥Ã¥É¡¢¥Ö¥í¥Ã¥¯¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç


PICTURE BLOCK(m,n) !¥Ö¥í¥Ã¥¯¤Ê¤É¤ò°ÌÃÖ(0,0)-(n,m)¤Ëɽ¼¨¤¹¤ë
   PLOT AREA: -2,-2; 4*n-2,-2; 4*n-2,4*m-2; -2,4*m-2
END PICTURE
!PICTURE BLOCK(m,n) !¥Ö¥í¥Ã¥¯¤Ê¤É¤ò°ÌÃÖ(0,0)-(n,m)¤Ëɽ¼¨¤¹¤ë
!   FOR i=0 TO m-1 !m¡ßn¥É¥Ã¥È
!      FOR j=0 TO n-1
!         DRAW DOT WITH SHIFT(V2W(j),V2W(i))
!      NEXT j
!   NEXT i
!END PICTURE

END
 

Re: ¥Ï¥¤¥¦¥§¥¤

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ11·î30Æü(·î)03»þ47ʬ38ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.758[¸µµ­»ö¤Ø]

!¼¡¤ÎÌäÂ꤬²ò¤±¤Ê¤«¤Ã¤¿¤¬¡¢
!¡Ö¸«¤¨±£¤ì¤¹¤ëÏ©Ì̤Î΢¦¤ò¡¢Ê̤ʿ§¤ÇÅɤëÊýË¡¡×¤¬¡¢¸«¤Ä¤«¤Ã¤¿¡£
!------------
! ¥Ï¥¤¥¦¥§¥¤
!------------
!SET bitmap SIZE 671,671 !¢« Â礭¤¤²èÌ̤ˤ¹¤ë¤È¤­¡£(1024x768 ¤Ë¤Ô¤Ã¤¿¤ê)
DIM Mp(4,4)         !»ëÅÀ¤«¤é¤ÎÈï¼ÌÂΤÎÁêÂкÂɸ¡Ê°ìÅÀÅê±ÆÍÑ¡Ë
DIM Xz(4,4),zY(4,4) !XY_XzÊÑ´¹, XY_zYÊÑ´¹
DIM XYz(4,4)        !XYÊ¿Ì̤ÎzÊ¿¹Ô°ÜÆ°
!
!¢¨Åê±ÆÌ̤Î΢¦¤Ë¡¢ÁàºîÂоݤ¬Í­¤ë¤Î¤Ç¡¢ºÂɸ¤Ïº¸¼ê·Ï¡Ê£Ú¼´¤¬Î¢¸þ¤­¡Ë¤Ç¤¹¡£
!¡¡Åê±ÆÌ̤ò¡¢¼ÖξÁ°±ïd ¤ËÃÖ¤­¡¢Z=1.5 ¡¢»ëÅÀ Z=0 ¤¬ ¼êÁ°¡£
!¡¡»ëÅÀ Z=0 ¤òĺÅÀ¤Ë¡¢Åê±ÆÌÌ Z=1.5 ¤Ø °ìÅÀÅê±Æ¡£ÌÌÃæ¿´¤«¤é¡Þ£±¤ò²èÌ̤Ȥ·¡¢
!¡¡³°³¦Ì̤ò¡¢Åê±ÆÌÌ Á°Êý+150 ¤«¤é¡¢Åê±ÆÌÌ Z=1.5 ¤Þ¤Ç¤ò¡¢±ü¤«¤éÉÁ¤¯¡£
!-------------------------------------------------------------------------
!      °ìÅÀÅê±ÆÍÑ Mp
!
!¸¶²è_¹Ô¥Ù¥¯¥È¥ë     Mp           ɽ¼¨_¹Ô¥Ù¥¯¥È¥ë
!     (X,Y,Z,1)|1   0   0   0| ¢ª¡ÊX+x,Y+y, * ,Z+z) ¤Î£´ÎóÌÜ Z+z ¤Ç½Ì¾®¡£
!              |0   1   0   0|                               ¢­
!              |0   0   0   1|      ºÂɸ (X+x)/(Z+z),(Y+y)/(Z+z) ¤ÎÉÁÅÀ·²¡£
!              |x   y   0   z|      * °õ¤Ï¡ÖºÇ½ªÅªÉ½¼¨¤Ç̵¸ú¡×¤Î£úºÂɸ¡£
MAT READ Mp
DATA 1,0,0,0   !¾®Ê¸»ú x y z ¤Ï¡¢»ëÅÀ¤«¤é¡¢Æ»Ï©º¸Ã¼¤ÎÁêÂкÂɸ¡£
DATA 0,1,0,0
DATA 0,0,0,1   !ÊÑ·Á»Ø¼¨ MAT ʸ¤Ç¸ú²Ì¤¹¤ë¡£
DATA 0,0,0,0
!-------------------------------------------------------------------------
!¡¡Æ»Ï©¤Ê¤É¡¢²èÌ̤˿âľ¤Ê¹­¤¬¤ê¤Ï¡¢°Ê²¼¤Î Xz zY XYz ¹ÔÎó¤ò¡¢Àè¤ËÄ̤·¤Þ¤¹¡£
!¡¡¾å¤Î¸¶²è¤Î Z ¤ÏÄ̾¤Ç¤¹¤¬¡¢°Ê²¼¤ÎÍÍ¤Ë ÊÑ·Á¤ò¹Ô¤Ê¤¦¤È¡¢È¯À¸¤·¤Þ¤¹¡£
!-------------------------------------------------------------------------
!¡ãÏ©ÌÌ¡ä¤Î¸¶²èÍÑ Xz   ¡¡XYÊ¿ÌÌ¢ª XZÊ¿Ì̤Ȥ·¤ÆÉÁ¤¯¡£
!
!¸¶²è_¹Ô¥Ù¥¯¥È ¥ë                   ¿·¤·¤¤¸¶²è_¹Ô¥Ù¥¯¥È¥ë
!     (X,Y,0,1)|1    0    0   0| ¢ª¡ÊX+Y*dxdz, Y*dydz, Y, 1)
!              |dxdz dydz 1   0|
!              |0    0    0   0|    dxdz: £Ú¼´¥«¡¼¥Ö¤ÎÈùʬ dx/dz
!              |0    0    0   1|    dydz: £Ú¼´¥Ô¥Ã¥Á¤ÎÈùʬ dy/dz
MAT READ Xz
DATA 1,0,0,0
DATA 0,0,1,0
DATA 0,0,0,0
DATA 0,0,0,1
!-------------------------------------------------------------------------
!¡ã·úʪ¡ä¤Î¸¶²èÍÑ zY     XYÊ¿ÌÌ¢ª ZYÊ¿Ì̤Ȥ·¤ÆÉÁ¤¯¡£
!
!¸¶²è_¹Ô¥Ù¥¯¥È ¥ë                   ¿·¤·¤¤¸¶²è_¹Ô¥Ù¥¯¥È¥ë
!     (X,Y,0,1)|dxdz 0    1   0| ¢ª¡ÊX*dxdz+x, Y, X, 1)
!              |0    1    0   0|
!              |0    0    0   0|    dxdz: £Ú¼´¥«¡¼¥Ö¤ÎÈùʬ dx/dz
!              |x    0    0   1|       x: ZYÊ¿Ì̤ΣøºÂɸ
MAT READ zY
DATA 0,0,1,0
DATA 0,1,0,0
DATA 0,0,0,0
DATA 0,0,0,1
!-------------------------------------------------------------------------
!¡ã·úʪ¡ä¤Î¸¶²èÍÑ XYz     XYÊ¿Ì̤ΠZ¼´°ÜÆ°¡£
!
!¸¶²è_¹Ô¥Ù¥¯¥È ¥ë                       ¿·¤·¤¤¸¶²è_¹Ô¥Ù¥¯¥È¥ë
!     (X,Y,0,1)|1        0    0   0| ¢ª¡ÊX+(dxdz)*z, Y, z, 1)
!              |0        1    0   0|
!              |0        0    0   0|    dxdz: £Ú¼´¥«¡¼¥Ö¤ÎÈùʬ dx/dz
!              |(dxdz)*z 0    z   1|       z: Z¼´ °ÜÆ°º¹Ê¬
MAT READ XYz
DATA 1,0,0,0
DATA 0,1,0,0
DATA 0,0,0,0
DATA 0,0,0,1
!-------------------------------------------------------------------------
!
DEF yaw(z)= 10*SIN((z-2)*0.1)     !¥«¡¼¥Ö¡¢²£¤ÎÊк¹  x(z)
DEF d_yaw(z)= COS((z-2)*0.1)      !¥«¡¼¥Ö¡¢Èùʬ·¸¿ô dx/dz
DEF pitch(z)= 5*SIN(z*0.1)        !¥Ô¥Ã¥Á¡¢½Ä¤ÎÊк¹  y(z)
DEF d_pitch(z)= 0.5*COS(z*0.1)    !¥Ô¥Ã¥Á¡¢Èùʬ·¸¿ô dy/dz
!
DEF v(t)=v0+a*t                   !®ÅÙ
DEF I_v(t)=v0*t+a*t*t/2           !°ÜÆ°µ÷Î¥ ¢év(t)dt
!
LET v0=15                         !½é®ÅÙ
LET a=-v0^2/2/100                 !¸ºÂ®²Ã®ÅÙ, -v0^2/2/°ÜÆ°µ÷Î¥
!
LET Zs=1.5                        ! Æ©»ëÌ̤ΣúºÂɸ( »ëÅÀ Z=0)
SET WINDOW -1,1,-1,1              !²èÌÌ¥¹¥±¡¼¥ë¡Þ£±
LET t0=TIME
DO
   LET t1=TIME-t0
   IF t1>tb+0.15 THEN
      LET tb=t1
      LET d=I_v(t)                !¼ÖξÁ°±ïd ¤Î£úºÂɸ
      PRINT USING "»þ´Ö=###.## ®ÅÙ=###.##  Áö¹Ôµ÷Î¥=###.##":t,v(t),d
      SET DRAW mode hidden        !΢¥Ú¡¼¥¸¤Ë½ñ¤¯
      CALL Animation              ! ÉÁ²è
      SET DRAW mode explicit      !΢¥Ú¡¼¥¸¤Îɽ¼¨
      LET t=t+.15
   END IF
   MOUSE POLL msx,msy,mlb,mrb
LOOP UNTIL v(t)<=0 OR mrb=1

SUB Animation
!----sky
   SET AREA COLOR 17
   PLOT AREA:-1,0; 1,0; 1,1; -1,1
   !----ground
   SET AREA COLOR 42
   PLOT AREA:-1,0; 1,0; 1,-1; -1,-1
   !----guide message
   SET TEXT COLOR 1
   SET TEXT FONT "",11
   PLOT TEXT,AT.35,.9:"±¦¥¯¥ê¥Ã¥¯ÊÝ»ý Stop"
   SET TEXT COLOR 0
   SET TEXT FONT "",90
   !----
   LET ss=5/2
   FOR i=IP((d+150)/ss)*ss TO d STEP -ss
      LET z=i-d+Zs !»ëÅÀ Z=0 ¡Á£é¤Î£úºÂɸ¡£
      LET Mp(4,1)=  yaw(i)-yaw(d)  -1.5 !Åê±ÆÌÌÃæ¿´Àþ¤«¤éƻϩº¸Ã¼¤Î£øºÂɸ
      LET Mp(4,2)=pitch(i)-pitch(d)-1.5 !Åê±ÆÌÌÃæ¿´Àþ¤«¤éƻϩº¸Ã¼¤Î£ùºÂɸ
      LET Mp(4,4)= z
      !----
      ! 1                 ,0                     ,0         ,0|
      ! 0                 ,1                     ,0         ,0|
      ! 0                 ,0                     ,0         ,1|
      ! yaw(i)-yaw(d)-1.5 ,pitch(i)-pitch(d)-1.5 ,0         ,z|
      !----
      IF MOD(i,10)=0 THEN
         DRAW Building( 0-2,-9, -3,20,-2  ) WITH Mp   !x,y, W,H,D
         DRAW Building( 6+2,-9, -3,19, 2.5) WITH Mp   !x,y, W,H,D
         DRAW Sign WITH Mp
      END IF
      IF MOD(i,10)=5 THEN DRAW Tree WITH Mp
      DRAW Road(-.993*ss) WITH Mp
   NEXT i
END SUB

!¥Ñ¡¼¥Ä¤Î¥µ¥¤¥º¡£
!²èÌÌ( z=Åê±ÆÌÌZs 1.5¡§¼ÖξÁ°±ïd )¤Ç¡¢É½¼¨ÇÜΨ 1/z ( ¼ÂÉý£³¢ª ÉÁ²èÉý£²)
!¸¶²èºÂɸ¤Ç¡¢Æ»Ï©º¸Ã¼£ø£ù£ú( 0 ,  0  ,1.5)= ²èÌ̺¸²¼³Ñ(-1,-1)
!¸¶²èºÂɸ¤Ç¡¢º¸¼ÖÀþ¾å£ø£ù£ú(1.5, 1.5 ,1.5)= ²èÌÌÃæ¿´ÅÀ( 0, 0) ¡ÄÅê±ÆÃæ¿´

PICTURE Building(x,y,w,h,d1)
   IF Zs-z<=w THEN
   !---back plane
      LET zY(1,1)=d_yaw(i+w/2)     !£Ú¼´¥«¡¼¥Ö¤ÎÈùʬ dx/dz
      LET zY(4,1)=x+d1             !ZYÊ¿Ì̤ΣøºÂɸ
      DRAW Wall((y),w,h) WITH zY
      !---facade
      LET zY(4,1)=x                !ZYÊ¿Ì̤ΣøºÂɸ
      DRAW Wall((y),w,h) WITH zY
      !---side plane
      LET XYz(4,1)=d_yaw(i+w/2)*w  !£Ú¼´¥«¡¼¥Ö¤Ë¤è¤ë£ø°ÜÆ°º¹Ê¬
      LET XYz(4,3)=w               !£Ú¼´ °ÜÆ°º¹Ê¬
      DRAW Side(x,y,h,d1) WITH XYz
   END IF
END PICTURE
!
PICTURE Wall(y,w,h)
   SET AREA COLOR 8  !gray
   PLOT AREA: 0,y; w,y; w,y+h; 0,y+h       !(Z,Y)Ê¿Ì̤Ȥ·¤ÆÉÁ¤¯¡£
   FOR y=y+h-.5 TO y+1 STEP -2.5
      PLOT LINES: 0,y; w,y                 !(Z,Y)Ê¿Ì̤Ȥ·¤ÆÉÁ¤¯¡£
   NEXT y
END PICTURE
!
PICTURE Side(x,y,h,d1)
   SET AREA COLOR 16 !dark gray
   PLOT AREA: x,y; x+d1,y; x+d1,y+h; x,y+h !°ÜÆ°Á°(X,Y)Ê¿Ì̤Ȥ·¤ÆÉÁ¤¯¡£
END PICTURE

PICTURE Road(e)
   IF e< Zs-z THEN LET e=Zs-z
   LET Xz(2,1)=d_yaw(i+e/2)     !£Ú¼´¥«¡¼¥Ö¤ÎÈùʬ dx/dz
   LET Xz(2,2)=d_pitch(i+e/2)   !£Ú¼´¥Ô¥Ã¥Á¤ÎÈùʬ dy/dz
   DRAW Surface(e) WITH Xz
END PICTURE
!
PICTURE Surface(e)
   IF Mp(4,2)/z<=d_pitch(i+e/2) THEN
      SET AREA COLOR 15
      PLOT AREA: 0,0; 6,0; 6,e; 0,e           !(X,Z)Ê¿Ì̤Ȥ·¤ÆÉÁ¤¯¡£
      !---center line
      SET AREA COLOR 0
      PLOT AREA: 2.9,0; 2.9,e; 3.1,e; 3.1,0   !(X,Z)Ê¿Ì̤Ȥ·¤ÆÉÁ¤¯¡£
   ELSE
   !---back side
      SET AREA COLOR 2
      PLOT AREA: 0,0; 6,0; 6,e; 0,e           !(X,Z)Ê¿Ì̤Ȥ·¤ÆÉÁ¤¯¡£
   END IF
   !---joint line
   PLOT LINES: 0  ,0; 2.9,0
   PLOT LINES: 3.1,0; 6  ,0
END PICTURE

PICTURE Tree
   SET AREA COLOR 12 !´´
   PLOT AREA:-0.075,0; 0.075,0; 0.025,3;-0.025,3
   SET AREA COLOR 10
   FOR w=1 TO 7      !ÍÕ
      DRAW disk WITH SCALE(0.3+0.05-RND*0.1)*SHIFT(0.4-RND*0.8, 2.7+0.325-RND*0.75)
   NEXT W
END PICTURE

PICTURE Sign
   IF MOD(i,50)=0 THEN SET AREA COLOR 2 ELSE SET AREA COLOR 4
   PLOT AREA:-0.025,0; 0.025,0; 0.025,2;-0.025,2 !pole
   DRAW disk WITH SCALE(0.5)*SHIFT(0,2)          !plate
   !PLOT TEXT,AT -.35,1.74,USING ">%%":STR$(i)    !sign
   CALL Plot_7segment(0 ,2 ,0.15 ,STR$(i))       !sign( PLOT TEXT ¤¬½Å¤¤»þ)
END PICTURE

SUB Plot_7segment(x,y,s,i$) !ʸ»úÎóÃæ¿´(x,y) ʸ»ú¤Î²£Éý(s) ¿ô»ú¤Îʸ»úÎó(i$)
   SET LINE COLOR 0
   SET LINE width 9/z       !°ìÅÀÅê±Æ¡¦½Ì¾®¤ÎÊä½þ¡£(ÀþÉý¤Ï MAT ʸ¤Ç½Ì¤Þ¤Ê¤¤)
   LET w=LEN(i$)
   LET s1=s      ! y¼´¢¬:s1=s  y¼´¢­:s1=-s
   LET s2=s/2
   LET x=x-(w-1)*s2*1.6
   FOR p=1 TO w
      SELECT CASE VAL(i$(p:p))
      CASE 0
         PLOT LINES:x-s2,y+s;x-s2,y-s;x+s2,y-s;x+s2,y+s;x-s2,y+s
      CASE 1
         PLOT LINES:x,y-s;x,y+s
      CASE 2
         PLOT LINES:x-s2,y+s1;x+s2,y+s1;x+s2,y;x-s2,y;x-s2,y-s1;x+s2,y-s1
      CASE 3
         PLOT LINES:x-s2,y-s;x+s2,y-s;x+s2,y+s;x-s2,y+s
         PLOT LINES:x-s2,y;x+s2,y
      CASE 4
         PLOT LINES:x-s2,y+s1;x-s2,y;x+s2,y
         PLOT LINES:x+s2,y+s1;x+s2,y-s1
      CASE 5
         PLOT LINES:x+s2,y+s1;x-s2,y+s1;x-s2,y;x+s2,y;x+s2,y-s1;x-s2,y-s1
      CASE 6
         PLOT LINES:x+s2,y+s1;x-s2,y+s1;x-s2,y-s1;x+s2,y-s1;x+s2,y;x-s2,y
      CASE 7
         PLOT LINES:x-s2,y+s1;x+s2,y+s1;x+s2,y-s1
      CASE 8
         PLOT LINES:x-s2,y;x-s2,y-s;x+s2,y-s;x+s2,y+s;x-s2,y+s;x-s2,y;x+s2,y
      CASE 9
         PLOT LINES:x+s2,y;x-s2,y;x-s2,y+s1;x+s2,y+s1;x+s2,y-s1;x-s2,y-s1
      CASE ELSE
      END SELECT
      LET x=x+s*1.6
   NEXT p
   SET LINE width 1
   SET LINE COLOR 1
END SUB

END
 

Ver. 7.4.0

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ11·î30Æü(·î)15»þ24ʬ4ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  Ver. 7.4.0¤Ç¡¤¿Þ·ÁÊÑ·Á¤¬Í­¸ú¤Ê¤È¤­¤ËPLOT TEXTʸ¤ò¼Â¹Ô¤·¤¿¾ì¹ç¤Ë¤Ï¡¤»ú·Á¼«ÂΤòÊÑ·Á¤ÎÂоݤ˴ޤá¤Þ¤¹¡£ JISµ¬³Ê¡Ê¡áANSI¡¤ISO¡Ë¤Ç¤Ï¥Æ¥­¥¹¥È¤ÏÌäÂêºÂɸ¤ÇÄêµÁ¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¤¬¡¤¤½¤ÎÄ̤ê¤Ë¤·¤Æ¤·¤Þ¤¦¤È¿¤¯¤Î¾ì¹ç¤Ëʸ»ú¤¬Æɤá¤Ê¤¯¤Ê¤Ã¤Æ¤· ¤Þ¤¦¤Î¤Ç¡¤´°Á´¤ËJIS¤Ë¹çÃפµ¤»¤ë¤³¤È¤ÏÊÝα¤È¤·¤Æ¤ª¤­¤Þ¤¹¡£
¤Ê¤ª¡¤µìÍè¤ÎPLOT TEXTʸ¤ÎÆ°ºî¤ò¿·ÀߤÎPLOT LETTERSʸ¤Ë°ú¤­·Ñ¤®¤Þ¤¹¡£
¤Þ¤¿¡¤¿Þ·ÁÊÑ·Á¤¬É½¸þ¤­Áê»÷ÊÑ´¹¤Ç¤¢¤ë¾ì¹ç¤Ë¤Ï¡¤½¾Íè¤É¤ª¤ê¤ÎÉÁ²è¤È¤·¤Þ¤¹¡£
 

Re: ¥»¥ó¥¿¡¼»î¸³ÄøÅÙ¤Î¥×¥í¥°¥é¥à±é½¬

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ12·î 1Æü(²Ð)09»þ42ʬ32ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.756[¸µµ­»ö¤Ø]

¥Ô¥ó¥Ý¥ó¤Î¿ôÍý

ÌäÂê¡¡Êɤ˲¿²ó¤«¥Ð¥¦¥ó¥É¤µ¤»¤Æ¡¢Ì¿Ã椵¤ì¤ë¤Ë¤Ï¡©


¸µ¤Î¿Þ·Á¤ò¡¢½Ä¤È²£¤Ë¶ÀÌÌ¥³¥Ô¡¼¤·¤ÆËü²Ú¶À¤ò¤Ä¤¯¤ë¡£
¤³¤³¤Ç¤ÏÂè°ì¾Ý¸Â¤Ç¹Í¤¨¤ë¡£¥Ü¡¼¥ë¤Îȯ¼Í°ÌÃÖ¤ÈÊý¸þ¤Ë¤è¤ê¡¢ÁªÂò¤¹¤ì¤Ð¤è¤¤¡£
¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤Æɽ¼¨¤µ¤ì¤ë³ÆĹÊý·Á¤Î
Ãæ±û¤Î¿ô»ú¤Ï¡¢¥Ð¥¦¥ó¥É²ó¿ô¡£¡¡º¸²¼¤Î¿ô»ú¤Ï¡¢¥Æ¡¼¥Ö¥ëÈֹ档 ÌÜɸ¡Ê¥¿¡¼¥²¥Ã¥È¡Ë¤ò¹õÅÀ¤È¤¹¤ë¡£

£ÁÅÀ¤«¤é¥Ü¡¼¥ë¤òȯ¼Í¤µ¤»¤ë¾ì¹ç¡¢¤¿¤È¤¨¤Ð£³²ó¤Î¥Ð¥¦¥ó¥É¤ÇÌ¿Ã椵¤»¤ë¤Ë¤Ï¡¢
£³¡¢£¶¡¢£¹¡¢£±£²È֤Υơ¼¥Ö¥ë¤Ç¤Î¡¢¸¶ÅÀ¤È¹õÅÀ¤ò·ë¤ÖÀþʬ¤¬¤½¤Îµ°ÀפȤʤ롣
¤³¤ÎÀþʬ¤È½ÄÀþ¤ä²£Àþ¤È¤Î¸òÅÀ¤Î¿ô¤¬¡¢¥Ð¥¦¥ó¥É²ó¿ô¤È¤Ê¤ë¡£

¼ÂºÝ¤Î¥Ü¡¼¥ë¤ÎÆ°¤­¤Ï¡¢£¹È֤ξì¹ç¡¢ÀÞ¤ê»æ¤Î¤è¤¦¤Ë£¹¡¢£¸¡¢£´¡¢£°È֤νç¤Ë¡¢
ÊÕ¤¬½Å¤Ê¤Ã¤¿¤È¤³¤í¤òÀÞ¤êÀþ¤È¤·¤ÆÀÞ¤ê½Å¤Í¤Æ¤¤¤¯¡£(»³ÀޤꡢëÀÞ¤ê¤É¤Á¤é¤Ç¤â¤è¤¤)
°ìÊҤȤʤ俤½¤ÎÀþ¤òÆ©¤«¤·¤Æ¸«¤ì¤Ð¤è¤¤¡£
SET bitmap SIZE 601,601
SET WINDOW -1,21,-1,21 !¥Ð¥¦¥ó¥É¤ò¸¡Æ¤¤¹¤ë¾Ý¸Â¤òÁª¤Ö
DRAW grid

LET w=5 !¥Æ¡¼¥Ö¥ë¡Ê¥³¡¼¥È¡Ë¤ÎÂ礭¤µ
LET h=4

FOR y=0 TO 5 !½ÄÊý¸þ¤Ø¶ÀÌÌ¥³¥Ô¡¼
   FOR x=0 TO 4 !²£Êý¸þ
      LET cx=x*w+w/2
      LET cy=y*h+h/2
      DRAW rect WITH SCALE(1-2*MOD(x,2),1-2*MOD(y,2))*SHIFT(cx,cy) !ÇÜΨSCALEÊÑ´¹¤Ç¶ÀÌÌ¥³¥Ô¡¼¤¹¤ë

      PLOT TEXT ,AT cx,cy: STR$(ABS(x)+ABS(y)) !¥Ð¥¦¥ó¥É¤Î²ó¿ô¡ÊÃæ±û¡Ë

      PLOT TEXT ,AT x*w+1,y*h+1: STR$(y*(w-1)+x) !¥Æ¡¼¥Ö¥ëÈÖ¹æ¡Êº¸²¼¡Ë
      PLOT TEXT ,AT x*w+0.1,y*h+0.1: mid$("ABCD",MOD(x,2)+2*MOD(y,2)+1,1) !ĺÅÀ
   NEXT x
NEXT y


LET ex=6 !ÌÜɸ¤Î°ÌÃÖ
LET ey=11
PLOT LINES: 0,0; ex,ey !¾å¡¢²¼¡¢±¦¤Ç¥Ð¥¦¥ó¥É¤¹¤ë

!FOR i=1 TO 50-1
!   DRAW disk WITH SCALE(0.1)*SHIFT(i*ex/50,i*ey/50)
!NEXT i


PICTURE rect !¸¶ÅÀ¤ÇÂоΤÊĹÊý·Á¤òÉÁ¤¯
   PLOT LINES: -w/2,-h/2; w/2,-h/2; w/2,h/2; -w/2,h/2; -w/2,-h/2
   DRAW disk WITH SCALE(0.1)*SHIFT(w/2-1,h/2-1) !ÌÜɸ
END PICTURE

END

¥Ð¥¦¥ó¥É²ó¿ô¤Î¶ö¿ô¤Ï¡¢ÀÞ¤ê»æ¤òÀÞ¤ê¾ö¤ó¤À¤È¤­¤Îɽ¤Î¤Þ¤Þ¤ÎÉôʬ¡£´ñ¿ô¤Ï¡¢Î¢ÊÖ¤ëÉôʬ¤È¤Ê¤ë¡£
 

¶ÊÀþ¡Ê¥Ñ¥¹¡Ë¾å¤Ëʸ»ú¤òɽ¼¨¤¹¤ë

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ12·î 6Æü(Æü)20»þ58ʬ45ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ¡üÍÛ´Ø¿ôɽ¼¨
!¶ÊÀþ¾å¤Ëʸ»ú¤òɽ¼¨¤¹¤ë

SET WINDOW -5,5,-5,5
DRAW grid

SET TEXT HEIGHT 0.5
SET TEXT JUSTIFY "CENTER","BOTTOM"
DRAW TextOnPath("Abc¤¢¤¤´Á",1.5) WITH SHIFT(-2,-1)

END


EXTERNAL FUNCTION f(x) !¶ÊÀþ y=f(x)¡¡¢¨ÍÛ´Ø¿ôɽ¼¨
!LET f=ABS(x-3)
!LET f=x^3
LET f=SIN(x)
END FUNCTION


EXTERNAL PICTURE TextOnPath(s$,L) !¶ÊÀþ¾å¤Ëʸ»ú¤òɽ¼¨¤¹¤ë
IF LEN(s$)=0 OR L<=0 THEN EXIT PICTURE

LET k=1 !£ëʸ»úÌÜ

LET S=0 !¶ÊÀþy=f(x)¤Î¶è´Ö[a,b]¤ÎŤµ¡¡S=¢é[a,b]SQR(1+f'(x)^2)dx
LET H=0.05
LET i=0
DO
   LET t=H*i !¥ê¡¼¥Þ¥óÏ¡¢¶èʬµáÀÑ

   LET Ft=f(t)
   LET df=(f(t+H)-Ft)/H !Ƴ´Ø¿ô f'(x)¡¡¢¨Èùʬ·¸¿ô¤Ë¤è¤ë
   LET S=S+H*SQR(1+df*df)

   IF S>=(k-1)*L THEN !ʸ»ú´Ö³Ö¤´¤È¤Ë
      DRAW disk WITH SCALE(0.05)*SHIFT(t,Ft) !°ÌÃÖ¤ò°õ¤¹
      SET TEXT ANGLE ANGLE(1,df) !³ÑÅÙ¤òÄ´À°¤¹¤ë
      PLOT TEXT ,AT t,Ft: s$(k:k) !£ëʸ»úÌÜ

      LET k=k+1 !¼¡¤Îʸ»ú¤Ø
      IF k>LEN(s$) THEN EXIT PICTURE !¤¹¤Ù¤Æ¤Îʸ»ú¤òɽ¼¨¤·¤¿¤Ê¤é
   ELSE
      PLOT LINES: t,Ft; !¶ÊÀþ¤Îµ°À×
   END IF

   LET i=i+1
LOOP
END PICTURE


¡üÇÞ²ðÊÑ¿ôɽ¼¨
!¶ÊÀþ¾å¤Ëʸ»ú¤òɽ¼¨¤¹¤ë

SET WINDOW -5,5,-5,5
DRAW grid

SET TEXT HEIGHT 0.5
SET TEXT JUSTIFY "CENTER","BOTTOM"
DRAW TextOnPath("Abc¤¢¤¤´Á",1.5) WITH SHIFT(-2,-1)

END


EXTERNAL FUNCTION x(t) !¶ÊÀþ x=f(t)¡¢y=f(t)¡¡¢¨ÇÞ²ðÊÑ¿ôɽ¼¨
!!!LET x=t !y=sin(x)
LET x=3*COS(t) !Ⱦ·Â£³¤Î±ß
END FUNCTION
EXTERNAL FUNCTION y(t)
!!!LET y=SIN(t) !y=sin(x)
LET y=3*SIN(t) !Ⱦ·Â£³¤Î±ß
END FUNCTION


EXTERNAL PICTURE TextOnPath(s$,L) !¶ÊÀþ¾å¤Ëʸ»ú¤òɽ¼¨¤¹¤ë
IF LEN(s$)=0 OR L<=0 THEN EXIT PICTURE

LET k=1 !£ëʸ»úÌÜ

LET S=0 !¶ÊÀþx=f(t),y=g(t)¤Î¶è´Ö[a,b]¤ÎŤµ¡¡S=¢é[a,b]SQR((dx/dt)^2+(dy/dt)^2)dx
LET H=0.05
LET i=0
DO
   LET t=H*i !¥ê¡¼¥Þ¥óÏ¡¢¶èʬµáÀÑ

   LET Xt=x(t)
   LET Yt=y(t)
   LET dx=(x(t+H)-Xt)/H !Ƴ´Ø¿ô dx/dt¡¢dy/dt¡¡¢¨Èùʬ·¸¿ô¤Ë¤è¤ë
   LET dy=(y(t+H)-Yt)/H
   LET w=dx*dx+dy*dy
   LET S=S+H*SQR(w)

   IF S>=(k-1)*L THEN !ʸ»ú´Ö³Ö¤´¤È¤Ë
      DRAW disk WITH SCALE(0.05)*SHIFT(Xt,Yt) !°ÌÃÖ¤ò°õ¤¹
      IF w<>0 THEN !³ÑÅÙ¤òÄ´À°¤¹¤ë
         SET TEXT ANGLE ANGLE(dx,dy)
      ELSE
         SET TEXT ANGLE 0
      END IF
      PLOT TEXT ,AT Xt,Yt: s$(k:k) !£ëʸ»úÌÜ

      LET k=k+1 !¼¡¤Îʸ»ú¤Ø
      IF k>LEN(s$) THEN EXIT PICTURE !¤¹¤Ù¤Æ¤Îʸ»ú¤òɽ¼¨¤·¤¿¤Ê¤é
   ELSE
      PLOT LINES: Xt,Yt; !¶ÊÀþ¤Îµ°À×
   END IF

   LET i=i+1
LOOP
END PICTURE


¡ü¶ËºÂɸɽ¼¨
!¶ÊÀþ¾å¤Ëʸ»ú¤òɽ¼¨¤¹¤ë

SET WINDOW -5,5,-5,5
DRAW grid

SET TEXT HEIGHT 0.5
SET TEXT JUSTIFY "CENTER","BOTTOM"
DRAW TextOnPath("Abc¤¢¤¤´Á",3.5) WITH SHIFT(-2,-1)

END


EXTERNAL FUNCTION r(t) !¶ÊÀþ r=f(¦È)¡¡¢¨¶ËºÂɸɽ¼¨
LET r=3*(1+COS(t))
END FUNCTION


EXTERNAL PICTURE TextOnPath(s$,L) !¶ÊÀþ¾å¤Ëʸ»ú¤òɽ¼¨¤¹¤ë
IF LEN(s$)=0 OR L<=0 THEN EXIT PICTURE

LET k=1 !£ëʸ»úÌÜ

LET S=0 !¶ÊÀþr=f(¦È)¤Î¶è´Ö[a,b]¤ÎŤµ¡¡S=¢é[a,b]SQR(r(¦È)^2+r'(¦È)^2)dx
LET H=0.05
LET i=0
DO
   LET t=H*i !¥ê¡¼¥Þ¥óÏ¡¢¶èʬµáÀÑ

   LET Rt=r(t)
   LET dr=(r(t+H)-Rt)/H !Ƴ´Ø¿ô r'(¦È)¡¡¢¨Èùʬ·¸¿ô¤Ë¤è¤ë
   LET w=Rt*Rt+dr*dr
   LET S=S+H*SQR(w)

   LET x=Rt*COS(t) !¶ËºÂɸ(r,¦È)¢ªÄ¾¸òºÂɸ(x,y)
   LET y=Rt*SIN(t)

   IF S>=(k-1)*L THEN !ʸ»ú´Ö³Ö¤´¤È¤Ë
      DRAW disk WITH SCALE(0.05)*SHIFT(x,y) !°ÌÃÖ¤ò°õ¤¹
      IF w<>0 THEN !³ÑÅÙ¤òÄ´À°¤¹¤ë
         SET TEXT ANGLE ANGLE(dr,Rt)+t
         !SET TEXT ANGLE ANGLE(dr-Rt*TAN(t),Rt+dr*TAN(t))
      ELSE
         SET TEXT ANGLE 0
      END IF
      PLOT TEXT ,AT x,y: s$(k:k) !£ëʸ»úÌÜ

      LET k=k+1 !¼¡¤Îʸ»ú¤Ø
      IF k>LEN(s$) THEN EXIT PICTURE !¤¹¤Ù¤Æ¤Îʸ»ú¤òɽ¼¨¤·¤¿¤Ê¤é
   ELSE
      PLOT LINES: x,y; !¶ÊÀþ¤Îµ°À×
   END IF

   LET i=i+1
LOOP
END PICTURE
 

Re: Ver. 7.4.0

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ12·î 7Æü(·î)03»þ35ʬ32ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.769[¸µµ­»ö¤Ø]

!°Ê²¼¤Î£²Îã¤Ç¡¢Ê¸»ú¤ÎÂ礭¤µ¤¬ 1.5ÇÜ¡¢¼Â¹Ô®ÅÙ¤¬£²£°£°Çܤۤɰ㤤¤Þ¤¹¤¬¡¢
!»ä¤Î´Ä¶­¡ÊWin98SE¡Ë¤À¤±¤Ç¤·¤ç¤¦¤«¡©  (Ver.7.4.0 ¤Î PLOT TEXT)
!
SET TEXT font "",14
SET TEXT background "OPAQUE"
SET WINDOW -1,1,-1,1
DIM m(4,4)
!
MAT m=IDN
!
LET t0=TIME
FOR i=1 TO 5000
   DRAW new_text WITH m
NEXT i
PRINT USING"###.###sec":TIME-t0
!
LET m(1,1)=-1
!
LET t0=TIME
FOR i=1 TO 5000
   DRAW new_text WITH m
NEXT i
PRINT USING"###.###sec":TIME-t0

PICTURE new_text
   PLOT TEXT,AT 0,0,USING"#####":STR$(i)
END PICTURE

END
 

Re: Ver. 7.4.0

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ12·î 7Æü(·î)08»þ45ʬ55ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.772[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> !°Ê²¼¤Î£²Îã¤Ç¡¢Ê¸»ú¤ÎÂ礭¤µ¤¬ 1.5ÇÜ¡¢¼Â¹Ô®ÅÙ¤¬£²£°£°Çܤۤɰ㤤¤Þ¤¹¤¬¡¢
> !»ä¤Î´Ä¶­¡ÊWin98SE¡Ë¤À¤±¤Ç¤·¤ç¤¦¤«¡©  (Ver.7.4.0 ¤Î PLOT TEXT)

¼Â¹Ô®ÅÙ¤ÏÃÙ¤¯¤Ê¤ê¤Þ¤¹¡£
Windows API¤Ïʸ»ú¤Î¼Í±ÆÊÑ´¹¤ËÂбþ¤·¤Ê¤¤¤Î¤Ç¡¤
Ê̤˳ÎÊݤ·¤¿¥Ó¥Ã¥È¥Þ¥Ã¥×¤ËÉÁ¤«¤»¤¿Ê¸»ú¤òµÕ¼ÌÁü¤òÍøÍѤ·¤Æ
ÉÁ²èÎΰè¤ËÌᤷ¤Æ¤¤¤Þ¤¹¡£
WindowsÈǤÏÈæ³ÓŪ®¤¤¤Û¤¦¤Ç¡¤Linux¡¤Mac¤À¤È¤µ¤é¤ËÃÙ¤¯¤Ê¤ê¤Þ¤¹¡£
¡ÊMacÈÇ¡¤LinuxÈǤϸ½ºß¡¤¿Ê¹ÔÃæ¡Ë

ʸ»ú¤ÎÂ礭¤µ¤Ï¡¤º£¸å¤ÎÄ´À°¤Çº¹¤¬ÌÜΩ¤¿¤Ê¤¤¤è¤¦¤Ë½¤Àµ¤·¤Þ¤¹¡£
 

Re: Ver. 7.4.0

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ12·î 7Æü(·î)15»þ26ʬ48ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.773[¸µµ­»ö¤Ø]

ÇòÀС¡ÀèÀ¸¤Ø
¥×¥í¥°¥é¥à¤Î¸ß´¹À­¤«¤é¡¢LETTERS ¤È TEXT ¤Îµ¡Ç½¤òÆþ´¹¤¨¤Æĺ¤¯¤È½õ¤«¤ê¤Þ¤¹¤¬¡¦¡¦
 

Re: Ver. 7.4.0

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ12·î 7Æü(·î)16»þ24ʬ30ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.774[¸µµ­»ö¤Ø]

SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¥×¥í¥°¥é¥à¤Î¸ß´¹À­¤«¤é¡¢LETTERS ¤È TEXT ¤Îµ¡Ç½¤òÆþ´¹¤¨¤Æĺ¤¯¤È½õ¤«¤ê¤Þ¤¹¤¬¡¦¡¦

PLOT TEXT¤ÎÆ°ºî¤òµ¬³Ê¤Ë¹ç¤ï¤»¤ë¤Î¤¬°Õ¿Þ¤Ê¤Î¤Ç¡¤¤½¤ì¤Ï̵Íý¤Ç¤¹¡£
 

²þ¹Ô¤Î»ÅÊý

 Åê¹Æ¼Ô¡§H.T  Åê¹ÆÆü¡§2009ǯ12·î 8Æü(²Ð)09»þ58ʬ18ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ½½¿ÊBASIC¤Ç¥×¥í¥°¥é¥à¤ò¤¯¤ó¤Ç¤¤¤Þ¤¹¡£IF   A=B  AND   C=D  AND.......THEN
¤È¤¤¤¦¹½Ê¸¤ò»È¤ï¤Ê¤¯¤Æ¤Ï¤¤¤±¤Ê¤¤¾ìÌ̤¬¤Ç¤Æ¤­¤¿¤Î¤Ç¤¹¤¬C=D  ¤Î¸å¤ËAND¤¬100¸Ä¤Û¤É
³¤¯¤Î¤Ç¤¹¤¬¤³¤³¤Î½ê¤òÊ£¿ô¹Ô¤Ëʬ¤±¤Æµ­½Ò¤¹¤ë¤Ë¤Ï¤É¤¦¤·¤¿¤é¤è¤¤¤Î¤Ç¤·¤ç¤¦¤«¡£
ÆþÌçŪ¤Ê¤³¤È¤Ç¤¹¤ß¤Þ¤»¤ó¤¬¡¢¶µ¤¨¤Æ¤¯¤À¤µ¤¤¡£
 

Re: ²þ¹Ô¤Î»ÅÊý

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ12·î 8Æü(²Ð)10»þ53ʬ46ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.776[¸µµ­»ö¤Ø]

H.T¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

!¡Ö¥Ø¥ë¥×¡×-¡ÖÌܼ¡¡×-¡Ö´ðËÜ¡×-¡Ö¹Ô·Ñ³¡×¤è¤ê

! ¹ÔËö¤È¹ÔƬ¤Ë¡õ¤ò¤Ä¤±¤ë

IF A=B AND &
&  C=D AND &
&  E=F THEN
   PRINT "OK"
END IF

END
 

ºÆµ¢´Ø¿ô¤ÎÉÔ¶ñ¹ç

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ12·î 8Æü(²Ð)11»þ04ʬ8ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ¡Ê³°Éô¡¢ÆâÉô¡ËºÆµ¢´Ø¿ô¤òÄêµÁ¤·¤¿¾ì¹ç¡¢°ÊÁ°¤ÎÃͤ¬¥¯¥ê¥¢¤µ¤ì¤ºº£²ó¤ËÈ¿±Ç¤µ¤ì¤ë¡£
LET t=fnV("1234",10)
PRINT t
LET t=fnV("567",10)
PRINT t

LET s$=fnS$(11,2)
PRINT s$
LET s$=fnS$(14,2)
PRINT s$

END

EXTERNAL FUNCTION fnV(s$,p)
LET L=LEN(s$)
IF L=0 THEN EXIT FUNCTION
LET fnV=fnV(s$(1:L-1),p)*p + VAL(s$(L:L))
END FUNCTION

EXTERNAL FUNCTION fnS$(n,p)
IF n=0 THEN EXIT FUNCTION
LET fnS$=fnS$(INT(n/p),p) & STR$(MOD(n,p))
END FUNCTION

¼Â¹Ô·ë²Ì
 1234
 1234567
1011
10111110
 

Re: ºÆµ¢´Ø¿ô¤ÎÉÔ¶ñ¹ç

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ12·î 8Æü(²Ð)16»þ52ʬ24ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.778[¸µµ­»ö¤Ø]

¤â¤Ã¤Èñ½ã¤ÊÎã¤Ç¤¹¡£
10 DECLARE EXTERNAL FUNCTION f
20 PRINT f(0)
30 PRINT f(1)
40 PRINT f(0)
50 END
60 EXTERNAL  FUNCTION f(x)
70 IF x=0 THEN EXIT FUNCTION
80 LET f=1
90 END FUNCTION
½½¿ÊBASIC¤òºî¤ê»Ï¤á¤¿¤³¤í(¤¿¤Ö¤ó¸½ºßÇÛÉÛ¤·¤Æ¤¤¤ëWindows95ÈǤޤÇ)¤Ï´Ø¿ôÄêµÁ¤ÎÌá¤êÃͤò¥¹¥¿¥Ã¥¯¾å¤Ë³ÎÊݤ·¤Æ¤¤¤Þ¤·¤¿¤¬¡¤¤½¤ì¤Ç¤Ïµ¬³Ê¤Ë¹ç¤ï¤Ê¤¤¤Î¤Ç¡¤¸½ºß¤Î¥Ð¡¼¥¸¥ç¥ó¤ÏÀÅŪ¤ÊÊÑ¿ô¤òÍѤ¤¤Æ¤¤¤Þ¤¹¡£
µ¬³Ê¤Ç¤Ï¡¤¡ÖÄêµÁ´Ø¿ô̾¤ËºÇ¸å¤ËÂåÆþ¤µ¤ì¤¿Ã͡פȤʤäƤ¤¤Þ¤¹¡£¤Þ¤¿¡¤ÄêµÁ´Ø¿ô̾¤Ïʸˡ¾å¡¤ÊÑ¿ô¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡Ê¤À¤«¤é¶É½êÊÑ¿ô¤Ç¤â¤Ê¤¤¡Ë¡£¤·¤¿¤¬¤Ã¤Æ¡¤º£²ó¤Î¸Æ¤Ó½Ð¤·¤ÇÃͤòÀßÄꤷ¤Ê¤¤¤È¡¤Á°²óÀßÄꤷ¤¿ÃͤòÊÖ¤¹¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£
 

Re: ºÆµ¢´Ø¿ô¤ÎÉÔ¶ñ¹ç

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ12·î 8Æü(²Ð)18»þ26ʬ27ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.779[¸µµ­»ö¤Ø]

ºÇ¸å¤ËÄêµÁ´Ø¿ô̾¤ËÂåÆþ¤µ¤ì¤¿Ãͤò´Ø¿ôÃͤȤ¹¤ë¤¿¤á¡¤
10 DECLARE EXTERNAL FUNCTION f
20 PRINT f(2)
30 END
40 EXTERNAL FUNCTION f(x)
50 LET f=x
60 IF x=2 THEN LET y=f(x-1)
70 END FUNCTION
¤Î¼Â¹Ô·ë²Ì¤Ï2¤Ç¤Ê¤¯1¤Ë¤Ê¤ê¤Þ¤¹¡£

¤³¤ì¤Ï¡¤¤¿¤È¤¨¤Ð¡¤ºÆµ¢½èÍý¤ò¹Ô¤¦¤È¤­¡¤¥Ç¥Õ¥©¥ë¥ÈÃͤòÄêµÁ´Ø¿ô̾¤ËÍ¿¤¨¤Æ¤ª¤¤¤Æ¡¤ºÆµ¢¤¬¤¦¤Þ¤¯¤¤¤«¤Ê¤¤¤È¤­¤ÏÄêµÁ´Ø¿ô̾¤Ø¤ÎÂåÆþ¤ò¤»¤º¤Ë´Ø¿ô¤«¤éÈ´¤±¤ë¤È¤½¤ÎÃͤ¬ÊÖ¤ë¤ÈÁÛÄꤹ¤ë¤È¡¤Í½´ü¤·¤Ê¤¤·ë²Ì¤¬ÆÀ¤é¤ì¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£
 

Re: ºÆµ¢´Ø¿ô¤ÎÉÔ¶ñ¹ç

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ12·î 8Æü(²Ð)20»þ11ʬ24ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.780[¸µµ­»ö¤Ø]

λ²ò¤·¤Þ¤·¤¿¡£¡¡¡¢¡¢¡¢¤È¸À¤¦»ö¤Ï¡¢BASICAcc¤¬¡ÊFullBASIC½àµò¤Ê¤é¡ËÉÔ¶ñ¹ç¤È¤Ê¤ê¤Þ¤¹¡£
 

Re: ºÆµ¢´Ø¿ô¤ÎÉÔ¶ñ¹ç

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ12·î 8Æü(²Ð)21»þ01ʬ22ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.781[¸µµ­»ö¤Ø]

BASICAcc¤Ï¡¤ÄêµÁ´Ø¿ô̾¤Ø¤ÎÂåÆþ¤òDelphi¸ì¤ÎresultÊÑ¿ô¤Ø¤ÎÂåÆþ¤ËÊÑ´¹¤·¤Æ¤¤¤ë¤Î¤Ç¡¤¸·Ì©¤Ë¤ÏFull BASICµ¬³Ê¤È¤Ï°Û¤Ê¤ëÆ°ºî¤ò¤¹¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£
 

Re: ºÆµ¢´Ø¿ô¤ÎÉÔ¶ñ¹ç

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ12·î 9Æü(¿å)17»þ39ʬ53ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.782[¸µµ­»ö¤Ø]

¡ÖºÇ¸å¤ËÂåÆþ¤µ¤ì¤¿Ã͡פˤ³¤À¤ï¤ëµ¬³Ê¤Î°Õ¿Þ¤¬Æɤá¤Þ¤»¤ó¡£
ÄêµÁ´Ø¿ô̾¤Ø¤ÎÂåÆþ¤Î·Á¤Ç´Ø¿ô¤Î·ë²Ì¤òÊÖ¤¹¸À¸ì¤Ç´Ø¿ô¤Î·ë²Ì¤ò¹­°èŪ¤ËÊÝ»ý¤¹¤ë¤³¤È¤òÍ׵᤹¤ë¤Î¤ÏÉԲIJò¤Ê»ÅÍͤǡ¤¡Ö³Æ²ó¤Î¸Æ¤Ó½Ð¤·¤Ë¤ª¤¤¤Æ¡×¤È¤¤¤¦¸ÂÄê ¤ò½ñ¤­Â»¤Í¤¿¡¤µ¬³Ê¤Î¥Ð¥°¤Ç¤¢¤ë²ÄǽÀ­¤â¹Í¤¨¤é¤ì¤ë¤Î¤Ç¡¤JIS¹çÃפˤ¹¤ë¤¿¤á¤Î¥ª¥×¥·¥ç¥ó¤ò¿·Àߤ·¡¤Ä̾ï¤ÎÆ°ºî¤Ï´Ø¿ô¤Î·ë²Ì¤ò¶É½êÊÑ¿ô¤ËÊÝ»ý¤¹¤ë¤è¤¦¤Ë Êѹ¹¤·¤Þ¤¹¡£
 

Re: ºÆµ¢´Ø¿ô¤ÎÉÔ¶ñ¹ç

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ12·î 9Æü(¿å)23»þ13ʬ10ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.778[¸µµ­»ö¤Ø]

!¼á²à¤ËÀâË¡¤Ç¶²½Ì¤Ç¤¹¤¬¡¢Ìá¤êÃͤϡ¢Ï³¤é¤µ¤º¥»¥Ã¥È¤¬¸¶Â§¤À¤È»×¤¤¤Þ¤¹¡¢¤¹¤ß¤Þ¤»¤ó¡£

LET t=fnV("1234",10)
PRINT t
LET t=fnV("567",10)
PRINT t

LET s$=fnS$(11,2)
PRINT s$
LET s$=fnS$(14,2)
PRINT s$

END

EXTERNAL FUNCTION fnV(s$,p)
LET L=LEN(s$)
IF 0< L THEN LET fnV=fnV(s$(1:L-1),p)*p + VAL(s$(L:L)) ELSE LET fnV=0
END FUNCTION

EXTERNAL FUNCTION fnS$(n,p)
IF 0< n THEN LET fnS$=fnS$(INT(n/p),p) & STR$(MOD(n,p)) ELSE LET fnS$=""
END FUNCTION

!  1234
!  567
! 1011
! 1110
 

7.4.1ÈǤÎÉÔ¶ñ¹ç

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ12·î11Æü(¶â)18»þ49ʬ30ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ½¤Àµ¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£

¼Í±ÆÊÑ´¹¤ÎPLOT TEXTʸ¤Ç¡¢¡Öź»ú¤¬Èϰϳ°¡×¥¨¥é¡¼¤È¤Ê¤ê¤Þ¤¹¡£7.4.0ÈǤǤÏÉÁ²è¤Ç¤­¤Æ¤¤¤Þ¤·¤¿¡£
! ¼Í±ÆÊÑ´¹¡¡sample\transfo9.basÄɲÃ
DIM T(4,4)
MAT READ T
DATA 1,  0,  0, -0.25
DATA 0,  1,  0,  0.2
DATA 0,  0,  1,  0
DATA 0,  0,  0,  1
PICTURE House
   SET AREA COLOR 15
   PLOT AREA:    0, 1;   0,  0;   2,  0;   2,  1         ! ÊÉ
   SET AREA COLOR 2
   PLOT AREA:  -0.6,1;  2.6, 1;   2,  2;   0,  2         ! ²°º¬
   SET AREA COLOR 10
   PLOT AREA:  0.1, 0; 0.1,0.8; 0.5,0.8; 0.5,  0         ! ¥É¥¢
   SET AREA COLOR 5
   PLOT AREA: 1.4,0.4; 1.9,0.4; 1.9,0.8; 1.4,0.8         ! Áë
   SET AREA COLOR 12
   PLOT AREA:  1.7, 2; 1.7,2.3; 1.5,2.3; 1.5,  2         ! ±ìÆÍ

   SET TEXT HEIGHT 2 !<----- Â礭¤¯¤¹¤ë¤È£Î£Ç
   PLOT TEXT ,AT 0,0: "²°º¬"

END PICTURE
SET WINDOW -5,5,-5,5
DRAW axes
DRAW House WITH T
END


¡Ö¾ï¤ËʪÍýºÂɸ¡×¤Ç¤Ï¡¢¤³¤ì¤òÍ­¸ú¤Ë¤·¤¿É½¼¨¤ÏÀµ¤·¤¤¤Î¤Ç¤·¤ç¤¦¤«¡©
SET WINDOW -5,5,-5,5
DRAW grid

!£²¤Ä¤Î¾Ã¼ºÅÀ
DATA  4,1 !¿åÊ¿Àþ¡Ê£Ø¼´¤ËÊ¿¹Ô¡Ë¤Î¾Ã¼ºÅÀ(x1,y1)
DATA -3,4 !¿âľÀþ¡Ê£Ù¼´¤ËÊ¿¹Ô¡Ë¤Î¾Ã¼ºÅÀ(x2,y2)
READ x1,y1, x2,y2
DRAW vp WITH SHIFT(x1,y1)
DRAW vp WITH SHIFT(x2,y2)

PICTURE vp !¥Þ¡¼¥«¡¼¤òÉÁ¤¯
   LET a=0.125
   PLOT AREA: -a,-a; a,-a; a,a; -a,a
END PICTURE


DIM M(4,4) !¾Ã¼ºÅÀ¤Ë¤Ê¤ë¤è¤¦¤ËÂæ·ÁÊÑ·Á¤¹¤ë
MAT M=IDN
LET M(1,4)=1/(x1-x2) !¾Ã¼ºÅÀ(x,0)¤Ê¤é¡¢1/x¡£¡¡x¢ª¡ç¤Ê¤é¡¢0
LET M(2,4)=1/(y2-y1) !¾Ã¼ºÅÀ(0,y)¤Ê¤é¡¢1/y¡£¡¡y¢ª¡ç¤Ê¤é¡¢0

DIM Mp(4,4)
MAT Mp=SHIFT(-x2,-y1)*M*SHIFT(x2,y1)


DRAW t WITH Mp

PICTURE t !ÊÑ·Á¤µ¤ì¤¿¿Þ·Á¤òÉÁ¤¯
   PLOT LINES: -1,-1; 1,-1; 1,1; -1,1; -1,-1 !¶­³¦Àþ¤òÉÁ¤¯
   PLOT LINES: -1,0; 1,0 !¼´
   PLOT LINES: 0,-1; 0,1

   SET TEXT HEIGHT 1 !Àµµ¬ºÂɸÆâ¤Î¿Þ·Á¡¡¢«¢«¢«¢« ¤³¤³
   !¢¨¡ÖÌäÂêºÂɸ¡ÊJIS¡Ë¡×¤Ç¤Ï¡¢´ûÄêÃͤ¬0.01¤Î¤¿¤á SET TEXT HEIGHT ¤Ï¤Û¤Üɬ¿Ü¤È¤Ê¤ë¡£
   PLOT TEXT ,AT  0, 0: "£Æ"
   PLOT TEXT ,AT -1, 0: "£²"
   PLOT TEXT ,AT -1,-1: "¡÷"
   PLOT TEXT ,AT  0,-1: "£Í"
END PICTURE

END
 

·Ç¼¨ÈIJáµî¥í¥°¤Ø¤Î¥ê¥ó¥¯µö²Ä´ê¤¤

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ12·î11Æü(¶â)18»þ52ʬ35ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ÇòÀÐÀèÀ¸¤Ë¤ª´ê¤¤¤Ç¤¹¡£

ÀèÆü"¡Ö½½¿ÊBASICÂè2·Ç¼¨ÈÄ¡×Åê¹Æµ­»ö¥ê¥¹¥È"¤È¤¤¤¦¥¹¥ì¥Ã¥É¤òºîÀ®¤·¤Þ¤·¤¿¤¬¡¢»öÁ°¤Ë´ÉÍý¼Ô¤Ç¤¢¤ëÇòÀÐÀèÀ¸¤Îµö²Ä¤òÆÀ¤ë¤Ù¤­¤Ç¤·¤¿¡£¤´ÍƼϤ¯¤À¤µ¤¤¡£
¿·¤¿¤Ë¡¢ÇòÀÐÀèÀ¸¤Î¸Ä¿Í¥µ¥¤¥È¡Ö¿ô³Ø¶µ°é¤ò¹Í¤¨¤ë¡×¤Ë¤¢¤ë¡Ö½½¿ÊBASIC·Ç¼¨ÈIJáµî¥í¥°¡×¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Î°ìÍ÷¤òÎã¤Î¤è¤¦¤Ë¤Þ¤È¤á¤Þ¤·¤¿¤Î¤Ç¡¢¥¹¥ì¥Ã¥É¤Ø¤Î·ÇºÜµö²Ä¤ò¤ª´ê¤¤¤¤¤¿¤·¤Þ¤¹¡£
²áµî¥í¥°¤Ë¤Ï4000·ï¤â¤Îµ­»ö¤¬Êݸ¤µ¤ì¤Æ¤¤¤Þ¤¹¤¬¡¢¤¢¤Þ¤ê³èÍѤµ¤ì¤Æ¤¤¤Ê¤¤¤Î¤Ç¤Ï¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£Âè2·Ç¼¨ÈĤ˰ìÍ÷¤Î¥ê¥ó¥¯¤òÃÖ¤¯¤³¤È¤Ë¤è¤ê¡¢Â¿¤¯¤ÎÊý¤Ëµ­»ö¤ò±ÜÍ÷¤¹¤ëµ¡²ñ¤òÍ¿¤¨¤é¤ì¤ë¤È»×¤¤¤Þ¤¹¡£
¤Þ¤¿¡¢¥¹¥ì¥Ã¥É¤Î¥È¥Ã¥×¤Ë¤Ï2005ǯ3·î11Æü¤Ë¸ø³«¤µ¤ì¤¿¡Ø·Ç¼¨ÈÄÍøÍѵ¬Äê¡Ê»ÃÄêÈÇ¡Ë¡Ù¤ò·ÇºÜ¤·¤¿¤¤¤Î¤Ç¤¢¤ï¤»¤Æµö²Ä¤ò¤ª´ê¤¤¤¤¤¿¤·¤Þ¤¹¡£

¤¢¤é¤¿¤á¤Æµö²Ä¤Ï½Ð¤»¤Ê¤¤¤¬ÌÛǧ¤Ï¤¹¤ë¤È¤¤¤¦¤³¤È¤Ç¤¢¤ì¤Ð¡¢Æä˲óÅú¤ò¤¤¤¿¤À¤«¤Ê¤¯¤È¤â°ì½µ´Ö¤Û¤ÉÂԤ俤ΤÁºî¶È¤ËÆþ¤ê¤¿¤¤¤È»×¤¤¤Þ¤¹¡£
¤è¤í¤·¤¯¤ª´ê¤¤¤¤¤¿¤·¤Þ¤¹¡£

Îã¡Ë
Page : 12 (¤³¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ï¥³¥Ô¡¼¤Ç¤¹) ¢ª ¸µ¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹
¡¡ ¥À¥¤¥ì¥¯¥È¥â¡¼¥É¤ÎÀâÌÀ¤Ë¤Ä¤¤¤Æ  ÀõÌµª  2002/08/20
¡¡¡¡¨¦½½¿ÊBASIC¤Ë¤Ï¥À¥¤¥ì¥¯¥È¥â¡¼¥É¤Ï¸ºß¤·¤Þ¤»...  ÇòÀÐÏÂÉ×  2002/08/20
¡¡¡¡¡¡¨¦¤½¤¦¤Ê¤ó¤Ç¤¹¤«¡£¤¿¤¤¤Ø¤ó»²¹Í¤Ë¤Ê¤ê¤Þ¤·¤¿...  ÀõÌµª  2002/08/21
¡¡ ÉâÆ°¾®¿ôÅÀ¤Î¼è¤ê°·¤¤  ¤Ý¤ó¤¿  2002/08/17
¡¡¡¡¨§(²¾¾Î)½½¿ÊBASIC¤ò½½¿Ê¥â¡¼¥É¤Ç»È¤¦¸Â¤ê¡¤Í­...  ÇòÀÐÏÂÉ×  2002/08/20
¡¡¡¡¨¦¤ª¶â¤ò°·¤¦¤Î¤¬ÌÜŪ¤Ç¤¢¤ë¤Î¤Ê¤é¤Ð¡¤¸ÇÄê¾®...  ÇòÀÐÏÂÉ×  2002/08/23
¡¡ ¥×¥ê¥ó¥¿¡¦¥°¥é¥Õ¥£¥Ã¥¯¥¹  ÇòÀÐÏÂÉ×  2002/08/14
¡¡ ¤Ï¤¸¤á¤Þ¤·¤Æ  ¤æ¤¦¤­¤ÎÉã  2002/07/17
¡¡¡¡¨¦°Õ¿Þ¤Î¤È¤ª¤ê¤ËÆ°ºî¤¹¤ë¤è¤¦¤Ç¤¢¤ì¤Ð¡¤ÆäË...  ÇòÀÐÏÂÉ×  2002/07/18
 

Re: 7.4.1ÈǤÎÉÔ¶ñ¹ç

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ12·î12Æü(ÅÚ)09»þ29ʬ17ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.785[¸µµ­»ö¤Ø]

> ¼Í±ÆÊÑ´¹¤ÎPLOT TEXTʸ¤Ç¡¢¡Öź»ú¤¬Èϰϳ°¡×¥¨¥é¡¼¤È¤Ê¤ê¤Þ¤¹¡£7.4.0ÈǤǤÏÉÁ²è¤Ç¤­¤Æ¤¤¤Þ¤·¤¿¡£
¤´Êó¹ð¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
½¤Àµ¤·¤Þ¤¹¡Ê¼ã´³¤Î®ÅÙ¸þ¾å¤Î»î¤ß¤Î¼ºÇԤǤ¹¡Ë¡£


¡Ö¾ï¤ËʪÍýºÂɸ¡×¤Ë¤¹¤ë¤È¥Ð¡¼¥¸¥ç¥ó7.3°ÊÁ°¤ÈƱ¤¸ÉÁ²è¤Ë¤Ê¤ê¤Þ¤¹¡£
´ðÅÀÉÕ¶á¤Î¾ðÊó¤Ë´ð¤Å¤¤¤ÆÉÁ¤­¤Þ¤¹¡£
 

Re: ·Ç¼¨ÈIJáµî¥í¥°¤Ø¤Î¥ê¥ó¥¯µö²Ä´ê¤¤

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ12·î12Æü(ÅÚ)09»þ32ʬ9ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.786[¸µµ­»ö¤Ø]

ÆäËÌäÂê¤Ï¤Ê¤¤¤È»×¤¤¤Þ¤¹¡£
¤¿¤À¤·¡¤Åê¹Æµ¬Äø¡Ê»ÃÄêÈǡˤϵ­½Ò¤¬¸Å¤¯¤Ê¤Ã¤Æ¤¤¤ë¤Î¤ÇžºÜ¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£
¡Ê¸½ºß¡¤£Ç£Ð£ÌÈǤν½¿Ê£Â£Á£Ó£É£Ã¤â¤¢¤ê¤Þ¤¹¡Ë

¤Ä¤¤¤Ç¤Ë¡¤ÌÜŪÊÌ¡Ê¥«¥Æ¥´¥ê¡¼¤´¤È¡Ë¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤âºî¤Ã¤Æ¤¤¤¿¤À¤±¤ë¤È½õ¤«¤ê¤Þ¤¹¡£
 

¥Æ¥È¥í¥ß¥Î

 Åê¹Æ¼Ô¡§±ÊÌî¸î  Åê¹ÆÆü¡§2009ǯ12·î12Æü(ÅÚ)10»þ25ʬ14ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¿ïʬ°ÊÁ°¤ÎËܤǤ¹¤¬¾¼¹¸Æ²¤è¤ê½ÐÈǤµ¤ì¤¿¡¢¡Ö¤Ï¤¸¤á¤Æ³Ø¤ÖBASIC¡×¡ÊÌÚ²¼»á¡¢¶Ì°æ»á¶¦Ãø¡Ë
¤È¤¤¤¦Ëܤ¬¤¢¤ê¤Þ¤¹¡£¤³¤ÎËܤÎ135¥Ú¡¼¥¸¤Ë¥Æ¥È¥í¥ß¥Î¤ÎÌäÂ꤬¤¢¤ê¡¢143¥Ú¡¼¥¸¤ÇÈ¢¤Î·Á¤ò
4¡ß5¤ÎĹÊý·Á¤Ë¤¹¤ë¤Ë¤Ï¥×¥í¥°¥é¥à¤ò¤É¤¦ÊѤ¨¤ì¤Ð¤è¤¤¤«¡¢¤È¤¤¤¦ÌäÂ꤬¤¢¤ê¤Þ¤¹¡£
¤³¤ì¤¬¤Ç¤­¤Ê¤¯¤ÆǺ¤ó¤Ç¤¤¤Þ¤¹¡£½½¿ÊBASIC¤ÈľÀܤϴط¸¤Ê¤¤¤Î¤Ç¤¹¤¬¡¢¤è¤í¤·¤±¤ì¤Ð
¥×¥í¥°¥é¥à¤ò¤É¤¦Êѹ¹¤¹¤ì¤Ð¤è¤¤¤«¶µ¤¨¤Æ¤¯¤À¤µ¤¤¡£²¿Â´¤è¤í¤·¤¯¤ª´ê¤¤¤·¤Þ¤¹¡£
 

Re: ¥Æ¥È¥í¥ß¥Î

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ12·î12Æü(ÅÚ)20»þ24ʬ30ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.789[¸µµ­»ö¤Ø]

±ÊÌî¸î¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¿ïʬ°ÊÁ°¤ÎËܤǤ¹¤¬¾¼¹¸Æ²¤è¤ê½ÐÈǤµ¤ì¤¿¡¢¡Ö¤Ï¤¸¤á¤Æ³Ø¤ÖBASIC¡×¡ÊÌÚ²¼»á¡¢¶Ì°æ»á¶¦Ãø¡Ë
> ¤È¤¤¤¦Ëܤ¬¤¢¤ê¤Þ¤¹¡£

¤³¤ÎËܤò»ý¤Ã¤Æ¤¤¤ë¿Í¤Ï¤¿¤Ö¤ó¤¤¤Ê¤¤¤È»×¤¤¤Þ¤¹¡£
¡Ê¸µ¤Þ¤¿¤Ï¼«Ê¬¤¬½¤ÀµÃæ¤Î¡Ë¥×¥í¥°¥é¥à¤ò·ÇºÜ¤¹¤ë¤Ê¤É¤·¤Ê¤¤¤È²óÅú¤Ï¤Ê¤¤¤È»×¤¤¤Þ¤¹¡£
 

Re: ·Ç¼¨ÈIJáµî¥í¥°¤Ø¤Î¥ê¥ó¥¯µö²Ä´ê¤¤

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ12·î12Æü(ÅÚ)21»þ51ʬ3ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.788[¸µµ­»ö¤Ø]

²óÅú¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£¤µ¤Ã¤½¤¯¤È¤ê¤«¤«¤ê¤Þ¤¹¡£


> ¤Ä¤¤¤Ç¤Ë¡¤ÌÜŪÊÌ¡Ê¥«¥Æ¥´¥ê¡¼¤´¤È¡Ë¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤âºî¤Ã¤Æ¤¤¤¿¤À¤±¤ë¤È½õ¤«¤ê¤Þ¤¹¡£

¤¢¤ì¤ÐÊØÍø¤Ê¤Î¤Çºî¤ê¤¿¤¤¤Î¤Ç¤¹¤¬¡¢»ä¸Ä¿Í¤ÎǽÎϤǤϽ½Ê¬¤Ê¥ì¥Ù¥ë¤Î¤â¤Î¤Ï¤Ç¤­¤Þ¤»¤ó¡£ÇòÀÐÀèÀ¸¤ä¾¤ÎÊý¤Î¶¨ÎϤò¤¤¤¿¤À¤±¤ì¤Ð²Äǽ¤À¤È»×¤¤¤Þ¤¹¡£
¤Þ¤º¤Ï¥«¥Æ¥´¥ê¡¼¤ÎÀßÄê¤ò¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
³Æ¥«¥Æ¥´¥ê¡¼¤Î̾¾Î¤òÄ󼨤·¤Æ¤¤¤¿¤À¤±¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£¤ª´ê¤¤¤·¤Þ¤¹¡£
 

Re: ·Ç¼¨ÈIJáµî¥í¥°¤Ø¤Î¥ê¥ó¥¯µö²Ä´ê¤¤

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ12·î13Æü(Æü)07»þ41ʬ54ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.791[¸µµ­»ö¤Ø]

> ¤Þ¤º¤Ï¥«¥Æ¥´¥ê¡¼¤ÎÀßÄê¤ò¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
> ³Æ¥«¥Æ¥´¥ê¡¼¤Î̾¾Î¤òÄ󼨤·¤Æ¤¤¤¿¤À¤±¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£¤ª´ê¤¤¤·¤Þ¤¹¡£
ÌÜŪ¤Îµ­»ö¤òõ¤·¤ä¤¹¤¤¤è¤¦¤ËʬÎब¤Ç¤­¤ì¤Ð¤¤¤¤¤È»×¤¤¤Þ¤¹¡£
¤¹¤Ù¤Æ¤Îµ­»ö¤òÌÖÍ夹¤ëɬÍפϤʤ¤¤È»×¤¤¤Þ¤¹¤·¡¤
µÕ¤ËÊ£¿ô¤Î¥«¥Æ¥´¥ê¡¼¤Ë°¤¹¤ëµ­»ö¤¬½Ð¤Æ¤­¤Æ¤â¤«¤Þ¤ï¤Ê¤¤¤Î¤Ç¤Ï¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£
 

¥Æ¥È¥í¥ß¥Î¤ÎÈ¢µÍ¤á¥Ñ¥º¥ë

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ12·î14Æü(·î)10»þ56ʬ39ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¡ÖC¸À¸ì¤Ë¤è¤ëºÇ¿·¥¢¥ë¥´¥ê¥º¥à»öŵ¡×¤è¤ê¡¡tetromin.c -- ¥Æ¥È¥í¥ß¥Î¤ÎÈ¢µÍ¤á¥Ñ¥º¥ë
LET Pieces=5 !¶ð¤Î¿ô
LET Col=5 !ÈפÎûÊÕ¤ÎŤµ¡¡¢¨£µ¤Ï¸ÇÄê
LET Row=8 !ÈפÎĹÊÕ¤ÎŤµ
LET PieceSize=4 !¶ð¤ÎÂ礭¤µ
LET MaxSymmetry=8 !¶ð¤ÎÃÖ¤­Êý¤ÎºÇÂç¿ô
LET MaxSite=(Col+1)*Row-1
LET LimSite=(Col+1)*(Row+1)

DIM board$(0 TO LimSite-1)
DIM NAME$(0 TO 2-1, 0 TO Pieces-1)
DIM symmetry(0 TO Pieces-1)
DIM shape(0 TO Pieces-1, 0 TO MaxSymmetry-1, 0 TO (PieceSize-1)-1)
DIM REST(0 TO Pieces-1)

LET count=0 !²òÅú¿ô
CALL initialize
CALL try(0)

SUB initialize
   local site, piece, state

   FOR site=0 TO MaxSite-1 !Èפò¤Ä¤¯¤ë
      IF MOD(site,Col+1)=Col THEN LET board$(site)="*" ELSE LET board$(site)=""
   NEXT site
   FOR site=MaxSite TO (LimSite-1)-1
      LET board$(site)="*"
   NEXT site
   LET board$(LimSite-1)="" !ÈÖ¿Í
   ! ¨£¨¡¨¤Col+1
   !      * ¨¤
   !      * ¨¢
   !      * ¨¢
   !      * ¨¢
   !      * ¨¢Row+1
   !      * ¨¢
   !      * ¨¢
   !      * ¨¢¢« MaxSite-1
   ! *****  ¨¥
   !      ¢¬ LimSite-1

   FOR piece=0 TO Pieces-1 !¶ð¤òÆɤ߹þ¤à
      LET REST(piece)=2 !£²Ë示¤Ä
      READ NAME$(1,piece),NAME$(0,piece), symmetry(piece) !̾¾Î¡¢¸Ä¿ô
      FOR state=0 TO symmetry(piece)-1
         FOR site=0 TO (PieceSize-1)-1
            READ shape(piece,state,site) !·Á¾õ
         NEXT site
      NEXT state
   NEXT piece
END SUB

SUB found !²ò¤Îɽ¼¨
!!!local i,j
   LET count=count+1
   PRINT "²ò";count
   FOR i=0 TO Col-1
      FOR j=i TO MaxSite-1 STEP Col+1
         PRINT board$(j);
      NEXT j
      PRINT
   NEXT i
END SUB

SUB try(site) !ºÆµ¢Åª¤Ë»î¤ß¤ë
   local piece,state,s0,s1,s2

   LET piece=0
   DO WHILE piece<Pieces !̤»ÈÍѤζð¤ËÂФ·¤Æ
      IF REST(piece)=0 THEN
      ELSE

         LET REST(piece)=REST(piece)-1 !¤³¤Î¶ð¤ò»ÈÍѤ¹¤ë

         LET state=0
         DO WHILE state<symmetry(piece) !¤¹¤Ù¤Æ¤Î¸þ¤­¤ËÃÖ¤¤¤Æ¤ß¤ë
            LET s0=site+shape(piece,state,0)

            IF board$(s0)<>"" THEN !¤³¤³¤Ë»Í³Ñ£±¤¬ÃÖ¤±¤ì¤Ð
            ELSE
               LET s1=site+shape(piece,state,1)

               IF board$(s1)<>"" THEN !»Í³Ñ£²
               ELSE
                  LET s2=site+shape(piece,state,2)

                  IF board$(s2)<>"" THEN !»Í³Ñ£³
                  ELSE
                     LET board$(site),board$(s0),board$(s1),board$(s2)=NAME$(REST(piece),piece)

                     LET temp=site !¼¡¤Î¶õ¤­°ÌÃÖ¤òõ¤¹
                     DO
                        LET temp=temp+1
                     LOOP WHILE board$(temp)<>""
                     IF temp<MaxSite THEN CALL try((temp)) ELSE CALL found

                     LET board$(site),board$(s0),board$(s1),board$(s2)=""

                  END IF !continue
               END IF
            END IF

            LET state=state+1
         LOOP

         LET REST(piece)=REST(piece)+1 !̤»ÈÍÑ

      END IF !continue

      LET piece=piece+1
   LOOP
END SUB


!¡¡tetromin.dat -- ¥Æ¥È¥í¥ß¥Î¤Î¶ð¤Î·Á¤Î¥Ç¡¼¥¿

!ÇÛÎóborad$()¤ÎÍ×ÁÇÈÖ¹æ¤ÈÈ×¾åÇÛÃ֤Ȥδط¸
!    site
!     ¢­
!      * 1 2 3
!  4 5 6 7 8 9
! 101112131415
! 161718192021
!¡¡¨¦ Col+1 ¨¥¡¡¢¨Col=5

DATA "O","o", 1 !̾¾Î¡¢¸Ä¿ô
DATA 1,6,7 !·Á¾õ s0,s1,s2

DATA "I","i", 2
DATA 1,2,3
DATA 6,12,18

DATA "T","t", 4
DATA 1,2,7
DATA 5,6,7
DATA 5,6,12
DATA 6,7,12

DATA "Z","z", 4
DATA 1,5,6
DATA 1,7,8
DATA 5,6,11 !΢
DATA 6,7,13

DATA "L","l", 8
DATA 1,2,6
DATA 1,2,8
DATA 1,6,12
DATA 1,7,13
DATA 4,5,6 !΢
DATA 6,7,8
DATA 6,11,12
DATA 6,12,13


END


!Åê¹Æ¡Êµ­½ÒÎã¡Ë¡¢¾ðÊó¡¢¥¢¥ë¥´¥ê¥º¥à¡¢¥Ñ¥º¥ë¡¢°Ü¿¢
 

Re: ·Ç¼¨ÈIJáµî¥í¥°¤Ø¤Î¥ê¥ó¥¯µö²Ä´ê¤¤

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ12·î14Æü(·î)11»þ42ʬ3ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.791[¸µµ­»ö¤Ø]

¹ÓÅĹÀÆ󤵤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¤Þ¤º¤Ï¥«¥Æ¥´¥ê¡¼¤ÎÀßÄê¤ò¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
> ³Æ¥«¥Æ¥´¥ê¡¼¤Î̾¾Î¤òÄ󼨤·¤Æ¤¤¤¿¤À¤±¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£¤ª´ê¤¤¤·¤Þ¤¹¡£
¡üµ­»ö¤Î¼ïÊÌ
¼ÁÌä
¡¡²óÅú
Åê¹Æ¡Êµ­½ÒÎã¡Ë
¡¡½éÈÇ¡¢²þÄûÈÇ¡¢¿·ÈÇ
»ÅÍÍ¡¦ÉÔ¶ñ¹ç


¡üTips¡Ê¾®µ»¡¢¥³¥Ä¡Ë
¥È¥é¥Ö¥ë¥·¥å¡¼¥È
µ»½Ñ¥á¥â


¡ü³Ø½¬Ê¬Ìî¡Ê³Ø¹»¡¢¿Þ½ñ¤Ê¤É¡Ë
¿ô³Ø
¡¡¤ª¤â¤·¤í¿ô³Ø
¡¡¹â¹»¿ô³Ø
¡¡¡¡¡Á¤Î¸ø¼°
¡¡¡¡´Ø¿ô¤È¥°¥é¥Õ¡¢¿Þ·Á¤ÈÊýÄø¼°
¡¡¡¡½¸¹ç¤ÈÌ¿Âê¤ÈÏÀÍý±é»»
¡¡¡¡½çÎó¡¢Áȹ礻¡¢³ÎΨ
¡¡¡¡¿ôÃÍ·×»»¤È¥³¥ó¥Ô¥å¡¼¥¿
¡¡¡¡¡¡¥»¥ó¥¿¡¼»î¸³
¡¡¡¡Åý·×¤È¥³¥ó¥Ô¥å¡¼¥¿
¡¡¡¡¡Ý
¡¡À°¿ôÏÀ
¾ðÊó
¡¡¥¢¥ë¥´¥ê¥º¥à
¡¡¡¡À°Îó¡Ê¥½¡¼¥È¡Ë
¡¡¡¡Ãµº÷¡Ê¥µ¡¼¥Á¡Ë
¡¡¡¡¿ôÍý
¡¡¡¡¥°¥é¥Õ
¡¡¡¡¥Ñ¥º¥ë
¡¡¾ðÊó¡¢¹©¶È´ðÁÃ
¡¡¡¡£î¿ÊË¡
¡¡¡¡¥Á¥å¡¼¥ê¥ó¥°¥Þ¥·¥ó
¡¡¡¡¥Ó¥Ã¥È±é»»
¡¡¡¡ÃÖ´¹
¡¡¸À¸ì½èÍý
¡¡¡¡¿ô¼°½èÍý
¹©¶È
¡¡Åŵ¤¡¦ÅÅ»Ò
¡¡¡¡Åŵ¤²óÏ©
¡¡¡¡¡¡£´Ã¼»Ò²óÏ©
¡¡¡¡¡¡¥Õ¥£¥ë¥¿²óÏ©
¡¡¡¡¡¡¹çÀ®Äñ¹³
¡¡¡¡¡¡¡Ý
¡¡¡¡Åż§µ¤
¡¡¡¡ÏÀÍý²óÏ©
¡¡¡¡¡¡±é»»²óÏ©
¡¡¡¡¡¡ÅŻҹ©ºî
¡¡¡¡¡¡¡Ý
¡¡·×¬¡¦À©¸æ
¡¡¡¡¥é¥À¡¼¥í¥¸¥Ã¥¯
¡¡¡¡À©¸æÍýÏÀ
¡¡Â¬ÎÌ
¾¦¶È


¡ü¼ÂÎã
¥æ¡¼¥Æ¥£¥ê¥Æ¥£¡¼¡¢¥é¥¤¥Ö¥é¥ê¡¢¥Ä¡¼¥ë
¡¡OLE¡¢Win32API
¡¡¡Ý
¶µºà
¥°¥é¥Õ¥£¥Ã¥¯¥¹
¡¡²èÁü½èÍý
¡¡¡Ý
¿ôÃÍ·×»»
¡¡¹ÔÎó
¡¡¡¡¸ÇÍ­ÃͤȸÇÍ­¥Ù¥¯¥È¥ë
¡¡¡¡¡Ý
¡¡Èùʬ
¡¡ÀÑʬ
¡¡Ï¢Î©£±¼¡ÊýÄø¼°
¡¡ÈóÀþ·ÁÊýÄø¼°
¡¡Æüì´Ø¿ô
¡¡Â¿·å¡Ê¿ÇÜĹ¡Ë
¡¡¡Ý
¥·¥ß¥å¥ì¡¼¥·¥ç¥ó
¡¡¥²¡¼¥à
 

WinÈÇ7.4.2¥¤¥ó¥¹¥È¡¼¥ë¥Õ¥¡¥¤¥ë

 Åê¹Æ¼Ô¡§Åç¼1243  Åê¹ÆÆü¡§2009ǯ12·î14Æü(·î)12»þ04ʬ18ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ºò£±£´Æü¤ËBASIC-7.4.2¤Îsetup.exe¤ò¥À¥¦¥ó¥í¡¼¥É¤·¤Æ¥¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤·¤¿¡£
BASIC¥¦¥£¥ó¥É¥¦¤Î¥á¥Ë¥å¡¼¡Ö¥Ø¥ë¥×¡×¤Ç¥Ð¡¼¥¸¥ç¥ó¾ðÊó¤ò¸«¤Þ¤·¤¿¤é¡Ö7.4.1¡×¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤·¤¿¡£
¥Ø¥ë¥×ÆâÍƤÎÊѹ¹Ï³¤ì¤Ç¡¢¼ÂºÝ¤ÎÆâÍƤÏ7.4.2¤Ê¤Î¤Ç¤·¤ç¤¦¤«¡£
 

Re: WinÈÇ7.4.2¥¤¥ó¥¹¥È¡¼¥ë¥Õ¥¡¥¤¥ë

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2009ǯ12·î14Æü(·î)15»þ40ʬ29ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.827[¸µµ­»ö¤Ø]

> ºò£±£´Æü¤ËBASIC-7.4.2¤Îsetup.exe¤ò¥À¥¦¥ó¥í¡¼¥É¤·¤Æ¥¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤·¤¿¡£
> BASIC¥¦¥£¥ó¥É¥¦¤Î¥á¥Ë¥å¡¼¡Ö¥Ø¥ë¥×¡×¤Ç¥Ð¡¼¥¸¥ç¥ó¾ðÊó¤ò¸«¤Þ¤·¤¿¤é¡Ö7.4.1¡×¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤·¤¿¡£
> ¥Ø¥ë¥×ÆâÍƤÎÊѹ¹Ï³¤ì¤Ç¡¢¼ÂºÝ¤ÎÆâÍƤÏ7.4.2¤Ê¤Î¤Ç¤·¤ç¤¦¤«¡£

¿½¤·Ìõ¤¢¤ê¤Þ¤»¤ó¡£
HELP¤Î½¤ÀµËº¤ì¤Ç¤¹¡£
12·î12Æü9»þ39ʬ¤ÎÆüÉÕ¤¬¤¢¤ì¤Ð½¤ÀµºÑ¤ß¤ÎÈǤǤ¹¡£
 

¥Æ¥È¥í¥ß¥Î

 Åê¹Æ¼Ô¡§±ÊÌî¸î  Åê¹ÆÆü¡§2009ǯ12·î14Æü(·î)15»þ46ʬ31ÉÃ
ÊÖ¿®¡¦°úÍÑ
  »³Ã椵¤ó¡¢ÃúÇ«¤Ê²óÅú¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
´¶¼Õ¤·¤Þ¤¹¡£¥Æ¥È¥í¥ß¥Î¤Ë¤Ï²ò¤¬¤Ê¤¤¤³¤È¤òÃΤê¤Þ¤»¤ó¤Ç¤·¤¿¡£
¥Ú¥ó¥È¥ß¥Î¤Î¾ì¹ç¤Ï¤Ç¤­¤Þ¤·¤¿¡£
 

Re: ·Ç¼¨ÈIJáµî¥í¥°¤Ø¤Î¥ê¥ó¥¯µö²Ä´ê¤¤

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ12·î14Æü(·î)17»þ08ʬ1ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.826[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

Îã¤òÄ󼨤·¤Æ¤¤¤¿¤À¤­¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
»ä¤¬¹Í¤¨¤¿Ê¬Îà¤Ï¼¡¤Î¤è¤¦¤Ê¤â¤Î¤Ç¤¹¡£
¾¤ÎÊý¤â¡¢²¿¤«Îɤ¤°Æ¤¬¤¢¤ì¤Ð¤ª´ó¤»¤¯¤À¤µ¤¤¡£¤ª´ê¤¤¤·¤Þ¤¹¡£

¿ôÃÍ·×»»[¥µ¥Ö¥«¥Æ¥´¥ê¡¼]
    [´Ø¿ô]
    [ÈùÀÑʬ]
    [Ê£ÁÇ¿ô]
    [¦Ð/»°³Ñ´Ø¿ô]
    [ÊýÄø¼°/¿¹à¼°]
    [ÁÇ¿ô]
    [½çÎóÁȹ礻]
    [¥°¥é¥Õ]
    [¤½¤Î¾]
ʪÍý·×»»(ÇÈÆ°/²óÏ©Åù)
¥Ç¡¼¥¿½èÍý(¥½¡¼¥È/¥µ¡¼¥Á/ʸ»úÎóÅù)
¥°¥é¥Õ¥£¥Ã¥¯(¥¢¥Ë¥á/3D)
¥·¥ß¥å¥ì¡¼¥·¥ç¥ó/¥Õ¥é¥¯¥¿¥ë
¥²¡¼¥à/¥Ñ¥º¥ë/¥Þ¥¸¥Ã¥¯
¥æ¡¼¥Æ¥£¥ê¥Æ¥£(GUI/¥Õ¥¡¥¤¥ë/²èÁü/²»À¼/ÄÌ¿®Åù)
OSÊÌ(Linux/Mac)
½½¿ÊBASIC¤Ë¤Ä¤¤¤Æ
Q&A/·Ç¼¨ÈĤˤĤ¤¤Æ/¤½¤Î¾
 

¤´¶ìÏ«¤µ¤Þ¤Ç¤¹

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ12·î14Æü(·î)18»þ23ʬ25ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¹ÓÅĤµ¤ó¤Ø
¤Û¤ó¤È¤¦¤Ë¤´¶ìÏ«¤µ¤Þ¤Ç¤¹¡£»ä¤ò´Þ¤à¸Å³ô¤ÎÌÌ¡¹¤âËÜÍè¤Ï¡¢¼êÅÁ¤ï¤Ê¤¤¤È¤¤¤±¤Ê¤¤½ê¡¢
¤½¤ì¤ò¡¢¤·¤Ê¤¤¡¢¸å¤í¤á¤¿¤µ¤â¤¢¤ê¡¢°Õ¸«¤Ï¤É¤¦¤«¤È»×¤¤¤Þ¤·¤¿¤¬¡¢
Ψľ¤Ê´üÂÔ¤ò¸À¤Ã¤Æ¤ß¤Þ¤¹¤È¡¦¡¦»×¤¤ÀڤꡢÆÈÃǤÈÊи«¤Ç¤ä¤é¤ì¤¿¤é¤¤¤«¤¬¤Ç¤·¤ç¤¦¡£
ÂçÊѤʸæ»Å»ö¡¢´¶¼Õ¤¤¤¿¤·¤Þ¤¹¡£¡¡2009.12.14¡¡¿Ûˬ ͺ¼£
 

µì·Ç¼¨ÈIJáµî¥í¥°¤Î¥È¥Ô¥Ã¥¯¤ò¥¹¥ì¥Ã¥É¤Ë¤·¤Þ¤·¤¿

 Åê¹Æ¼Ô¡§¹ÓÅĹÀÆó  Åê¹ÆÆü¡§2009ǯ12·î14Æü(·î)19»þ58ʬ27ÉÃ
ÊÖ¿®¡¦°úÍÑ
  µì·Ç¼¨ÈĤβáµî¥í¥°¥¤¥ó¥Ç¥Ã¥¯¥¹¤«¤é¥È¥Ô¥Ã¥¯¥¿¥¤¥È¥ë¤Î¤ß¤òÈ´¤­½Ð¤·¤Æ°ìÍ÷¤Ë¤·¤¿¥¹¥ì¥Ã¥É¤òºîÀ®¤·¤Þ¤·¤¿¡£
¡Ö½½¿ÊBASIC·Ç¼¨ÈIJáµî¥í¥°¡×¥¤¥ó¥Ç¥Ã¥¯¥¹¡Ê¥È¥Ô¥Ã¥¯¡Ë
¥Ä¥ê¡¼·Á¼°¤Î»ÞÉôʬ¤Î¥ì¥¹¤ò¥«¥Ã¥È¤·¤¿¤Î¤Ç°ìÍ÷À­¤¬¹â¤¯¤Ê¤ê»ëǧ¤Ë¤è¤ë¸¡º÷¤¬¤·¤ä¤¹¤¤¤È»×¤¤¤Þ¤¹¡£¤´³èÍѤ¯¤À¤µ¤¤¡£


SECOND¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£
¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£¤½¤¦¸À¤Ã¤Æ¤¤¤¿¤À¤±¤ë¤È¤ä¤ëµ¤¤â¤ª¤­¤Þ¤¹¡£
¤Ç¤­¤ë¤À¤±Îɤ¤¤â¤Î¤òºî¤ê¤¿¤¤¤Î¤Ç¡¢¤Ç¤­¤ì¤ÐSECOND¤µ¤ó¤Ë¤â¼êÅÁ¤Ã¤Æ¤¤¤¿¤À¤±¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£
¸½ºß¡¢ºî¶È·×²è¤ò¹½ÁÛ¤·¤Æ¤¤¤Þ¤¹¤¬¡¢¥«¥Æ¥´¡¼¥ê¡¼¤¬·èÄ꼡Âè¡Ö°ì¼¡Ê¬Îà¡×¤È¤·¤Æ¤Þ¤ºÅê¹Æ¼ÔËܿͤËʬÎà¤ò¤ª´ê¤¤¤·¤è¤¦¤«¤È¹Í¤¨¤Æ¤¤¤Þ¤¹¡£¤³¤ì¤Û¤É³Î¼Â¤ÊʬÎà¤Ï¤Ê¤¤¤Ç¤·¤ç¤¦¡£
»Ä¤Ã¤¿µ­»ö¤ò¡ÖÆó¼¡Ê¬Îà¡×¤È¤·¤Æ¥«¥Æ¥´¥ê¡¼¤´¤È¤Ë¶¨ÎϼԤòÊç¤êʬÎàºî¶È¤ò¤ª´ê¤¤¤·¤Þ¤¹¡£
»ä¤¬Ã챤ò»ý¤¿¤Ê¤¤Ê¬Ìî¤â¿¤¤¤Î¤Ç¡¢¤³¤³¤ÇSECOND¤µ¤ó¤äÅê¹Æ¾ïÏ¢¤ÎÊý¤Ë¼ê¤òµó¤²¤Æ¤¤¤¿¤À¤±¤ë¤È¤È¤Æ¤â½õ¤«¤ê¤Þ¤¹¡£
ºÇ¸å¤Ë»Ä¤Ã¤¿µ­»ö¤ò»ä¤¬Ê¬Îष¡¢¥ê¥ó¥¯¤òÉÕ¤±¤Æ¥¢¥Ã¥×¤·¤Þ¤¹¡£
°Ê¾å¤Î¤è¤¦¤Ê¹½ÁۤǤ¹¡£
¤¼¤Ò¡¢¤´¶¨ÎϤò¤ª´ê¤¤¤·¤Þ¤¹¡£
 

PLOT TEXT

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ12·î14Æü(·î)21»þ35ʬ26ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ! PLOT TEXT ʸ»ú¤Î¡¢¶ÀÁü¥Æ¥¹¥È¡£
!
!-------------------
LET N=1  !0,1,2, Ä̾ï¤ÎËü²Ú¶À¤Ï£²¤Ë¤¹¤ë¡£
LET NN=2^N
SET TEXT JUSTIFY "center","half"
SET TEXT BACKGROUND "OPAQUE"
ASK PIXEL SIZE (0,0;1,1) xx,yy
LET xx=xx/2
LET yy=yy/2
SET WINDOW -xx/NN,xx/NN, -yy/NN,yy/NN

LET ¦Õ=0
LET stp=-PI/180*6
DO
   LET t=INT(TIME)
   IF t0<>t THEN
      LET t0=t
      IF 2*PI<=ABS(¦Õ) THEN LET stp=-stp
      LET ¦Õ=REMAINDER(¦Õ, 2*PI) +stp
      !-----
      SET DRAW mode hidden
      CLEAR
      SET TEXT font "Century",12*NN
      DRAW D4(N) WITH SHIFT(-300/2,-300/2/SQR(3))*ROTATE(¦Õ*(-1)^N)*SCALE(1,(-1)^N)
      SET TEXT font "Century",12
      PLOT TEXT,AT (xx-80)/NN,(yy-10)/NN:"Right Click to Stop"
      DRAW center WITH SHIFT(-300/2/NN,-300/2/SQR(3)/NN)*ROTATE(¦Õ)
      SET DRAW mode explicit
   END IF
   WAIT DELAY 0 !¡¡¾ÊÅÅÎϸú²Ì
   MOUSE POLL mx,my,mlb,mrb
LOOP UNTIL mrb>=1 !¡¡±¦¥¯¥ê¥Ã¥¯¤ÇÄä»ß

PICTURE center
   SET LINE COLOR 2
   SET LINE width 2
   PLOT LINES:0,0; 300/NN,0; 300/2/NN,300*SQR(3)/2/NN; 0,0
   SET LINE width 1
   SET LINE COLOR 1
END PICTURE

!------
PICTURE D4(k)
   IF 0< k THEN
      DRAW D4(k-1) WITH SCALE(1/2,1/2)*SHIFT(300/4,SQR(3)*300/4) !¡¡Æ⦤ξå
      DRAW D4(k-1) WITH SCALE(1/2,-1/2)*SHIFT(300/4,SQR(3)*300/4) !¡¡Æ⦤ÎÃæ
      DRAW D4(k-1) WITH SCALE(1/2,1/2)*ROTATE(-PI*2/3)*SHIFT(300/4,SQR(3)*300/4) !Æ⦤κ¸
      DRAW D4(k-1) WITH SCALE(1/2,1/2)*ROTATE(PI*2/3)*SHIFT(300,0) !¡¡Æ⦤α¦
   ELSE
      DRAW A_Clock WITH ROTATE(-¦Õ)*SHIFT(300/2,300/2/SQR(3))
      PLOT LINES:0,0; 300,0; 300/2,300*SQR(3)/2; 0,0 !¡¡³°Â¦¤Î´ð½à»°³Ñ·Á
   END IF
END PICTURE

!------
PICTURE A_Clock
   SET AREA COLOR 1
   FOR i=1 TO 60
      LET a=-PI/30*(i-15)
      IF MOD(i,5)=0 THEN
         PLOT TEXT,AT 60*COS(a)+.5, 60*SIN(a) :STR$(i/5)           !¿ô»ú
         ! CALL Plot_7segment( 60*COS(a) ,60*SIN(a) ,5.5 ,STR$(i/5)) !¿ô»ú(ÂåÂØ)
      END IF
      DRAW disk WITH SCALE(1-.5*SGN(MOD(i,5)))*SHIFT(72*COS(a),72*SIN(a)) !ʬÌÜÀ¹¤ê
   NEXT i
   !---
   DRAW hand(1) WITH SCALE(2.5, 0.75)*ROTATE(-t*PI/21600) !»þ¿Ë
   DRAW hand(1) WITH ROTATE(-t*PI/1800)                   !ʬ¿Ë
   DRAW hand(1) WITH SCALE(0, 1.1)*ROTATE(-t*PI/30)       !ÉÿË
   DRAW disk WITH SHIFT(0,0)*SCALE(4)                     !Ãæ¿´¤Î¾þ¤ê
END PICTURE

PICTURE hand(c)
   SET AREA COLOR c
   PLOT AREA: -1,-15; 1,-15; 1,60; -1,60    !£³¿Ë¶¦ÍÑ¡¢£°»þ°ÌÃ֤οË
END PICTURE

!--------------------------------------------------------------------------
SUB Plot_7segment(x,y,s,i$) !ʸ»úÎóÃæ¿´(x,y) ʸ»ú¤Î²£Éý(s) ¿ô»ú¤Îʸ»úÎó(i$)
   LET w=LEN(i$)
   LET s1=s      ! y¼´¢¬:s1=s  y¼´¢­:s1=-s
   LET s2=s/2
   LET x=x-(w-1)*s2*1.6
   FOR p=1 TO w
      SELECT CASE VAL(i$(p:p))
      CASE 0
         PLOT LINES:x-s2,y+s;x-s2,y-s;x+s2,y-s;x+s2,y+s;x-s2,y+s
      CASE 1
         PLOT LINES:x,y-s;x,y+s
      CASE 2
         PLOT LINES:x-s2,y+s1;x+s2,y+s1;x+s2,y;x-s2,y;x-s2,y-s1;x+s2,y-s1
      CASE 3
         PLOT LINES:x-s2,y-s;x+s2,y-s;x+s2,y+s;x-s2,y+s
         PLOT LINES:x-s2,y;x+s2,y
      CASE 4
         PLOT LINES:x-s2,y+s1;x-s2,y;x+s2,y
         PLOT LINES:x+s2,y+s1;x+s2,y-s1
      CASE 5
         PLOT LINES:x+s2,y+s1;x-s2,y+s1;x-s2,y;x+s2,y;x+s2,y-s1;x-s2,y-s1
      CASE 6
         PLOT LINES:x+s2,y+s1;x-s2,y+s1;x-s2,y-s1;x+s2,y-s1;x+s2,y;x-s2,y
      CASE 7
         PLOT LINES:x-s2,y+s1;x+s2,y+s1;x+s2,y-s1
      CASE 8
         PLOT LINES:x-s2,y;x-s2,y-s;x+s2,y-s;x+s2,y+s;x-s2,y+s;x-s2,y;x+s2,y
      CASE 9
         PLOT LINES:x+s2,y;x-s2,y;x-s2,y+s1;x+s2,y+s1;x+s2,y-s1;x-s2,y-s1
      CASE ELSE
      END SELECT
      LET x=x+s*1.6
   NEXT p
END SUB

END
 

»°³ÑÈ¢¤Ç¡¢Ä·¤Í¤ë¥Ü¡¼¥ë

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ12·î19Æü(ÅÚ)16»þ24ʬ33ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  !»°³ÑÈ¢¤Ç¡¢Ä·¤Í¤ë¥Ü¡¼¥ë
!-----------------------
!¥Ü¡¼¥ë¤ÎÊý¸þ¤ò¡¢Å¬Åö¤Ê̵Íý¿ô¤Ë¤¹¤ë¤È¡¢¼þ´ü¤¬¤Ê¤¯¤Ê¤ê¡¢
!¥Ù¥ë¥Ì¡¼¥¤¡¦¥·¥Õ¥È¼ÌÁü( ̵Íý¿ô¤Î¾®¿ô²¼°Ì¤ò¡¢Ìµ¸Â¤ËÆɤ߿ʤ๽¤¤Ç¡¢¼þ´ü¤ò¼º¤¦¥«¥ª¥¹ )
!¤Ë¡¢»÷¤¿¥«¥ª¥¹¤¬¸½¤ì¤ë¡£

LET si=11   !Àµ»°³Ñ·Á(x1,y1)(x2,y2)(x3,y3) ¤Î°ìÊÕ¡£
LET x1=1.5
LET y1=2.5
!----       !ɬ¤º¤·¤â¡¢ÅùÊդǤʤ¯¤Æ¤è¤¤¤¬¡¢³°ÊÉɽ¼¨¤Ï¥º¥ì¤ë¡£
LET x2=x1+si
LET y2=y1
LET x3=x1+si/2
LET y3=y1+SQR(3)*si/2
!----                    !       £³
LET A12=(y2-y1)/(x2-x1)  ! f13 ¡¿  ¡À f23
LET A13=(y3-y1)/(x3-x1)  !   £±¨¡¨¡¨¡£²
LET A23=(y3-y2)/(x3-x2)  !      f12
DEF f12(x)=A12*(x-x1)+y1 ! ¨¡
DEF f13(x)=A13*(x-x1)+y1 ! ¡¿
DEF f23(x)=A23*(x-x2)+y2 ! ¡À
!
!¥Ü¡¼¥ë°ÌÃÖ(bx,by)¤ÎÁ°Îò¤ÎÀþ y=my/mx*(x-bx)+by ¤ÈÊɤÎ
!
!  Ä¾Àþf12 y=A12*(x-x1)+y1 ¤È¤Î¸òÅÀ¤Î¼° A12*(x-x1)+y1=my/mx*(x-bx)+by
!  x=(A12*x1-y1-bx*my/mx+by)/(A12-my/mx)
!  y=f12(x)
!  Ä¾Àþf13 y=A13*(x-x1)+y1 ¤È¤Î¸òÅÀ¤Î¼° A13*(x-x1)+y1=my/mx*(x-bx)+by
!  x=(A13*x1-y1-bx*my/mx+by)/(A13-my/mx)
!  y=f13(x)
!  Ä¾Àþf23 y=A23*(x-x2)+y2 ¤È¤Î¸òÅÀ¤Î¼° A23*(x-x2)+y2=my/mx*(x-bx)+by
!  x=(A23*x2-y2-bx*my/mx+by)/(A23-my/mx)
!  y=f23(x)
!
LET px12= (x2-x1)/SQR((y2-y1)^2+(x2-x1)^2)
LET py12= (y2-y1)/SQR((y2-y1)^2+(x2-x1)^2) !ľÀþf12 ¤ËÊ¿¹Ô¤Ê¡¢Ã±°Ì¥Ù¥¯¥È¥ë
LET px13= (x3-x1)/SQR((y3-y1)^2+(x3-x1)^2)
LET py13= (y3-y1)/SQR((y3-y1)^2+(x3-x1)^2) !ľÀþf13 ¤ËÊ¿¹Ô¤Ê¡¢Ã±°Ì¥Ù¥¯¥È¥ë
LET px23= (x3-x2)/SQR((y3-y2)^2+(x3-x2)^2)
LET py23= (y3-y2)/SQR((y3-y2)^2+(x3-x2)^2) !ľÀþf23 ¤ËÊ¿¹Ô¤Ê¡¢Ã±°Ì¥Ù¥¯¥È¥ë
LET ox12= py12
LET oy12=-px12   !ľÀþf12 ¤Ë¿âľ¤Ê¡¢Ã±°Ì¥Ù¥¯¥È¥ë
LET ox13= py13
LET oy13=-px13   !ľÀþf13 ¤Ë¿âľ¤Ê¡¢Ã±°Ì¥Ù¥¯¥È¥ë
LET ox23= py23
LET oy23=-px23   !ľÀþf23 ¤Ë¿âľ¤Ê¡¢Ã±°Ì¥Ù¥¯¥È¥ë
!
LET bx=X1            !¥Ü¡¼¥ë¤Î½é´ü°ÌÃÖ
LET by=Y1
LET mx=SQR(5)/8      !¥Ü¡¼¥ë¤ÎX®ÅÙ¡¢¥¹¥Æ¥Ã¥×­ùX
LET my=SQR(3)/20     !¥Ü¡¼¥ë¤ÎY®ÅÙ¡¢¥¹¥Æ¥Ã¥×­ùY
!
SET WINDOW 0,14, 0,14
! DRAW grid(1,1)
SET DRAW MODE NOTXOR  !£²ÅÙ½ñ¤­¤Ç¾Ã¤¨¤ë NOTXOR ¥â¡¼¥É
LET r=0.7             !¥Ü¡¼¥ë¤ÎȾ·Â
!----
PLOT LINES: x1-r*SQR(3),y1-r; x2+r*SQR(3),y2-r; x3,y3+r*2; x1-r*SQR(3),y1-r !ɽ¼¨ÊÉÌÌ
SET LINE COLOR 15     !¶ä
PLOT LINES: x1,y1; x2,y2; x3,y3; x1,y1 ! ·×»»ÊÉÌÌ
SET LINE COLOR 2      !ÀÄ
SET AREA COLOR 2      !ÀÄ
!
PLOT TEXT,AT 10,13: "±¦¥¯¥ê¥Ã¥¯¡§Ää»ß"
DO
   DRAW disk WITH SCALE(r)*SHIFT(bx,by) !¥Ü¡¼¥ë¤ò½ñ¤¯
   ! SET DRAW mode explicit
   WAIT DELAY 0.02              !¾ÊÅÅÎϸú²Ì¤È¡¢Â®ÅÙ
   ! SET DRAW mode hidden
   DRAW disk WITH SCALE(r)*SHIFT(bx,by) !¥Ü¡¼¥ë¤À¤±¤ò¾Ã¤¹
   PLOT LINES : bx,by;                  ! ÍúÎòÀþ¤ò¡Ê½ñ¤¯¡¦¾Ã¤¹¡Ë
   LET bx=bx+mx
   LET by=by+my
   IF f23(bx)<=by THEN LET bx23=(A23*x2-y2-bx*my/mx+by)/(A23-my/mx)
   IF f13(bx)<=by THEN LET bx13=(A13*x1-y1-bx*my/mx+by)/(A13-my/mx)
   IF f12(bx)>=by THEN LET bx12=(A12*x1-y1-bx*my/mx+by)/(A12-my/mx)
   !----
   IF f23(bx)<=by AND x3<=bx23 AND bx23<=x2 THEN
      LET bx=bx23
      LET by=f23(bx)
      LET wy=(mx*px23+my*py23)*py23-(mx*ox23+my*oy23)*oy23
      LET mx=(mx*px23+my*py23)*px23-(mx*ox23+my*oy23)*ox23 !mx,my ¤Î¡¢ÊɤËÊ¿¹ÔÀ®Ê¬¡ÝÊɤ˿âľÀ®Ê¬
      LET my=wy
   ELSEIF f13(bx)<=by AND x1<=bx13 AND bx13<=x3 THEN
      LET bx=bx13
      LET by=f13(bx)
      LET wy=(mx*px13+my*py13)*py13-(mx*ox13+my*oy13)*oy13
      LET mx=(mx*px13+my*py13)*px13-(mx*ox13+my*oy13)*ox13
      LET my=wy
   ELSEIF f12(bx)>=by AND x1<=bx12 AND bx12<=x2 THEN
      LET bx=bx12
      LET by=f12(bx)
      LET wy=(mx*px12+my*py12)*py12-(mx*ox12+my*oy12)*oy12
      LET mx=(mx*px12+my*py12)*px12-(mx*ox12+my*oy12)*ox12
      LET my=wy
   END IF
   MOUSE POLL mox,moy,mlb,mrb
LOOP UNTIL 0< mrb

END
 

»¶Ê⥳¡¼¥¹¤Îõº÷´ê¤¤

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ12·î19Æü(ÅÚ)20»þ24ʬ57ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¤¢¤ëÅÀ¤«¤éÅìÀ¾ÆîË̤¤¤º¤ì¤ÎÊý¸þ¤Ç¤â¤¤¤¤¤«¤é£±¿Ê¤à¡£
¤½¤³¤Çľ³Ñ¤Ë¶Ê¤¬¤ê£²¿Ê¤à¡£
¤µ¤é¤Ë¤½¤³¤Çľ³Ñ¤Ë¶Ê¤¬¤ê£³¿Ê¤à¡£
¤³¤ì¤ò·«¤êÊÖ¤·¤Æ¤¤¤­¡¢Ä¾³Ñ¤Ë¶Ê¤¬¤Ã¤Æ¤«¤é£´¡¤£µ¡¤£¶¡¤£·¤Îµ÷Î¥¿Ê¤ó¤Ç¤¤¤­ºÇ¸å£¸¤Îµ÷Î¥¿Ê¤ó¤À»þ¤Ë¸µ¤Î½ÐȯÅÀ¤ËÌá¤ë¥³¡¼¥¹¤É¤ê¡ÊÁ°¤Î¥³¡¼¥¹¤Ï²£ÀÚ¤é¤Ê¤¤¤³¤È¡£¡Ë¤Î¥Ñ¥¿¡¼¥ó¤òÄ´¤Ù¤Æ¤Û¤·¤¤¡£¡Ê¤³¤ì¤ò°Ì¿ô£¸¤Î»¶Ê⥳¡¼¥¹¤È¸Æ¤Ö¤³¤È¤Ë¤·¤Þ¤¹¡£¡Ë
Ʊ¤¸¤¯°Ì¿ô£±£¶¤Î»¶Ê⥳¡¼¥¹
°Ì¿ô£²£´¤Î»¶Ê⥳¡¼¥¹¤Ç¤Ï²¿¼ïÎब²Äǽ¤«ÃΤꤿ¤¤¡£
 

Re: »¶Ê⥳¡¼¥¹¤Îõº÷´ê¤¤

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ12·î20Æü(Æü)11»þ08ʬ38ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.900[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¡Ö²£ÀÚ¤ë¡×¤ä¡ÖƱ°ì¡×¤ÎȽÄê¤Ï¡¢¿Þ·Á¤¬É½¼¨¤µ¤ì¤ë¤Î¤Ç¡¢¤½¤ì¤ò¸«¤Æ³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡£
!»¶Ê⥳¡¼¥¹¤Îõº÷

PUBLIC NUMERIC N !Êâ¿ô
LET N=16

DIM d(N),x(0 TO N),y(0 TO N) !³ÆÊâ¿ô¤Ç¤ÎÊý¸þ¤È°ÌÃÖ
MAT d=ZER
MAT x=ZER !¸¶ÅÀ
MAT y=ZER

LET x(1)=1 !£±ÊâÌܤÏÅì¤Ø¡¡¢¨0:Åì¡¢1:ËÌ¡¢2:À¾¡¢3:Æî

CALL search(2,d,x,y) !£²ÊâÌܰʹß

END


EXTERNAL SUB search(s,d(),x(),y()) !¥Ð¥Ã¥¯¥È¥é¥Ã¥¯¤Ç¸¡º÷¤¹¤ë
FOR i=-1 TO 1 STEP 2 !±¦¤Èº¸¤Î¤ß
   LET dd=MOD(d(s-1)+i,4) !£±¤ÄÁ°¤ò´ð½à¤Ë¤¹¤ë

   LET xx=x(s-1) !¸½ºß¤Î°ÌÃÖ
   LET yy=y(s-1)
   SELECT CASE dd !sÊâÌܤΰÜÆ°µ÷Î¥
   CASE 0 !E
      LET xx=xx+s
   CASE 1 !N
      LET yy=yy+s
   CASE 2 !W
      LET xx=xx-s
   CASE 3 !S
      LET yy=yy-s
   CASE ELSE
   END SELECT
   LET x(s)=xx !¿Ê¤á¤ë
   LET y(s)=yy

   LET d(s)=dd !sÊâÌܤÎÊý¸þ

   IF s=N THEN !»ØÄê¤ÎÊâ¿ô¤Ë㤷¤¿¤é
      IF x(N)=x(0) AND y(N)=y(0) THEN !¸µ¤Î°ÌÃÖ¤ËÌá¤Ã¤¿¤é
         MAT PRINT d;

         SET bitmap SIZE 600,600 !ºî²è¤·¤Æ¸òº¹¤Ê¤É¤ò³Îǧ¤¹¤ë
         SET WINDOW -40,40,-40,40
         CLEAR
         DRAW grid(5,5)
         SET LINE width 2
         SET TEXT HEIGHT 1.5 !¢¨Ä´À°¤¬É¬ÍפǤ¢¤ë
         SET TEXT JUSTIFY "center","half"
         FOR k=1 TO N
            SET LINE COLOR 1 !´ñ¿ô¤È¶ö¿ô¤Ç¿§Ê¬¤±
            IF MOD(k,2)=0 THEN SET LINE COLOR 4
            PLOT LINES: x(k-1),y(k-1); x(k),y(k) !µ°À×
            PLOT TEXT ,AT (x(k-1)+2*x(k))/3,(y(k-1)+2*y(k))/3: STR$(k)
         NEXT k
         SET LINE width 1 !restore it

         pause !OK?
         !INPUT PROMPT "OK¤«NG¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡£": y$

      END IF
   ELSE
      CALL search(s+1,d,x,y) !¼¡¤Ø
   END IF
NEXT i
END SUB

!²óÅú¡¢¾ðÊó¡¢¥¢¥ë¥´¥ê¥º¥à¡¢¥Ñ¥º¥ë

!£±ÊâÌܤòÅì¡Ê¿åÊ¿Êý¸þ¡Ë¤Ø¸ÇÄꤹ¤ë¤È
!´ñ¿ôÌܤϿåÊ¿Êý¸þ¡ÊÅìÀ¾Êý¸þ¡Ë¡¢¶ö¿ôÌܤϿâľÊý¸þ¡ÊÆîËÌÊý¸þ¡Ë¤Ë¤Ê¤ë¡£
!¼°¤Çɽ¸½¤¹¤ë¤È
! x=¡Þ1¡Þ3¡Þ5¡Þ7
! y=¡Þ2¡Þ4¡Þ6¡Þ8
!¥×¥é¥¹¥Þ¥¤¥Ê¥¹¤ÎÁȹ礻¤Ç£°¤Ë¤Ê¤ë¤«¤É¤¦¤«¤Î¸¡¾Ú¤Ë¤Ê¤ë¡£
 

Ä·¤Í¤ë¥Ü¡¼¥ë¤ò¡¢£Î³Ñ·Á ¤ÎÊÉÌÌ¤Ø ³ÈÄ¥

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ12·î22Æü(²Ð)04»þ55ʬ8ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.899[¸µµ­»ö¤Ø]

! Ä·¤Í¤ë¥Ü¡¼¥ë¤ò¡¢£Î³Ñ·Á ¤ÎÊÉÌÌ¤Ø ³ÈÄ¥
!--------------------------------------
!¥Ü¡¼¥ë¤ÎÊý¸þ¤ò¡¢Å¬Åö¤Ê̵Íý¿ô¤Ë¤¹¤ë¤È¡¢¼þ´ü¤¬¤Ê¤¯¤Ê¤ê¡¢
!¥Ù¥ë¥Ì¡¼¥¤¡¦¥·¥Õ¥È¼ÌÁü( ̵Íý¿ô¤Î¾®¿ô²¼°Ì¤ò¡¢Ìµ¸Â¤ËÆɤ߿ʤ๽¤¤Ç¡¢¼þ´ü¤ò¼º¤¦¥«¥ª¥¹ )
!¤Ë¡¢»÷¤¿¥«¥ª¥¹¤¬¸½¤ì¤ë¡£

OPTION BASE 0
SET WINDOW -7,7, -7,7
DRAW axes
!----
LET ma=9                    !¿³Ñ·Á¤Î ³Ñ¿ô 3,4,5,6,7,8,,,,
DIM x(ma),y(ma),A(ma),px(ma),py(ma)
LET r=0.7                   !¥Ü¡¼¥ë¤ÎȾ·Â
LET r0=5.5                  !·×»»¤Ç»ÈÍѤΠ¿³Ñ·Á¡¢³°ÀܱߤÎȾ·Â
LET r1=r0+r/SIN(PI/2-PI/ma) !¥Ü¡¼¥ë¤ÎÅö¤ë ¿³Ñ·Á¡¢³°ÀܱߤÎȾ·Â
!
!LET a0=PI*(1.5-1/ma)        !(x1,y1)¤Î³Ñ¡£
LET a0=PI*(1.5-3/ma)        !(x1,y1)¤Î£±¤Ä¼êÁ°¤Î³Ñ¡£
FOR i=0 TO ma
   LET x(i)=r0*COS(a0)
   LET y(i)=r0*SIN(a0)
   IF 0< i THEN
      SET LINE COLOR "silver"
      PLOT LINES: x(i-1),y(i-1); x(i),y(i) !·×»»ÊÉÌÌ
      SET LINE COLOR "black"
      PLOT LINES: r1/r0*x(i-1),r1/r0*y(i-1); r1/r0*x(i),r1/r0*y(i) !¥Ü¡¼¥ëÊÉÌÌ
   END IF
   LET a0=a0+2*PI/ma
NEXT i
!                      A3         A4  £´  A3
!       £³          £´¨¡¨¡£³      £µ¡¿  ¡À£³
!  A3 ¡¿  ¡À A2   A4¨¢    ¨¢A2   A5¡À    ¡¿A2   ¡¦¡¦¡¦
!   £±¨¡¨¡¨¡£²      £±¨¡¨¡£²        £±¨¡£²
!       A1             A1             A1
!
FOR i=1 TO ma
   LET j=MOD(i,ma)+1
   LET A(i)=(y(j)-y(i))/(x(j)-x(i))                         !ľÀþij ¤Î¸ûÇÛ
   LET px(i)=(x(j)-x(i))/SQR((y(j)-y(i))^2+(x(j)-x(i))^2)
   LET py(i)=(y(j)-y(i))/SQR((y(j)-y(i))^2+(x(j)-x(i))^2)   !ľÀþij ¤ËÊ¿¹Ô¤Ê¡¢Ã±°Ì¥Ù¥¯¥È¥ë
NEXT i
!
LET a0=ANGLE(x(1),y(1))
LET bx=r0*COS(a0)*0.999 ! ¥Ü¡¼¥ë¤Î½é´ü°ÌÃÖX
LET by=r0*SIN(a0)*0.999 ! ¥Ü¡¼¥ë¤Î½é´ü°ÌÃÖY
LET a0=ANGLE(x(2)-x(1),y(2)-y(1))+SQR(2)*PI/ma/1.1313 !¥Ü¡¼¥ë¤Î½é´ü³ÑÅÙ
LET m0=.23        !¥Ü¡¼¥ë¤Î®¤µ­ù
LET mx=m0*COS(a0) !¥Ü¡¼¥ë¤Î½é´ü­ùX
LET my=m0*SIN(a0) !¥Ü¡¼¥ë¤Î½é´ü­ùY

SUB Cross   !³ÆÊդؤξ×Æ͸¡½Ð¤ÈÈ¿¼Í
   LET ok=0
   IF ABS(A(n))< 1 THEN
   !---ÊɤÎľÀþ(y-y0)=(x-x0)*A ,¥Ü¡¼¥ë°ÌÃ֤ȿÞÃæ¿´¤ò·ë¤ÖÀþ y=x*by/bx ¤Î¸òÅÀ(xw,yw)¡£
      LET xw=(x(n)*A(n)-y(n))/(A(n)-by/bx)                  !xw Í¥Àè
      LET yw=(xw-x(n))*A(n)+y(n)
      IF 0< xw*bx+yw*by AND xw^2+yw^2<=bx^2+by^2 THEN       !Êɤγ°
      !---ÊɤÎľÀþ(y-y0)=(x-x0)*A, ¥Ü¡¼¥ëµ°À×Àþ(y-by)=(x-bx)*my/mx ¤Î¸òÅÀ(xc,yc)¡£
         LET xc=(x(n)*A(n)-y(n)-bx*my/mx+by)/(A(n)-my/mx)   !xc Í¥Àè
         LET yc=(xc-x(n))*A(n)+y(n)
         !---ÊɤΰìÊÕÆâ¤Ê¤é¡¢È¿¼Í½èÍý
         IF (x(n)<=xc AND xc<=x(MOD(n,ma)+1) OR x(MOD(n,ma)+1)<=xc AND xc<=x(n)) THEN CALL Mirror
      END IF
   ELSE
   !---ÊɤÎľÀþ(y-y0)=(x-x0)*A ,¥Ü¡¼¥ë°ÌÃ֤ȿÞÃæ¿´¤ò·ë¤ÖÀþ y=x*by/bx ¤Î¸òÅÀ(xw,yw)¡£
      LET yw=(y(n)/A(n)-x(n))/(1/A(n)-bx/by)                !yw Í¥Àè
      LET xw=(yw-y(n))/A(n)+x(n)
      IF 0< xw*bx+yw*by AND xw^2+yw^2<=bx^2+by^2 THEN       !Êɤγ°
      !---ÊɤÎľÀþ(y-y0)=(x-x0)*A, ¥Ü¡¼¥ëµ°À×Àþ(y-by)=(x-bx)*my/mx ¤Î¸òÅÀ(xc,yc)¡£
         LET yc=(y(n)/A(n)-x(n)-by*mx/my+bx)/(1/A(n)-mx/my) !yc Í¥Àè
         LET xc=(Yc-y(n))/A(n)+x(n)
         !---ÊɤΰìÊÕÆâ¤Ê¤é¡¢È¿¼Í½èÍý
         IF (y(n)<=yc AND yc<=y(MOD(n,ma)+1) OR y(MOD(n,ma)+1)<=yc AND yc<=y(n)) THEN CALL Mirror
      END IF
   END IF
END SUB

SUB Mirror   !¥Ù¥¯¥È¥ë(mx,my)¤ÎÈ¿¼Í¤ò¡¢Æ±¤¸(mx,my)¤Ë¾å½ñ¡£
   LET bx=xc !¥Ü¡¼¥ë¤ò¾×ÆÍÅÀ¤ËÃÖ¤¯
   LET by=yc                                ! ñ°Ì¥Ù¥¯¥È¥ë¡§ÊɤËÊ¿¹Ô( px(n), py(n) )
   !----                                                       ¿âľ(-py(n), px(n) )
   LET wy=(mx*px(n)+my*py(n))*py(n)+(mx*py(n)-my*px(n))*px(n)
   LET mx=(mx*px(n)+my*py(n))*px(n)-(mx*py(n)-my*px(n))*py(n)
   LET my=wy                     !                             ÆâÀÑ *Êý¸þ        ÆâÀÑ *Êý¸þ
   LET ok=1  !È¿¼ÍÊó¹ð           !ball®Å٥٥¯¥È¥ë£í= (mx*px+my*py)*£ð¡Ý(mx*ox+my*oy)*£ï
END SUB                          !                     Ê¿¹Ôñ°Ìvect.£ð   ¿âľñ°Ìvect.£ï

SET LINE COLOR "blue"
SET AREA COLOR "blue"
SET DRAW MODE NOTXOR !£²ÅÙ½ñ¤­¤Ç¾Ã¤¨¤ë NOTXOR ¥â¡¼¥É
!
PLOT TEXT,AT 3.7, 6.4: "±¦¥¯¥ê¥Ã¥¯¡§Ää»ß"
DO
   DRAW disk WITH SCALE(r)*SHIFT(bx,by) !¥Ü¡¼¥ë¤ò½ñ¤¯
   ! SET DRAW mode explicit             !¤Á¤é¤Ä¤­Ëɻߡ£| ¤«¤Ê¤ê¤ÊÉé²Ù¤¬¡¢¤«¤«¤ê¤Þ¤¹¡£ÃÙ¤¤|
   ! SET DRAW mode hidden               !¤Á¤é¤Ä¤­Ëɻߡ£| ¥Ñ¥½¥³¥ó¤ä¾ÊÅÅÎϤʤé»È¤ï¤Ê¤¤¤¬ÎÉ|
   WAIT DELAY 0.02                      ! ¾ÊÅÅÎϸú²Ì¤È¡¢Â®ÅÙ
   DRAW disk WITH SCALE(r)*SHIFT(bx,by) !¥Ü¡¼¥ë¤À¤±¤ò¾Ã¤¹
   PLOT LINES : bx,by;                  ! ÍúÎòÀþ¤ò¡Ê½ñ¤¯¡¦¾Ã¤¹¡Ë
   LET bx=bx+mx
   LET by=by+my
   !----
   FOR n=1 TO ma
      CALL Cross  !¾×Æ͸¡½Ð¤ÈÈ¿¼Í
      IF ok=1 THEN EXIT FOR
   NEXT n
   MOUSE POLL mox,moy,mlb,mrb
LOOP UNTIL 0< mrb

END
 

Re: Ä·¤Í¤ë¥Ü¡¼¥ë¤ò¡¢£Î³Ñ·Á ¤ÎÊÉÌÌ¤Ø ³ÈÄ¥

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ12·î22Æü(²Ð)14»þ00ʬ24ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.940[¸µµ­»ö¤Ø]

Àè¤Î¥Ö¥í¥Ã¥¯Êø¤·¤Î¥Ü¡¼¥ë¤Îµ°Æ»¤Î²òÀÏ¥×¥í¥°¥é¥à¤Ç¤¹¡£
¥Ù¥¯¥È¥ë¤È¿Þ·ÁÊýÄø¼°¤Çµ­½Ò¤·¤Æ¤ß¤Þ¤·¤¿¡£
LET cEps=1e-13 !ÀºÅÙ

DIM t(2) !ºî¶ÈÍÑ

SET bitmap SIZE 600,600
SET WINDOW -5,5,-5,5
DRAW grid

LET iter=200 !·«¤êÊÖ¤·²ó¿ô

LET M=3 !£í³Ñ·Á¡¡¢¨£³°Ê¾å¤ÎÀ°¿ô

DIM Pw(M,4) !ÊÉÌ̤Îü
!DATA  3,-4,  3, 4 !ÀµÊý·Á¡¡»ÏÅÀ(x1,y1)¡¢½ªÅÀ(x2,y2)
!DATA  3, 4, -3, 4
!DATA -3, 4, -3,-4
!DATA -3,-4,  3,-4
!MAT READ Pw
!MAT PRINT Pw;

LET R=4 !³°ÀܱߤÎȾ·Â
FOR i=1 TO M !£Ø¼´¾å¤ÎÅÀ(R,0)¤«¤éÈ¿»þ·×¤Þ¤ï¤ê¤ËĺÅÀ¤òÆÀ¤ë
   LET th=2*PI*(i-1)/M !»ÏÅÀ(x1,y1)
   LET Pw(i,1)=R*COS(th)
   LET Pw(i,2)=R*SIN(th)
   LET th=2*PI*i/M !½ªÅÀ(x2,y2)
   LET Pw(i,3)=R*COS(th)
   LET Pw(i,4)=R*SIN(th)
NEXT i
MAT PRINT Pw;

DIM w(M,2) !ÊÉÌ̤ÎË¡Àþ¥Ù¥¯¥È¥ë
FOR i=1 TO M !Àþʬ¤ÎÊý¸þ¥Ù¥¯¥È¥ë¤«¤é»»½Ð¤¹¤ë
   LET t(1)=-(Pw(i,4)-Pw(i,2)) !£ØÊý¸þ
   LET t(2)=  Pw(i,3)-Pw(i,1)  !£ÙÊý¸þ
   CALL Vec2Normalize(t,t) !Àµµ¬²½
   MAT PRINT t;
   LET w(i,1)=t(1)
   LET w(i,2)=t(2)
NEXT i

FOR i=1 TO M !ÊÉÌ̤òɽ¼¨¤¹¤ë
   PLOT LINES: Pw(i,1),Pw(i,2); Pw(i,3),Pw(i,4)
NEXT i


!¥Ü¡¼¥ë¤Îµ°Æ»¡¡Ä¾Àþp(t)=Pa+t*a
DIM a(2) !¥Ü¡¼¥ë¤Î°ÜÆ°Êý¸þ¥Ù¥¯¥È¥ë
DATA 1,2
MAT READ a
CALL Vec2Normalize(a,a) !|a|=1
MAT PRINT a;

DIM Pa(2) !¥Ü¡¼¥ë¤Îȯ¼Í°ÌÃÖ
DATA 1,0
MAT READ Pa


DIM Pc(2) !¾×ÆÍ°ÌÃÖ
DIM aa(2) !È¿¼ÍÊý¸þ¥Ù¥¯¥È¥ë
FOR k=1 TO iter !¥Ð¥¦¥ó¥É¤µ¤»¤ë
   CALL CalcCollision(Pc,aa)
   MAT PRINT Pc; !debug
   PLOT LINES: Pa(1),Pa(2); Pc(1),Pc(2) !µ°ÀפòÉÁ¤¯

   MAT Pa=Pc !¼¡¤Ø
   MAT a=aa
NEXT k


!¾×Æͤ¹¤ëÊ¿Ì̤ÎË¡Àþ¥Ù¥¯¥È¥ë¤òn¡¢Æþ¼ÍÊý¸þ¥Ù¥¯¥È¥ë¤òa¤È¤¹¤ë¡£
!È¿¼ÍÊý¸þ¥Ù¥¯¥È¥ëb¤Ï¡¢b=a-2*(a¡¦n)*n
!
!¤Þ¤¿¡¢Ê¿Ì̾å¤ÎǤ°Õ¤ÎÅÀ¤òPs¡¢Æþ¼ÍÊý¸þ¥Ù¥¯¥È¥ëa¤Î»ÏÅÀ¤òPa¤È¤¹¤ë¤È¡¢
!¾×ÆÍ°ÌÃÖPc¤Ï¡¢Pc=Pa+{n¡¦(Ps-Pa)/(a¡¦n)}*a

SUB CalcReflection(a(),n(), b()) !È¿¼Í¥Ù¥¯¥È¥ë¤ò·×»»¤¹¤ë
   MAT t=(2*DOT(a,n))*n !¥Ù¥¯¥È¥ëa¤ò¥Ù¥¯¥È¥ën¤Ë¼Í±Æ¤·¤Æ¡¢¤½¤Î£²ÇܤΥ٥¯¥È¥ë
   MAT b=a-t
   MAT PRINT b; !debug
END SUB

SUB CalcCollision(Pc(),b()) !ÊÉÌ̤Ȥξ×ÆÍ°ÌÃÖ¤ÈÈ¿¼ÍÊý¸þ¥Ù¥¯¥È¥ë¤ò·×»»¤¹¤ë
   DIM n(2),Ps(2),Pe(2)
   FOR i=1 TO M
      CALL Vec2Set(w(i,1),w(i,2), n) !Ë¡Àþ¥Ù¥¯¥È¥ë
      CALL Vec2set(Pw(i,1),Pw(i,2), Ps) !Ê¿Ì̾å¤ÎǤ°Õ¤ÎÅÀ
      PRINT "ÊÉÌÌ=";i !debug

      LET an=DOT(a,n) !¥Ù¥¯¥È¥ë£á¤È¥Ù¥¯¥È¥ë£î¤È¤Î¤Ê¤¹³Ñ¤òÆÀ¤ë¡¡|a||n|cos¦È<0
      IF an<0 THEN !¾×Æͤ¹¤ëÊÉÌ̤Îɽ΢ȽÄê
         MAT t=Ps-Pa
         LET nT=DOT(n,t)
         IF nT<0 THEN !ÊÉÌ̤ȤΰÌÃÖ´Ø·¸¤«¤é
            MAT t=(nT/an)*a
            MAT Pc=Pa+t !¸òÅÀ

            CALL Vec2Set(Pw(i,3),Pw(i,4), Pe) !ľÀþ¤Î½ªÅÀ
            LET v=InRange(Pc, Ps,Pe)
            IF v>=0 AND v<=1 THEN !Àþʬ¾å¤Ê¤é
               MAT PRINT Pc; !debug

               CALL CalcReflection(a,n, b) !È¿¼ÍÊý¸þ¥Ù¥¯¥È¥ë

               EXIT SUB !£±¤Ä¸«¤Ä¤«¤ì¤Ð
            ELSE
               PRINT "ÊÉÌ̤αäĹ¾å¤Ç¾×Æͤ¹¤ë"
               MAT PRINT Pc; !debug
            END IF
         ELSEIF nT=0 THEN
            PRINT "¾×ÆÍÃæ"
            MAT PRINT Pa; !debug

            MAT Pc=Pa
            CALL CalcReflection(a,n, b) !È¿¼ÍÊý¸þ¥Ù¥¯¥È¥ë

            EXIT SUB !£±¤Ä¸«¤Ä¤«¤ì¤Ð
         ELSE
            PRINT "¾×Æͤ·¤Ê¤¤"
         END IF

      ELSE
         PRINT "¾×Æͤ·¤Ê¤¤..."
         IF i=M THEN
            PRINT "¤¹¤Ù¤Æ¤ÎÊÉÌ̤Ⱦ×Æͤ·¤Þ¤»¤ó¡£"
            STOP
         END IF
      END IF
   NEXT i
END SUB

!Ps¤ÈPe¤ò·ë¤ÖÀþʬ¤ò±äŤ·¤¿Ä¾Àþ¾å¤ÎÅÀPc¤ÈÀþʬ¤È¤Î°ÌÃÖ´Ø·¸
!0¡åt¡å1¤Ê¤é¡¢Àþʬ¾å
FUNCTION InRange(Pc(), Ps(),Pe())
   DIM t1(2),t2(2)
   MAT t1=Pe-Ps
   MAT t2=Pc-Ps
   IF ABS(t1(1))>=cEps THEN !t1(1)<>0
      LET v=t2(1)/t1(1) !£ØÊý¸þ¤ÎÈæ
   ELSE !¿âľÀþ
      IF ABS(t1(2))>=cEps THEN !t1(2)<>0
         LET v=t2(2)/t1(2) !£ÙÊý¸þ¤ÎÈæ
      ELSE !£±ÅÀ
         LET v=0
      END IF
   END IF
   LET InRange=v
END FUNCTION


END


!¥Ù¥¯¥È¥ë
EXTERNAL FUNCTION Vec2Length(a()) !Ťµ |a|
LET Vec2Length=SQR(a(1)*a(1)+a(2)*a(2))
END FUNCTION

EXTERNAL SUB Vec2Normalize(a(),n()) !Àµµ¬²½ n=a/|a|
LET L=Vec2Length(a)
IF L>0 THEN MAT n=(1/L)*a
END SUB

!¤½¤Î¾
EXTERNAL SUB Vec2Set(x,y, v())
LET v(1)=x
LET v(2)=y
END SUB
 

´Ê°×¥²¡¼¥à¤Ç

 Åê¹Æ¼Ô¡§Night  Åê¹ÆÆü¡§2009ǯ12·î22Æü(²Ð)15»þ08ʬ25ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¤Ï¤¸¤á¤Þ¤·¤Æ

º£¡¢10¿ÊBasic¤Ç´Ê°×¥À¥ó¥¸¥ç¥óRPG¤òºî¤í¤¦¤È»×¤Ã¤Æ¤¤¤Þ¤¹
¤½¤³¤Ç¼ÁÌä¤Ê¤Î¤Ç¤¹¤¬
¡¦¥°¥é¥Õ¥£¥Ã¥¯¥¹¤ò½Å¤Í¤º¤É¤ó¤É¤óɽ¼¨¤¹¤ëÊýË¡
¡¦¥À¥ó¥¸¥ç¥ó¤ò°ÜÆ°¤¹¤ëºÝ¤Î¥­¡¼¤òÌð°õ¤Ë¤¹¤ëÊýË¡
¡¦Ê⤯¾ì½ê¤ò·è¤á¤é¤ì¤ë¤«¤É¤¦¤«
¤Î£³ÅÀ¤ò¤ª´ê¤¤¤·¤Þ¤¹

ËÜÅö¤ÏÂç¤Þ¤«¤Ê¥×¥í¥°¥é¥à¤ò¶µ¤¨¤Æ¤¤¤¿¤À¤­¤¿¤¤¤Î¤Ç¤¹¤¬
¼«Ê¬¤Ç¤ä¤é¤Ê¤±¤ì¤Ð°ÕÌ£¤Ï¤Ê¤¤¤Î¤Ç¡¢¤¬¤ó¤Ð¤ì¤ë¤À¤±¤ä¤Ã¤Æ¤ß¤è¤¦¤È»×¤¤¤Þ¤¹

¤è¤í¤·¤¯¤ª´ê¤¤¤·¤Þ¤¹
 

Re: ´Ê°×¥²¡¼¥à¤Ç

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ12·î22Æü(²Ð)19»þ17ʬ46ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.942[¸µµ­»ö¤Ø]

Night¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

½½¿ÊBASIC¤Ï¡¢¥ê¥¢¥ë¥¿¥¤¥à·Ï¥²¡¼¥à¤ÎºîÀ®¤Ë¤ÏÉÔ¸þ¤­¤Ç¤¹¡£
¡¦¥Ó¥Ã¥È¥Þ¥Ã¥×²èÁü¤ò¹â®¤Ë½èÍý¤Ç¤­¤Ê¤¤¡£¡ÊÀÚ¤ê½Ð¤·É½¼¨¤Ê¤É¡Ë
¡¦£³£Ä¤Ï¼«Á°¤Ç½èÍý¤¹¤ëɬÍפ¬¤¢¤ë¡£¤Þ¤¿¡¢Â¾¤Î¥é¥¤¥Ö¥é¥ê¤òÍøÍѤǤ­¤Ê¤¤¡£

°ÊÁ°ºîÀ®¤·¤¿¤â¤Î¤Ç¤¹¡£»²¹Í¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£
!¥Õ¥¡¥ß¥³¥ó»þÂå¤Î2D RPG¤òºî¤ë

!¥Þ¥Ã¥×¤Î¹½À®
!¡¡¡ÖÀµÌ̸«²¼¤í¤·¡×·Á¼°¤Î¥Á¥Ã¥×²èÁü¤òÍÑ°Õ¤·¤Æ¡¢¥¿¥¤¥ë¾õ¤ËÇÛÃÖ¤¹¤ë¡£
!¡¡¥Õ¥£¡¼¥ë¥É¡¢¥ª¥Ö¥¸¥§¥¯¥È¤Î£²Áؤǹ½À®¤µ¤ì¤ë¡£
!¡¡¥ª¥Ö¥¸¥§¥¯¥ÈÁؤ¬°ÜÆ°²ÄǽȽÄê¤ÎÂоݤȤ¹¤ë¡£
!¥Á¥Ã¥×²èÁü
!¡¡½½¿ÊBASIC¤Ï¥Ó¥Ã¥È¥Þ¥Ã¥×²èÁü¤ò°·¤¦¤Î¤¬¶ì¼ê¤Î¤¿¤á¡¢¥Ù¥¯¥È¥ë¿Þ·Á¡ÊPLOTʸ¡Ë¤ÇÉÁ²è¤¹¤ë¡£
!¡¡£Ø¡¢£Ù¤È¤â¡Ý£±¡Á£±¤ÎÈϰϤκÂɸ¤Çɽ¸½¤·¤Æ¡¢ÉÁ²èñ°Ì¤ÏPICTUREʸ¤Ç¤Þ¤È¤á¤ë¡£
!
!¥Þ¥Ã¥×¤ÎŸ³«
!¡¡½½¿ÊBASIC¤ÎÌäÂêºÂɸ¤Ë¥Þ¥Ã¥×Á´ÂΤòDRAWʸ¤ÇÉÁ²è¤¹¤ë¡£
!¡¡¥Õ¥£¡¼¥ë¥É¡¢¥ª¥Ö¥¸¥§¥¯¥È¤Î½ç¤ËÉÁ²è¤¹¤ë¡£
!¥Þ¥Ã¥×¤Îɽ¼¨¡Ê¥Ó¥å¡¼¡Ë
!¡¡SET WINDOWSʸ¤Ç¥Ó¥å¡¼¤ò¹½À®¤·¤Æ¡¢¥Þ¥Ã¥×¤Î°ìÉô¤ò²èÌ̤Ëɽ¼¨¤¹¤ë¡£
!¥Ó¥å¡¼¤Î¥¹¥¯¥í¡¼¥ë
!¡¡£Ð£Ã¡ÊPlayer Character¡Ë¤Î¡ÖÃæ±û¸ÇÄê¡×¤ÇÄɽ¾¤¹¤ë¡£
!¥­¥ã¥é¥¯¥¿¤Î°ÜÆ°
!¡¡¥Á¥Ã¥×ñ°Ì¡¢¾å²¼º¸±¦¤Î£´Êý¸þ¡£
!¡¡²¾ÁÛ¥²¡¼¥à¥Ñ¥Ã¥É¤«¤é¤ÎÆþÎϤò¥µ¥Ý¡¼¥È¤¹¤ë¡£
!¡¡¡¡°ÜÆ°¥­¡¼¡§¥«¡¼¥½¥ë¥­¡¼
!¡¡¡¡£Á¥Ü¥¿¥ó¡§SPACE¥­¡¼
!¡¡¡¡£Â¥Ü¥¿¥ó¡§


!¥Þ¥Ã¥×¤ÎÄêµÁ
DATA 15,12 !¥Þ¥Ã¥×¤ÎÂ礭¤µ
READ msx,msy !¥Þ¥Ã¥×¾ðÊó¤òÆɤ߹þ¤à

DATA 1,1,1,2,2, 2,1,1,1,1, 2,2,2,1,1 !¥Á¥Ã¥×ÇÛÃÖ¾ðÊó¡Ê¥Õ¥£¡¼¥ë¥É¡Ë
DATA 1,1,1,2,2, 2,1,1,1,1, 2,2,2,1,1
DATA 1,1,1,2,2, 2,1,1,1,1, 1,1,1,1,1
DATA 1,1,1,1,2, 1,1,1,1,1, 1,1,1,1,1
DATA 1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1
DATA 1,2,2,1,1, 1,1,1,1,1, 1,1,1,1,1
DATA 1,2,2,1,1, 1,2,2,2,1, 1,1,1,1,1
DATA 2,2,1,1,1, 1,2,2,2,1, 3,3,1,1,1
DATA 2,2,1,1,1, 1,2,2,2,1, 3,2,2,1,1
DATA 2,2,2,2,1, 1,1,1,1,1, 3,2,2,1,1
DATA 2,2,2,2,1, 1,1,1,1,1, 3,3,2,1,1
DATA 1,1,1,1,1, 1,1,1,1,1, 3,3,3,1,1
DIM mapFld(msy,msx)
MAT READ mapFld

DATA 0, 0, 0, 0,12,  0, 0, 0, 0,11,   0,12,12, 0, 0 !¥Á¥Ã¥×ÇÛÃÖ¾ðÊó¡Ê¥ª¥Ö¥¸¥§¥¯¥È¡Ë
DATA 0, 0, 0, 0,12,  0, 0, 0, 0,11,   0, 0,12, 0, 0
DATA 0, 0, 0, 0,12,  0, 0, 0, 0,11,  11, 0, 0, 0, 0
DATA 0, 0, 0, 0, 0,  0, 0, 0,11,11,   0, 0, 0, 0, 0
DATA 0, 0 ,0, 0, 0,  0, 0, 0, 0, 0,   0, 0, 0, 0, 0
DATA 0, 0, 0, 0, 0,  0, 0, 0, 0, 0,   0, 0, 0, 0, 0
DATA 0,12,12, 0, 0,  0, 0, 0,12, 0,   0, 0, 0, 0, 0
DATA 0, 0,11,11, 0,  0, 0,21,12, 0,  13,13, 0, 0, 0
DATA 0,12,11,11, 0,  0, 0, 0,12, 0,  13,12, 0, 0, 0
DATA 0,12,12,12, 0,  0, 0, 0, 0, 0,  13,12,12, 0, 0
DATA 0, 0, 0, 0, 0,  0, 0, 0, 0, 0,  13, 0, 0, 0, 0
DATA 0, 0, 0, 0, 0,  0, 0, 0, 0, 0,   0, 0, 0, 0, 0
DIM mapObj(msy,msx)
MAT READ mapObj


!¥²¡¼¥à²èÌ̤ÎÄêµÁ
LET GAME_TITLE=1 !¥¿¥¤¥È¥ë
LET GAME_MOVE=2 !°ÜÆ°
LET GAME_TALK=3 !²ñÏÃ
LET GAME_BATTLE=4 !ÀïÆ®

LET gs=GAME_TITLE !¥¿¥¤¥È¥ë²èÌ̤«¤é


!¥Ó¥å¡¼¥Ý¡¼¥È¤ÎÄêµÁ
LET vsx=15 !¥Ó¥å¡¼¥Ý¡¼¥È¤ÎÂ礭¤µ¡Ê1/2¥Á¥Ã¥×ñ°Ì¡Ë
LET vsy=15
LET vx=0 !°ÌÃ֡ʺ¸²¼¡£¢¨ÌäÂêºÂɸ¡Ë
LET vy=0


!°ÜÆ°Êý¸þ¤ÎÄêµÁ
LET MOVE_NONE=-1 !¤Ê¤·
LET MOVE_RIGHT=0 !±¦
LET MOVE_UP=2 !¾å
LET MOVE_LEFT=4 !º¸
LET MOVE_DOWN=6 !²¼


!²ñÏÃʸ¤ÎÄêµÁ
DATA "¤Ï¤¸¤á¤ë¡§£Á¥Ü¥¿¥ó¡ÊSPACE¥­¡¼¡Ë" !#1¡¡¢¨£´¹Ôñ°Ì
DATA "¤ª¤ï¤ë¡§ESC¥­¡¼"
DATA ""
DATA "°ÜÆ°¡§½½»ú(¥«¡¼¥½¥ë¥­¡¼)¡¢£Ï£Ë¡§£Á¥Ü¥¿¥ó"
DATA "" !#2
DATA ""
DATA ""
DATA ""
DATA "¥³¡¼¥Ò¡¼¥¿¥¤¥à¢ö" !#3
DATA ""
DATA "¡ÖµÙ·Æ¤ò¤È¤Ã¤¿¤é½Ðȯ¤À¡ª¡×"
DATA ""
DATA "¡Ö»ÄÇ°¡¢¤Ü¤¯¤Ï±Ë¤²¤Ê¤¤¤ó¤À¡£¡×" !#4
DATA "¡ÖÈô¤Ó±Û¤¨¤é¤ì¤Ê¤¤¤¾¡¥¡¥¡¥¡×"
DATA ""
DATA ""
DATA "" !#5
DATA ""
DATA ""
DATA ""
DIM ms$(4*5)
MAT READ ms$

DATA 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0 !¥¤¥Ù¥ó¥ÈÇÛÃÖ¾ðÊó
DATA 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0
DATA 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0
DATA 0,0,0,0,0, 0,0,0,0,0, 4,0,0,0,0
DATA 0,0,0,0,0, 0,0,0,4,4, 0,0,0,0,0
DATA 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0
DATA 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0
DATA 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0
DATA 0,0,0,0,0, 0,0,3,0,0, 0,0,0,0,0
DATA 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0
DATA 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0
DATA 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0
DIM mapEvt(msy,msx)
MAT READ mapEvt
LET evt=0

!¥²¡¼¥à¤Î½é´ü²½
LET x=6 !¥­¥ã¥é¥¯¥¿¤Î°ÌÃÖ¡Ê¥Á¥Ã¥×ñ°Ì¡Ë
LET y=5
LET d=MOVE_DOWN !¸þ¤­

CALL SetViewPort !¥Ó¥å¡¼¥Ý¡¼¥È°ÜÆ°


LET t0=TIME
LET fRun=-1 !¥²¡¼¥à³«»Ï
DO WHILE fRun<0 !¥²¡¼¥à¥ë¡¼¥×

   IF gs=GAME_TITLE THEN !¥¿¥¤¥È¥ë²èÌ̤ʤé
      SET DRAW mode hidden !¤Á¤é¤Ä¤­ËÉ»ß(³«»Ï)
      CLEAR
      DRAW Hiro(6,d) WITH SHIFT(vx+8,vy+8) !¥­¥ã¥é¥¯¥¿
      PLOT TEXT ,AT vx+6,vy+11: "¥Á¥ç¥³¥Ü¤ÎËÁ¸±"
      CALL DrawSpeak(0,0)
      SET DRAW mode explicit !¤Á¤é¤Ä¤­ËÉ»ß(½ªÎ»)

      CALL GetAButton(t0) !£Á¥Ü¥¿¥ó¤ÎÆþÎÏ
   END IF
   IF gs=GAME_MOVE THEN !°ÜÆ°²èÌ̤ʤé
      CALL GetMoveKey(dx,dy,dr,t0) !°ÜÆ°¥­¡¼¤ÎÆþÎÏ

      IF dx<>0 OR dy<>0 THEN !°ÜÆ°¤Ê¤é
         LET d=dr !°ÜÆ°Êý¸þ¤Ë¸þ¤¯

         LET xx=x+dx !²¾¤Ë°ÜÆ°¤¹¤ë¡Ê¥Á¥Ã¥×ñ°Ì¡Ë
         LET yy=y+dy
         IF xx>0 AND xx<=msx AND yy>0 AND yy<=msy THEN !¥Þ¥Ã¥×Æâ¤Ç
            IF mapObj(yy,xx)=0 THEN !¾ã³²Êª¤¬¤Ê¤±¤ì¤Ð
               LET x=xx !¼ÂºÝ¤Ë°ÜÆ°¤µ¤»¤ë
               LET y=yy
            END IF
         END IF

         CALL SetViewPort !¥Ó¥å¡¼¥Ý¡¼¥È°ÜÆ°

         LET evt=CheckEvent(mapEvt,x,y) !¥Õ¥£¡¼¥ë¥É¾å¤Î¥¤¥Ù¥ó¥È¤ò³Îǧ
      END IF

      CALL DrawView !¥Ó¥å¡¼É½¼¨
   END IF
   IF gs=GAME_TALK THEN !²ñÏòèÌ̤ʤé
      CALL DrawView !¥Ó¥å¡¼É½¼¨

      CALL GetAButton(t0) !£Á¥Ü¥¿¥ó¤ÎÆþÎÏ
   END IF


   IF GetKeyState(27)<0 THEN LET fRun=0 !ESC¥­¡¼¤Ç½ªÎ»
LOOP

SUB GetMoveKey(dx,dy,dr,t0) !°ÜÆ°¥­¡¼¤ÎÆþÎϤò³Îǧ¤¹¤ë
   LET dx=0 !°ÜÆ°ÎÌ
   LET dy=0
   LET dr=MOVE_NONE !°ÜÆ°Êý¸þ
   IF TIME-t0>0.2 THEN !200¥ß¥êÉ䴤ȤË
      IF GetKeyState(37)<0 THEN !¤¤¤º¤ì¤«£±¤Ä¤Î¤ß
         LET dx=-1
         LET dr=MOVE_LEFT !º¸¥«¡¼¥½¥ë¥­¡¼
      ELSE
         IF GetKeyState(38)<0 THEN
            LET dy=-1
            LET dr=MOVE_UP !¾å
         ELSE
            IF GetKeyState(39)<0 THEN
               LET dx=1
               LET dr=MOVE_RIGHT !±¦
            ELSE
               IF GetKeyState(40)<0 THEN
                  LET dy=1
                  LET dr=MOVE_DOWN !²¼
               END IF
            END IF
         END IF
      END IF

      LET t0=TIME !¼¡¤Ø
   END IF
END SUB

SUB GetAButton(t0) !£Á¥Ü¥¿¥ó¤ÎÆþÎϤò³Îǧ¤¹¤ë
   IF TIME-t0>0.2 THEN !200¥ß¥êÉ䴤ȤË
      IF GetKeyState(32)<0 THEN LET gs=GAME_MOVE !SPACE¥­¡¼
      LET t0=TIME !¼¡¤Ø
   END IF
END SUB

SUB SetViewPort !¥Ó¥å¡¼¥Ý¡¼¥È¤ÎÀßÄꤹ¤ë
   LET vx=2*x-vsx/2-1 !¡Ö¥­¥ã¥é¥¯¥¿¤ÎÃæ±û¸ÇÄê¡×¤Ç¥Ó¥å¡¼¥Ý¡¼¥È¤òÄɽ¾¤µ¤»¤ë
   LET vy=2*(msy-y)-vsy/2+1
   SET WINDOW vx,vx+vsx,vy,vy+vsy
END SUB

SUB DrawView !¥Þ¥Ã¥×¡¢¥­¥ã¥é¥¯¥¿¤òɽ¼¨¤¹¤ë
   SET DRAW mode hidden !¤Á¤é¤Ä¤­ËÉ»ß(³«»Ï)
   CLEAR

   CALL DrawLayer(mapFld,msx,msy) !¥Õ¥£¡¼¥ë¥É
   CALL DrawLayer(mapObj,msx,msy) !¥ª¥Ö¥¸¥§¥¯¥È
   DRAW Hiro(6,d) WITH SHIFT(2*x-1,2*(msy-y)+1) !¥­¥ã¥é¥¯¥¿
   IF gs=GAME_TALK THEN CALL DrawSpeak(evt,0) !²ñÏÃʸ

   SET DRAW mode explicit !¤Á¤é¤Ä¤­ËÉ»ß(½ªÎ»)
END SUB

SUB DrawSpeak(n,v) !²ñÏÃʸ¤òɽ¼¨¤¹¤ë
   SET AREA COLOR 199 !¤Õ¤­¤À¤·
   PLOT AREA: vx+1,vy+1; vx+vsx-1,vy+1; vx+vsx-1,vy+5; vx+1,vy+5
   SET LINE COLOR 1
   SET LINE width 3
   PLOT LINES: vx+1,vy+1; vx+vsx-1,vy+1; vx+vsx-1,vy+5; vx+1,vy+5; vx+1,vy+1

   SET TEXT HEIGHT 0.4
   FOR i=1 TO 4 !£´¹Ôñ°Ì
      PLOT TEXT ,AT vx+2,vy+4.75-i*0.75: ms$(n+i)
   NEXT i
END SUB

FUNCTION CheckEvent(e(,),x,y) !¥Õ¥£¡¼¥ë¥É¾å¤Î¥¤¥Ù¥ó¥È¤ò³Îǧ¤¹¤ë
   LET a=e(y,x)
   IF a>0 THEN LET gs=GAME_TALK !²ñÏòèÌ̤Ø
   LET CheckEvent=4*(a-1)
END FUNCTION

END

³¤¯
 

Re: ´Ê°×¥²¡¼¥à¤Ç

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ12·î22Æü(²Ð)19»þ18ʬ57ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.943[¸µµ­»ö¤Ø]

³¤­
EXTERNAL SUB DrawLayer(m(,),sx,sy) !¥ì¥¤¥ä¤òɽ¼¨¤¹¤ë
FOR j=1 TO sy !±ü¤«¤é½ç¤Ë¡ÊÀµÌ̸«²¼¤í¤·¡Ë
   LET y=2*(sy-j)+1 !º¸¾å¤ò¸¶ÅÀ¡¢±¦Êý¸þ¤¬£Ø¼´¤ÎÀµ¡¢²¼Êý¸þ¤¬£Ù¼´¤ÎÀµ
   FOR i=1 TO sx
      LET x=2*i-1
      DRAW PutChip(m(j,i)) WITH SHIFT(x,y) !¥Á¥Ã¥×¾ðÊó¤ò¤â¤È¤ËÇÛÃÖ¤¹¤ë
   NEXT i
NEXT j
END SUB


EXTERNAL PICTURE PutChip(i) !ÈÖ¹æ¤ËÂбþ¤·¤¿¥Á¥Ã¥×²èÁü¤òÉÁ¤¯
IF i=1 THEN DRAW Ground
IF i=2 THEN DRAW Grass
IF i=3 THEN DRAW Rock
IF i=11 THEN DRAW Pool
IF i=12 THEN DRAW Tree
IF i=13 THEN DRAW Mount
IF i=21 THEN DRAW House
END PICTURE


!¢¨ºîÀ®´ð½à - £Ø¡¢£ÙºÂɸ¤È¤âÈϰϤÏ-1¡Á1¤È¤¹¤ë¡£¾¯¤·¤Ï¤ß½Ð¤Æ¤â¤è¤¤¡£

!¥­¥ã¥é¥¯¥¿
EXTERNAL PICTURE Hiro(c,d) !¥Á¥ç¥³¥Ü
SET AREA COLOR 8
DRAW disk WITH SCALE(0.8,0.2)*SHIFT(0,-0.9) !±Æ
SET LINE width 2
SET LINE COLOR 1
PLOT LINES: -0.2,-0.3; -0.3,-0.9; -0.1,-0.9 !­
SET AREA COLOR c
DRAW disk WITH SCALE(0.6) !ÂÎ
PLOT LINES: 0.3,-0.3; 0.4,-0.9; 0.6,-0.8 !­
DRAW disk WITH SCALE(0.45)*SHIFT(0.4,0.4) !Ƭ
SET AREA COLOR 2
PLOT AREA: 0.7,0.5; 1,0.7; 0.7,0.7 !¤¯¤Á¤Ð¤·
SET AREA COLOR 1
DRAW disk WITH SCALE(0.08)*SHIFT(0.5,0.7) !ÌÜ
END PICTURE

!¥Õ¥£¡¼¥ë¥É
EXTERNAL PICTURE Ground !Ê¿ÃÏ
SET AREA COLOR 27
PLOT AREA: -1,-1; 1,-1; 1,1; -1,1
END PICTURE

EXTERNAL PICTURE Grass !ÁðÃÏ
SET AREA COLOR 3
PLOT AREA: -1,-1; 1,-1; 1,1; -1,1
END PICTURE

EXTERNAL PICTURE Rock !´äÃÏ
SET AREA COLOR 50
PLOT AREA: -1,-1; 1,-1; 1,1; -1,1
END PICTURE

!¥ª¥Ö¥¸¥§¥¯¥È
EXTERNAL PICTURE Tree !ÌÚ
SET AREA COLOR 10
DRAW disk WITH SCALE(0.5)*SHIFT(0,0.5) !ÍÕ
DRAW disk WITH SCALE(0.5)*SHIFT(-0.4,0) !ÍÕ
DRAW disk WITH SCALE(0.4)*SHIFT(0.5,-0.2) !ÍÕ
SET AREA COLOR 12
PLOT AREA: -0.2,-1; 0.2,-1; 0,0 !´´
END PICTURE

EXTERNAL PICTURE Pool !ÃÓ
SET AREA COLOR 5
PLOT AREA: -1,-1; 1,-1; 1,1; -1,1
END PICTURE

EXTERNAL PICTURE Mount !»³
SET AREA COLOR 240
PLOT AREA: -0.6,-1; 1,-1; 0.2,1
PLOT AREA: -1,-1; 0,-1; -0.5,0
END PICTURE

EXTERNAL PICTURE House !²È
SET AREA COLOR 15
PLOT AREA: -1,0; -1,-1; 1,-1; 1,0 !ÊÉ
SET AREA COLOR 2
PLOT AREA: -1.6,0; 1.6,0; 1,1; -1,1 !²°º¬
SET AREA COLOR 10
PLOT AREA: -0.9,-1; -0.9,-0.2; -0.5,-0.2; -0.5,-1 !¥É¥¢
SET AREA COLOR 5
PLOT AREA: 0.4,-0.6; 0.9,-0.6; 0.9,-0.2; 0.4,-0.2 !Áë
SET AREA COLOR 12
PLOT AREA: 0.7,1; 0.7,1.3; 0.5,1.3; 0.5,1 !±ìÆÍ
END PICTURE
 

¥Ð¥¯¤¬¡¢¤¢¤ê¤Þ¤·¤¿¡£

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2009ǯ12·î24Æü(ÌÚ)04»þ05ʬ10ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.940[¸µµ­»ö¤Ø]


N |mod(N,3)+1|mod(N+1,3)|    £±¤ÄÀè¤Î³Ñ¤òµá¤á¤ë¤È¤­¡¢º¸¤Îɽ¤Î¤è¤¦¤Ë¡¢mod(N,3)+1 ¤È
1 |    2     |    2     |    ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤½ê¡¢mod(N+1,3) ¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤·¤¿¡£
2 |    3     |    0     |    ºî¿Þ¤ÎÅÔ¹ç¾å¡¢x(0)y(0)¤Ë¤â¡¢x(3)y(3) ¤ÈƱ¤¸ÆâÍƤò¡¢
3 |    1     |    1     |    Æþ¤ì¤Æ¤¤¤¿¤¿¤á¡¢³°¸«¤Ë¤Ï¡¢½Ð¤Þ¤»¤ó¤Ç¤·¤¿¤¬¡¢Âç¥Ð¥¯¤Ç¤¹¡£

                               ËÁƬ¤Îºî¿ÞÉôʬ¤Ç¡¢0 to ma ¤ò¡¢£± to ma ¤Ë¤¹¤ë¤È¡¢¿Þ¤¬
ÊѤë¤À¤±¤Ç¤Ê¤¯¡¢´Ø·¸Ìµ¤¤Æ°ºî¾õÂ֤ޤǡ¢¤ª¤«¤·¤¯¤Ê¤Ã¤Æ¤¤¤¿¤Î¤Ï¡¢¤³¤Î¤¿¤á¤Ç¤¹¡£¸½ºß¤Ï¡¢
¤½¤Î¾¤â¡¢½¤Àµ¤·¤Þ¤·¤¿¡£

 

¥Ù¥¯¥È¥ë¤Ë¤è¤ëÊ¿ÌÌ´ö²¿¤Î·×»»

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ12·î24Æü(ÌÚ)10»þ49ʬ37ÉÃ
ÊÖ¿®¡¦°úÍÑ
 
!¥Ù¥¯¥È¥ë¤Ë¤è¤ëÊ¿ÌÌ´ö²¿¤Î·×»» - ÅÀ¡¢Ä¾Àþ¡ÊÀþʬ¡Ë

LET cEps=1e-13 !ÀºÅÙ

!¥Ù¥¯¥È¥ë(a1,a2)¤È¥Ù¥¯¥È¥ë(b1,b2)¤È¤Î±é»»
DEF fnDot(a1,a2, b1,b2)=a1*b1+a2*b2 !ÆâÀÑ
DEF fnCross(a1,a2, b1,b2)=fnDot(-a2,a1,b1,b2) !µ¼»÷³°ÀÑ¡¢¥Ñ¡¼¥×ÆâÀÑ¡¡a1*b2-a2*b1
DEF fnABS(a,b)=SQR(a*a+b*b) !ÀäÂÐÃÍ¡¢Â礭¤µ

DIM a(2),b(2),c(2),d(2) !ÅÀ£Á¡¢£Â¡¢£Ã¡¢£Ä

DATA  4, 4 !A
DATA -1, 1 !B
DATA -3, 2 !C
DATA  3,-4 !D

MAT READ A
MAT READ B
MAT READ C
MAT READ D

SET WINDOW -5,5,-5,5 !¥°¥é¥Õ¤òÉÁ¤¯
DRAW grid
SET TEXT HEIGHT 0.4
PLOT LINES: A(1),A(2); B(1),B(2) !Àþʬ£Á£Â
PLOT TEXT ,AT A(1),A(2): "£Á"
PLOT TEXT ,AT B(1),B(2): "£Â"
PLOT LINES: C(1),C(2); D(1),D(2) !Àþʬ£Ã£Ä
PLOT TEXT ,AT C(1),C(2): "£Ã"
PLOT TEXT ,AT D(1),D(2): "£Ä"


DIM s(2),t(2),u(2),v(2) !ºî¶ÈÍÑ

!ÅÀ£Á¤ÈÅÀ£Â¤òÄ̤ëľÀþ¤ÈÅÀ£Ã¤ÈÅÀ£Ä¤òÄ̤ëľÀþ¤È¤Îľ¸ò¡¦Ê¿¹ÔȽÄê
!ÆâÀѤ¬£°¤Ê¤é¡¢Ä¾¸ò¡£¡¡³°ÀѤ¬£°¤Ê¤é¡¢Ê¿¹Ô¡£

MAT s=b-a
MAT t=d-c
IF fnDot(s(1),s(2),t(1),t(2))=0 THEN PRINT "ľ¸ò"
IF fnCross(s(1),s(2),t(1),t(2))=0 THEN PRINT "Ê¿¹Ô"


!ÅÀ£Á¤ÈÅÀ£Â¤òÄ̤ëľÀþ¤ÈÅÀ£Ã¤ÈÅÀ£Ä¤òÄ̤ëľÀþ¤È¤Î¸òÅÀ

MAT s=b-a
MAT t=d-c
LET DD=fnCross(t(1),t(2),s(1),s(2))
IF DD<>0 THEN
   MAT u=c-a
   MAT v=( fnCross(t(1),t(2),u(1),u(2))/DD ) * s
   MAT v=a+v
   MAT PRINT v; !¸òÅÀ
ELSE
   PRINT "Ê¿¹Ô¤Ç¤¹¡£"
END IF


!ÅÀ£Á¤ÈÅÀ£Â¤ò·ë¤ÖÀþʬ¤ÈÅÀ£Ã¤ÈÅÀ£Ä¤ò·ë¤ÖÀþʬ¤È¤Î¸òÅÀ

MAT s=b-a
MAT t=c-a
LET d1=fnCross(s(1),s(2),t(1),t(2))
!MAT s=b-a
MAT t=d-a
LET d2=fnCross(s(1),s(2),t(1),t(2))
MAT s=d-c
MAT t=a-c
LET d3=fnCross(s(1),s(2),t(1),t(2))
!MAT s=d-c
MAT t=b-c
LET d4=fnCross(s(1),s(2),t(1),t(2))
IF d1*d2<=0 AND d3*d4<=0 THEN
   MAT u=b-a
   MAT u=( ABS(d3)/(ABS(d3)+ABS(d4)) ) * u
   MAT u=a+u
   MAT PRINT u; !¸òÅÀ
ELSE
   PRINT "¸òº¹¤Ê¤·"
END IF


!ÅÀ£Ã¤È¡¢ÅÀ£Á¤ÈÅÀ£Â¤òÄ̤ëľÀþ¤È¤Î°ÌÃÖ´Ø·¸

MAT s=b-a
MAT t=c-a
LET DD=fnCross(s(1),s(2),t(1),t(2))
IF DD=0 THEN
   PRINT "Àþ¾å"
ELSEIF DD>0 THEN
   PRINT "º¸Â¦"
ELSE
   PRINT "±¦Â¦"
END IF


!ÅÀ£Ã¤¬¡¢ÅÀ£Á¤ÈÅÀ£Â¤ò·ë¤ÖÀþʬ¾å¤Ë¤¢¤ë¤«¤É¤¦¤«¤ÎȽÄê
!»°³ÑÉÔÅù¼° |a-b|¡å|a-c|+|c-b|

MAT s=a-c
MAT t=c-b
MAT u=a-b
IF fnABS(s(1),s(2))+fnAbs(t(1),t(2))<fnABS(u(1),u(2))+cEps THEN PRINT "Àþ¾å"


!ÅÀ£Ã¤È¡¢ÅÀ£Á¤ÈÅÀ£Â¤òÄ̤ëľÀþ¤È¤Îµ÷Î¥

MAT s=b-a
MAT t=c-a
PRINT ABS(fnCross(s(1),s(2),t(1),t(2))) / fnABS(s(1),s(2))


!ÅÀ£Ã¤È¡¢ÅÀ£Á¤ÈÅÀ£Â¤ò·ë¤ÖÀþʬ¤È¤Îµ÷Î¥¡ÊºÇ¶áÀÜÅÀ¡Ë

MAT s=b-a
MAT t=c-a
MAT u=c-b
IF fnDot(s(1),s(2),t(1),t(2))<cEps THEN !ÅÀ£Á³°Â¦
   PRINT fnABS(t(1),t(2)) !ÅÀ£Á¤È¤Îµ÷Î¥
ELSEIF fnDot(-s(1),-s(2),u(1),u(2))<cEps THEN !ÅÀ£Â³°Â¦
   PRINT fnABS(u(1),u(2)) !ÅÀ£Â¤È¤Îµ÷Î¥
ELSE !Àþʬ£Á£ÂÆâ
   PRINT ABS(fnCross(s(1),s(2),u(1),u(2))) / fnABS(s(1),s(2)) !¿âÀþ
END IF


END

!Åê¹Æ¡Êµ­½ÒÎã¡Ë¡¢¿ô³Ø¡¢¥Ù¥¯¥È¥ë¤È¿Þ·ÁÊýÄø¼°¡¢¥¢¥ë¥´¥ê¥º¥à¡¢¥²¡¼¥à¡¢Åö¤¿¤êȽÄê
 

Re: ¥»¥ó¥¿¡¼»î¸³ÄøÅÙ¤Î¥×¥í¥°¥é¥à±é½¬

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ12·î24Æü(ÌÚ)12»þ54ʬ51ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.770[¸µµ­»ö¤Ø]

½½¿ÊBASIC¤Ç¥Ù¥¯¥È¥ëÀ®Ê¬¤Î·×»»¤ò¹Ô¤¦¾ì¹ç¡¢
MATʸ¡Ê¹ÔÎó¡Ë¤ÎϺ¹¡¢¼Â¿ôÇܤη׻»¤òÂбþ¤µ¤»¤ë¤Î¤¬°ìÈÌŪ¤À¤í¤¦¡£

¼¡¤Î¤è¤¦¤ÊÌäÂê¤Ç¡¢ÅÅÂîÂå¤ï¤ê¤Ë³èÍѤ¹¤ë¤Ê¤é¡¢¡¢¡¢
!Ê£ÁÇ¿ô¤Ë¤è¤ëÊ¿Ì̾å¤Î¥Ù¥¯¥È¥ë¤Î·×»»

OPTION ARITHMETIC COMPLEX

DEF v(a,b)=COMPLEX(a,b) !Ê£ÁÇ¿ô¤ÎϺ¹¡¢¼Â¿ôÇܤη׻»¤òÂбþ¤µ¤»¤ë

DEF fnDOT(a,b)=Re(a)*Re(b)+Im(a)*Im(b) !ÆâÀÑ¡¡a1*b1+a2*b2
DEF fnCROSS(a,b)=Re(a)*Im(b)-Im(a)*Re(b) !µ¼»÷³°ÀÑ¡¡a1*b2-a2*b1
!DEF fnDOT(a,b)=Re(a*conj(b)) !ÆâÀÑ¡¡a1*b1+a2*b2
!DEF fnCROSS(a,b)=Im(conj(a)*b) !µ¼»÷³°ÀÑ¡¡a1*b2-a2*b1
!DEF fnDOT(a,b)=( a*conj(b) + conj(a)*b ) / 2 !ÆâÀÑ¡¡a1*b1+a2*b2

DEF fnANGLE(a,b)=ANGLE(Re(b/a),Im(b/a)) !¤Ê¤¹³Ñ

DEF fnROTATE(a,th)=v(COS(th),SIN(th))*a !²óž
!¡¡Ê£ÁÇ¿ô cos¦¨+i*sin¦¨ ¤ò¹ÔÎóɽ¸½¤¹¤ë¤È
!¡¡¨£ cos¦¨ -sin¦¨ ¨¤
!¡¡¨¦ sin¦¨  cos¦¨ ¨¥


!ÌäÂê¡¡À®Ê¬¤Î·×»»¡¡(-3,4)-(2,-1)=

PRINT v(-3,4)-v(2,-1)


!ÌäÂê¡¡À®Ê¬¤Î·×»»¡¡-2(1,-2)=

PRINT (-2)*v(1,-2)


!ÌäÂê¡¡À®Ê¬¤Î·×»»¡¡a=(1,1)¡¢b=(1,-1)¤Î¤È¤­¡¢3(2a-b)-2(3a+b)¡¡¢¨a,b¤Î¾å¤Ë¢ª¤¬ÉÕ¤¯

LET a=v(1,1)
LET b=v(1,-1)
PRINT 3*(2*a-b)-2*(3*a+b)


!ÌäÂê¡¡a=(¢å3,1)¡¢b=(0,2)¤Î¤È¤­¡¢a¡¢b¤Î¤Ê¤¹³Ñ¡¡¢¨a,b¤Î¾å¤Ë¢ª¤¬ÉÕ¤¯

LET a=v(SQR(3),1)
LET b=v(0,2)
PRINT DEG(ACOS( fnDOT(a,b)/(ABS(a)*ABS(b)) )); "¡ë" !a¡¦b=|a||b|cos¦¨¤è¤ê
PRINT DEG(ATN(fnCROSS(a,b)/fnDOT(a,b))); "¡ë"
PRINT DEG(fnANGLE(a,b)); "¡ë"


!ÌäÂê¡¡|a|=2¡¢|b|=3¡¢|a+b|=3¤Î¤È¤­¡¢a¡¦b¡¡¢¨a,b¤Î¾å¤Ë¢ª¤¬ÉÕ¤¯

LET absA=2
LET absB=3
LET absAB=3
PRINT (absAB^2-(absA^2+absB^2))/2 !|a+b|^2=|a|^2+2*a¡¦b+|b|^2¤è¤ê


!ÌäÂê¡¡ÅÀ(0,1)¤òÈ¿»þ·×¤Þ¤ï¤ê¤Ë90¡ë²óž¤¹¤ë

LET a=v(0,1)
PRINT fnROTATE(a,RAD(90))


!ÌäÂê¡¡»ÙÅÀ¤¬¤éº¸1m¤Ë15kg¡¢±¦3m¤Ë10kg¤¬ºÜ¤Ã¤¿¥·¡¼¥½¡¼¤Ï¤É¤Á¤é¤Ë·¹¤¯¤«¡Ê¥â¡¼¥á¥ó¥È¡Ë

LET a=v(-1,0)
LET Fa=v(0,15*9.8)
LET b=v(3,0)
LET Fb=v(0,10*9.8)
PRINT fnCROSS(a,Fa)+fnCROSS(b,Fb) !Àµ¤Ê¤é±¦


END

!Åê¹Æ¡Êµ­½ÒÎã¡Ë¡¢¿ô³Ø¡¢¥Ù¥¯¥È¥ë¡¢Ê£ÁÇ¿ô
 

POKE

 Åê¹Æ¼Ô¡§¤á¤í¤ó  Åê¹ÆÆü¡§2009ǯ12·î24Æü(ÌÚ)19»þ44ʬ56ÉÃ
ÊÖ¿®¡¦°úÍÑ
  POKE¤¬¤Ä¤«¤¤¤¿¤¤¤Î¤Ç¤¹¤¬»È¤¨¤Ê¤¤¾ì¹ç¤Ï²¿¤ò¤Ä¤«¤¨¤Ð¤¤¤¤¤ó¤Ç¤¹¤«¡©  

Re: POKE

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ12·î24Æü(ÌÚ)19»þ54ʬ40ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.948[¸µµ­»ö¤Ø]

¤á¤í¤ó¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> POKE¤¬¤Ä¤«¤¤¤¿¤¤¤Î¤Ç¤¹¤¬»È¤¨¤Ê¤¤¾ì¹ç¤Ï²¿¤ò¤Ä¤«¤¨¤Ð¤¤¤¤¤ó¤Ç¤¹¤«¡©

N88,MSX·Ï¤ÎPEEK/POKEÌ¿Îá¤Ï¤¢¤ê¤Þ¤»¤ó¡£ÂåÂØÌ¿Îá¤â¤¢¤ê¤Þ¤»¤ó¡£
 

Re: POKE

 Åê¹Æ¼Ô¡§Å¯  Åê¹ÆÆü¡§2009ǯ12·î25Æü(¶â)10»þ21ʬ28ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.948[¸µµ­»ö¤Ø]

¤á¤í¤ó¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> POKE¤¬¤Ä¤«¤¤¤¿¤¤¤Î¤Ç¤¹¤¬»È¤¨¤Ê¤¤¾ì¹ç¤Ï²¿¤ò¤Ä¤«¤¨¤Ð¤¤¤¤¤ó¤Ç¤¹¤«¡©
Windows¤Ç¤ÏPOKE¤Î¤è¤¦¤ÊľÀÜ¥á¥â¥ê¡¼¤Ë½ñ¤­¹þ¤à¤è¤¦¤ÊÌ¿Îá¤ò»ÈÍѤ¹¤ë¤È´Ö°ã¤Ã¤Æ¥·¥¹¥Æ¥à¤ò²õ¤·Ë½Áö¤¹¤ë¶²¤ì¤¬¤¢¤ë¤Î¤Ç¤³¤Î¤è¤¦¤ÊÌ¿Îá¤Ï¤¢¤ê¤Þ¤»¤ó¡£

¤É¤¦¤·¤Æ¤âPOKE¤ò»È¤Ã¤¿¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤¿¤¤¾ì¹ç¤Ï£¹£¹BASIC¤ò»È¤Ã¤Æ¤¯¤À¤µ¤¤¡£
£¹£¹BASIC¤Ç¤Ï¥á¥â¥ê¡¼¤ò³ÎÊݤ·¤Æ¤½¤ÎÎΰ衢²¾ÁÛÎΰèÆâ¤ÇPOKEÌ¿Îá¤ò¼Â¹Ô¤·¤Þ¤¹¤Î¤Ç¥·¥¹¥Æ¥à¤ò²õ¤¹¤³¤È¤Ï̵¤¯°ÂÁ´¤Ç¤¹¡£
 

Re:Re:POKE

 Åê¹Æ¼Ô¡§¤á¤í¤ó  Åê¹ÆÆü¡§2009ǯ12·î25Æü(¶â)13»þ14ʬ53ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ÊÖ¿®¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡ª¤ï¤«¤ê¤Þ¤·¤¿¡£  

£³Ãʹ½¤¨¤ÎËâÊý¿Ø¤Ï²Äǽ¤«¡©

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ12·î28Æü(·î)20»þ19ʬ13ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¡¡ 5  22  18
¡¡28  15   2
¡¡12   8  25

¤Ï¤â¤Á¤í¤ó³Æ¹Ô¡¢³ÆÎó¡¢ÂгÑÀþ¤¬Ï£´£µ¤ÎËâÊý¿Ø¤Ç¤¢¤ë¤¬

¤³¤Î¿ô»ú¤Î¸ì¤ò±Ñ¸ì¤Ë¤·¤Æ

   five      twenty-two   eighteen
twenty-eight  fifteen       two
  twelve       eight     twenty-five

¤ÈÄÖ¤ì¤Ð¤½¤Îʸ»ú¿ô¤¬
¡¡ 4   9   8
¡¡11   7   3
¡¡ 6   5  10

¤È¤Ê¤ê¡¢¤³¤ì¤¬¤Þ¤¿ÏÂ21¤ÎËâÊý¿Ø¤ò¹½À®¤·¤Æ¤¤¤ë¡£

¤½¤³¤Ç¤â¤¦°ì¤Ä¡¢¹¹¤Ë¤³¤ì¤òÄ֤äÆÂ裳¤ÎËâÊý¿Ø¤¬¹½À®¤Ç¤­¤ë¥Ñ¥¿¡¼¥ó¤¬Â¸ºß¤Ç¤­¤ë¤«ÃΤꤿ¤¤¡£
²¿¤é¤«¤Î¸¡º÷¤Ç²Äǽ¤Ç¤¹¤«¡©
 

Àµ·îÍÑ¥Þ¥¸¥Ã¥¯

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ12·î30Æü(¿å)09»þ28ʬ57ÉÃ
ÊÖ¿®¡¦°úÍÑ
  º£Ç¯¤â¤¢¤È¶Ï¤«¡£¤â¤¦¤¹¤°¤ªÀµ·î¤Ç¤¹¡£
¤½¤³¤Ç¡¢¤ªÀµ·î¤Ë½¸¤Þ¤Ã¤¿»þ¤Ë¤Ç¤­¤ë¥Þ¥¸¥Ã¥¯¤ò°ì¤Ä¾Ò²ð¤·¤Þ¤¹¡£

¿·ÉʤΥ«¡¼¥É¡Ê¥Þ¡¼¥¯Ëè¤Ë¿ô»ú¤¬Â·¤Ã¤Æ¤¤¤ë¾õÂ֡ˤòÁê¼ê¤ËÅϤ·¡¢¥Ç¥Ã¥¯¤òÂçÂΣ²Ê¬¤·¤Æ
£²¤Ä¤Î¥Ñ¥±¥Ã¥È¤Ç¥ê¥Õ¥ë¥·¥ã¥Ã¥Õ¥ë¤ò£³²ó¤µ¤»¤ë¡£
¤½¤Î¸å¥Ç¥Ã¥¯¤ò¥«¥Ã¥È¡ÊŬÅö¤Ê¾ì½ê¤Ç¾å²¼¤Î°ÌÃÖ¤ò¸ò´¹¤¹¤ë¡Ë¤µ¤»¡¢°ìÈÖ¾å¤Ë¤­¤¿¥«¡¼¥É¤ò³Ð¤¨¤Æ¤â¤é¤¤¡¢¤³¤Î¥«¡¼¥É¤ò¥Ç¥Ã¥¯¤ÎÃæÄø¤Ëº¹¤·¹þ¤ó¤Ç¤â¤é¤Ã¤Æ¤«¤é¡¢ÊÖ¤·¤Æ¤â¤é¤¦¡£
¤³¤³¤Ç¿ô²ó¥Ç¥Ã¥¯¤ò¥«¥Ã¥È¤·¤ÆµÒ¤Î¥«¡¼¥É¤Î°ÌÃÖ¤ò¤ï¤«¤é¤Ê¤¯¤·¤Æ¤â¤è¤¤¡£
¤³¤Î¾õÂÖ¤«¤é¥«¡¼¥É¤òÅö¤Æ¤ë¡£




¡ãµÒ¤Î¥«¡¼¥É¤Îõ¤·Êý¡ä
µÒ¤«¤é¥Ç¥Ã¥¯¤ò¼õ¤±¼è¤ê¡¢
±é¼Ô¤À¤±¤¬É½¤¬¸«¤¨¤ë¤è¤¦¤Ë¤·¤Æ»ý¤Á¡¢À֤Υ«¡¼¥É¤ò¥¢¥Ã¥×¥¸¥ç¥°¡Ê¾å¤ËȾʬ°Ì¾å¤²¤ë¡Ë
¤·¤Æ¤¤¤­¡¢½çÈÖ¤ò¶¸¤ï¤µ¤Ê¤¤¤è¤¦¤Ë¤·¤ÆÁ´¤ÆÈ´¤­¼è¤ê¸å¤í¤Ø²ó¤¹¡£
¼¡¤Ë¹õ¤Î¥«¡¼¥É¤Î°ìÊý¤Î¥Þ¡¼¥¯¡ÊÎ㤨¤Ð¥¯¥é¥Ö¡Ë¤ÈÀ֤Υ«¡¼¥É¤Î°ìÊý¤Î¥Þ¡¼¥¯¡ÊÎ㤨¤Ð¥À¥¤¥ä¡Ë¤ò¥¢¥Ã¥×¥¸¥ç¥°¤·¤ÆÁ´¤ÆÈ´¤­¼è¤ê¸å¤í¤Ø²ó¤¹¡£
¡Ê¤³¤ì¤Ç¥Þ¡¼¥¯Ëè¤Ë¥«¡¼¥É¤¬¤«¤¿¤Þ¤ë¡Ë
Ʊ¤¸¥Þ¡¼¥¯¤ÎÉôʬ¤ËÃåÌܤ·¡¢A¤«¤é£²¡¤£³¡¤£´¡¢¡¦¡¦¡¦¤È½çÈ֤˸«¤Æ¤¤¤¯¡£
±¦Ã¼¤Þ¤Ç¤­¤¿¤é¡¢º¸Ã¼¤Ë¤Ä¤Ê¤²¤Æ¸«¤Æ¤¤¤¯¡£
¤³¤Î¤È¤­¡¢½çÈÖÄ̤ê¤Ë¥«¡¼¥É¤¬Â¸ºß¤·¤Æ¤¤¤¿¤é¤½¤Î¥Þ¡¼¥¯¤Î¥«¡¼¥É¤Ï°ã¤¦¡£
A¤«¤éK¤Þ¤Ç¤Î½çÈÖ¤¬ÁêÂÐŪ¤ËÊø¤ì¤Æ¤¤¤¿¤é¡¢Êø¤ì¤¿Éôʬ¤Î¥«¡¼¥É¤¬µÒ¤¬¸«¤¿¥«¡¼¥É¤Ë¤Ê¤ë¡£
¤¢¤È¤ÏŬÅö¤Ê±é½Ð¤Ç¥«¡¼¥É¤ò½Ð¸½¤µ¤»¤Æ²¼¤µ¤¤¡£

¡ã¸¶Íý¡ä
¥ê¥Õ¥ë¥·¥ã¥Ã¥Õ¥ë¤Ï¸«¤¿ÌܤϺ®¤¼¤Æ¤¤¤ë¤è¤¦¤Ë¸«¤¨¤Æ¼Â¤ÏÁêÂÐŪ°ÌÃÖ´Ø·¸¤Ï°Ê³°¤ËÊݸ¤µ¤ì¤Æ¤¤¤ë¤³¤È¤òÍøÍѤ·¤¿¤â¤Î¤Ç¤¹¡£
Íð¿ô¤È¤Ï°Ê³°¤ËÌñ²ð¤ÊÂåʪ¤Ç¤¢¤ë¤³¤È¤ò¶µ¤¨¤Æ¤¯¤ì¤Þ¤¹¡£
 

Re: £³Ãʹ½¤¨¤ÎËâÊý¿Ø¤Ï²Äǽ¤«¡©

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ12·î30Æü(¿å)09»þ54ʬ59ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.952[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

a,b,c¤ÏÀ°¿ô¡¢M,A,B,C¤Ï¹ÔÎó¤È¤·¤Æ¡ÖM+a*A+b*B+c*C ¤Ë¤è¤ëÊÑ·Á¡×¤Ç¸¡º÷¤·¤Þ¤·¤¿¡£
£°¡Á£¹£¹£¹¤Î¿ô»ú¤ò»È¤Ã¤¿¾ì¹ç¡¢½ÅÊ£¤ò½ü¤¤¤Æ¸ºß¤·¤Þ¤»¤ó¡£
¤·¤«¤â¡¢Ä󼨤µ¤ì¤¿ËâÊý¿Ø¤¬Í£°ì½ÅÊ£¤Ê¤·£²Ãʳ¬¤Î¤â¤Î¤Ç¤¹¡£
!£³¡ß£³ËâÊý¿Ø¤Ç£³Ãʳ¬¤Ë¤Ê¤ë¤â¤Î¤ò¸¡º÷¤¹¤ë

OPTION ARITHMETIC NATIVE !CPU¥Ñ¥ï¡¼

DIM nm$(0 TO 19) !£°¡Á£±£¹
DATA "Zero" !0
DATA "One" !1
DATA "Two" !2
DATA "Three" !3
DATA "Four" !4
DATA "Five" !5
DATA "Six" !6
DATA "Seven" !7
DATA "Eight" !8
DATA "Nine" !9
DATA "Ten" !10
DATA "Eleven" !11
DATA "Twelve" !12
DATA "Thirteen" !13
DATA "Fourteen" !14
DATA "Fifteen" !15
DATA "Sixteen" !16
DATA "Seventeen" !17
DATA "Eighteen" !18
DATA "Nineteen" !19
MAT READ nm$

DIM nm2$(2 TO 9) !£²£°°Ê¾å
DATA "Twenty" !20
DATA "Thirty" !30
DATA "Fourty" !40
DATA "Fifty" !50
DATA "Sixty" !60
DATA "Seventy" !70
DATA "Eigthy" !80
DATA "Ninety" !90
MAT READ nm2$

FUNCTION f(x) !¿ôÃͤò±Ñ¸ìÆɤߤËÊÑ´¹¤¹¤ë¡¡¢¨£°¡Á£¹£¹£¹
   LET v=0
   IF x>=100 THEN LET v=LEN(nm$(INT(x/100))) + LEN("hundred") !É´¤Î°Ì

   LET xx=MOD(x,100) !0¡Á99¤ÎÉôʬ
   IF xx<>0 THEN
      IF xx<20 THEN !0¡Á19¤Ê¤é
         LET v=v+LEN(nm$(xx))
      ELSE
         LET v=v+LEN(nm2$(INT(xx/10))) !½½¤Î°Ì
         LET w=MOD(xx,10) !°ì¤Î°Ì
         IF w<>0 THEN LET v=v+LEN(nm$(w))
      END IF
   END IF
   LET f=v
END FUNCTION
!------------------------------


DIM M(9) !£³¡ß£³´ðËÜ·Á
!DATA 2,9,4 !¹ç·×¤Ï¡¢15
!DATA 7,5,3
!DATA 6,1,8
!MAT READ M
MAT M=ZER

! M+a*A+b*B+c*C ¤Ë¤è¤ëÊÑ·Á¡¡¹ç·×¤Ï¡¢15+3*a ¤È¤Ê¤ë¡£

DIM A(9)
DATA +1,+1,+1
DATA +1,+1,+1
DATA +1,+1,+1
MAT READ A

DIM B(9)
DATA  0,-1,+1
DATA +1, 0,-1
DATA -1,+1, 0
MAT READ B

DIM C(9) !¢¨B¤ò90¡ë²óž
DATA +1,-1, 0
DATA -1, 0,+1
DATA  0,+1,-1
MAT READ C

LET cTRUE=-1 !¿¿
LET cFALSE=0 !µ¶

FUNCTION CheckRange(T()) !£±¡Á£¹£¹£¹
   LET CheckRange=cFALSE
   FOR i=1 TO 9
      IF T(i)<0 OR T(i)>999 THEN EXIT FUNCTION
   NEXT i
   LET CheckRange=cTRUE
END FUNCTION
FUNCTION CheckUnique(T()) !Ʊ¤¸¿ô»ú¤«¤É¤¦¤«
   LET CheckUnique=cFALSE
   FOR i=1 TO 8
      FOR j=i+1 TO 9
         IF T(i)=T(j) THEN EXIT FUNCTION
      NEXT j
   NEXT i
   LET CheckUnique=cTRUE
END FUNCTION
FUNCTION CheckSum(T()) !¹ç·×
   LET CheckSum=cFALSE
   LET v=3*T(5)
   IF v<>T(1)+T(2)+T(3) THEN EXIT FUNCTION !²£
   IF v<>T(4)+T(5)+T(6) THEN EXIT FUNCTION
   IF v<>T(7)+T(8)+T(9) THEN EXIT FUNCTION

   IF v<>T(1)+T(4)+T(7) THEN EXIT FUNCTION !½Ä
   IF v<>T(2)+T(5)+T(8) THEN EXIT FUNCTION
   IF v<>T(3)+T(6)+T(9) THEN EXIT FUNCTION

   IF v<>T(1)+T(5)+T(9) THEN EXIT FUNCTION !¼Ð¤á
   IF v<>T(3)+T(5)+T(7) THEN EXIT FUNCTION
   LET CheckSum=cTRUE
END FUNCTION
!------------------------------


DIM T(9),TT(9)
!FOR aa=111 TO 0 STEP -1
FOR aa=0 TO 111 !¢¨
   DIM Ta(9)
   MAT TT=aa*A
   MAT Ta=M+TT
   PRINT "¹ç·×=";3*M(5)+3*aa; aa

   FOR bb=0-Ta(8) TO 999-Ta(8) !¢¨
      DIM Tb(9)
      MAT TT=bb*B
      MAT Tb=Ta+TT

      FOR cc=0-Ta(8) TO 999-Ta(8) !¢¨
         MAT TT=cc*C
         MAT T=Tb+TT !£±Ãʳ¬ÌÜ

         !IF CheckRange(T)=cTRUE AND CheckUnique(T)=cTRUE THEN !½ÅÊ£¤Ê¤·
         IF CheckRange(T)=cTRUE THEN !½ÅÊ£¤¢¤ê
            DIM T1(9)
            MAT T1=T !save it

            FOR i=1 TO 9 !£²Ãʳ¬ÌÜ
               LET T(i)=f(T(i))
            NEXT i
            !IF CheckUnique(T)=cTRUE AND CheckSum(T)=cTRUE THEN
            IF CheckSum(T)=cTRUE THEN
               DIM T2(9)
               MAT T2=T !save it
               !!!MAT PRINT T; !debug

               FOR i=1 TO 9 !£³Ãʳ¬ÌÜ
                  LET T(i)=f(T(i))
               NEXT i
               !IF CheckUnique(T)=cTRUE AND CheckSum(T)=cTRUE THEN
               IF CheckSum(T)=cTRUE THEN

                  MAT PRINT T1;T2;T; !ËâÊý¿Ø¤òɽ¼¨¤¹¤ë
                  PRINT

               END IF
            END IF
         END IF

      NEXT cc
   NEXT bb
NEXT aa


END
 

¹çÀ®¥Ñ¥º¥ë

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ12·î31Æü(ÌÚ)10»þ35ʬ43ÉÃ
ÊÖ¿®¡¦°úÍÑ
  £³ÃʤȤϡ¢¤½¤¦¾å¼ê¤¯¤¤¤¯¤³¤È¤Ï¤¢¤ê¤¨¤Ê¤¯ÉÔ²Äǽ¤Ê¤ó¤Ç¤¹¤Í¡£
¼«Ê¬¤Ç¤Ê¤ó¤È¤«¥×¥í¥°¥é¥à¤òºî¤í¤¦¤È¤¢¤ì¤³¤ì¤ä¤ë¤ó¤Ç¤¹¤¬¡¢Á´¤Æ¤ÎÃμ±¤Î·çÇ¡¤ò»×¤¤ÃΤë¤À¤±¤Ç¡¢Á´¤¯»õ¤¬Î©¤Á¤Þ¤»¤ó¡£

°ÊÁ°¤Î»¶Ê⥳¡¼¥¹¤Î¥ë¡¼¥Èõ¤·¤È¡¢Ê¸»ú¿ô¤Ç¤ÎËâÊý¿Ø¹½À®¤ò¾å¼ê¤¯ÁȤ߹ç¤ï¤»¤¿¤â¤Î¤Ç
¼¡¤Î¹½À®ºîÉʤòÌܤˤ·¤Þ¤·¤¿¤Î¤Ç¾Ò²ð¤·¤Þ¤¹¡£

TFOURTEEN
H       F
I       I
R       F
T       T   OTWO
E       E   N  T
E       E   E  H
N       NZERO  R
TWELVEE        E
      L    FOURE
      E    F
      V    I
      E    V
      N SIXE
   NTEN S
   I    E
   N    V
   E    E
   EIGHTN


¡Ê£±£¶ÊÕ¤¬£°¡Á£±£µ¤Þ¤Ç¤Î¿ô»ì¤Ë¤è¤Ã¤Æ·èÄꤵ¤ì¤¿¥Ý¥ê¥ª¥ß¥Î¡Ë
À¨¤¤¤Î°ì¸À¤Ç¤¹¡£
 

ÁϺî¥Ñ¥º¥ë¤ËɬÍ×

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2009ǯ12·î31Æü(ÌÚ)11»þ40ʬ17ÉÃ
ÊÖ¿®¡¦°úÍÑ
  £î¸Ä¤Î°Û¤Ê¤ë¿ô»ú¤òÁ´¤Æ»È¤Ã¤Æʤ٤ƣî·å¤ÎÀ°¿ô¤òºî¤ê¡¢¾®¤µ¤¤½ç¤Ëʤ٤¿¤È¤¹¤ë»þ¡¢
°ìÈ̤ˣëÈÖÌܤËʤֽçÎ󤬲¿¤Ë¤Ê¤ë¤«¤ä¡¢
µÕ¤Ë»ØÄê¤ÎÀ°¿ô¤¬²¿ÈÖÌܤËʤó¤Ç¤¤¤ë¤«¤ò·×»»¤¹¤ë¤¿¤á¤Ëfactorial base(factoradic?)
¤È¸À¤¦É½µ­Ë¡¤¬Í­¸ú¤Ç¤¢¤ë¤ÈÆɤó¤À¡£
Î㡧£´£·¡á£±¡ö£´¡ª¡Ü£³¡ö£³¡ª¡Ü£²¡ö£²¡ª¡Ü£±¡ö£±¡ª
¤³¤ì¤è¤ê£´£·¤Îɽµ­¤ò
£±(4)£³(3)£²(2)£±(1)
¤Ê¤É¤Èɽ¤¹¤³¤È¤Ë¤¹¤ë¡£

n: f(n)
0  0
1  1
2  10
3  11
4  20
5  21
6  100
7  101
8  110
9  111
10 120
11 121
12 200
13 201
14 210
15 211
16 220
17 221
18 300
19 301
20 310
21 311
22 320
23 321
24 1000
¡¦¡¦¡¦¡¦
¤Ê¤É¤Ê¤É

£î¡Ê¾¯¤Ê¤¯¤È¤â£±£°·å¤Ç¤â²Äǽ¤Ç¤¢¤ë¤è¤¦¤Ë¤·¤Æ¤â¤é¤¤¤¿¤¤¡£¡Ë
¤òÆþÎϤ·¤¿¤é¡¢¤½¤Îfactoradic¤Ç¤Îɽµ­¤¬½ÐÎϤµ¤ì¤ë¤è¤¦¤Ë¤ª´ê¤¤¤·¤¿¤¤¡£
¤è¤í¤·¤¯¤ª´ê¤¤¤·¤Þ¤¹¡£
 

Re: ÁϺî¥Ñ¥º¥ë¤ËɬÍ×

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ12·î31Æü(ÌÚ)12»þ07ʬ7ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.956[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

No.721[¸µµ­»ö¤Ø] ¤Î¼ê³¤­ Num2Factoradic¡¢Factoradic2Num ¤ò»²¾È¤Î¤³¤È¡£

ÇÛÎóA()¤Ï¡¢ 1(4!),3(3!),2(2!),1(1!),0(0!) ¤Î½ç¤Çɽ¼¨¤µ¤ì¤Þ¤¹¡£
 

Re: ¹çÀ®¥Ñ¥º¥ë

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2009ǯ12·î31Æü(ÌÚ)16»þ06ʬ15ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.955[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¤«¤Ê¤êÅú¤¨¤¬¤¢¤ë¤è¤¦¤Ç¤¹¡£¸¡¾Ú¤ÏO(2^n)¤Ç¤¹¤«¤é¡¢£²£´¤¢¤¿¤ê¤¬ÂÅÅö¤«¤È¡¢¡¢¡¢

F2$(x)¤ò»È¤Ã¤¿¤â¤Î¤Ï¡¢Á°²ó¤Î¡Ö¿ôÃͤοô¤À¤±¿Ê¤à¡×¤Î¸òº¹È½Äê¤ò´Þ¤ó¤À²óÅú¤È¤Ê¤ê¤Þ¤¹¡£
¡ÊF$(x)¤ò»È¤Ã¤¿£´²Õ½ê¤Î¥³¥á¥ó¥È¤òÆþ¤ìÂؤ¨¤ë¡Ë
!»¶Ê⥳¡¼¥¹¤Îõº÷

DECLARE EXTERNAL FUNCTION F.F$ !³°Éô´Ø¿ô¤ÎÀë¸À
DECLARE EXTERNAL FUNCTION F2$ !³°Éô´Ø¿ô¤ÎÀë¸À

LET t0=TIME

PUBLIC NUMERIC ANSWER_COUNT !²òÅú¿ô
LET ANSWER_COUNT=0

PUBLIC NUMERIC N !Êâ¿ô
LET N=16

PUBLIC NUMERIC M !¥Þ¥Ã¥×¤ÎÂ礭¤µ
LET M1=0
LET M2=0
FOR i=0 TO N !¢¨2+4+6+ ¡Ä +(N-2)+N¤è¤êÂ礭¤¯
   LET t=LEN(F$(i)) !Êâ¿ô
   !!!LET t=LEN(F2$(i)) !Êâ¿ô¡¡¢«¢«¢«¢«¢«
   IF MOD(i,2)=1 THEN
      LET M1=M1+t
   ELSE
      LET M2=M2+t
   END IF
NEXT i
LET M=MAX(M1,M2)
PRINT M;M1;M2

DIM map(-M TO M,-M TO M) !»¶Ê⤷¤¿¥³¡¼¥¹¡Ê­ÀסË
MAT map=(ORD("."))*CON !̤Ƨ

LET x=0 !¸½ºß°ÌÃÖ
LET y=0

!¢¨£±ÊâÌܤȣ²ÊâÌܤò¸ÇÄꤷ¤Æ¡¢²óž¤È¶ÀÌ̤òÇÓ½ü¤¹¤ë
CALL walk(F$(0),map,0,x,y, ok) !£±ÊâÌܤÏÅì¤Ø¡¡¢¨0:Åì¡¢1:ËÌ¡¢2:À¾¡¢3:Æî
!!!CALL walk(F2$(1),map,0,x,y, ok) !£±ÊâÌܤÏÅì¤Ø¡¡¢¨0:Åì¡¢1:ËÌ¡¢2:À¾¡¢3:Æî¡¡¢«¢«¢«¢«¢«

LET d=MOD(0-1,4) !¿Ê¹ÔÊý¸þ
CALL walk(F$(1),map,d,x,y, ok) !£²ÊâÌܤÏË̤Ø
!!!CALL walk(F2$(2),map,d,x,y, ok) !£²ÊâÌܤÏË̤ء¡¢«¢«¢«¢«¢«


CALL search(3,map,d,x,y) !£³ÊâÌܰʹß

IF ANSWER_COUNT=0 THEN PRINT "²òÅú¤Ê¤·"

PRINT "·×»»»þ´Ö=";time-t0

END


EXTERNAL SUB walk(s$,map(,),d,x,y, ok) !¥³¡¼¥¹¤Ë­Àפò»Ä¤¹
LET ok=0

LET L=LEN(s$)
SELECT CASE d !¿Ê¹ÔÊý¸þ¤Ë±þ¤¸¤Æ
CASE 0 !E
   FOR i=1 TO L
      IF map(y,x+i)<>ORD(".") THEN EXIT SUB !̤Ƨ°Ê³°¤Ê¤é
      LET map(y,x+i)=ORD(s$(i:i))
   NEXT i
   LET x=x+L !°ÜÆ°Àè
CASE 1 !N
   FOR i=1 TO L
      IF map(y+i,x)<>ORD(".") THEN EXIT SUB !̤Ƨ°Ê³°¤Ê¤é
      LET map(y+i,x)=ORD(s$(i:i))
   NEXT i
   LET y=y+L !°ÜÆ°Àè
CASE 2 !W
   LET x=x-L !°ÜÆ°Àè¡¡¢¨Í½¤áÀè¤Ë
   FOR i=1 TO L
      IF map(y,x+i-1)<>ORD(".") THEN EXIT SUB !̤Ƨ°Ê³°¤Ê¤é
      LET map(y,x+i-1)=ORD(s$(i:i))
   NEXT i
CASE 3 !S
   LET y=y-L !°ÜÆ°Àè¡¡¢¨Í½¤áÀè¤Ë
   FOR i=1 TO L
      IF map(y+i-1,x)<>ORD(".") THEN EXIT SUB !̤Ƨ°Ê³°¤Ê¤é
      LET map(y+i-1,x)=ORD(s$(i:i))
   NEXT i
CASE ELSE
END SELECT

LET ok=1 !À®¸ù
END SUB


EXTERNAL SUB search(s,map(,),d,x,y) !¥Ð¥Ã¥¯¥È¥é¥Ã¥¯¤Ç¸¡º÷¤¹¤ë
DECLARE EXTERNAL FUNCTION F.F$ !³°Éô´Ø¿ô¤ÎÀë¸À
DECLARE EXTERNAL FUNCTION F2$ !³°Éô´Ø¿ô¤ÎÀë¸À

LET s$=F$(s-1) !Êâ¿ô¤ò»»½Ð¤¹¤ë
!!!LET s$=F2$(s) !Êâ¿ô¤ò»»½Ð¤¹¤ë¡¡¢«¢«¢«¢«¢«

LET L=LEN(s$)
DIM mmm(-L TO L) !save map
IF MOD(s,2)=0 THEN
   FOR i=-L TO L !£±Îóʬ¤Î¤ß¡Ê¥á¥â¥ê»ÈÍѤÎÀáÌó¡Ë
      LET mmm(i)=map(y+i,x)
   NEXT i
ELSE
   FOR i=-L TO L !£±¹Ôʬ¤Î¤ß
      LET mmm(i)=map(y,x+i)
   NEXT i
END IF

FOR k=-1 TO 1 STEP 2 !±¦¤Èº¸¤Î¤ß
   LET dd=MOD(d+k,4) !£±¤ÄÁ°¤ò´ð½à¤Ë¤·¤Æ¡¢sÊâÌܤÎÊý¸þ¤ò·è¤á¤ë

   LET xx=x
   LET yy=y
   CALL walk(s$,map,dd,xx,yy, ok) !sÊâÌܤΰÜÆ°
   IF ok=1 THEN

      IF s=N THEN !»ØÄê¤ÎÊâ¿ô¤Ë㤷¤¿¤é
         IF xx=0 AND yy=0 THEN !¸µ¤Î°ÌÃÖ¤ËÌá¤Ã¤¿¤é

            LET ANSWER_COUNT=ANSWER_COUNT+1 !²òÅú¿ô
            PRINT ANSWER_COUNT

            FOR i=-M TO M !¥³¡¼¥¹¤òɽ¼¨¤¹¤ë
               LET t$=""
               FOR j=-M TO M
                  LET t$=t$ & CHR$(map(i,j))
               NEXT j
               PRINT t$ !£±¹Ôʬ¤ò¤Þ¤È¤á¤Æ½ÐÎϤ¹¤ë¡Ê¹â®¡Ë
            NEXT i
            PRINT

         END IF
      ELSE
         CALL search(s+1,map,dd,xx,yy) !¼¡¤Ø
      END IF

   END IF


   IF MOD(s,2)=0 THEN !restore map
      FOR i=-L TO L
         LET map(y+i,x)=mmm(i)
      NEXT i
   ELSE
      FOR i=-L TO L
         LET map(y,x+i)=mmm(i)
      NEXT i
   END IF
NEXT k

END SUB


MODULE F !±Ñ¸ìÆɤߤËÊÑ´¹¤¹¤ë
SHARE STRING nm$(0 TO 19) !£°¡Á£±£¹
DATA "Zero" !0
DATA "One" !1
DATA "Two" !2
DATA "Three" !3
DATA "Four" !4
DATA "Five" !5
DATA "Six" !6
DATA "Seven" !7
DATA "Eight" !8
DATA "Nine" !9
DATA "Ten" !10
DATA "Eleven" !11
DATA "Twelve" !12
DATA "Thirteen" !13
DATA "Fourteen" !14
DATA "Fifteen" !15
DATA "Sixteen" !16
DATA "Seventeen" !17
DATA "Eighteen" !18
DATA "Nineteen" !19
MAT READ nm$

SHARE STRING nm2$(2 TO 9) !£²£°°Ê¾å
DATA "Twenty" !20
DATA "Thirty" !30
DATA "Fourty" !40
DATA "Fifty" !50
DATA "Sixty" !60
DATA "Seventy" !70
DATA "Eigthy" !80
DATA "Ninety" !90
MAT READ nm2$

PUBLIC FUNCTION F$
EXTERNAL FUNCTION F$(x) !¿ôÃͤò±Ñ¸ìÆɤߤËÊÑ´¹¤¹¤ë¡¡¢¨£°¡Á£¹£¹
   IF x<20 THEN !0¡Á19¤Ê¤é
      LET v$=v$ & nm$(x)
   ELSE
      LET v$=v$ & nm2$(INT(x/10)) !½½¤Î°Ì
      LET w=MOD(x,10) !°ì¤Î°Ì
      IF w<>0 THEN LET v$=v$ & "-" & nm$(w)
   END IF
   LET F$=v$
END FUNCTION
END MODULE


EXTERNAL FUNCTION F2$(x) !¿ôÃͤÎŤµ
LET F2$=REPEAT$(mid$("123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",x,1),x)
END FUNCTION


!²óÅú¡¢¾ðÊó¡¢¥¢¥ë¥´¥ê¥º¥à¡¢¥Ñ¥º¥ë
 

¿·Ç¯¤Î¤´°§»¢

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2010ǯ 1·î 1Æü(¶â)07»þ37ʬ59ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ÌÀ¤±¤Þ¤·¤Æ¡¢¤ª¤á¤Ç¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
¿·Ç¯¤ò·Þ¤¨¡¢³§ÍÍÊý¤È¶¦¤Ëº£Ç¯¤¬Îɤ­Ç¯¤Ç¤¢¤ê¤Þ¤¹¤è¤¦¤Ë´ê¤¤¤¿¤¤¤È»×¤¤¤Þ¤¹¡£

¤µ¤Ã¤½¤¯¤Ç¤Ï¤¢¤ê¤Þ¤¹¤¬¡¢¤³¤³¤Ë¤è¤¯¤³¤é¤ì¤ëÊý¡¹¤Ï¡¢µ®½Å¤Ê¥³¥ß¥å¥±¡¼¥·¥ç¥ó¤ÎÊõ¸Ë¤Ç¤¢¤ê¤Þ¤¹¡£
¤½¤³¤Ç¡¢³§Íͤò¡ÉÑæ·Û¤ÎÃç¡É¤È¸Æ¤Ð¤»¤Æ¤¤¤¿¤À¤¤¤Æ¡¢¼¡¤ÎÁϺî¥Ñ¥º¥ë¤ËÄ©À路¤Æ¤¤¤¿¤À¤­¤¿¤¯¤´°ÆÆ⤤¤¿¤·¤Þ¤¹¡£

Ñæ·Û¤ÎÃç¡Ê¥Õ¥ó¥±¥¤¥Î¥Ê¥«¡Ë
¤Î£·Ê¸»ú¡É¤Õ¡É¡¢¡É¤ó¡É¡¢¡É¤±¡É¡¢¡É¤¤¡É¡¢¡É¤Î¡É¡¢¡É¤Ê¡É¡¢¡É¤«¡É
¤òʤÓÂؤ¨¤Æñ¸ì¤òºî¤ê¤Þ¤·¤¿¡£
¤³¤ì¤òÁ´¤Æºî¤ê½Ð¤·¡¢¼­½ñ¼°¤Ëʤ٤¿»þ¡¢º£Ç¯¡Ê£²£°£±£°Ç¯¡Ë¤ËÅö¤¿¤ë
£²£°£±£°ÈÖÌܤËÍè¤ëñ¸ì¤Ï²¿¤Ç¤·¤ç¤¦¡©

¤³¤ì¤òÀ§Èó´Á»ú¤ËÊÑ´¹¤µ¤ìÊÖ¿®¤µ¤ì¤¿¤·¡£


Àµ²ò¼Ô¿¿ô¤Î¾ì¹ç¤ÏÀèÃ壱̾Íͤˡ¢¹ë²Ú·ÊÉʡʤ³¤Î£·Ê¸»ú¤Çºî¤ëÉÊʪ¡Ë¤òº¹¤·¾å¤²¤Þ¤¹¡£

¡ã¸¦µæÇ®¿´¤ÊÊý¤Ë¡ä
0¡¢£±¡¤£²¡¤£³¡¤£´¡¤£µ¡¤£¶¡¤£·¡¤£¸¡¤£¹
¤«¤éºî¤é¤ì¤ëÁ´¤Æ¤Î½çÎó¡Ê£³£¶£²£¸£¸£°£°Ä̤ê¡Ë¤ò¾®¤µ¤¤¤Û¤¦¤«¤éʤ٤Ƥ¤¤Ã¤¿»þ
£±£´£±£·£³£¸£¶ÈÖÌܤˤ¯¤ë½çÎó¤ÎʤӤϲ¿¤Ë¤Ê¤ê¤Þ¤¹¤«¡©
¼Â¤Ï¤³¤ÎʤӤò»ý¤ÄÀ°¿ô¤Ï¤¢¤ëÆÃÊ̤ÊÀ­¼Á¤ò»ý¤Á¤Þ¤¹¡£
²Äǽ¤Ê¸Â¤ê¤½¤ÎÆÃħ¤òȯ¸«¤·¤Æ²¼¤µ¤¤¡£

¤Þ¤¿¡¢¤½¤ÎʤӤò¸«¤Ä¤±½Ð¤¹¤¿¤á¤ËÍ­¸ú¤È¤Ê¤ë¥¢¥¤¥Ç¥¢¤ä·×»»¼ê½ç¤ò¤ªÊ¹¤«¤»²¼¤µ¤¤¡£
 

Re: ¿·Ç¯¤Î¤´°§»¢

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2010ǯ 1·î 1Æü(¶â)14»þ22ʬ5ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.959[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> 0¡¢£±¡¤£²¡¤£³¡¤£´¡¤£µ¡¤£¶¡¤£·¡¤£¸¡¤£¹
> ¤«¤éºî¤é¤ì¤ëÁ´¤Æ¤Î½çÎó¡Ê£³£¶£²£¸£¸£°£°Ä̤ê¡Ë¤ò¾®¤µ¤¤¤Û¤¦¤«¤éʤ٤Ƥ¤¤Ã¤¿»þ
> £±£´£±£·£³£¸£¶ÈÖÌܤˤ¯¤ë½çÎó¤ÎʤӤϲ¿¤Ë¤Ê¤ê¤Þ¤¹¤«¡©

3,912,657,840

¡¦0¤«¤é9¤Þ¤Ç¤Î¿ô»ú¤ò°ìÅÙ¤º¤Ä»È¤Ã¤Æ¤¤¤ë
¡¡¡¡¢Í ¤¹¤Ù¤Æ¤Î½çÎó¡Ê10!Ä̤ê¡Ë¤òÀ¸À®¤¹¤ë
¡¦0¤ò½ü¤¯Á´¤Æ¤Î°ì·å¤Î¿ô¡Ê1,2,3,4,5,6,7,8,9¡Ë¤Ç³ä¤êÀÚ¤ì¤ë
¡¡¡¡¢Í 2^3*3^2*5*7¤ÎÇÜ¿ô
¡¦¤³¤Î¿ô¤Ë´Þ¤Þ¤ì¤ëÎÙ¤ê¹ç¤¦Æó·å¤Î¿ô¡Ê39¡¢91¡¢12¡¢26¤Ê¤É¡Ë¤Ç³ä¤êÀÚ¤ì¤ë
¡¡¡¡¢Í ¡©
¡¦¤³¤Î¿ô¡Ê¿ôÎó¡Ë¤Ë¤Þ¤À̾Á°¤¬¤Ê¤¤¡Ê±ß¼þΨ¡¢¡Á¤ÎÄê¿ô¤Ê¤É¡Ë


¤Þ¤¿£¹·å¡Ê£°¡Á£¸¡Ë¤Î¾ì¹ç¡¢384,572,160 ¤È 728,451,360 ¤¬¤¢¤ê¤Þ¤¹¡£
 

¿·Ç¯¤Î¶Ã¤­

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2010ǯ 1·î 1Æü(¶â)15»þ21ʬ45ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.960[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

.................................
............TenN.................
............E..i.................
............l..n.................
............e..e.................
............v..EightS............
............e.......e............
............nTwelve.v............
..................T.e............
..................h.n............
..................i.SixF.........
..................r....i.........
..................t....v.........
..................e....e.........
..................e....FourT.....
..................nFourteenh.....
..........................Fr.....
..........................ie.....
..........................fe.....
..........................tTwoO..
..........................e...n..
..........................e...e..
..........................nZero..
.................................


...................................
.................TenN..............
.................E..i..............
.................l..n..............
.................e..e..............
.................v..EightS.........
.................e.......e.........
...........Twelven.......v.........
...........T.............e.........
...........h.............n.........
...........i..........FSix.........
...........r..........i............
...........t..........v............
...........e..........e............
...........e..........FourT........
...........nFourteen......h........
...................F......r........
...................i......e........
...................f......e........
...................t...OTwo........
...................e...n...........
...................e...e...........
...................nZero...........
...................................


.....................................
.....................................
.........FourteenT...................
.........F.......h...................
.........i.......i...................
.........f.......r...................
.........t...OTwot...................
.........e...n..Te...................
.........e...e..he...................
.........nZero..rn...................
................eTwelveE.............
............Foure......l.............
............F..........e.............
............i..........v.............
............v..........e.............
............eSix.......n.............
...............S....NTen.............
...............e....i................
...............v....n................
...............e....e................
...............nEight................
.....................................


............................
.......TFourteen............
.......h.......F............
.......i.......i............
.......r.......f............
.......t.......t...OTwo.....
.......e.......e...n..T.....
.......e.......e...e..h.....
.......n.......nZero..r.....
.......TwelveE........e.....
.............l....Foure.....
.............e....F.........
.............v....i.........
.............e....v.........
.............n....eSix......
.............TenN....S......
................i....e......
................n....v......
................e....e......
................Eightn......
............................



..............................
...........TFourteen..........
...........h.......F..........
...........r.......f..........
...........t.......t...OTwo...
...........e.......e...n..T...
...........e.......e...e..h...
...........n.......nZero..r...
...........TwelveE........e...
.................l....Foure...
.................e....F.......
.................v....i.......
.................e....v.......
.................n.Sixe.......
..............NTen.S..........
..............i....e..........
..............n....v..........
..............e....e..........
..............Eightn..........
..............................



.........................................................
..................................555554.................
..................................6....4.................
..................................6....4.................
..................................6....4.................
..................................6.2333.................
..................................6.2....................
...........................77777776G1....................
...........................8.......G.....................
...........................8.......G.....................
...........................8.......G.....................
...........................8.......G.....................
...........................8.......G.....................
...........................8.......G.....................
...........................8.......G.....................
..................9999999998.......G.....................
..................A................G.....................
..................A................G.....................
..................A................G.....................
..................A................G.....................
..................A................G.....................
..................A................G.....................
..................A................G.....................
..................A.EFFFFFFFFFFFFFFF.....................
..................A.E....................................
.......BBBBBBBBBBBA.E....................................
.......C............E....................................
.......C............E....................................
.......C............E....................................
.......C............E....................................
.......C............E....................................
.......C............E....................................
.......C............E....................................
.......C............E....................................
.......C............E....................................
.......C............E....................................
.......C............E....................................
.......CDDDDDDDDDDDDD....................................
.........................................................


¤Ê¤É¤Ê¤É


> ¡¦0¤ò½ü¤¯Á´¤Æ¤Î°ì·å¤Î¿ô¡Ê1,2,3,4,5,6,7,8,9¡Ë¤Ç³ä¤êÀÚ¤ì¤ë
> ¡¡¡¡¢Í 2^3*3^2*5*7¤ÎÇÜ¿ô
¤Ï¡¼¤½¤¦¤«¡ª¡ª¡ª

> ¡¦¤³¤Î¿ô¤Ë´Þ¤Þ¤ì¤ëÎÙ¤ê¹ç¤¦Æó·å¤Î¿ô¡Ê39¡¢91¡¢12¡¢26¤Ê¤É¡Ë¤Ç³ä¤êÀÚ¤ì¤ë
¤è¤¯¤³¤ì¤Ëµ¤¤Å¤­¤Þ¤·¤¿¤Í¡¼

> ¤Þ¤¿£¹·å¡Ê£°¡Á£¸¡Ë¤Î¾ì¹ç¡¢384,572,160 ¤È 728,451,360 ¤¬¤¢¤ê¤Þ¤¹¡£
¤Ê¤ó¤È¿·¤¿¤Êȯ¸«

>¤³¤Î¿ô¡Ê¿ôÎó¡Ë¤Ë¤Þ¤À̾Á°¤¬¤Ê¤¤¡Ê±ß¼þΨ¡¢¡Á¤ÎÄê¿ô¤Ê¤É
¥Ì¡¼¥É¾®Ä®¤Ç¤Ï¤É¤¦¤Ç¤·¤ç¤¦¡£


»³Ã椵¤óÀ¨¤¤¤Î°ì¸À¤Ç¤¹¡£
 

Re: »¶Ê⥳¡¼¥¹¤Îõº÷´ê¤¤

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2010ǯ 1·î 4Æü(·î)12»þ29ʬ28ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.902[¸µµ­»ö¤Ø]

90¡ë¤ÎÏ¢·ëÅù³Ñ¿³Ñ·Á¡Ê¥Ý¥ê¥ª¥ß¥Î¡Ë¤Ë¤è¤ëÊÄÏ©

¡üÊÄÏ©¤Î¸õÊä
ÅìÀ¾¡Ê´ñ¿ô¡Ë¡¢ÆîË̡ʶö¿ô¡Ë¤Î°ÜÆ°¤Ëʬ¤±¤Æ¹Í¤¨¤ë¤È¡¢¤½¤ì¤¾¤ì¤Î¹ç·×¤¬£°¤Ë¤Ê¤ë¤â¤Î¤Ç¤¢¤ë¡£
¤³¤ÎÁȤ߹ç¤ï¤»¡ÊÀѡˤÎÃæ¤Ç¡¢¸òº¹¤¹¤ë¤â¤Î¤ò½ü¤¤¤¿¤â¤Î¤¬µá¤á¤ë¤â¤Î¡ÊÅú¤¨¡Ë¤Ç¤¢¤ë¡£
¡¡°Ì¿ô¡¡´ñ¿ô¡¡¶ö¿ô¡¡¡¡¡¡¡¡¡¡ÀÑ¡¡Åú¤¨
¡¡¡¡ 7¡¡¡¡ 1¡¡¡¡ 1¡¡ ¡¡¡¡¡¡¡¡1¡¡¡¡ 1
¡¡¡¡ 8¡¡¡¡ 1¡¡¡¡ 1¡¡ ¡¡¡¡¡¡¡¡1¡¡¡¡ 1
¡¡¡¡15¡¡¡¡ 4¡¡¡¡ 4¡¡ ¡¡¡¡¡¡ 16¡¡¡¡ 1
¡¡¡¡16¡¡¡¡ 4¡¡¡¡ 7¡¡¡¡¡¡¡¡¡¡28¡¡¡¡ 3
¡¡¡¡23¡¡¡¡34¡¡¡¡35¡¡¡¡¡¡¡¡1190¡¡¡¡25
¡¡¡¡24¡¡¡¡34¡¡¡¡62¡¡¡¡¡¡¡¡2108¡¡¡¡67
¡¡¡¡¡§¡Ê¤³¤ÎÈϰϤÏ̤³Îǧ¡Ë
¡¡¡¡32¡¡ 346¡¡ 657¡¡¡¡¡¡227322¡¡¡¡¡©
¡¡¡¡¡§¡Ê̤³Îǧ¡Ë
¡¡¡¡40¡¡3965¡¡7636¡¡¡¡30276740¡¡¡¡¡©
¡¡¡¡¡§¡Ê̤³Îǧ¡Ë
¡¡¡¡48 48396 93846¡¡4541771016¡¡¡¡¡©
¡¡¡¡¡§¡Ê̤³Îǧ¡Ë

Àè¤Î¥×¥í¥°¥é¥à¡ÊNo.958[¸µµ­»ö¤Ø]¡Ë¤Ç¤Ï¡¢¸òº¹È½Äê¤Ë¤è¤ë»Þ´¢¤ê¤ò¹Ô¤Ã¤Æ¤¤¤ë¤¬¡¢N=32¤ÏÁêÅö»þ´Ö¤¬¤«¤«¤ë¡£
¾åµ­¤Î¤è¤¦¤Ë½èÍý¤¹¤ë¤È¡¢32¤ä40¤¬·×»»²Äǽ¤Ë¤Ê¤ë¡£


¡ü¸õÊä¤Î¸Ä¿ô¡Ê¡¢Éä¹æ¥Ñ¥¿¡¼¥ó¡Ë¤òµá¤á¤ë¥×¥í¥°¥é¥à
LET t0=TIME

LET N=24 !°Ì¿ô

LET w=INT((N-1)/2)+1 !³µ»»
DIM A(w) !£±¡Á£î¤Þ¤Ç¤Î´ñ¿ôÎ󡢶ö¿ôÎó

LET m=0
FOR i=1 TO N
   IF MOD(i,2)=1 THEN !´ñ¿ô¤Ê¤é
   !IF MOD(i,2)=0 THEN !¶ö¿ô¤Ê¤é¡¡¢«¢«¢«¢«¢«
      LET m=m+1
      LET A(m)=i
   END IF
NEXT i
redim A(m)


LET ANSWER_COUNT=0

DIM B(m)
FOR i=0 TO 2^(m-1)-1 !¥Ó¥Ã¥È¥Ñ¥¿¡¼¥ó¤Ç¸¡¾Ú¤¹¤ë¡¡¢¨MSB=0
   MAT B=CON
   LET t$=right$(REPEAT$("0",m)&BSTR$(i,2),m) !m·å
   FOR k=1 TO LEN(t$)
      IF t$(k:k)="1" THEN LET B(k)=-1 !0:1¡¢1:-1¤Ø
   NEXT k

   IF DOT(A,B)=0 THEN !¡Þ1*1 + ¡Þ1*3 + ¡Ä + ¡Þ1*(2*m+1)¤ò·×»»¤¹¤ë
      LET ANSWER_COUNT=ANSWER_COUNT+1
      !!!PRINT "DATA ";CHR$(34);t$;CHR$(34)
   END IF
NEXT i

PRINT "¸Ä¿ô=";ANSWER_COUNT !´ñ¿ô¤Î¸Ä¿ô
PRINT


PRINT "·×»»»þ´Ö=";TIME-t0

END
 

¶öÁ³¤ÏɬÁ³¤«¡©

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2010ǯ 1·î 4Æü(·î)15»þ48ʬ55ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  ±ß¼þΨ
¦Ð=3.1415926535 8979323846 2643383279¡¦¡¦¡¦¡¦

¤ò¿ô»ú¤Î½çÈÖ¤Ë
1:3
2:1
3:4
4:1
5:5
6:9
7:2
8:6
9:5
10:3
11:5
12:8
13:9
14:7
15:9
16:3
17:2
18:3
19:8
20:4
21:6
22:2
23:6
24:4
25:3
....
¤È¤·¤Æ¤ª¤¯¡£


¤³¤³¤ËËâÊý¿Ø¡Ê³ÆÏ£¶£µ¡Ë
  17      24        1         8        15
  23       5        7        14        16
   4       6       13        20        22
  10      12       19        21         3
  11      18       25         2         9

¤Î¿ô»ú¤ò¦Ð¤Ç¤Î¿ô»ú¤ØÊÑ´¹¤·¤Æ¤ß¤ë¤È
   2        4        3         6         9¡¦¡¦¡¦24
   6        5        2         7         3¡¦¡¦¡¦23
   1        9        9         4         2¡¦¡¦¡¦25
   3        8        8         6         4¡¦¡¦¡¦29
   5        3        3         1         5¡¦¡¦¡¦17
   ¡¦       ¡¦       ¡¦        ¡¦¡¡¡¡¡¡  ¡¦
   ¡¦       ¡¦       ¡¦¡¡¡¡¡¡¡¡¡¦¡¡¡¡¡¡  ¡¦
   ¡¦       ¡¦       ¡¦¡¡¡¡¡¡¡¡¡¦¡¡¡¡¡¡  ¡¦
   17       29       25        24        23

¤³¤ó¤Ê¶öÁ³¤Ã¤Æ¤¢¤ê¡©
 

»¶Ê⥳¡¼¥¹¤Îõº÷¤Î·ë²Ì

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2010ǯ 1·î 5Æü(²Ð)06»þ04ʬ40ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.962[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£


°Ì¿ô£²£´¤ÎÁ´¥Ñ¥¿¡¼¥ó¤òÀµ·î£³Æü´ÖÆ°¤«¤·Â³¤±¤Æõ¤·½Ð¤·¤Þ¤·¤¿¡£
¼¡¤Î£³£²¤ËÄ©À路¤è¤¦¤È¤·¤Þ¤·¤¿¤¬¡¢¤³¤Î»þ´Ö¤ÎɬÍפò»×¤¦¤ÈÅÓÊý¤ËÊë¤ì¤Æ¤¤¤Þ¤·¤¿¡£
¤Ê¤ª°Ì¿ô£·¡¢£±£µ¤Ê¤É¤Î¥Ñ¥¿¡¼¥ó¤Ï³ÆÊÕ¤ÎŤµ¤¬£±¡¤£²¡¤£³¡¢¡¦¡¦¡¦
¤È¤¤¤¦Ìõ¤Ë¤Ï¤¤¤«¤Ê¤¤¤Î¤Ç¡ÊÎ㤨¤Ð°Ì¿ô£·¤Ç¤Ï½ÐȯÅÀ¤ÈÅþÃåÅÀ¤¬°ìľÀþ¤Ë¤Ê¤ë¤Î¤Ç¤³¤³¤Î
¥ë¡¼¥È¤ÎŤµ¤¬£¸¤È¤ß¤ì¤ë¤Î¤Ç¡¢¤³¤ì¤Ï½ü³°¤¹¤ë¤³¤È¤Ë¤·¤Þ¤·¤ç¤¦¡£¡Ë

> ¡¡¡¡ 7¡¡¡¡ 1¡¡¡¡ 1¡¡ ¡¡¡¡¡¡¡¡1¡¡¡¡ 1
> ¡¡¡¡ 8¡¡¡¡ 1¡¡¡¡ 1¡¡ ¡¡¡¡¡¡¡¡1¡¡¡¡ 1
> ¡¡¡¡15¡¡¡¡ 4¡¡¡¡ 4¡¡ ¡¡¡¡¡¡ 16¡¡¡¡ 1
> ¡¡¡¡16¡¡¡¡ 4¡¡¡¡ 7¡¡¡¡¡¡¡¡¡¡28¡¡¡¡ 3
> ¡¡¡¡23¡¡¡¡34¡¡¡¡35¡¡¡¡¡¡¡¡1190¡¡¡¡25
> ¡¡¡¡24¡¡¡¡34¡¡¡¡62¡¡¡¡¡¡¡¡2108¡¡¡¡67
> ¡¡¡¡¡§¡Ê¤³¤ÎÈϰϤÏ̤³Îǧ¡Ë
> ¡¡¡¡32¡¡ 346¡¡ 657¡¡¡¡¡¡227322¡¡¡¡¡©¡¡¡¡¢ª¢ª¢ª¢ª1259
> ¡¡¡¡40¡¡3965¡¡7636¡¡¡¡30276740¡¡¡¡¡©¡¡¡¡¢ª¢ª¢ª¢ª41381
> ¡¡¡¡48 48396 93846¡¡4541771016¡¡¡¡¡©¡¡¡¡¢ª¢ª¢ª¢ª1651922
 

¥×¥í¥°¥é¥à¤ÎÉé²Ù¤ò¸º¤é¤¹

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2010ǯ 1·î 7Æü(ÌÚ)12»þ02ʬ56ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.940[¸µµ­»ö¤Ø]

! ¥×¥í¥°¥é¥à¤ÎÉé²Ù¤ò¸º¤é¤¹¤È¡¢
!Ʊ¤¸£Î³Ñ¥Ð¥¦¥ó¥É¡¦¥Ü¡¼¥ë¤Ç¤¢¤ë¤¬¡¢·Ú¤¯¤Ê¤Ã¤¿Í¾Çò¤Ç¡¢
!Æ°ºîÃæ¤Î£Î³Ñ¿ô Êѹ¹¤¬¡¢¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£
!º¸¥¯¥ê¥Ã¥¯¤Ç¡¢£±³Ñ¤Å¤Ä¡¢£³¡Á£±£µ³Ñ( ŬÅö¤Ë ¡Ë²¿»þ¤Ç¤âÊѤ¨¤é¤ì¤ë¡£
!º¸¥¯¥ê¥Ã¥¯²¡¤·Â³¤±¤ë¤È¡¢ÁáÁ÷¤ê¡£
!--------------------------------------

LET m_=15                      !ºÇÂç³Ñ¿ô
LET ma=3                       !³«»Ï³Ñ¿ô
LET m0=.23                     !¥Ü¡¼¥ë¤Î®¤µ­ù
DIM x(m_+1),y(m_+1),A(m_+1),ox(m_+1),oy(m_+1)
SET WINDOW -7,7, -7,7
SET DRAW MODE NOTXOR           !£²ÅÙ½ñ¤­¤Ç¾Ã¤¨¤ë NOTXOR ¥â¡¼¥É
LET r=0.7                      !¥Ü¡¼¥ë¤ÎȾ·Â
LET r0=5.5                     !·×»»¤Ç»ÈÍѤΠ¿³Ñ·Á¡¢³°ÀܱߤÎȾ·Â
DO
   CLEAR
   DRAW axes
   LET r1=r0+r/SIN(PI/2-PI/ma) !¥Ü¡¼¥ë¤ÎÅö¤ë ¿³Ñ·Á¡¢³°ÀܱߤÎȾ·Â
   LET a0=PI*(1.5-1/ma)        !(x1,y1)¤Î³Ñ¡£
   FOR i=1 TO ma+1
      LET x(i)=r0*COS(a0)
      LET y(i)=r0*SIN(a0)
      IF 1< i THEN
         SET LINE COLOR "silver"
         PLOT LINES: x(i-1),y(i-1); x(i),y(i) !·×»»³°ÊÉ
         SET LINE COLOR "black"
         PLOT LINES: r1/r0*x(i-1),r1/r0*y(i-1); r1/r0*x(i),r1/r0*y(i) !¥Ü¡¼¥ë³°ÊÉ
      END IF
      LET a0=a0+2*PI/ma
   NEXT i
   !                      A3         A4  £´  A3
   !       £³          £´¨¡¨¡£³      £µ¡¿  ¡À£³
   !  A3 ¡¿  ¡À A2   A4¨¢    ¨¢A2   A5¡À    ¡¿A2   ¡¦¡¦¡¦
   !   £±¨¡¨¡¨¡£²      £±¨¡¨¡£²        £±¨¡£²
   !       A1             A1             A1
   !
   FOR i=1 TO ma
      LET A(i)=(y(i+1)-y(i))/(x(i+1)-x(i))   !ľÀþi~i+1 ¤Î¸ûÇÛ
      LET oy(i)= (x(i+1)-x(i))/SQR((y(i+1)-y(i))^2+(x(i+1)-x(i))^2)
      LET ox(i)=-(y(i+1)-y(i))/SQR((y(i+1)-y(i))^2+(x(i+1)-x(i))^2)
   NEXT i                   !ľÀþi~i+1 ¤Ë¿âľ¤Êñ°Ì¥Ù¥¯¥È¥ë(º¸²óž)
   CALL play00
   LET ma=MOD(ma-2,m_-2)+3  !¼¡¡¹³Ñ¿ô 3,4,5,6,,,3,4,,
LOOP UNTIL 0< mrb

SUB play00
   PLOT TEXT,AT -6.7, 6.4: "º¸¥¯¥ê¥Ã¥¯¡§³Ñ¿ô¤ÎÁªÂò= "& STR$(ma)
   PLOT TEXT,AT  3.2, 6.4: "±¦¥¯¥ê¥Ã¥¯¡§Ää»ß"
   LET i=ANGLE(x(2)-x(1),y(2)-y(1))+SQR(2)*PI/ma/1.1313 !¥Ü¡¼¥ë¤Î½é´ü³ÑÅÙ
   LET mx=m0*COS(i)                                     !¥Ü¡¼¥ë¤Î½é´ü­ùX
   LET my=m0*SIN(i)                                     !¥Ü¡¼¥ë¤Î½é´ü­ùY
   LET i=ANGLE(x(1),y(1))
   LET bx=r0*COS(i)*0.999  !¥Ü¡¼¥ë¤Î½é´ü°ÌÃÖX
   LET by=r0*SIN(i)*0.999  !¥Ü¡¼¥ë¤Î½é´ü°ÌÃÖY
   LET nb=0
   DO
      DRAW disk WITH SCALE(r)*SHIFT(bx,by) !¥Ü¡¼¥ë¤ò½ñ¤¯
      WAIT DELAY 0.02                      ! ¾ÊÅÅÎϸú²Ì¤È¡¢Â®ÅÙ
      DRAW disk WITH SCALE(r)*SHIFT(bx,by) !¥Ü¡¼¥ë¤À¤±¤ò¾Ã¤¹
      PLOT LINES : bx,by;                  ! ÍúÎòÀþ¤ò¡Ê½ñ¤¯¡¦¾Ã¤¹¡Ë
      LET bx=bx+mx
      LET by=by+my
      FOR n=1 TO ma
         IF n<>nb THEN
            CALL Sensor                    ! ÊÕ¤ÎÆâ³°¸¡½Ð¤ÈÈ¿¼Í¡ÊƱ¤¸ÊդθƽÐÍÞÀ©¡Ë
            IF n=nb THEN EXIT FOR
         END IF
      NEXT n
      IF mlbk=0 OR mlb=0 THEN LET mlbk=2*mlb ELSE LET mlbk=mlbk-1.001/13
      MOUSE POLL mox,moy,mlb,mrb
   LOOP UNTIL 0< mrb OR  mlbk< mlb         !º¸¥¯¥ê¥Ã¥¯¤Ï¡¢Leading Edge ¸¡½Ð
   PLOT LINES                              !do¡Áloop13 ²ó¤Ç¥ª¡¼¥È¥ê¥Ô¡¼¥È¤ØÆþ¤ë
END SUB

SUB Sensor
   IF ABS(A(n))< 1 THEN  !¶­³¦¸ûÇÛ£±
      LET xc=(x(n)*A(n)-y(n)-bx*my/mx+by)/(A(n)-my/mx)   !¸òÅÀ xc Í¥Àè< 45¡ë
      LET yc=(xc-x(n))*A(n)+y(n)
      IF SGN(yc-by)<>SGN(my) AND SGN(x(n)-xc)<>SGN(x(n+1)-xc) THEN CALL Mirror
   ELSE
      LET yc=(y(n)/A(n)-x(n)-by*mx/my+bx)/(1/A(n)-mx/my) !¸òÅÀ yc Í¥Àè >=45¡ë
      LET xc=(yc-y(n))/A(n)+x(n)
      IF SGN(xc-bx)<>SGN(mx) AND SGN(y(n)-yc)<>SGN(y(n+1)-yc) THEN CALL Mirror
   END IF
END SUB

SUB Mirror
   LET i=mx*ox(n)+my*oy(n) !ox,oy: Êդ˿⾤ÇÆâ¸þ¤­ ñ°Ìvector
   IF 0<=i THEN EXIT SUB   !¸å¸þ¤­¤Î¸òÅÀ
   LET mx=mx-2*i*ox(n)
   LET my=my-2*i*oy(n)     !È¿¼Í®ÅÙ
   LET bx=xc
   LET by=yc
   LET nb=n                !È¿¼ÍÊÕ ÍúÎò
END SUB

END
 

¤ª´ê¤¤¤Ç¤¹¡ª

 Åê¹Æ¼Ô¡§angel  Åê¹ÆÆü¡§2010ǯ 1·î 8Æü(¶â)10»þ21ʬ15ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ½½¿Êbasic¤ò»È¤Ã¤Æ£î°Ê²¼¤ÎÁÇ¿ô¤Î¿ô¤ò¿ô¤¨¤ë¥×¥í¥°¥é¥à¤òºî¤ê¤¿¤¤¤Î¤Ç¤¹¤¬¡¢¤É¤Î¤è¤¦¤ËºîÀ®¤·¤¿¤é¤è¤í¤·¤¤¤Ç¤·¤ç¤¦¤«¡©
Á´¤¯¤Î½é¿´¼Ô¤Ê¤Î¤Çʬ¤«¤ê¤Þ¤»¤ó¡£
¤è¤í¤·¤¯¤ª´ê¤¤¤·¤Þ¤¹¡£
 

Re: ¤ª´ê¤¤¤Ç¤¹¡ª

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2010ǯ 1·î 8Æü(¶â)10»þ53ʬ17ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.966[¸µµ­»ö¤Ø]

¥¨¥é¥È¥¹¥Æ¥Í¥¹¤ÎäÁ¤Î¥×¥í¥°¥é¥à¤ò¾¯¤·½¤Àµ¤¹¤ì¤Ð²Äǽ¤Ç¤¹¡£
¥¨¥é¥È¥¹¥Æ¥Í¥¹¤ÎäÁ¤Ï¡¤¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à
MATH\ERATOS.BAS
¤È¤·¤Æ¼ýÏ¿¤·¤Æ¤¤¤Þ¤¹¡£
¶ñÂÎŪ¤Ë¤¤¤¨¤Ð¡¤ÇÛÎósÃæ¤Î1¤Î¸Ä¿ô¤òź»ú¤¬n°Ê²¼¤ÎÈϰϤǿô¤¨¤ë¤À¤±¤Ç¤¹¡£
¤¿¤À¤·¡¤ÇÛÎós¤ÎÂ礭¤µ¤ÏÆþÎϤòͽÄꤹ¤ën¤è¤êÂ礭¤¯¤È¤Ã¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£
 

¥°¥é¥Õ¡¡¤Î°ìÉô¤Îʸ»ú¤ÎÂ礭¤µ

 Åê¹Æ¼Ô¡§Âç·§¡¡Àµ  Åê¹ÆÆü¡§2010ǯ 1·î 8Æü(¶â)16»þ03ʬ11ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¥°¥é¥Õ¤Ëʸ»ú¤òÆþ¤ì¤Æ¤ë¤Î¤Ç¤¹¤¬¡¢¸½ºß¡¢²¼µ­¤Î¡¡¥¤¥ó¥Ñ¥ë¥¹±þÅú ¡¡¤Îʸ»ú´Þ¤á¥½¥Õ¥È¤Î±Ñʸ»ú¤Ï12¤ÎÂ礭¤µ¤Ç¤¹¡£
¡¡PLOT TEXT,   AT  3,0.4,USING "a=#.#¡¡k=#.# ": A,k
  PLOT TEXT,   AT  2,0.8:"¥¤¥ó¥Ñ¥ë¥¹±þÅú "

¥°¥é¥Õ¤Îʸ»ú"A,k"¤ÎÂ礭¤µ¤Ï12¤Ç¡¢¤³¤Î"¥¤¥ó¥Ñ¥ë¥¹±þÅú"¤Îʸ»ú¤À¤±¥°¥é¥Õ¾å¤Î¤ß18¤ÎÂ礭¤µ¤Ç¡¢¤«¤ÄÂÀʸ»ú¤Ë¤¹¤ëÊýË¡¤ò¸æ¶µ¤¨²¼¤µ¤¤¡£Ã±½ã¤Ë ¥Õ¥©¥ó¥È¤ò¤¤¤¸¤Ã¤Æ18¤Ë¤¹¤ë¤È¥½¥Õ¥È¤Î±Ñ¸ìʸ»ú¤¬18¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤¤¡¢°ìÊý¥°¥é¥Õ¤ÎÊý¤ÏξÊý¤È¤â12¤ÈÊѤê¤Þ¤»¤ó¡£¥½¥Õ¥È¤ä¥°¥é¥Õ¤Îʸ»ú"A,k"¤ÎÂç ¤­¤µ¤Ï12¤Ç¤³¤Î"¥¤¥ó¥Ñ¥ë¥¹±þÅú"¤Îʸ»ú¤ÎÉôʬ¤À¤±¡¢¥°¥é¥Õ¾å¤Î¤ß18¤ÎÂ礵¤ÈÂÀ¤¤Ê¸»ú¤Ë¤·¤¿¤¤¤Î¤Ç¤¹¡£

°Ê¾å
 

Re: ¥°¥é¥Õ¡¡¤Î°ìÉô¤Îʸ»ú¤ÎÂ礭¤µ

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2010ǯ 1·î 8Æü(¶â)16»þ09ʬ1ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.968[¸µµ­»ö¤Ø]

SET TEXT FONT "Courier New",12
PLOT TEXT,   AT  3,0.4,USING "a=#.#  k=#.# ": A,k
SET TEXT FONT "£Í£Ó ¥´¥·¥Ã¥¯",18
PLOT TEXT,   AT  2,0.8:"¥¤¥ó¥Ñ¥ë¥¹±þÅú "
¤ß¤¿¤¤¤Ê´¶¤¸¤Ç¤É¤¦¤Ç¤·¤ç¤¦¤«¡£
 

Re: ¤ª´ê¤¤¤Ç¤¹¡ª

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2010ǯ 1·î 8Æü(¶â)19»þ51ʬ35ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.966[¸µµ­»ö¤Ø]

angel¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£
100 LET N=100
110 LET c=0
120 FOR i=2 TO N
130    FOR k=2 TO i-1 !Ìó¿ô¤ò³Îǧ¤¹¤ë
140       IF MOD(i,k)=0 THEN GOTO 170 !¤Ò¤È¤Ä¤Ç¤â³ä¤êÀÚ¤ì¤ë¤Ê¤é¡¢ÁÇ¿ô¤Ç¤Ê¤¤
150    NEXT k
160    LET c=c+1 !ÁÇ¿ô
170 NEXT i
180 PRINT c !·ë²Ì¤òɽ¼¨¤¹¤ë
190 END
 

Re: ¥°¥é¥Õ¡¡¤Î°ìÉô¤Îʸ»ú¤ÎÂ礭¤µ

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2010ǯ 1·î 9Æü(ÅÚ)11»þ46ʬ59ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.968[¸µµ­»ö¤Ø]

Âç·§¡¡Àµ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£


½ñÂΤËÂÀ»ú¡ÊBold¡Ë¤ä¼ÐÂΡÊItalic¡Ë¤¬¤¢¤ë¾ì¹ç
SET TEXT font "Courier New Bold Italic",24
PLOT TEXT ,AT 0.3,0.2: "ABCabc"

¤È¤¹¤ë¤È¡¢¤­¤ì¤¤¤Êʸ»ú¤¬ÉÁ¤±¤ë¤È»×¤¤¤Þ¤¹¡£


Ä̾ï¤Î½ñÂΤˤϡ¢¡Öɸ½à¡×ʸ»ú¤·¤«ÍÑ°Õ¤µ¤ì¤Æ¤¤¤Ê¤¤¤¿¤á¡¢¥·¥¹¥Æ¥à¤Ç¤Ï
PLOT TEXT ,AT 0.1,0.8: "ABCabc¤¢¤¤¤¦´Á»ú" !¸µ¤Î½ñÂΤÈÂ礭¤µ

DRAW PlotText("£Í£Ó ÌÀÄ«","",24,"ABCabc¤¢¤¤¤¦´Á»ú") WITH SHIFT(0.1,0.7)
DRAW PlotText("£Í£Ó ÌÀÄ«","ÂÀ»ú",0,"ABCabc¤¢¤¤¤¦´Á»ú") WITH SHIFT(0.1,0.6)
DRAW PlotText("","¼ÐÂÎ",0,"ABCabc¤¢¤¤¤¦´Á»ú") WITH SHIFT(0.1,0.5)
DRAW PlotText("£Í£Ó ÌÀÄ«","ÂÀ»ú ¼ÐÂÎ",24,"ABCabc¤¢¤¤¤¦´Á»ú") WITH SHIFT(0.1,0.4)

END

EXTERNAL PICTURE PlotText(f$,a$,s,s$) !¸¶ÅÀ¤ò´ð½à¤Ë¡¢ÂÀ»ú¡ÊBold¡Ë¤ä¼ÐÂΡÊItalic¡Ë¤Çʸ»ú¤òÉÁ¤¯
IF f$<>"" OR s<>0 THEN SET TEXT font f$,s

IF POS(a$,"¼ÐÂÎ")>0 THEN LET a=0.5 ELSE LET a=0
DRAW TEXT(s$) WITH SHEAR(a)

LET dx=worldx(pixelx(0)+1) !£±¥É¥Ã¥È¤º¤é¤¹
LET dy=worldy(pixely(0)+1)
IF POS(a$,"ÂÀ»ú")>0 THEN DRAW TEXT(s$) WITH SHEAR(a)*SHIFT(dx,0)
!IF POS(a$,"ÂÀ»ú")>0 THEN DRAW TEXT(s$) WITH SHEAR(a)*SHIFT(0,dy) !¢¨É¬Íפ˱þ¤¸¤Æ
!IF POS(a$,"ÂÀ»ú")>0 THEN DRAW TEXT(s$) WITH SHEAR(a)*SHIFT(dx,dy) !¢¨É¬Íפ˱þ¤¸¤Æ
END PICTURE

EXTERNAL PICTURE TEXT(s$) !¸¶ÅÀ¤ò´ð½à¤Ëʸ»ú¤òÉÁ¤¯
PLOT TEXT ,AT 0,0: s$
END PICTURE

¤Èʸ»ú¤Î¼Í±ÆÊÑ´¹¤ò»È¤Ã¤Æɽ¼¨¤Ç¤­¤Þ¤¹¡£¹â®ÉÁ²è¤Ë¤Ï¸þ¤­¤Þ¤»¤ó¡£
 

Re: ¥°¥é¥Õ¡¡¤Î°ìÉô¤Îʸ»ú¤ÎÂ礭¤µ

 Åê¹Æ¼Ô¡§Âç·§¡¡Àµ  Åê¹ÆÆü¡§2010ǯ 1·î 9Æü(ÅÚ)15»þ42ʬ29ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.971[¸µµ­»ö¤Ø]

ÇòÀÐÀèÀ¸¡¡»³ÃæÍÍ

Í­Æñ¤¦¤´¤¶¤¤¤Þ¤¹¡£
 

SET COLOR MIX

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2010ǯ 1·î12Æü(²Ð)07»þ12ʬ30ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  SET COLOR MIX(3) 0, .5, 0 !3ÎТª°ÅÎÐ(ÌÀÅÙ50%¡¡10:Ç»¤¤ÎФÈƱ¿§¤Ë¡£)

SET AREA COLOR "red"
SET AREA COLOR "GREEN" !set color mix(3) ¤Ç¡¢GREEN ¤¬ ̵¸ú¤Ë¤Ê¤ê¤Þ¤¹¡£
PLOT AREA:0,0;.5,0;.5,.5;0,.5

SET AREA COLOR 3
PLOT AREA:1,1;.5,1;.5,.5;1,.5

END
 

Re: SET COLOR MIX

 Åê¹Æ¼Ô¡§ÇòÀС¡ÏÂÉ×  Åê¹ÆÆü¡§2010ǯ 1·î12Æü(²Ð)08»þ06ʬ1ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.973[¸µµ­»ö¤Ø]

SET AREA COLOR "GREEN"
¤ò¼Â¹Ô¤¹¤ë¤È256¸Ä¤Î¿§»Øɸ¤Î¤Ê¤«¤é»ØÄꤵ¤ì¤¿¿§¤òõ¤·¤Þ¤¹¡£
¸ºß¤·¤Ê¤¤¤È¤­¤Ï¡¤²¿¤â¤·¤Þ¤»¤ó¡£
 

Re: SET COLOR MIX

 Åê¹Æ¼Ô¡§SECOND  Åê¹ÆÆü¡§2010ǯ 1·î12Æü(²Ð)08»þ11ʬ13ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.974[¸µµ­»ö¤Ø]

¤ï¤«¤ê¤Þ¤·¤¿¡£¿§»Øɸ£³¤Î¥·¥ó¥Ü¥ë¤À¤È»×¤Ã¤Æ¤¤¤Þ¤·¤¿¡£
 

Re: ¥»¥ó¥¿¡¼»î¸³ÄøÅÙ¤Î¥×¥í¥°¥é¥à±é½¬

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2010ǯ 1·î20Æü(¿å)09»þ55ʬ16ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.947[¸µµ­»ö¤Ø]

Á°²ó¤Ë³¤­¥Ù¥¯¥È¥ë¤Î·×»»¤ò¤Ê¤ë¤Ù¤¯¿ô³Øɽµ­¤Ë¶á¤¤¤è¤¦¤Ë¹Ô¤¤¤Þ¤¹¡£
¤µ¤¢¡¢¤³¤Î¥·¥ê¡¼¥º¡¢£²Ç¯ÌܤΥ¹¥¿¡¼¥È¤Ç¤¹¡ª
!Ê¿Ì̾å¤Î¥Ù¥¯¥È¥ëÊýÄø¼°¤È¤½¤Î¥°¥é¥Õ

OPTION ARITHMETIC COMPLEX

DEF v(a,b)=COMPLEX(a,b) !Ê£ÁÇ¿ô¤ÎϺ¹¡¢¼Â¿ôÇܤη׻»¤òÂбþ¤µ¤»¤ë

DEF fnDOT(a,b)=( a*conj(b) + conj(a)*b ) / 2 !ÆâÀÑ¡¡a1*b1+a2*b2
!ÀäÂÐÃÍ¡¡¥Ù¥¯¥È¥ë |a|^2=a¡¦a¡¡¡¡Ê£ÁÇ¿ô |z|^2=z*conj(z)


SET WINDOW -8,8,-8,8 !ɽ¼¨Îΰè¤òÀßÄꤹ¤ë
DRAW grid !XYºÂɸ
ASK PIXEL SIZE (-8,-8; 8,8) w,h !²èÁü¤Î½Ä²£¤ÎÂ礭¤µ(¥É¥Ã¥Èñ°Ì)¤òÄ´¤Ù¤ë

LET cEps=0.1 !ÀºÅÙ¡¡¢¨Ä´À°¤¬É¬ÍפǤ¢¤ë

SET POINT STYLE 1 !ÅÀ¤Î·Á¾õ


!Îã¡¡ÅÀA(1,0)¤òÄ̤ꡢÊý¸þ¥Ù¥¯¥È¥ë(2,3)¤Ç¤¢¤ëľÀþ¤ÎÊýÄø¼°¤òµá¤á¤è¡£
!»²¹Í¡¡Ê£ÁÇ¿ô¤Ë¤è¤ëɽ¸½
!¡¡ÅÀA¡Ê¦Á=a+b*i¡Ë¡¢d¡Ê¦Â=c+d*i¡Ë¤È¤¹¤ë¤È
!¡¡conj(¦Â)*z-¦Â*conj(z)=conj(¦Â)*¦Á-¦Â*conj(¦Á)

LET OA=v(1,0)
LET d=v(2,3)

FOR t=-3 TO 3 !t=[-¡ç,¡ç]¡¡¢¨ÈϰϤÏÄ´À°¤¬É¬ÍפǤ¢¤ë
   LET OP=OA+t*d !(x,y)=(1,0)+t*(2,3)=(1+2*t,3*t)
   PLOT LINES: Re(OP),Im(OP);
NEXT t
PLOT LINES


!Îã¡¡£²ÅÀA(2,5)¡¢B(-1,3)¤ò·ë¤ÖÀþʬAB¤ÎÊýÄø¼°¤òµá¤á¤è¡£
!»²¹Í¡¡Ê£ÁÇ¿ô¤Ë¤è¤ëɽ¸½
!¡¡ÅÀA¡Ê¦Á=a+b*i¡Ë¡¢ÅÀB¡Ê¦Â=c+d*i¡Ë¤È¤¹¤ë¤È¡¢Ä¾ÀþAB¤Ï
!¡¡(conj(¦Â)-conj(¦Á))*z+(¦Â-¦Á)*conj(z)=conj(¦Â)*¦Á-¦Â*conj(¦Á)

LET OA=v(2,5)
LET OB=v(-1,3)

FOR t=0 TO 1 !t=[0,1]
   LET OP=(1-t)*OA+t*OB !(x,y)=(1-t)*(2,5)+t*(-1,3)
   PLOT LINES: Re(OP),Im(OP);
NEXT t
PLOT LINES


!Îã¡¡ÅÀA(2,5)¡¢¥Ù¥¯¥È¥ën=(4,3)¤Ë¿âľ¤ÊľÀþ¤ÎÊýÄø¼°¤òµá¤á¤è¡£¡ÊÆâÀѤòÍѤ¤¤¿É½¸½¡Ë
!»²¹Í¡¡Ê£ÁÇ¿ô¤Ë¤è¤ëɽ¸½
!¡¡ÅÀA¡Ê¦Á=a+b*i¡Ë¡¢n¡Ê¦Â=c+d*i¡Ë¤È¤¹¤ë¤È
!¡¡conj(¦Â)*z+¦Â*conj(z)=conj(¦Â)*¦Á+¦Â*conj(¦Á)

LET a=v(2,5)
LET n=v(4,3)

FOR j=0 TO h !²èÌÌÁ´ÂΤòÁöºº¤¹¤ë
   LET y=worldy(j) !¥É¥Ã¥È¤òxyºÂɸ¤ËÊÑ´¹¤¹¤ë
   FOR i=0 TO w
      LET x=worldx(i)

      LET p=v(x,y) !n¡¦(p-a)=0¤È¤Ê¤ëÅÀP¤Îµ°À×
      IF ABS( fnDOT(n,p-a) )<cEps THEN PLOT POINTS: x,y

   NEXT i
NEXT j


!Îã¡¡ÅÀC(-1,1)¤òÃæ¿´¤È¤¹¤ëȾ·Â3¤Î±ß¤ÎÊýÄø¼°¤òµá¤á¤è¡£
!»²¹Í¡¡Ê£ÁÇ¿ô¤Ë¤è¤ëɽ¸½
!¡¡ÅÀC¡Ê¦Á=a+b*i¡Ë¤È¤¹¤ë¤È¡¢|z-¦Á|=r

LET OC=v(-1,1)
LET r=3

FOR j=0 TO h !²èÌÌÁ´ÂΤòÁöºº¤¹¤ë
   LET y=worldy(j) !¥É¥Ã¥È¤òxyºÂɸ¤ËÊÑ´¹¤¹¤ë
   FOR i=0 TO w
      LET x=worldx(i)

      LET OP=v(x,y) !|p-c|=r¤È¤Ê¤ëÅÀP¤Îµ°À×
      IF ABS( ABS(OP-OC)-r )<cEps THEN PLOT POINTS: x,y

   NEXT i
NEXT j



!Îã¡¡£²ÅÀA(-5,-3)¡¢B(2,4)¤òľ·Â¤È¤¹¤ë±ß¤ÎÊýÄø¼°¤òµá¤á¤è¡£¡ÊÆâÀѤòÍѤ¤¤¿É½¸½¡Ë
!»²¹Í¡¡Ê£ÁÇ¿ô¤Ë¤è¤ëɽ¸½
!¡¡ÅÀA¡Ê¦Á=a+b*i¡Ë¡¢ÅÀB¡Ê¦Â=c+d*i¡Ë¤È¤¹¤ë¤È
!¡¡arg((z-¦Á)/(z-¦Â))=¡ÞPI/2¡¡¤Þ¤¿¤Ï¡¡|z-(¦Á+¦Â)/2|=|¦Á-¦Â|/2

LET OA=v(-5,-3)
LET OB=v(2,4)

FOR j=0 TO h !²èÌÌÁ´ÂΤòÁöºº¤¹¤ë
   LET y=worldy(j) !¥É¥Ã¥È¤òxyºÂɸ¤ËÊÑ´¹¤¹¤ë
   FOR i=0 TO w
      LET x=worldx(i)

      LET OP=v(x,y) !PA¡¦PB=0¡Ê±ß¼þ³Ñ¤ÎÄêÍý¡Ë¤È¤Ê¤ëÅÀP¤Îµ°À×
      IF ABS( fnDOT(OA-OP,OB-OP) )<cEps THEN PLOT POINTS: x,y

   NEXT i
NEXT j


!Îã¡¡ÅÀO(0,0)¡¢A(2,0)¡¢B(1,2)¤È¤·¤Æ¡¢ÅÀP¤òOP=s*OA+t*OB¡¢¼Â¿ôs,t¤È¤¹¤ë¡£
!¡¡­¡1¡ås+t¡å3¡¢0¡ås¡¢0¡åt¤ÎÈϰϤòÆ°¤¯¤È¤­¡¢ÅÀP¤Î¸ºßÈϰϤò¿Þ¼¨¤»¤è¡£
!¡¡­¢2*s+t=1¤òËþ¤¿¤¹¤È¤­¡¢ÅÀP¤Î¸ºßÈϰϤò¿Þ¼¨¤»¤è¡£

LET OA=v(2,0)
LET OB=v(1,2)

FOR s=0 TO 3 STEP 2^(-6) !s¡å3¡¡¢¨¹ï¤ß¤ÏÄ´À°¤¬É¬ÍפǤ¢¤ë
   FOR t=0 TO 3 STEP 2^(-6) !0¡ås¤è¤ê¡¢s+t¡å3¡å3+s¤È¤Ê¤ë¡£¤³¤ì¤è¤ê¡¢t¡å3
      IF 1<=s+t AND s+t<=3 THEN !­¡
         LET OP=s*OA+t*OB
         PLOT POINTS: Re(OP),Im(OP)
      END IF
   NEXT t
NEXT s

FOR s=-4 TO 4 STEP 2^(-6) !t=[-¡ç,¡ç]¡¡¢¨ÈϰϤȹï¤ß¤ÏÄ´À°¤¬É¬ÍפǤ¢¤ë
   LET t=1-2*s !2*s+t=1¤è¤ê
   LET OP=s*OA+t*OB
   PLOT POINTS: Re(OP),Im(OP) !­¢
NEXT s


!Îã¡¡£Ø¼´¾å¤òž¤¬¤ëȾ·Â1¤Î±ß¤Î±ß¼þ¾å¤ÎÅÀP¤Îµ°Àסʥµ¥¤¥¯¥í¥¤¥É¡Ë

LET r=1
FOR t=-3*PI TO 3*PI STEP 0.1 !¢¨ÈϰϤȹï¤ß¤ÏÄ´À°¤¬É¬ÍפǤ¢¤ë
   LET OA=v(r*t,r) !Ãæ¿´A¡¢£Ø¼´¤È¤ÎÀÜÅÀB¤È¤¹¤ë¤È¡¢OB=¸ÌBP¤è¤ê
   LET AP=v(-r*SIN(t),-r*COS(t))
   LET OP=OA+AP !ÅÀP¤Îµ°À×
   PLOT LINES: Re(OP),Im(OP);
NEXT t
PLOT LINES


END
 

¥Æ¥­¥¹¥È¥¢¡¼¥È¤ÎºîÀ®°ÍÍê

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2010ǯ 1·î22Æü(¶â)10»þ34ʬ41ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¼Ì¿¿¤ò¥¹¥­¥ã¥Ê¡¼¤ÇÆɤ߼è¤ê¡¢¤½¤Î¥Ó¥Ã¥È¤ËÂбþ¤¹¤ëǻø¤«¤é¤³¤ì¤ËÂбþ¤¹¤ë¡Éʸ»ú¡É¡Ê´Á»ú¤ò´Þ¤à¡Ë¤ò³ä¤êÅö¤Æ¡¢¸µ¤Î¥¤¥á¡¼¥¸¤ò¤¹¤Ù¤Æʸ»ú¤ÎÍåÎó¤Ë¤Æ¤½¤Î²è¤òºî¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤ç¤¦¤«¡©
¤Ç¤­¤¿¤é²££·£°Ê¸»ú¡¢½Ä£·£µÊ¸»ú¤Û¤É¤ÎÂ礭¤µ¤¬Íߤ·¤¤¤Ç¤¹¡£
 

Re: ¥Æ¥­¥¹¥È¥¢¡¼¥È¤ÎºîÀ®°ÍÍê

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2010ǯ 1·î22Æü(¶â)11»þ09ʬ48ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.977[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

>¼Ì¿¿¤ò¥¹¥­¥ã¥Ê¡¼¤ÇÆɤ߼è¤ê¡¢¤½¤Î¥Ó¥Ã¥È¤ËÂбþ¤¹¤ëǻø¤«¤é

ľÀÜ¥¹¥­¥ã¥Ê¤«¤é¤ÏÉÔ²Äǽ¤Ç¤¹¤¬¡¢²èÁü¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤à¤Î¤Ê¤é²Äǽ¤Ç¤¹¡£

¡Ö¥«¥é¡¼²èÁü¤Î³Æ£±¥Ô¥¯¥»¥ë¤ò¥â¥Î¥È¡¼¥ó¡Êǻø¡Ë¤ËÊÑ´¹¤·¤Æ¡¢£±Ê¸»ú¤Çɽ¸½¤¹¤ë¡×¤Ê¤é
²áµî·Ç¼¨ÈÄ¡Ö²èÁü¤ò¥Æ¥­¥¹¥È¥¢¡¼¥È¤Ë¤¹¤ë¡×¡Ê¸µµ­»ö¡Ë¤ò»²¾È¤Î¤³¤È¡£
¥É¥é¥¤¥Ö C ¤Î¥Õ¥©¥ë¥À My Documents ¤Ë¡¢TEXTART.HTM ¤¬ºîÀ®¤µ¤ì¤Þ¤¹¡£


>¤Ç¤­¤¿¤é²££·£°Ê¸»ú¡¢½Ä£·£µÊ¸»ú¤Û¤É¤ÎÂ礭¤µ¤¬Íߤ·¤¤¤Ç¤¹¡£

¥â¥¶¥¤¥¯½èÍý¤Ë¤Ê¤ë¤Î¤Ç¤·¤ç¤¦¤«¡©
 

Re: ¥Æ¥­¥¹¥È¥¢¡¼¥È¤ÎºîÀ®°ÍÍê

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2010ǯ 1·î23Æü(ÅÚ)06»þ28ʬ45ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.978[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¥É¥é¥¤¥Ö C ¤Î¥Õ¥©¥ë¥À My Documents ¤Ë¡¢TEXTART.HTM ¤¬ºîÀ®¤µ¤ì¤Þ¤¹¡£

¤¹¤Ð¤é¤·¤¤¤Î°ì¸À¤Ç¤¹¡£
¤¿¤À¤³¤ì¤ò¸«¤ë¤È²èÌÌ°ìÌ̤ˤʤꡢÁ´ÂÎÁü¤ò¸«¤ë¤Î¤Ë¶ìÏ«¤·¤Þ¤¹¡£
¤³¤ì¤ò¥Æ¥­¥¹¥ÈÊÔ½¸¤ä¡¢Â礭¤µ¤òÊѹ¹¤Ç¤­¤¿¤ê¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¤«¡©



> ¥â¥¶¥¤¥¯½èÍý¤Ë¤Ê¤ë¤Î¤Ç¤·¤ç¤¦¤«¡©
B5ÈǤäA4ÈǤÎÍÑ»æ¤ÇÁ´ÂΤò°õºþ¤¹¤ë°Ì¤ÎÂ礭¤µ¤¬¤¤¤¤¤Î¤Ç¤¹¤¬¡¦¡¦¡¦
¤Ê¤ª¡¢¾åµ­¤Î²èÌ̤ò¥³¥Ô¡¼¤·¤Æ¥á¥âÄ¢¤ËŽ¤êÉÕ¤±¤è¤¦¤È¤·¤¿¤é¤¦¤Þ¤¯¤¤¤«¤Ê¤¤¤Î¤Ç¤¹¤¬¤É¤¦¤·¤¿¤é¤¤¤¤¤Î¤Ç¤¹¤«¡©
 

Re: ¥Æ¥­¥¹¥È¥¢¡¼¥È¤ÎºîÀ®°ÍÍê

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2010ǯ 1·î23Æü(ÅÚ)09»þ39ʬ55ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.979[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

> ¤¿¤À¤³¤ì¤ò¸«¤ë¤È²èÌÌ°ìÌ̤ˤʤꡢÁ´ÂÎÁü¤ò¸«¤ë¤Î¤Ë¶ìÏ«¤·¤Þ¤¹¡£

¥É¥Ã¥È¡¦¤òʸ»ú¢£¤Ë³ÈÂçɽ¼¨¤¹¤ë¤Î¤ÇÂ礭¤¯¤Ê¤ë¤Î¤Ï¡¢¡¢¡¢


> ¤³¤ì¤ò¥Æ¥­¥¹¥ÈÊÔ½¸¤ä¡¢Â礭¤µ¤òÊѹ¹¤Ç¤­¤¿¤ê¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¤«¡©

HTMLʸ½ñ¡Ê³ÈÄ¥»Ò.HTM¡Ë¤Ç¤¹¤Î¤Ç¡¢¡Ê¥¤¥ó¥¿¡¼¥Í¥Ã¥È¡Ë¥Ö¥é¥¦¥¶¤Çɽ¼¨¤·¤Æ¤¤¤ë¤È»×¤¤¤Þ¤¹¡£
¤·¤¿¤¬¤Ã¤Æ¡¢¥Ö¥é¥¦¥¶¤Îɽ¼¨¤ä°õ»úµ¡Ç½¡Êʸ»ú¤ò¾®¤µ¤¯¤·¤¿¤ê¡¢°õ»ú¥×¥ì¥Ó¥å¡¼¤Ê¤É¡Ë¤Ç
Âн褷¤Æ¤¯¤À¤µ¤¤¡£
¸µ²èÁü¤¬200¡ß150¥Ô¥¯¥»¥ë¤Ê¤é¡¢Ê¸»ú¥µ¥¤¥º¤òºÇ¾®¤Ë¤¹¤ì¤Ð¡¢¤Û¤ÜÁ´ÂΤ¬É½¼¨¤Ç¤­¤ë¤È»×¤¤¤Þ¤¹¡£


> ¾åµ­¤Î²èÌ̤ò¥³¥Ô¡¼¤·¤Æ¥á¥âÄ¢¤ËŽ¤êÉÕ¤±¤è¤¦¤È¤·¤¿¤é

¥á¥âÄ¢¤Ï¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤¬32KB¤Þ¤Ç¤Ê¤Î¤Ç¡¢¥ï¡¼¥É¥Ñ¥Ã¥É¤«¥ï¡¼¥×¥í¥½¥Õ¥È¤Ç°·¤¤¤Þ¤¹¡£


> ¥â¥¶¥¤¥¯½èÍý¤Ë¤Ê¤ë¤Î¤Ç¤·¤ç¤¦¤«¡©¡Ê¼«Åú¡Ë

¥Æ¥­¥¹¥È¥¢¡¼¥È
¡¡¥â¥Î¥È¡¼¥ó²èÁü¤Î£±¥Ô¥¯¥»¥ë¡Ê¥É¥Ã¥È¡Ë¤ò£±Ê¸»ú¤ËÃÖ¤­´¹¤¨¤ë
¡¡¡¡Ç»¤¤¡ü¡¡¢ª¡¡¡¡¡ü¡¡¤ä¡¡¡ý
¡¡¡¡Ã¸¤¤¡ü¡¡¢ª¡¡¡¡¡û¡¡¤ä¡¡£°¡¡¤ä¡¡£Ï

¡¡¡¡¤¿¤È¤¨¤Ð¡¢256³¬Ä´¡Êǻø¡Ë¤Ê¤é256ʸ»ú¡ÊÀþ¤ÎÌ©Å٥ѥ¿¡¼¥ó¡Ë¤òÍÑ°Õ¤¹¤ë


¥¢¥¹¥­¡¼¥¢¡¼¥È
¡¡£²ÃͲèÁü¤Î¤¿¤È¤¨¤Ð£´¡ß£´¥Ô¥¯¥»¥ë¡Ê¥É¥Ã¥È¡Ë¤ò£±Ê¸»ú¤ËÃÖ¤­´¹¤¨¤ë
¡¡¡¡¢£¢¢¢¢¢£
¡¡¡¡¢¢¢£¢£¢¢¡¡¢ª¡¡£Ø¡¡¤ä¡¡£Ë
¡¡¡¡¢£¢£¢£¢¢
¡¡¡¡¢£¢¢¢¢¢£¡¡¡¡¡¡¡¡¹â¡¹2^16Ä̤ê¤Îʸ»ú¡ÊÀþ¤Î·Á¾õ¥Ñ¥¿¡¼¥ó¡Ë¤òÍÑ°Õ¤¹¤ë
 

¿ÇÜĹLOG(5)¤òµá¤á¤ë

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2010ǯ 1·î23Æü(ÅÚ)19»þ18ʬ26ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¿ÇÜĹ LOG(5)¤òµá¤á¤ë

(µì·Ç¼¨ÈÄ¡¢Åê¹Æ¥Í¥¿¤«¤é¤Î·¡¤êµ¯¤·¤Ç¤¹)

T=1-X/2^N (0<T<=1) ¤È¤·¤Æ
  LOG(1-T)=-(T+T^2/2+T^3/3+T^4/4+...)
  LOG(X)=LOG(T)+N*LOG(2)

Ëô¤Ï

T=X/2^(N-1) (1<T<=2) ¤È¤·¤Æ
  LOG((1+U)/(1-U))=2*(U+U^3/3+U^5/5...) U=(T-1)/(T+1)
  LOG(X)=LOG(T)+(N-1)*LOG(2)

¤È¤·¤Æµá¤á¤ë¡£
   ¤Ê¤ª¡¢LOG(2)¤Ïͽ¤á¡¢ÍÑ°Õ¤·¤Æ¤ª¤¯

¼Â¹Ô¤Ë¤Ï¡¢2¿Ê¥â¡¼¥É¤ò¤´»ÈÍѤ¯¤À¤µ¤¤¡£

PUBLIC NUMERIC BIAS, KETA, SIGN, EPS
INPUT  PROMPT "·å¿ô=":KETA !' 2000·å¤Þ¤Ç
LET  KETA = INT(KETA/4)
LET  EPS = 5  !'·×»»¸íº¹Ê¬(4*EPS ·å)
LET  BIAS = 0 !'10000 ^ (BIAS+1) ¤Þ¤Ç
LET  KETA = KETA + EPS !'10000 ^ (-KETA) ¤Þ¤Ç
LET  SIGN = -BIAS - 1  !'¿ÇÜĹ¿ôÉä¹æ A(SIGN)=1... Àµ  A(SIGN)=-1...Éé
DIM A(-BIAS-1 TO KETA)
LET X=5
!'INPUT  PROMPT "LOG(X) X=":X
CALL SLOG(X,A)
CALL DISPLAY2(A)
END

EXTERNAL  SUB SLOG(X,S())
DIM A(-BIAS-1 TO KETA)
FOR I=1 TO 32
   IF X<=2^I THEN EXIT FOR
NEXT I
IF (2^I-X)/2^I<(X-2^(I-1))/2^(I-1) THEN
   CALL SLOG2(X,S)
ELSE
   CALL SLOG3(X,S)
END IF
END SUB

EXTERNAL  SUB SLOG2(AX, X()) !'LOG(1-T) T=1-X/2^N (0<T<=1) ¢ª LOG((2^N-X)/2^N)
IF AX < 0 THEN
   PRINT "ERROR in SLOG2"
   STOP
END IF
DIM U(-BIAS - 1 TO KETA), V(-BIAS - 1 TO KETA), S(-BIAS - 1 TO KETA), N(-BIAS - 1 TO KETA)
LET NN= 1
LET U(0) = 1
LET U(SIGN) = 1
LET S(SIGN) = 1
LET  F = 1
DO WHILE 2 ^ F < AX
   LET  F = F + 1
LOOP
LET XX = 2 ^ F - AX
LET XA = 2 ^ F
CALL LN2(N)
CALL SMUL(N,F)
IF XX=0 THEN
   CALL LCOPY(X,N)
   EXIT SUB
END IF
DO
   CALL SMUL(U,XX)
   CALL SDIV(U,XA)
   CALL LCOPY(V, U)
   CALL SDIV(V, NN)
   CALL LADD2(S, V)
   LET  NN = NN+ 1
LOOP UNTIL ZERO(V)<>0
CALL LSUB (N, S, X)
END SUB

EXTERNAL  SUB SLOG3(XA, X()) !'LOG((T-1)/(T+1)) T=X/2^N (1<T<=2) ¢ª LOG((X-2^N)/(X+2^N))
IF XA < 0 THEN
   PRINT "ERROR in SLOG3"
   STOP
END IF
DIM D(-BIAS - 1 TO KETA)
DIM M(-BIAS - 1 TO KETA), S(-BIAS - 1 TO KETA)
DO
   LET K=K+1
LOOP WHILE 2 ^ (K+1) < XA
IF XA - 2 ^ (K+1) = 0  THEN
   CALL LN2(X)
   CALL SMUL(X,K+1)
   EXIT SUB
END IF
LET  N = 1
CALL LCLR (X)
LET  X(0) = XA - 2^K
LET  X(SIGN) = 1
CALL SDIV(X,XA+2^K)
CALL LCOPY(S, X)
DO
   CALL LCOPY(M, S)
   CALL SMUL(X,(XA-2^K)^2)
   CALL SDIV(X,(XA+2^K)^2)
   CALL LCOPY(D, X)
   LET  N = N + 2
   CALL SDIV(D, N)
   CALL LADD2(S, D)
LOOP UNTIL EQUAL(M, S)<>0
CALL SMUL(S,2)
CALL LN2(D)
CALL SMUL(D,K)
CALL LADD(D,S,X)
END SUB

EXTERNAL  SUB LN2(X()) !' LOG(2) (2000·åʬ)
CALL LCLR (X)
LET X(SIGN)=1
FOR I = 1 TO KETA
   READ IF MISSING THEN EXIT FOR:X(I)
NEXT I
DATA 6931,4718,0559,9453,0941,7232,1214,5817,6568,0755,0013,4360,2552,5412,0680,0094,9339,3621,9696,9471,5605,8633,2699,6418,6875
DATA 4200,1481,0205,7068,5733,6855,2023,5758,1305,5703,2670,7516,3507,5961,9307,2757,0828,3714,3519,0307,0386,2389,1673,4711,2335
DATA 0115,3644,9795,5239,1204,7517,2681,5749,3206,5155,5247,3413,9525,8829,5045,3007,0953,2636,6642,6541,0423,9157,8149,5204,3740
DATA 4303,8550,0801,9441,7064,1671,5186,4471,2839,9681,7178,4546,9570,2627,1631,0645,4615,0257,2074,0248,1637,7733,8963,8550,6952
DATA 6066,8341,1372,7387,3722,9289,5649,3547,0257,6265,2098,8596,9320,1965,0585,5476,4703,3067,9365,4432,5476,3274,4951,2504,0606
DATA 9438,1471,0468,9946,5062,2016,7720,4245,2452,9612,6879,4654,6193,1651,7468,1392,6725,0410,3802,5462,5965,6869,1441,9287,1608
DATA 2938,0317,2714,3677,8265,4877,5664,8508,5674,0776,4845,1464,4399,4046,1422,6031,9309,6735,4025,7444,6070,3080,9608,5047,4866
DATA 3852,3138,1816,7675,1438,6674,7664,7890,8814,3714,1985,4942,3151,9973,5488,0375,1658,6127,5352,9166,1000,7105,3558,2498,7941
DATA 4729,5092,9311,3897,1559,9820,5654,3928,7170,0072,1808,5761,0252,3688,9213,2449,7138,9320,3784,3935,3088,7748,2597,0171,5591
DATA 0708,8236,8362,7589,8425,8918,5353,0243,6342,1436,7061,1892,3678,9192,3723,1467,2321,7205,3401,6492,5687,2747,7823,4453,5347
DATA 6481,1494,1864,2386,7767,7440,6069,5626,5737,9600,8670,7625,7199,1847,3402,2651,4628,3790,4883,0620,3306,1144,6300,7371,9489
DATA 0027,4364,3965,0025,8093,6519,4430,4119,1150,6080,9487,9306,7865,1588,7090,0605,2034,6842,9736,1938,4128,9652,5565,3968,6022
DATA 1941,2292,4207,5743,2175,7489,0977,0675,2687,1158,1705,1137,0091,5894,2665,4785,9596,4890,6530,5846,0258,6683,8294,0022,8330
DATA 0538,2074,0056,7705,3046,7870,0184,1624,0441,8833,2327,9838,6349,0015,6312,1889,5606,5055,3151,2721,9939,8332,0307,5140,8426
DATA 0914,7900,1265,1682,4344,3893,5724,7278,8205,4862,7155,2741,8772,4300,2489,7945,4019,6187,2339,8086,0831,6648,1149,0930,6675
DATA 1933,9312,8904,3164,1370,6813,9777,6498,1769,7486,8903,8877,8999,1296,5036,1927,0710,8892,6410,5230,9247,8391,7373,5012,2984
DATA 2420,4995,6893,5992,2066,0220,4654,9415,1061,3918,7885,7442,4557,7510,2068,3703,0866,6194,8089,6412,1868,0779,0208,1815,8858
DATA 0001,6881,1597,3056,1866,7619,9187,3952,0076,6719,2145,9223,6720,6025,3959,5436,5416,5531,1295,1759,8994,0056,0003,6651,3567
DATA 5690,5124,5926,8257,4394,6483,1683,3262,4901,8038,2424,0824,2314,5230,6140,9638,0570,0702,5513,8770,2681,7851,6306,9025,5137
DATA 0323,4053,8021,4501,9015,3740,2950,9942,2629,9577,9647,4271,3815,7363,8017,2987,3940,7042,4217,9972,2669,6297,9939,3127,0693
DATA 5747,2404,9338,6530,8797
END SUB

!'°Ê²¼¡¢Â¿ÇÜĹ·×»»¶¦Ḁ̈롼¥Á¥ó  (¿ÇÜĹLOG(¦Ð)¤òµá¤á¤ë¡¢¤Ç¤â»ÈÍÑ)

EXTERNAL  SUB DISPLAY2(X()) !'ɽ¼¨
FOR K=-BIAS TO 0
   IF X(K)<>0 THEN EXIT FOR
NEXT K
IF X(SIGN) = -1 THEN PRINT "- ";
IF K>=0 THEN
   LET K=0
   PRINT STR$(X(0));"."
ELSE
   PRINT STR$(X(K));
   FOR I=K+1 TO 0
      LET A$=A$ & RIGHT$("000"&STR$(X(I)),4)
      IF LEN(A$) = 100 THEN
         PRINT A$
         LET A$=""
      END IF
   NEXT I
   IF LEN(A$) > 0 THEN
      PRINT A$;"."
      LET A$=""
   END IF
END IF
LET S=0
FOR I=1 TO KETA-EPS
   LET A$=A$ & RIGHT$("000"&STR$(X(I)),4)
   IF LEN(A$) = 100 THEN
      LET S=S+100
      FOR J=1 TO 10
         PRINT LEFT$(A$,10);" ";
         IF J=5 THEN PRINT "   ";
         LET A$=RIGHT$(A$,LEN(A$)-10)
      NEXT J
      PRINT ":";S
      LET A$=""
      IF MOD(S,1000)=0 THEN PRINT
   END IF
NEXT I
IF LEN(A$) > 0 THEN
   LET S=S+LEN(A$)
   LET A$=A$ & REPEAT$(" ",10)
   FOR J=1 TO 9
      PRINT RTRIM$(LEFT$(A$,10));" ";
      IF J=5 THEN PRINT "   ";
      LET A$=RIGHT$(A$,LEN(A$)-10)
      IF RTRIM$(A$)="" THEN EXIT FOR
   NEXT J
   !'  PRINT ":";S
END IF
END SUB

EXTERNAL  FUNCTION EQUAL(A(), B()) !'Åù¤·¤¤¤«¤É¤¦¤«
FOR I = -BIAS - 1 TO KETA-EPS
   IF A(I)<>B(I) THEN
      LET EQUAL=0
      EXIT FUNCTION
   END IF
NEXT I
LET EQUAL=-1
END FUNCTION

EXTERNAL  FUNCTION ZERO(A()) !'0Ãͤ«¤É¤¦¤«
FOR I=-BIAS TO KETA-EPS
   IF A(I)<>0 THEN
      LET ZERO=0
      EXIT FUNCTION
   END IF
NEXT I
LET ZERO=-1
END FUNCTION

EXTERNAL  FUNCTION GREAT(A(), B()) !'¿ÇÜĹ¿ôA > ¿ÇÜĹ¿ôB ¤Ê¤é¿¿
LET  SIGNA = A(SIGN)
LET  SIGNB = B(SIGN)
IF SIGNA = -1 AND SIGNB = 1 THEN
   LET  GREAT = 0
   EXIT FUNCTION
END IF
IF SIGNA = 1 AND SIGNB = -1 THEN
   LET  GREAT = -1
   EXIT FUNCTION
END IF
FOR I = -BIAS TO KETA
   IF SIGNA = -1 AND SIGNB = -1 THEN
      IF A(I) < B(I) THEN
         LET  GREAT = -1
         EXIT FUNCTION
      END IF
      IF A(I) > B(I) THEN
         LET  GREAT = 0
         EXIT FUNCTION
      END IF
   ELSE
      IF A(I) > B(I) THEN
         LET  GREAT = -1
         EXIT FUNCTION
      END IF
      IF A(I) < B(I) THEN
         LET  GREAT = 0
         EXIT FUNCTION
      END IF
   END IF
NEXT I
END FUNCTION
 

Re: ¿ÇÜĹLOG(5)¤òµá¤á¤ë

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2010ǯ 1·î23Æü(ÅÚ)19»þ19ʬ36ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.981[¸µµ­»ö¤Ø]

³¤­

EXTERNAL  SUB LCLR(A()) !'0ÃÍ¥»¥Ã¥È
MAT A=ZER
LET  A(SIGN) = 1
END SUB

EXTERNAL  SUB LCOPY(A(), B()) !'ÃÍ¥³¥Ô¡¼
MAT A=B
END SUB

EXTERNAL  SUB LADD(A(), B(), C()) !'¿ÇÜĹƱ»Î¤Î²Ã»» C=A+B
LET  SIGNA = A(SIGN)
LET  SIGNB = B(SIGN)
IF SIGNA = 1 AND SIGNB = -1 THEN
   LET  B(SIGN) = 1
   CALL LSUB (A, B, C)
   LET  B(SIGN) = -1
   EXIT SUB
ELSEIF SIGNA = -1 AND SIGNB = 1 THEN
   LET  A(SIGN) = 1
   CALL LSUB (B, A, C)
   LET  A(SIGN) = -1
   EXIT SUB
END IF
MAT C=A+B
FOR I = KETA TO -BIAS + 1 STEP -1
   IF C(I) >= 10000 THEN
      LET  C(I) = C(I) - 10000
      LET  C(I - 1) = C(I - 1) + 1
   END IF
NEXT I
IF C(-BIAS) >= 10000 THEN
   PRINT "OVER FLOW in LADD"
   STOP
END IF
IF SIGNA = -1 AND SIGNB = -1 THEN LET  C(SIGN) = -1 ELSE LET  C(SIGN) = 1
END SUB

EXTERNAL  SUB LADD2(A(),B()) !'¿ÇÜĹƱ»Î¤Î²Ã»» A=A+B
DIM C(-BIAS-1 TO KETA)
CALL LADD(A,B,C)
CALL LCOPY(A,C)
END SUB

EXTERNAL  SUB LSUB (A(), B(), C())!'¿ÇÜĹƱ»Î¤Î¸º»» C=A-B
LET  SIGNA = A(SIGN)
LET  SIGNB = B(SIGN)
LET  A(SIGN) = 1
LET  B(SIGN) = 1
IF SIGNA * SIGNB = -1 THEN
   CALL LADD (A, B, C)
   LET  C(SIGN) = SIGNA
   LET  A(SIGN) = SIGNA
   LET  B(SIGN) = SIGNB
   EXIT SUB
END IF
LET  GR = GREAT(A, B)
IF SIGNA = 1 AND SIGNB = 1 THEN
   IF GR<>0 THEN
      MAT C=A-B
      LET  C(SIGN) = 1
   ELSE
      MAT C=B-A
      LET  C(SIGN) = -1
   END IF
ELSE
   IF GR<>0 THEN
      MAT C=B-A
      LET  C(SIGN) = 1
   ELSE
      MAT C=A-B
      LET  C(SIGN) = -1
   END IF
END IF
FOR I = KETA TO -BIAS + 1 STEP -1
   IF C(I) < 0 THEN
      LET  C(I) = C(I) + 10000
      LET  C(I - 1) = C(I - 1) - 1
   END IF
NEXT I
LET  A(SIGN) = SIGNA
LET  B(SIGN) = SIGNB
END SUB

EXTERNAL  SUB LSUB2(A(),B()) !'¿ÇÜĹƱ»Î¤Î¸º»» A=A-B
DIM C(-BIAS-1 TO KETA)
CALL LSUB(A,B,C)
CALL LCOPY(A,C)
END SUB

EXTERNAL  SUB SDIV (A(), XA) !'³ä¤ê»»  Â¿ÇÜĹ¿ôA = ¿ÇÜĹ¿ôA / À°¿ôXA (1E+10ÄøÅÙ¤Þ¤Ç)
IF XA=0 THEN
   PRINT "ERROR in SDIV"
   STOP
END IF
LET  SIGNA = A(SIGN)
LET  SG = SGN(XA)
LET  XX = ABS(XA)
FOR I = -BIAS TO KETA - 1
   LET  R = A(I) - INT(A(I) / XX) * XX
   LET  A(I) = INT(A(I) / XX)
   LET  A(I + 1) = A(I + 1) + R * 10000
NEXT I
LET  A(KETA) = INT(A(KETA) / XX)
LET  A(SIGN) = SIGNA * SG
END SUB

EXTERNAL  SUB SMUL (A(), XA)!'³Ý¤±»»  Â¿ÇÜĹ¿ôA = ¿ÇÜĹ¿ôA * À°¿ôXA (1E+10ÄøÅÙ¤Þ¤Ç)
LET  SIGNA = A(SIGN)
IF XA >= 0 THEN LET SG=1 ELSE LET SG=-1
LET  XX = ABS(XA)
MAT A=(XX)*A
FOR I = KETA TO -BIAS + 1 STEP -1
   IF A(I) >= 10000 THEN
      LET  R = INT(A(I) / 10000)
      LET  A(I) = A(I) - 10000 * R
      LET  A(I - 1) = A(I - 1) + R
   END IF
NEXT I
IF A(-BIAS) >= 10000 THEN
   PRINT "OVER FLOW in SMUL"
   STOP
END IF
LET  A(SIGN) = SIGNA * SG
END SUB
 

¿ÇÜĹLOG(2)¤òµá¤á¤ë

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2010ǯ 1·î23Æü(ÅÚ)19»þ21ʬ2ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¿ÇÜĹ LOG(2)¤òµá¤á¤ë

Á°½Ò¤Î·×»»ÊýË¡¤Ç¤ÏÊÌÅÓ¡¢LOG(2)Ãͤ¬É¬ÍפȤʤë

·×»»¼°¤Ë

    LOG((1+1/X)/(1-1/X))=LOG((X+1)/(X-1)=2*(1/X+1/(3*X^3)+1/(5*X^5)+1/(7*X^7)+...)

¤ò»ÈÍѤ·¡¢°Ê²¼¤Î´Ø·¸¼°

    LOG(2) = 3 * LOG(81/80) + 5 * LOG(25/24) + 7 * LOG(16/15)

¤ò»È¤Ã¤ÆLOG(2)¤òµá¤á¤ë¡£

¤Ê¤ª¡¢LOG(5)¤òľÀܵá¤á¤ë¤Î¤Ê¤é¡¢¾å¤Î·×»»¼°¤È´Ø·¸¼°

    LOG(5) = 7 * LOG(81/80) + 4 * LOG(16/15) + 12 * LOG(10/9)

¤ò»È¤Ã¤Æµá¤á¤ë¤³¤È¤¬¤Ç¤­¤ë¡£

PUBLIC NUMERIC KETA,BIAS,EPS
INPUT  PROMPT "·å¿ô=":KETA
LET  KETA=INT(KETA/4)
LET  EPS=2
LET  BIAS=0
LET  KETA=KETA+EPS
OPTION BASE 0
DIM S(KETA),A(KETA),B(KETA),C(KETA),AA(KETA),BB(KETA),CC(KETA),M(KETA)
LET  N = 1
LET A(0)=3
LET B(0)=5
LET C(0)=7
FOR I = 0 TO KETA - 1
   LET  R = A(I) - INT(A(I) / 161) * 161
   LET  A(I) = INT(A(I) / 161)
   LET  A(I + 1) = A(I + 1) + R * 10000
   LET  R = B(I) - INT(B(I) / 49) * 49
   LET  B(I) = INT(B(I) / 49)
   LET  B(I + 1) = B(I + 1) + R * 10000
   LET  R = C(I) - INT(C(I) / 31) * 31
   LET  C(I) = INT(C(I) / 31)
   LET  C(I + 1) = C(I + 1) + R * 10000
NEXT I
LET  A(KETA) = INT(A(KETA) / 161)
LET  B(KETA) = INT(B(KETA) / 49)
LET  C(KETA) = INT(C(KETA) / 31)
MAT S=S+A
MAT S=S+B
MAT S=S+C
FOR I = KETA TO 0 STEP -1
   IF S(I) >= 10000 THEN
      LET  R = INT(S(I) / 10000)
      LET S(I)=S(I)-R*10000
      LET  S(I - 1) = S(I - 1) + R
   END IF
NEXT I
DO
   FOR I = 0 TO KETA - 1
      LET  R = A(I) - INT(A(I) / 25921) * 25921
      LET  A(I) = INT(A(I) / 25921)
      LET  A(I + 1) = A(I + 1) + R * 10000
      LET  R = B(I) - INT(B(I) / 2401) * 2401
      LET  B(I) = INT(B(I) / 2401)
      LET  B(I + 1) = B(I + 1) + R * 10000
      LET  R = C(I) - INT(C(I) / 961) * 961
      LET  C(I) = INT(C(I) / 961)
      LET  C(I + 1) = C(I + 1) + R * 10000
   NEXT I
   LET  A(KETA) = INT(A(KETA) / 25921)
   LET  B(KETA) = INT(B(KETA) / 2401)
   LET  C(KETA) = INT(C(KETA) / 961)
   MAT AA=A
   MAT BB=B
   MAT CC=C
   LET N=N+2
   FOR I = 0 TO KETA - 1
      LET  R = AA(I) - INT(AA(I) / N) * N
      LET  AA(I) = INT(AA(I) / N)
      LET  AA(I + 1) = AA(I + 1) + R * 10000
      LET  R = BB(I) - INT(BB(I) / N) * N
      LET  BB(I) = INT(BB(I) / N)
      LET  BB(I + 1) = BB(I + 1) + R * 10000
      LET  R = CC(I) - INT(CC(I) / N) * N
      LET  CC(I) = INT(CC(I) / N)
      LET  CC(I + 1) = CC(I + 1) + R * 10000
   NEXT I
   LET  AA(KETA) = INT(AA(KETA) / N)
   LET  BB(KETA) = INT(BB(KETA) / N)
   LET  CC(KETA) = INT(CC(KETA) / N)
   MAT S=S+AA
   MAT S=S+BB
   MAT S=S+CC
   FOR I = KETA TO 0 STEP -1
      IF S(I) >= 10000 THEN
         LET  R = INT(S(I) / 10000)
         LET  S(I)=S(I)-R*10000
         LET  S(I - 1) = S(I - 1) + R
      END IF
   NEXT I
   FOR J = 0 TO KETA
      IF S(J)<>M(J) THEN
         MAT  M = S
         LET K=J
         EXIT FOR
      END IF
   NEXT J
LOOP WHILE J<=KETA-EPS
MAT S=2*S
FOR I = KETA TO 0 STEP -1
   IF S(I) >= 10000 THEN
      LET  S(I) = S(I) - 10000
      LET  S(I - 1) = S(I - 1) + 1
   END IF
NEXT I
CALL WRITEDATA(S,"")
END

EXTERNAL  SUB WRITEDATA(X(),Z$)
IF Z$="" THEN OPEN #1:TextWindow1 ELSE OPEN #1:NAME Z$
ERASE #1
FOR KK=-BIAS TO KETA
   IF X(KK)<>0 THEN EXIT FOR
NEXT KK
PRINT #1:"SUB LN2(X())"
PRINT #1:"CALL LCLR(X)"
PRINT #1:"LET X(SIGN)=1"
PRINT #1:"FOR I=";STR$(KK);" TO KETA"
PRINT #1:"READ IF MISSING THEN EXIT FOR:X(I)"
PRINT #1:"NEXT"
PRINT #1:"DATA ";
FOR I=KK TO KETA-EPS-1
   LET K=K+1
   IF MOD(K,25)=0  THEN
      PRINT #1:RIGHT$("000"&STR$(X(I)),4)
      PRINT #1:"DATA ";
   ELSE
      PRINT #1:RIGHT$("000"&STR$(X(I)),4);
      IF I<>0 THEN PRINT #1:",";
   END IF
   IF -BIAS<=0 AND I=0 THEN
      PRINT #1
      PRINT #1:"DATA ";
      LET K=0
   END IF
NEXT I
PRINT #1:RIGHT$("000"&STR$(X(KETA-EPS)),4)
PRINT #1:"END SUB"
CLOSE #1
END SUB
 

¿ÇÜĹLOG(¦Ð)¤òµá¤á¤ë

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2010ǯ 1·î23Æü(ÅÚ)19»þ22ʬ46ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¿ÇÜĹ LOG(¦Ð)¤òµá¤á¤ë (2000·å)

·×»»¼°¤Ë

    LOG(1 - X) = -(X + X^2/2 + X^3/3 + X^4/4 +...)

¤ò»ÈÍѤ·¤¿¡£

X ¤Ï»î¹Ôºø¸í¤·¤¿·ë²Ì

     X = 1 - 544482330679994391053312457583 / 1710541690073718870111737129379 * ¦Ð

¤È¤·¤¿¡£·×»»¸å¤Ë

  LOG(17105416...) - LOG(54448233...)¤ò²Ã»»¤·¤Æ¡¢LOG(¦Ð)¤òµá¤á¤ë¡£

¤Þ¤¿¡¢·×»»»þ´Öû½Ì¤Î¤¿¤á¡¢¦Ð¡¢LOG(17105416...)¡¢LOG(54448233...)ÃͤÏͽ¤áÍÑ°Õ¤·¤¿¡£

¡¡¶¦Ḁ̈롼¥Á¥ó¤¬É¬Íס£

PUBLIC NUMERIC BIAS, KETA, SIGN, EPS
LET  EPS=12
LET  N=2^9-EPS
LET  BIAS = 0
LET  KETA =-BIAS+N+EPS
LET  SIGN = -BIAS - 1
DIM X(-BIAS - 1 TO KETA)
CALL LLOGPI(X)
CALL DISPLAY2(X)
END

EXTERNAL  SUB LLOGPI(X())
DIM L(-BIAS - 1 TO KETA)
DIM A(-BIAS - 1 TO KETA), B(-BIAS - 1 TO KETA)
DIM S(-BIAS - 1 TO KETA), C(-BIAS - 1 TO KETA)
CALL PI(L)
CALL SDIV(L,9*31*14699) !'1710541690073718870111737129379 ¤Ç³ä¤ë
CALL SDIV(L,304439)
CALL SDIV(L,49368533)
CALL SDIV2(L,27751800277)
CALL SMUL(L,101*1657) !' 544482330679994391053312457583 Çܤ¹¤ë
CALL SMUL(L,3580259)
CALL SMUL(L,5392007)
CALL SMUL2(L,168529144463)
CALL LCLR(X)
LET X(0)=1
CALL LSUB2(X, L)
CALL LCOPY(B, X)
CALL LCOPY(S, X)
LET  NN = 2
DO
   CALL LMUL2(B, X)
   CALL LCOPY(C, B)
   CALL SDIV(C, NN)
   LET  NN = NN + 1
   CALL LADD2(S, C)
LOOP UNTIL ZERO(B)<>0
LET S(SIGN)=-1
CALL LN1710541690073718870111737129379(L)
CALL LADD2(S,L)
CALL LN544482330679994391053312457583(L)
CALL LSUB(S,L,X)
END SUB

EXTERNAL  SUB SMUL2(X(),XA) !'¿ÇÜĹ¿ôX = ¿ÇÜĹ¿ôX * À°¿ôXA (1E+11¡Á1E+14ÄøÅÙ¤Þ¤Ç)
DIM A(-BIAS*4 TO KETA*4+3)  !'(´ð¿ô10000 ¢ª ´ð¿ô10 ¤ËÊÑ´¹¤·¤Æ·×»») ÀºÅÙÍî¤ÁÂкö
LET  SIGNA = X(SIGN)
IF XA >= 0 THEN LET SG=1 ELSE LET SG=-1
LET  XX = ABS(XA)
FOR I=-BIAS TO KETA
   LET A(I*4)=MOD(INT(X(I)/1000),10)
   LET A(I*4+1)=MOD(INT(X(I)/100),10)
   LET A(I*4+2)=MOD(INT(X(I)/10),10)
   LET A(I*4+3)=MOD(X(I),10)
NEXT I
MAT A=(XX)*A
FOR I=KETA*4 TO -BIAS*4+1 STEP -1
   IF A(I) >= 10 THEN
      LET  R = INT(A(I) / 10)
      LET  A(I) = MOD(A(I),10)
      LET  A(I - 1) = A(I - 1) + R
   END IF
NEXT I
IF A(-BIAS*4) >= 10 THEN
   PRINT "OVER FLOW in SMUL2"
   STOP
END IF
FOR I=-BIAS TO KETA-1
   LET X(I)=A(I*4)*1000+A(I*4+1)*100+A(I*4+2)*10+A(I*4+3)
NEXT I
LET X(SIGN)= SIGNA * SG
END SUB

EXTERNAL  SUB SDIV2(X(),XA) !'¿ÇÜĹ¿ôX = ¿ÇÜĹ¿ôX / À°¿ôXA (1E+11¡Á1E+14ÄøÅÙ¤Þ¤Ç)
DIM A(-BIAS*4 TO KETA*4+3)  !'(´ð¿ô10000 ¢ª ´ð¿ô10 ¤ËÊÑ´¹¤·¤Æ·×»») ÀºÅÙÍî¤ÁÂкö
IF XA=0 THEN
   PRINT "ERROR in SDIV2"
   STOP
END IF
LET  SIGNA = X(SIGN)
LET  SG=SGN(XA)
LET  XX = ABS(XA)
FOR I=-BIAS TO KETA
   LET A(I*4)=MOD(INT(X(I)/1000),10)
   LET A(I*4+1)=MOD(INT(X(I)/100),10)
   LET A(I*4+2)=MOD(INT(X(I)/10),10)
   LET A(I*4+3)=MOD(X(I),10)
NEXT I
FOR I=-BIAS*4 TO KETA*4-1
   LET  R = A(I) - INT(A(I) / XX) * XX
   LET  A(I) = INT(A(I) / XX)
   LET  A(I + 1) = A(I + 1) + R * 10
NEXT I
LET A(KETA*4)=INT(A(KETA*4)/XX)
FOR I=-BIAS TO KETA-1
   LET X(I)=A(I*4)*1000+A(I*4+1)*100+A(I*4+2)*10+A(I*4+3)
NEXT I
LET X(SIGN)= SIGNA * SG
END SUB

EXTERNAL  SUB LMUL(A(),B(),C())!'¿ÇÜĹƱ»Î¤Î¾è»» C=A*B
LET N=(KETA+BIAS)*2
IF INT(LOG2(N))<>LOG2(N) THEN
   PRINT "ERROR in LMUL"
   STOP
END IF
OPTION BASE 0
DIM AA(N*2),BB(N*2),CC(N*2)
FOR I=0 TO N/2-1
   LET AA(2*I)=A(-BIAS+I)
   LET BB(2*I)=B(-BIAS+I)
NEXT I
CALL CDFT(2*N, COS(PI/N), SIN(PI/N), AA)
CALL CDFT(2*N, COS(PI/N), SIN(PI/N), BB)
FOR I = 0 TO N-1
   LET  CC(2*I) = AA(2*I) * BB(2*I) - AA(2*I+1) * BB(2*I+1)
   LET  CC(2*I+1) = AA(2*I) * BB(2*I+1) + BB(2*I) * AA(2*I+1)
NEXT I
CALL CDFT(2*N, COS(PI/N), -SIN(PI/N), CC)
FOR I=0 TO N/2-1
   IF -2*BIAS+I>=-BIAS AND -2*BIAS+I<=KETA THEN
      LET C(-2*BIAS+I)=INT(CC(2*I)/N+.5)
   END IF
NEXT I
FOR I=KETA TO -BIAS STEP -1
   IF C(I) >=10000 THEN
      LET  R = INT(C(I) / 10000)
      LET  C(I) = C(I) - R * 10000
      LET  C(I - 1) = C(I - 1) + R
   ELSEIF C(I)<0 THEN
      LET C(I)=C(I)+10000
      LET C(I-1)=C(I-1)-1
   END IF
NEXT I
LET C(SIGN)=A(SIGN)*B(SIGN)
END SUB

EXTERNAL  SUB LMUL2 (A(), B()) !'¿ÇÜĹƱ»Î¤Î¾è»» A=A*B
DIM C(-BIAS-1 TO KETA)
CALL LMUL(A,B,C)
CALL LCOPY(A,C)
END SUB

EXTERNAL  SUB CDFT(N, WR, WI, A()) !'¥Í¥Ã¥È¾å¤«¤éÆþ¼ê¤·¤¿(¢¨¸¶ÈǤÏFORTRAN)
LET  WMR = WR
LET  WMI = WI
LET  M = N
DO WHILE M > 4
   LET  L = M / 2
   LET  WKR = 1
   LET  WKI = 0
   LET  WDR = 1 - 2 * WMI * WMI
   LET  WDI = 2 * WMI * WMR
   LET  SS = 2 * WDI
   LET  WMR = WDR
   LET  WMI = WDI
   FOR J = 0 TO N - M STEP M
      LET  I = J + L
      LET  XR = A(J) - A(I)
      LET  XI = A(J + 1) - A(I + 1)
      LET  A(J) = A(J) + A(I)
      LET  A(J + 1) = A(J + 1) + A(I + 1)
      LET  A(I) = XR
      LET  A(I + 1) = XI
      LET  XR = A(J + 2) - A(I + 2)
      LET  XI = A(J + 3) - A(I + 3)
      LET  A(J + 2) = A(J + 2) + A(I + 2)
      LET  A(J + 3) = A(J + 3) + A(I + 3)
      LET  A(I + 2) = WDR * XR - WDI * XI
      LET  A(I + 3) = WDR * XI + WDI * XR
   NEXT J
   FOR K = 4 TO L - 4 STEP 4
      LET  WKR = WKR - SS * WDI
      LET  WKI = WKI + SS * WDR
      LET  WDR = WDR - SS * WKI
      LET  WDI = WDI + SS * WKR
      FOR J = K TO N - M + K STEP M
         LET  I = J + L
         LET  XR = A(J) - A(I)
         LET  XI = A(J + 1) - A(I + 1)
         LET  A(J) = A(J) + A(I)
         LET  A(J + 1) = A(J + 1) + A(I + 1)
         LET  A(I) = WKR * XR - WKI * XI
         LET  A(I + 1) = WKR * XI + WKI * XR
         LET  XR = A(J + 2) - A(I + 2)
         LET  XI = A(J + 3) - A(I + 3)
         LET  A(J + 2) = A(J + 2) + A(I + 2)
         LET  A(J + 3) = A(J + 3) + A(I + 3)
         LET  A(I + 2) = WDR * XR - WDI * XI
         LET  A(I + 3) = WDR * XI + WDI * XR
      NEXT J
   NEXT  K
   LET  M = L
LOOP
IF M > 2 THEN
   FOR J = 0 TO N - 4 STEP 4
      LET  XR = A(J) - A(J + 2)
      LET  XI = A(J + 1) - A(J + 3)
      LET  A(J) = A(J) + A(J + 2)
      LET  A(J + 1) = A(J + 1) + A(J + 3)
      LET  A(J + 2) = XR
      LET  A(J + 3) = XI
   NEXT J
END IF
IF N > 4  THEN CALL BITRV2(N, A)
END SUB
 

Re: ¿ÇÜĹLOG(¦Ð)¤òµá¤á¤ë

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2010ǯ 1·î23Æü(ÅÚ)19»þ23ʬ47ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.984[¸µµ­»ö¤Ø]

³¤­

EXTERNAL  SUB BITRV2(N, A())
LET  M = N / 4
LET  M2 = 2 * M
LET  N2 = N - 2
LET  K = 0
FOR J = 0 TO M2 - 4 STEP 4
   IF J < K THEN
      LET  XR = A(J)
      LET  XI = A(J + 1)
      LET  A(J) = A(K)
      LET  A(J + 1) = A(K + 1)
      LET  A(K) = XR
      LET  A(K + 1) = XI
   ELSEIF J > K THEN
      LET  J1 = N2 - J
      LET  K1 = N2 - K
      LET  XR = A(J1)
      LET  XI = A(J1 + 1)
      LET  A(J1) = A(K1)
      LET  A(J1 + 1) = A(K1 + 1)
      LET  A(K1) = XR
      LET  A(K1 + 1) = XI
   END IF
   LET  K1 = M2 + K
   LET  XR = A(J + 2)
   LET  XI = A(J + 3)
   LET  A(J + 2) = A(K1)
   LET  A(J + 3) = A(K1 + 1)
   LET  A(K1) = XR
   LET  A(K1 + 1) = XI
   LET  L = M
   DO WHILE K >= L
      LET  K = K - L
      LET  L = L / 2
   LOOP
   LET  K = K + L
NEXT J
END SUB

EXTERNAL  SUB PI(X()) !'¦ÐÃÍ
CALL LCLR (X)
LET X(SIGN)=1
FOR I=0 TO KETA
   READ IF MISSING THEN EXIT FOR:X(I)
NEXT I
DATA 0003
DATA 1415,9265,3589,7932,3846,2643,3832,7950,2884,1971,6939,9375,1058,2097,4944,5923,0781,6406,2862,0899,8628,0348,2534,2117,0679
DATA 8214,8086,5132,8230,6647,0938,4460,9550,5822,3172,5359,4081,2848,1117,4502,8410,2701,9385,2110,5559,6446,2294,8954,9303,8196
DATA 4428,8109,7566,5933,4461,2847,5648,2337,8678,3165,2712,0190,9145,6485,6692,3460,3486,1045,4326,6482,1339,3607,2602,4914,1273
DATA 7245,8700,6606,3155,8817,4881,5209,2096,2829,2540,9171,5364,3678,9259,0360,0113,3053,0548,8204,6652,1384,1469,5194,1511,6094
DATA 3305,7270,3657,5959,1953,0921,8611,7381,9326,1179,3105,1185,4807,4462,3799,6274,9567,3518,8575,2724,8912,2793,8183,0119,4912
DATA 9833,6733,6244,0656,6430,8602,1394,9463,9522,4737,1907,0217,9860,9437,0277,0539,2171,7629,3176,7523,8467,4818,4676,6940,5132
DATA 0005,6812,7145,2635,6082,7785,7713,4275,7789,6091,7363,7178,7214,6844,0901,2249,5343,0146,5495,8537,1050,7922,7968,9258,9235
DATA 4201,9956,1121,2902,1960,8640,3441,8159,8136,2977,4771,3099,6051,8707,2113,4999,9998,3729,7804,9951,0597,3173,2816,0963,1859
DATA 5024,4594,5534,6908,3026,4252,2308,2533,4468,5035,2619,3118,8171,0100,0313,7838,7528,8658,7533,2083,8142,0617,1776,6914,7303
DATA 5982,5349,0428,7554,6873,1159,5628,6388,2353,7875,9375,1957,7818,5778,0532,1712,2680,6613,0019,2787,6611,1959,0921,6420,1989
DATA 3809,5257,2010,6548,5863,2788,6593,6153,3818,2796,8230,3019,5203,5301,8529,6899,5773,6225,9941,3891,2497,2177,5283,4791,3151
DATA 5574,8572,4245,4150,6959,5082,9533,1168,6172,7855,8890,7509,8381,7546,3746,4939,3192,5506,0400,9277,0167,1139,0098,4882,4012
DATA 8583,6160,3563,7076,6010,4710,1819,4295,5596,1989,4676,7837,4494,4825,5379,7747,2684,7104,0475,3464,6208,0466,8425,9069,4912
DATA 9331,3677,0289,8915,2104,7521,6205,6966,0240,5803,8150,1935,1125,3382,4300,3558,7640,2474,9647,3263,9141,9927,2604,2699,2279
DATA 6782,3547,8163,6009,3417,2164,1219,9245,8631,5030,2861,8297,4555,7067,4983,8505,4945,8858,6926,9956,9092,7210,7975,0930,2955
DATA 3211,6534,4987,2027,5596,0236,4806,6549,9119,8818,3479,7753,5663,6980,7426,5425,2786,2551,8184,1757,4672,8909,7777,2793,8000
DATA 8164,7060,0161,4524,9192,1732,1721,4772,3501,4144,1973,5685,4816,1361,1573,5255,2133,4757,4184,9468,4385,2332,3907,3941,4333
DATA 4547,7624,1686,2518,9835,6948,5562,0992,1922,2184,2725,5025,4256,8876,7179,0494,6016,5346,6804,9886,2723,2791,7860,8578,4383
DATA 8279,6797,6681,4541,0095,3883,7863,6095,0680,0642,2512,5205,1173,9298,4896,0841,2848,8626,9456,0424,1965,2850,2221,0661,1863
DATA 0674,4278,6220,3919,4945,0471,2371,3786,9609,5636,4371,9172,8746,7764,6575,7396,2413,8908,6583,2645,9958,1339,0478,0275,9009
DATA 9465,7640,7895,1269,4683,9835,2595,7098,2582,2620,5224,8940
END SUB

EXTERNAL  SUB LN1710541690073718870111737129379(X()) !'LOG(1710..)ÃÍ
CALL LCLR(X)
LET X(SIGN)=1
FOR I=0 TO KETA
   READ IF MISSING THEN EXIT FOR:X(I)
NEXT I
DATA 0069
DATA 6143,6288,7993,3268,3004,4228,2256,8485,2026,6785,3596,6394,4004,2459,4994,5470,1366,5214,8581,6415,4697,3145,7866,1523,7272
DATA 6551,2059,0127,0534,7351,7820,4920,0008,7989,9541,7800,2163,7623,0895,4887,3922,8357,3520,5004,0375,5683,9209,4332,0242,9540
DATA 1748,4435,3241,8232,0917,6048,6351,8267,6655,4103,1920,3713,6534,2808,6848,0068,3923,2800,1886,4684,2394,0286,5595,7822,8870
DATA 6824,4083,5434,5674,3002,0302,6430,7887,0940,1081,9799,5193,2835,3565,5690,4021,5682,1679,9587,2726,5741,7738,9966,8303,9374
DATA 4065,5626,7370,2317,3186,2152,1129,2984,3621,1141,6888,7106,2708,7294,1105,4881,3419,1360,3002,9792,2275,7776,7209,3100,7189
DATA 1333,2926,5906,5310,6574,2333,0024,4444,6043,7221,5935,4199,0820,3015,5200,1473,4002,4862,2284,7807,2731,8261,8953,2953,7309
DATA 4162,4615,8900,1280,1186,1445,3416,9135,4404,4277,0805,7623,1006,4866,6480,4750,1673,5797,3590,6210,4828,8466,8064,0621,5369
DATA 6822,3112,8752,9922,5756,4306,5244,5723,7782,5053,2215,5848,6850,0720,0010,0839,6060,6790,9162,7960,6519,9616,7812,3819,6481
DATA 2850,4009,5322,6067,3979,0496,8839,2466,5255,0930,4737,8771,8972,6183,6781,6485,6742,6847,7569,0628,3272,4958,9055,0595,1667
DATA 0318,1311,7655,2636,5449,8892,8994,6549,8185,5605,1410,8418,3957,3941,9585,7859,8354,6284,4894,3324,7101,4235,7355,6297,7705
DATA 6284,7948,3668,3827,3890,3916,7911,8682,2761,6156,8577,8088,8066,9387,2851,5278,4084,2809,0879,0882,6939,4694,4014,9549,7450
DATA 2911,5763,0278,3692,1766,1804,8124,9781,4074,8058,6307,1025,2785,0760,5599,0083,4081,9099,0502,6793,1794,6341,6502,0176,2868
DATA 3796,2139,9878,6835,7170,1164,2205,6497,0107,8877,3771,7488,8657,5263,9761,2416,6278,3016,1690,0953,1383,8181,7952,3541,1635
DATA 6891,5224,4409,2332,4874,2319,4524,2884,0889,5022,8222,5650,3677,3971,7593,6214,1500,2361,0686,4206,4017,9737,8034,3987,7461
DATA 5150,7437,9961,5876,6881,2221,9103,9820,1354,6600,2760,3220,1344,0667,5700,0559,0702,6840,8532,2596,9193,2134,9548,5155,8877
DATA 1115,9327,4668,8319,5471,2802,0874,9640,1131,7970,8168,2428,1598,3983,6017,5960,3281,6942,4686,9574,9764,9433,1216,4959,2387
DATA 0873,8907,8785,5093,6238,0367,4603,0384,3624,6755,5657,2459,9473,2847,7735,8517,5154,0299,6744,3440,0577,4508,6886,3276,1136
DATA 3026,8720,1951,3001,5676,9739,1394,0643,7786,6988,0521,2185,7078,9937,0618,4466,8235,0108,8657,3294,3409,0176,9410,4535,3487
DATA 5923,4566,3163,5408,2042,0034,7213,0857,1778,0402,9447,8452,8732,6232,4880,1913,2182,3249,5532,6094,1509,8743,6779,9084,9870
DATA 0148,8381,3012,8627,2066,3865,1370,4664,5664,9339,4367,0190,7057,6215,5163,9757,6009,6007,7540,5813,9957,0761,4465,5132,0577
DATA 5503,8417,6557,8706,8939,7814,1500,5247,4757,4949,9209,4162
END SUB

EXTERNAL  SUB LN544482330679994391053312457583(X()) !'LOG(5444..)ÃÍ
CALL LCLR(X)
LET X(SIGN)=1
FOR I=0 TO KETA
   READ IF MISSING THEN EXIT FOR:X(I)
NEXT I
DATA 0068
DATA 4696,3300,2143,9266,5590,0800,8743,3179,3315,0312,4115,3479,0888,5308,1371,0786,7772,6582,8354,8087,7911,8425,1658,1624,6863
DATA 3534,2720,9432,7548,7948,6284,7447,1357,2875,4696,1898,3726,1025,5558,4562,0907,4477,6791,4979,6390,9355,8684,7181,2383,6067
DATA 5125,9038,3164,5872,4149,1463,9290,8100,8221,3858,4661,7368,8894,4392,1782,5529,1379,0706,7263,6717,7094,2864,3556,3900,7575
DATA 8220,5281,5426,2279,7293,8843,9725,1183,2375,0876,2708,1484,0473,9670,8817,3223,4819,0068,2413,2727,7063,0621,1175,4750,7107
DATA 8671,3441,3378,9146,9346,1923,8237,0526,7108,5413,6817,1946,4759,6110,2330,5046,3222,6584,6590,6347,9478,9162,1229,8258,0639
DATA 8629,0999,7506,3639,3766,9619,4748,6069,6562,5828,2302,4778,3079,2466,1935,4340,5305,9867,9470,7594,5310,3809,3799,2927,1647
DATA 2356,9062,6748,9596,1245,0147,5975,5100,6274,8333,6949,6146,2909,4481,6231,2366,8112,4857,0275,2529,1010,3037,7042,6637,0392
DATA 1670,0491,9722,4984,9411,3815,8869,2731,5703,6430,4132,8603,8424,8368,8011,9123,4089,8308,1853,8980,8362,2095,2457,1928,3638
DATA 0053,3991,4538,1624,6079,4415,8152,2109,6785,7592,9725,2195,0650,0526,5590,0422,3146,3046,8647,5876,9130,4732,3389,1245,8068
DATA 7812,3293,5439,3929,1890,9399,6703,8878,7077,5335,6941,7431,1782,2323,8457,0834,4553,9586,3123,6397,5711,0712,1356,5910,7625
DATA 2193,7131,0681,5285,6609,1095,4149,6754,7763,2836,8796,8730,4951,2823,6551,9299,6014,9348,6341,1187,0646,7366,9790,3242,0076
DATA 3159,2614,7305,1479,3803,0883,1726,8138,1385,3562,1576,6493,8245,0199,7851,4583,9672,9911,8496,3168,7333,7765,0503,4451,0920
DATA 5090,5214,6787,1314,6772,6862,3736,8572,0251,7508,8096,1615,0470,5139,3677,8073,5561,0597,8884,4253,9075,0348,7834,3251,6913
DATA 6549,9352,6478,6587,3687,6446,5803,7343,1607,6931,6148,2364,8107,6286,4138,6620,4422,4124,9848,5744,8327,3790,8854,9012,5488
DATA 6930,5446,1559,2103,7235,1105,4337,1632,8662,1702,8001,9460,1977,8871,6694,9328,1262,7307,0409,3747,7022,2234,8243,0766,1057
DATA 1794,9925,2660,2292,2678,0591,1757,8530,6030,0003,8275,0990,6180,5366,9308,0990,1612,3368,9265,3857,0729,5854,4739,4278,6728
DATA 2111,2446,8161,9364,0415,6814,3644,1779,3609,4265,9090,3322,2336,7923,4096,4595,1538,1568,3121,3374,7747,7340,2591,1985,8297
DATA 1375,4564,3882,8472,3644,4193,1371,2433,7491,7818,1991,7233,1335,2034,1296,1177,3339,7135,6549,2440,4227,1453,0204,3370,3408
DATA 9449,0546,0281,3840,9872,7548,2470,7503,6138,4063,2497,2268,8601,9381,1855,0714,6065,2571,9613,8541,6472,6325,5532,3632,6764
DATA 0684,0804,6469,2615,3651,3647,2317,6321,2200,3895,4491,6134,5365,5560,5641,2651,0168,7531,0092,4478,8313,3640,3413,7462,9541
DATA 1403,9443,4183,7689,8013,2877,3469,9226,6078,9523,0380,9531
END SUB

°Ê²¼¤Ë¶¦Ḁ̈롼¥Á¥ó¤ò¥³¥Ô¥Ú¤¹¤ë(¿ÇÜĹLOG(5)¤òµá¤á¤ë¡¢¤è¤ê)
 

¿ÇÜĹ²«¶âÈæ¤òµá¤á¤ë

 Åê¹Æ¼Ô¡§¤·¤Ð¤Ã¤Á  Åê¹ÆÆü¡§2010ǯ 1·î23Æü(ÅÚ)19»þ24ʬ40ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ¿ÇÜĹ²«¶âÈæ¤òµá¤á¤ë (SQR(5)+1)/2=1.618033...

·×»»¼°¤Ë

    (1-X)^(-.5)=1+(1/2)*X+(1*3)/(2*4)*X^2+(1*3*5)/(2*4*6)*X^3+...

¤ò»ÈÍѤ·¡¢°Ê²¼¤Î´Ø·¸¼°

    SQR(5)= 6460 / 2889 * (1 - 1 / 8346321)^(-.5)

¤ò»È¤Ã¤Æ²«¶âÈæ¤òµá¤á¤ë¡£

PUBLIC NUMERIC KETA,EPS,SIGN
INPUT  PROMPT "·å¿ô=":KETA
LET KETA=INT(KETA/4)
LET EPS=2
LET BIAS=0
LET KETA=KETA+EPS
LET SIGN=-BIAS-1
DIM A(-BIAS-1 TO KETA),S(-BIAS-1 TO KETA),T(-BIAS-1 TO KETA)
LET A(0)=1
LET S(0)=1
LET N=1
DO
   MAT A=(2*N-1)*A
   FOR I = 0 TO KETA - 1
      LET  R = A(I) - INT(A(I)/16692642/N)*(16692642*N)
      LET  A(I) = INT(A(I) /16692642/N)
      LET  A(I + 1) = A(I + 1) + R * 10000
   NEXT I
   LET  A(KETA) = INT(A(KETA)/16692642/N)
   MAT S=S+A
   FOR I = KETA TO 0 STEP -1
      IF S(I) >= 10000 THEN
         LET  R = INT(S(I) / 10000)
         LET  S(I) = S(I) - R * 10000
         LET  S(I-1) = S(I-1) + R
      END IF
   NEXT I
   LET FL=0
   FOR I=0 TO KETA
      IF S(I)<>T(I) THEN
         LET T(I)=S(I)
         LET FL=1
         LET N=N+1
         EXIT FOR
      END IF
   NEXT I
   IF FL=0 THEN EXIT DO
LOOP
MAT S=6460*S
FOR I = KETA TO 0 STEP -1
   IF S(I) >= 10000 THEN
      LET  R = INT(S(I) / 10000)
      LET  S(I) = S(I) - R * 10000
      LET  S(I-1) = S(I-1) + R
   END IF
NEXT I
FOR I = 0 TO KETA - 1
   LET  R = S(I) - INT(S(I)/2889)*2889
   LET  S(I) = INT(S(I)/2889)
   LET  S(I + 1) = S(I + 1) + R * 10000
NEXT I
LET  S(KETA) = INT(S(KETA)/2889)
LET S(0)=S(0)+1
FOR I = 0 TO KETA - 1
   LET  R = S(I) - INT(S(I)/2)*2
   LET  S(I) = INT(S(I)/2)
   LET  S(I + 1) = S(I + 1) + R * 10000
NEXT I
LET  S(KETA) = INT(S(KETA)/2)
CALL DISPLAY(S)
END

EXTERNAL  SUB DISPLAY(X())
FOR K=-BIAS TO 0
   IF X(K)<>0 THEN EXIT FOR
NEXT K
IF K > 0 THEN LET K=0
IF X(SIGN) = -1 THEN PRINT "- ";
PRINT STR$(X(K));" ";
IF K=0 THEN PRINT "."
FOR I=K+1 TO KETA-EPS
   LET L=L+1
   PRINT RIGHT$("000"&STR$(X(I)),4);" ";
   IF I=0 THEN
      PRINT "."
      LET L=0
   END IF
   IF MOD(L,25)=0 THEN PRINT
NEXT I
PRINT
END SUB
 

¤ª´ê¤¤¤Ç¤¹

 Åê¹Æ¼Ô¡§sukehiro  Åê¹ÆÆü¡§2010ǯ 1·î24Æü(Æü)07»þ17ʬ32ÉÃ
ÊÖ¿®¡¦°úÍÑ
  »ä¤â½½¿ÊBASIC¤Î°¦ÍѼԤǤ¹¡£
¶ìÏ«¤·¤Æ¥¡¥°¥é¥ó¥¸¥§¤ÎÊýÄø¼°¤È¡¢MuPaD¤ò¶î»È¤·¤Æ¡¢2½Å¿¶¤ê»Ò¤Î±¿Æ°ÊýÄø¼°c1'',
c2''¤òƳ¤­½Ð¤·¡¢Æ°ºî¥·¥ß¥å¥ì¡¼¥·¥ç¥ó¤ò¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤·¤¿¡£

3½Å¿¶¤ê»Ò¤ËÄ©À路¤¿¤Î¤Ç¤¹¤¬¡¢¼ý½¦¤¬¤Ä¤«¤Ê¤¯¤Ê¤ê¤Þ¤·¤¿¡£
¤É¤Ê¤¿¤«¡¢¥×¥í¥°¥é¥àºîÀ®¤··Ç¼¨¤·¤Æ¤¤¤¿¤À¤±¤ë¤È´ò¤·¤¤¤Ç¤¹
 

Re: ¤ª´ê¤¤¤Ç¤¹

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2010ǯ 1·î25Æü(·î)10»þ08ʬ5ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  > No.987[¸µµ­»ö¤Ø]

sukehiro¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£
!ľÎó¿½Å¿¶¤ê»Ò
!»²¹Í¥µ¥¤¥È¡¡http://www.aihara.co.jp/~taiji/pendula-equations/present-node5.html

LET N=3 !¿¶¤ê»Ò¤Î¿ô

DIM m(N) !¿¶¤ê»Ò¤Î¤ª¤â¤ê¤Î¼ÁÎÌ
DATA 0.2, 0.3, 0.2
MAT READ m

DIM l(N) !¿¶¤ê»Ò¤Î»å¤ÎŤµ
DATA 3, 3, 4
MAT READ l

DIM th(N) !¿¶¤ê»Ò¤Îy¼´¤ËÂФ¹¤ë³ÑÅÙ
LET th(1)=2*PI/3 !½é´üÃÍ
LET th(2)=-PI/2
LET th(3)=PI/6

!¦È[d]¡Êd=1,n¡Ë¤Ë´Ø¤¹¤ë¥é¥°¥é¥ó¥¸¥å±¿Æ°ÊýÄø¼°
!   m[d,n]*l[d]^2*d/dt^2{¦È[d]}
! + ¦²[i=1,d-1] m[d,n]*l[d]*l[i]*d/dt^2{¦È[i]}*C[d,i]
! + ¦²[i=d+1,n] m[i,n]*l[d]*l[i]*d/dt^2{¦È[i]}*C[d,i]
! + ¦²[i=1,d-1] m[d,n]*l[d]*l[i]*(d/dt{¦È[i])^2*S[d,i]
! + ¦²[i=d+1,n] m[i,n]*l[d]*l[i]*(d/dt{¦È[i])^2*S[d,i]
! + m[d,n]*g*l[d]*SIN(¦È[d])
! = 0

LET G=9.8 !½ÅÎϲîÅÙ

FUNCTION sm(k,l) !m[k,l]=¦²[j=k,l] mj
   local s,j
   LET s=0
   FOR j=k TO l
      LET s=s+m(j)
   NEXT j
   LET sm=s
END FUNCTION
DEF C(i,j)=COS(th(i)-th(j)) !C[i,j]=COS(¦Èi-¦Èj)
DEF S(i,j)=SIN(th(i)-th(j)) !S[i,j]=SIN(¦Èi-¦Èj)

!£²³¬ÈùʬÊýÄø¼°¤òϢΩ£±³¬ÈùʬÊýÄø¼°¤Ë¤¹¤ë
!¡¡¦Ød=d/dt{¦Èd}¤È¤¹¤ë¤È¡¢R*d/dt^2{¦Èd}=v¤è¤êd/dt{¦Ød}=[INV(R)*v]d

DIM R(N,N),v(N)
SUB FNC(t,x(), f()) !ϢΩÈùʬÊýÄø¼° d/dt{Xi}=f(t,Xi)
   FOR d=1 TO N !¹Ô
      FOR i=1 TO N !Îó
         IF i>d THEN !±¦¾åÉôʬ
            LET R(d,i)=sm(i,N)*l(d)*l(i)*C(d,i)
         ELSEIF i=d THEN !ÂгÑÀþ
            LET R(d,i)=sm(d,N)*l(d)^2
         ELSE !º¸²¼Éôʬ
            LET R(d,i)=sm(d,N)*l(d)*l(i)*C(d,i)
         END IF
      NEXT i
   NEXT d
   !!!MAT PRINT R;

   FOR d=1 TO N !¹Ô
      LET ss=0
      FOR i=1 TO d-1
         LET ss=ss-sm(d,N)*l(d)*l(i)*x(i)^2*S(d,i)
      NEXT i
      FOR i=d+1 TO N
         LET ss=ss-sm(i,N)*l(d)*l(i)*x(i)^2*S(d,i)
      NEXT i
      LET ss=ss-sm(d,N)*G*l(d)*SIN(th(d))

      LET v(d)=ss
   NEXT d
   !!!MAT PRINT v;

   MAT R=INV(R)
   MAT f=R*v
END SUB


SET WINDOW -10,10,-12,8 !ÉÁ²èÎΰè

DIM w(N) !¿¶¤ê»Ò¤Îy¼´¤ËÂФ¹¤ë³Ñ®ÅÙ
MAT w=ZER

LET h=0.01 !»þ´Ö¹ï¤ßÉý ­ùt
FOR t=0 TO 30 STEP h !¢¨Ä´À°¤¹¤ë¤³¤È

   SET DRAW mode hidden !¤Á¤é¤Ä¤­Ëɻ߳«»Ï
   CLEAR
   DRAW PendulumN(1) !¿Æ¤«¤é½ç¤ËÉÁ²è¤¹¤ë
   SET DRAW mode explicit !¤Á¤é¤Ä¤­Ëɻ߽ªÎ»

   !WAIT DELAY 0.2 !¢¨É¬Íפ˱þ¤¸¤Æ

   !£´¼¡¤Î¥ë¥ó¥²¡¦¥¯¥Ã¥¿Ë¡¤ÇϢΩÈùʬÊýÄø¼° d/dt{Xi}=f(t,Xi)¤ò²ò¤¯
   DIM k1(N),k2(N),k3(N),k4(N), f(N)

   DIM x(N),TT(N)
   MAT x=w
   CALL FNC(t,x, f)
   MAT k1=h*f

   MAT TT=(1/2)*k1
   MAT x=w+TT
   CALL FNC(t+h/2,x, f)
   MAT k2=h*f

   MAT TT=(1/2)*k2
   MAT x=w+TT
   CALL FNC(t+h/2,x, f)
   MAT k3=h*f

   MAT x=w+k3
   CALL FNC(t+h,x, f)
   MAT k4=h*f

   FOR i=1 TO N
      LET w(i)=w(i)+(k1(i)+2*(k2(i)+k3(i))+k4(i))/6 !x(t+h)=x(t)+(k1+2*k2+2*k3+k4)/6
   NEXT i

   MAT TT=h*w !¦Ød=d/dt{¦Èd}¤è¤ê
   MAT th=th+TT
   !!!MAT PRINT th;

NEXT t


PICTURE PendulumN(i) !£î½Å¤Î¿¶¤ê»Ò¤òÉÁ¤¯
   LET LL=l(i)
   LET AA=th(i)
   DRAW Pendulum(LL,m(i)) WITH ROTATE(AA) !¿Æ
   IF i<N THEN DRAW PendulumN(i+1) WITH SHIFT(LL*SIN(AA),-LL*COS(AA)) !³¬Áشط¸¡Ê»Ò¤Ø¡Ë
END PICTURE

PICTURE Pendulum(L,r) !¸¶ÅÀ¤ò´ð½à¤Ë¿¶¤ê»Ò¤òÉÁ¤¯
   PLOT LINES: 0,0; 0,-L !Ȍ
   DRAW disk WITH SCALE(r)*SHIFT(0,-L) !¤ª¤â¤ê
END PICTURE

END
 

Í­Æñ¤¦¤´¤¶¤¤¤Þ¤·¤¿

 Åê¹Æ¼Ô¡§sukehiro  Åê¹ÆÆü¡§2010ǯ 1·î26Æü(²Ð)03»þ48ʬ53ÉÃ
ÊÖ¿®¡¦°úÍÑ
  »³ÃæϵÁÍÍ¡¢Í­Æñ¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£  

3¼¡¸µ¡¡²òÀÏ¥½¥Õ¥È¡¡³¨

 Åê¹Æ¼Ô¡§Í¿ºä¡¡¡¡¾ºÊ¿  Åê¹ÆÆü¡§2010ǯ 1·î26Æü(²Ð)16»þ09ʬ3ÉÃ
ÊÖ¿®¡¦°úÍÑ
  Æñ¤·¤¤¡¡¡¡¿ô³Ø¤ò¡¡¡¡»ÈÍѤ·¤Ê¤¤¤Ç¡¡¡¡¥Þ¥È¥ê¥Ã¥¯¥¹¤¬¡¡¡¡²ò¤ì¤Ð
Íý²ò¤Ç¤­¤ë¡¡¡¡£³¼¡¸µ¡¡¡¡¤Î¡¡¡¡Í­¸ÂÍ×ÁÇË¡¤Ç¤Î¡¡¡¡¹½Â¤²òÀÏ¥½¥Õ¥È¤ò¡¡¡¡ºîÀ®¤·¤Æ¤¤¤Þ¤¹
º£
£²£µÍ×ÁǤΡ¡¡¡ËÀ¤ò¡¡¡¡±¦Ã¼¡¡¡¡¸ÇÄꤷ¤Æ¡¡¡¡¡¡º¸¤ò¡¡¡¡»ý¤Á¾å¤²
¤½¤Î¸å¡¡¡¡¸å¤í¤Ë¡¡¡¡²¡¤·¤¿¡¡¡¡¥°¥é¥Ò¥Ã¥¯¤ò¡¡¡¡¤ª¸«¤»¤·¤Þ¤¹
full  basic  ¤Ç¤¹

´¶Áۤϡ¡¡¡¤É¤¦¤Ç¤¹¤«¡¡¡¡¡©¡©¡©
 

£³¼¡¸µ¤Î¡¡¡¡³¨

 Åê¹Æ¼Ô¡§Í¿ºä¡¡¡¡¾ºÊ¿  Åê¹ÆÆü¡§2010ǯ 1·î26Æü(²Ð)16»þ11ʬ14ÉÃ
ÊÖ¿®¡¦°úÍÑ
  ³¨¤¬¡¡¡¡ºÜ¤é¤Ê¤¤¤Î¤Ç¡¡¡¡ºÆÅÙ¡¡¡¡Á÷¤ê¤Þ¤¹  

Re: ¥»¥ó¥¿¡¼»î¸³ÄøÅÙ¤Î¥×¥í¥°¥é¥à±é½¬

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2010ǯ 1·î26Æü(²Ð)19»þ54ʬ57ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.976[¸µµ­»ö¤Ø]

»°³Ñ·Á¤ÎÀ­¼Á¤ò¥Ù¥¯¥È¥ëÊýÄø¼°¤Ê¤É¤Çɽ¸½¤·¤Æ¤ß¤Þ¤·¤¿¡£
!¿Þ·Á¤È¥Ù¥¯¥È¥ëÊýÄø¼°¡Ê»°³Ñ·Á¤Î¿´¡Ë

!Ê¿Ì̤ÎÅÀ¤ò¡ÖÊ¿Ì̤Υ٥¯¥È¥ë¤È¤ß¤ë¡×¤È¡ÖÊ£ÁÇ¿ô¤È¤ß¤ë¡×¤È¹Í¤¨¤é¤ì¤ë

OPTION ARITHMETIC COMPLEX

DEF v(a,b)=COMPLEX(a,b) !Ê£ÁÇ¿ô¤ÎϺ¹¡¢¼Â¿ôÇܤη׻»¤òÂбþ¤µ¤»¤ë

DEF fnDOT(a,b)=( a*conj(b) + conj(a)*b ) / 2 !ÆâÀÑ¡¡a1*b1+a2*b2
!ÀäÂÐÃÍ¡¡¥Ù¥¯¥È¥ë |a|^2=a¡¦a¡¡¡¡Ê£ÁÇ¿ô |z|^2=z*conj(z)

DEF fnNormalize(a)=a/ABS(a) !Àµµ¬²½

!------------------------------ ¤³¤³¤Þ¤Ç¤¬¥µ¥Ö¥ë¡¼¥Á¥ó


SET WINDOW -8,8,-8,8 !ɽ¼¨Îΰè¤òÀßÄꤹ¤ë
DRAW grid !XYºÂɸ
ASK PIXEL SIZE (-8,-8; 8,8) w,h !²èÁü¤Î½Ä²£¤ÎÂ礭¤µ(¥É¥Ã¥Èñ°Ì)¤òÄ´¤Ù¤ë

LET cEps=0.1 !ÀºÅÙ¡¡¢¨Ä´À°¤¬É¬ÍפǤ¢¤ë

SET POINT STYLE 1 !ÅÀ¤Î·Á¾õ


!Îã¡¡»°³Ñ·ÁABC¤Î¿´
!¡¡¡¡¡¡C
!¡¡b ¡¿¡À a
!¡¡A ¨¡¨¡ B
!¡¡¡¡ c

LET OA=v(-4,-5)
LET OB=v(3,-4)
LET OC=v(4,6)

LET AB=OB-OA !ÊÕAB
LET BC=OC-OB !ÊÕBC
LET CA=OA-OC !ÊÕCA

PLOT LINES: Re(OA),Im(OA); Re(OB),Im(OB) !ÊÕAB¤òÉÁ¤¯
PLOT LINES: Re(OB),Im(OB); Re(OC),Im(OC) !ÊÕBC
PLOT LINES: Re(OC),Im(OC); Re(OA),Im(OA) !ÊÕCA


LET a=ABS(BC) !ÊÕBC¤ÎŤµ
LET b=ABS(CA) !ÊÕCA
LET c=ABS(AB) !ÊÕAB

LET t=(a+b+c)/2 !¥Ø¥í¥ó¤Î¸ø¼°¤è¤ê¡¢ÌÌÀÑS
LET S=SQR(t*(t-a)*(t-b)*(t-c))


!------------------------------

LET OI=(a*OA+b*OB+c*OC)/(a+b+c) !Æâ¿´¤Î°ÌÃÖ¥Ù¥¯¥È¥ë
SET AREA COLOR 4
DRAW disk WITH SCALE(0.2)*SHIFT(OI)

SET LINE COLOR 4
LET R=S/t !S=¢¤IAB+¢¤IBC+¢¤ICA=1/2*c*r+1/2*a*r+1/2*b*r=r*(a+b+c)/2¤è¤ê
DRAW circle WITH SCALE(R)*SHIFT(OI) !ÆâÀܱߤòÉÁ¤¯¡¡|z-¦Á|=r

CALL DrawLine4(OA,OB,OC)
SUB DrawLine4(OA,OB,OC) !­¤¢ÜBAC¤òÆóÅùʬ¤¹¤ëÀþ
   FOR t=0 TO 10 !t=[0,¡ç]¡¡¢¨ÈϰϤÏÄ´À°¤¬É¬ÍפǤ¢¤ë
      LET wAB=OB-OA
      LET wAC=OC-OA
      LET OP=OA+(fnNormalize(wAB)+fnNormalize(wAC))*t !¤Ò¤··ÁAbDc¤ÎÂгÑÀþAD
      PLOT LINES: Re(OP),Im(OP);
   NEXT t
   PLOT LINES
END SUB
CALL DrawLine4(OB,OC,OA)
CALL DrawLine4(OC,OA,OB)


!------------------------------

LET OG=(OA+OB+OC)/3 !½Å¿´¤Î°ÌÃÖ¥Ù¥¯¥È¥ë
SET AREA COLOR 2
DRAW disk WITH SCALE(0.2)*SHIFT(OG)

SET LINE COLOR 2
CALL DrawLine2(OA,OB,OC)
SUB DrawLine2(OA,OB,OC) !­¢ÅÀA¤ÈÊÕBC¤ÎÃæÅÀ¤òÄ̤ëÀþ
   FOR t=0 TO 10 !t=[0,¡ç]¡¡¢¨ÈϰϤÏÄ´À°¤¬É¬ÍפǤ¢¤ë
      LET OP=OA+(OB+OC-2*OA)*t !Ê¿¹Ô»ÍÊÕ·ÁABDC¤ÎÂгÑÀþAD
      PLOT LINES: Re(OP),Im(OP);
   NEXT t
   PLOT LINES
END SUB
CALL DrawLine2(OB,OC,OA)
CALL DrawLine2(OC,OA,OB)



!------------------------------

LET sin2A=2*S*(b^2+c^2-a^2)/(b*c)^2 !sin2A=2*cosA*sinA¡¢Í¾¸¹ÄêÍýcosA=(b^2+c^2-a^2)/(2*b*c)¡¢ÌÌÀÑS=1/2*b*c*sinA¤è¤ê
LET sin2B=2*S*(c^2+a^2-b^2)/(c*a)^2
LET sin2C=2*S*(a^2+b^2-c^2)/(a*b)^2
LET OQ=(sin2A*OA+sin2B*OB+sin2C*OC)/(sin2A+sin2B+sin2C) !³°¿´¤Î°ÌÃÖ¥Ù¥¯¥È¥ë
SET AREA COLOR 3
DRAW disk WITH SCALE(0.2)*SHIFT(OQ)

SET LINE COLOR 3
LET R=a*b*c/(4*S) !Àµ¸¹ÄêÍýa/sinA=b/sinB=c/sinC=2*R¤ÈÌÌÀÑS=1/2*b*c*sinA¤è¤ê
DRAW circle WITH SCALE(R)*SHIFT(OQ) !³°ÀܱߤòÉÁ¤¯


!------------------------------

LET tanA=2*S/(b^2+c^2-a^2) !tanA=sinA/cosA¤È;¸¹ÄêÍýcosA=(b^2+c^2-a^2)/(2*b*c)¤ÈÌÌÀÑS=1/2*b*c*sinA¤è¤ê
LET tanB=2*S/(c^2+a^2-b^2)
LET tanC=2*S/(a^2+b^2-c^2)
LET OH=(tanA*OA+tanB*OB+tanC*OC)/(tanA+tanB+tanC) !¿â¿´¤Î°ÌÃÖ¥Ù¥¯¥È¥ë
SET AREA COLOR 1
DRAW disk WITH SCALE(0.2)*SHIFT(OH)


FOR j=0 TO h !²èÌÌÁ´ÂΤòÁöºº¤¹¤ë
   LET y=worldy(j) !¥É¥Ã¥È¤òxyºÂɸ¤ËÊÑ´¹¤¹¤ë
   FOR i=0 TO w
      LET x=worldx(i)

      LET OP=v(x,y)

      SET POINT COLOR 3 !³°¿´
      IF ABS( fnDOT(OP-(OB+OC)/2,BC) )<cEps THEN PLOT POINTS: x,y !­£ÊÕBC¤Î¿âľÆóÅùʬÀþ
      IF ABS( fnDOT(OP-(OC+OA)/2,CA) )<cEps THEN PLOT POINTS: x,y
      IF ABS( fnDOT(OP-(OA+OB)/2,AB) )<cEps THEN PLOT POINTS: x,y

      SET POINT COLOR 1 !¿â¿´
      IF ABS( fnDOT(OP-OA,BC) )<cEps THEN PLOT POINTS: x,y !­¡ÅÀA¤«¤éÊÕBC¤Ø¤Î¿âÀþ¡¡AP¢ÝBC
      IF ABS( fnDOT(OP-OB,CA) )<cEps THEN PLOT POINTS: x,y
      IF ABS( fnDOT(OP-OC,AB) )<cEps THEN PLOT POINTS: x,y

   NEXT i
NEXT j


END
 

¥²¡¼¥à²òÀϤΤª´ê¤¤

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2010ǯ 1·î27Æü(¿å)11»þ42ʬ43ÉÃ
ÊÖ¿®¡¦°úÍÑ ¡¡ÊÔ½¸ºÑ
  £µ£²Ëç¤Î¥«¡¼¥É¤«¤éǤ°Õ¤Î£±£³Ëç¤òÈ´¤­½Ð¤¹¤È¡¢É¬¤º£´Ëç¤ÎƱ¤¸¥Þ¡¼¥¯¤Î¥«¡¼¥É¤¬´Þ¤Þ¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¤Î¤Ç¡¢¤³¤Î£´Ëç¤À¤±¤¬É½¸þ¤­¤Ç½ªÎ»¤¹¤ë¤è¤¦¤ÊºîÉʤòºî¤ê¤¿¤¤¡£
ɽ¤Ë¤·¤¿¤¤¥«¡¼¥É¤Î°ÌÃ֤Ȥ·¤Æ¹Í¤¨¤é¤ì¤ëÁ´¥Ñ¥¿¡¼¥ó¤¬13C4¡á715Ä̤ê¹Í¤¨¤é¤ì¡¢¤³¤ì¤é¤¬¤¹¤Ù¤Æ²Äǽ¤Ç¤¢¤ë¤Î¤«ÃΤꤿ¤¤¡£

¡ã£±£³Ëç¤Î¥Ñ¥±¥Ã¥È¤ÎÁàºîÊýË¡¡ä
΢¸þ¤­¤Ë»ý¤Á¡¢¾å¤«¤éǤ°Õ¤ÎËç¿ô¤Ç¤Ò¤Ã¤¯¤êÊÖ¤·¥Ñ¥±¥Ã¥È¤ËÌ᤹¡£
¤³¤ÎÁàºî¤ò²¿²ó¤«¤¯¤êÊÖ¤·¤Æ¤¤¤­¡¢ÌÜŪ¤Î£´Ëç¤À¤±¤¬É½¸þ¤­¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾õÂ֤ˤ¹¤ë¡£

¥Ñ¥±¥Ã¥È¤Î¾å¤«¤é»ý¤Á¾å¤²¤ëËç¿ô¤ÈºÇ½ªÉ½¤Î¥«¡¼¥É¡Ê*)¤ÎÎã

4Ëç
1        *4
2        *3
3        *2
4        *1
5         5
6         6
7         7
8         8
9         9
10       10
11       11
12       12
13       13


6Ëç¡¡¡¡ 3Ëç¡¡¡¡¡¡4Ëç¡¡¡¡¡¡9Ëç
1       *6        4        3        *9
2       *5        5       *6        *8
3       *4        6       *5        *7
4       *3       *3       *4         1
5       *2       *2       *2         2
6       *1       *1       *1         4
7        7        7        7         5
8        8        8        8         6
9        9        9        9        *3
10       10       10       10        10
11       11       11       11        11
12       12       12       12        12
13       13       13       13        13

ºÇ½ª¥Ñ¥¿¡¼¥ó¤òãÀ®¤¹¤ë¤¿¤á¤Î»ý¤Á¾å¤²¤ëËç¿ô¤ÎÀïά¤òÃΤꤿ¤¤¡£
 

Re: ¥²¡¼¥à²òÀϤΤª´ê¤¤

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2010ǯ 1·î27Æü(¿å)16»þ11ʬ19ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.993[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

Îã
¡¡1,2,3,4,5,6,7,8,9,10,11,12,13
¡¡¡¡¡¡¢­
¡¡-9,-8,-7,1,2,4,5,6,-3,10,11,12,13

¡¡Ëç¿ôÎó{6,3,4,9}¤Î£´¼ê¤¬ºÇ¾¯¼ê¿ô¤Î¤è¤¦¤Ç¤¹¡£

LET t0=TIME


PUBLIC NUMERIC N !¥«¡¼¥É¤ÎËç¿ô
LET N=13

DIM c(N) !ºÇ½é¤Î¥Ñ¥¿¡¼¥ó¡¡¢¨
DATA 1,2,3,4,5,6,7,8,9,10,11,12,13
MAT READ c

PUBLIC NUMERIC GOAL(100) !ºÇ½ª¤Î¥Ñ¥¿¡¼¥ó¡¡¢¨
MAT GOAL=ZER(N)
DATA -9,-8,-7,1,2,4,5,6,-3,10,11,12,13
MAT READ GOAL

PUBLIC NUMERIC LIMIT !¼ê¿ô¤Î¾å¸Â¡¡¢¨
LET LIMIT=10

DIM A(LIMIT) !Ëç¿ô
CALL backtrack(c,1,A)


PRINT "·×»»»þ´Ö=";TIME-t0

END


EXTERNAL SUB reverse(c(),P) !ÀèƬ¤«¤éPËç¤ò΢ÊÖ¤¹
FOR i=1 TO INT(P/2) !¸ò´¹
   LET t=c(i)
   LET c(i)=c(P-i+1)
   LET c(P-i+1)=t
NEXT i
FOR i=1 TO P !ȿž
   LET c(i)=-c(i)
NEXT i
END SUB

EXTERNAL SUB backtrack(c(),K,A()) !¥Ð¥Ã¥¯¥È¥é¥Ã¥¯Ë¡¤Ç¸¡¾Ú¤¹¤ë
IF K<=LIMIT THEN !¼ê¿ô¤Î¾å¸ÂÆâ¤Ê¤é
   DIM x(N)
   MAT x=c !save it

   FOR i=1 TO N !Ëç¿ô¤òÊѤ¨¤ë
      LET A(K)=i
      CALL reverse(c,i) !ȿž

      FOR j=1 TO N !ºÇ½ª¤Î¥Ñ¥¿¡¼¥ó¤«¤É¤¦¤«³Îǧ¤¹¤ë
         IF c(j)<>GOAL(j) THEN EXIT FOR
      NEXT j
      IF j>N THEN !°ìÃפ·¤¿¤é
         LET LIMIT=K-1 !¾å¸Â¤ò¶¹¤á¤ë¡¡¢¨ºÇ½é¤Ë¸«¤Ä¤«¤Ã¤¿¤â¤Î
         PRINT K;"¼ê"
         FOR j=1 TO K
            PRINT A(j); !Ëç¿ô
         NEXT j
         PRINT
         !!!MAT PRINT c; !debug
      ELSE
         CALL backtrack(c,K+1,A) !¼¡¤Ø
      END IF

      MAT c=x !restore it
   NEXT i
END IF
END SUB
 

Re: ¥²¡¼¥à²òÀϤΤª´ê¤¤

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2010ǯ 1·î27Æü(¿å)19»þ12ʬ53ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.994[¸µµ­»ö¤Ø]

»³ÃæϵÁ¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

¤µ¤Ã¤½¤¯ºî¤Ã¤Æ夭¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£
¼«Ê¬¤Ç¾¯¤·Êѹ¹¤·¤Æ¤ß¤è¤¦¤È»î¤ß¤Þ¤·¤¿¤¬¡¢ÌÂÏ©¤ËÆþ¤êºÆ¤Ó¤ª´ê¤¤¤¬¤¢¤ê¤Þ¤¹¡£

¥«¡¼¥É¤òǤ°Õ¤ÎËç¿ô¤Ç¤Ò¤Ã¤¯¤êÊÖ¤·¤Æ¤¤¤¯¤È¤­¡¢É½¤¬£´Ëç¤Ë¤Ê¤Ã¤¿¤Ê¤é¥«¡¼¥É¤ÎÇÛÎó¤òɽ¼¨¤·¡ÊºÇ½ª¥Ñ¥¿¡¼¥ó¤ËÁêÅö¤¹¤ë¤â¤Î¡£¡Ë
¤½¤³¤Þ¤Ç¤Î¡¢»ý¤Á¾å¤²¤ëËç¿ô¤òƱ»þ¤Ë¸«¤Æ¤ß¤¿¤¤¡£


¤³¤Îɽ¤¬£´Ëç¤È¤Ê¤ë¤¢¤é¤æ¤ë¥Ñ¥¿¡¼¥ó¡ÊºÇ½é¤Î²¿ÈÖÌܤΥ«¡¼¥É¤¬É½¤«¤Ç¤Î°ã¤¤¤Ë¤Ä¤¤¤Æ¤Î¡Ë¤ÏÄ´¤Ù¤ë¤³¤È¤Ï½ÐÍè¤Þ¤¹¤«¡©
 

Re: ¥²¡¼¥à²òÀϤΤª´ê¤¤

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2010ǯ 1·î27Æü(¿å)20»þ26ʬ9ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.995[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£
LET t0=TIME


PUBLIC NUMERIC N !¥«¡¼¥É¤ÎËç¿ô
LET N=13

DIM c(N) !ºÇ½é¤Î¥Ñ¥¿¡¼¥ó¡¡¢¨
DATA 1,2,3,4,5,6,7,8,9,10,11,12,13
MAT READ c

PUBLIC NUMERIC LIMIT !¼ê¿ô¤Î¾å¸Â¡¡¢¨
LET LIMIT=4

PUBLIC NUMERIC cMIN !ºÇ¾¯¼ê¿ô
LET cMIN=LIMIT+1

DIM A(LIMIT) !Ëç¿ô
CALL backtrack(c,0,A)

IF cMIN<=LIMIT THEN PRINT "ºÇ¾¯¼ê¿ô=";cMIN


PRINT "·×»»»þ´Ö=";TIME-t0

END


EXTERNAL SUB reverse(c(),P) !ÀèƬ¤«¤éPËç¤ò΢ÊÖ¤¹
FOR i=1 TO INT(P/2) !¸ò´¹
   LET t=c(i)
   LET c(i)=c(P-i+1)
   LET c(P-i+1)=t
NEXT i
FOR i=1 TO P !ȿž
   LET c(i)=-c(i)
NEXT i
END SUB

EXTERNAL SUB backtrack(c(),K,A()) !¥Ð¥Ã¥¯¥È¥é¥Ã¥¯Ë¡¤Ç¸¡¾Ú¤¹¤ë
LET s=0
FOR j=1 TO N !ɽ¤ÎËç¿ô¤ò³Îǧ¤¹¤ë
   IF c(j)<0 THEN LET s=s+1
NEXT j
IF s=4 THEN !°ìÃפ·¤¿¤é
   IF K<cMIN THEN LET cMIN=K !ºÇ¾¯¼ê¿ô¤òµ­Ï¿¤¹¤ë
   PRINT K;"¼ê"
   FOR j=1 TO K
      PRINT A(j); !Ëç¿ôÎó
   NEXT j
   PRINT
   MAT PRINT c; !ºÇ½ª¤Î¥Ñ¥¿¡¼¥ó
ELSE
   IF K<LIMIT THEN !¼ê¿ô¤Î¾å¸ÂÆâ¤Ê¤é
      DIM x(N)
      MAT x=c !save it

      FOR i=1 TO N !Ëç¿ô¤òÊѤ¨¤ë
         IF K>=1 AND i=A(K) THEN !Ʊ¤¸¼ê¤¬Â³¤¯¾ì¹ç¤Ï̵¸ú¡ª
         ELSE
            LET A(K+1)=i
            CALL reverse(c,i) !ȿž

            CALL backtrack(c,K+1,A) !¼¡¤Ø

            MAT c=x !restore it
         END IF
      NEXT i
   END IF
END IF
END SUB
 

ʬÀϤ·¤Æʬ¤«¤Ã¤¿¤³¤È

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2010ǯ 1·î30Æü(ÅÚ)16»þ10ʬ20ÉÃ
ÊÖ¿®¡¦°úÍÑ
  »³Ã椵¤ó¤«¤éºî¤Ã¤Æ夤¤¿¥×¥í¥°¥é¥à¤òÆ°¤«¤·¤Æ¤½¤Î·ë²Ì¤òÀ°Íý¤·¤Æ¤¤¤¿¤é¡¢¼¡¤Î¸¶Íý¤¬¸«¤¨¤Æ¤­¤Þ¤·¤¿¡£
ɽ¤Ë¤·¤¿¤¤¥«¡¼¥É¤ÎºÇ½é¤Î°ÌÃÖ¤¬¾å¤«¤éÎ㤨¤Ð£³¡¤£·¡¤£¸¡¤£±£±ÈÖÌܤǤ¢¤Ã¤¿¤È¤¹¤ë¤È
°ì²óÌÜ¡§£²Ëç¡Ê¤³¤ì¤Ï£³¤Î¼êÁ°¤Þ¤Ç¤ÎËç¿ô¡Ë
Æó²óÌÜ¡§£³Ëç¡Ê¤³¤ì¤ÏºÇ½é¤Î¥«¡¼¥É¤Î°ÌÃÖ£³¤ËÂбþ¤¹¤ë¡Ë
»°²óÌÜ¡§£¶Ëç¡Ê¼¡¤Î£·¤Î¼êÁ°¤Þ¤Ç¤ÎËç¿ô¡Ë
»Í²óÌÜ¡§£¸Ëç¡Ê£·¡¤£¸¤ÈϢ³¤·¤Æ¤¤¤ë¤«¤é£¸¤Þ¤Ç¤ÎËç¿ô¡Ë
¸Þ²óÌÜ¡§£±£°Ëç¡ÊºÇ¸å¤Î£±£±¤Î¼êÁ°¤Þ¤Ç¤ÎËç¿ô¡Ë
Ï»²óÌÜ¡§£±£±Ëç¡ÊºÇ¸å¤Î£±£±¤ËÂбþ¤¹¤ë¡Ë

ʬ¤«¤Ã¤Æ¤ß¤ë¤ÈÅö¤¿¤êÁ°¤Ë´¶¤¸¤ë¤¬¡¢ºÇ½é¤«¤é¤³¤Î¤³¤È¤Ë¤Ï¤Ê¤«¤Ê¤«µ¤¤¬¤Ä¤«¤Ê¤¤¡£
½¾¤Ã¤Æ¥«¡¼¥É¤¬¤É¤³¤Ë²¿Ë礢¤í¤¦¤¬¤³¤Î¸¶Â§¤µ¤¨½ÏÃΤ·¤Æ¤ª¤±¤Ð¤Á¤ç¤Ã¤È¤·¤¿¥²¡¼¥à¤ä¥Ñ¥º¥ë¤Ë±þÍѤ¬Íø¤¯¡£
 

Re: ʬÀϤ·¤Æʬ¤«¤Ã¤¿¤³¤È

 Åê¹Æ¼Ô¡§»³ÃæϵÁ  Åê¹ÆÆü¡§2010ǯ 1·î30Æü(ÅÚ)20»þ24ʬ52ÉÃ
ÊÖ¿®¡¦°úÍÑ
  > No.997[¸µµ­»ö¤Ø]

GAI¤µ¤ó¤Ø¤Î¤ªÊÖ»ö¤Ç¤¹¡£

(p-1)Ëç¡¢pËç¤È¤á¤¯¤ë¤È¡¢-p,1,2,3,¡Ä,p-1 ¤Î½ç¤Ëʤ֡£

¤³¤ì¤Ï¡¢¡ÖpÈÖÌܤΥ«¡¼¥É¤Î¤ß¤òɽ¸þ¤­¤ÇÀèƬ¤Ø¡£°Ê¹ß¤Î½çÈÖ¤ÏÊѤï¤é¤º¡×¤ò°ÕÌ£¤¹¤ë¡£

»²¹Í
¡¡È¿Å¾Áàºî¤Ë¤è¤ë¥Ö¥í¥Ã¥¯°ÜÆ°¡ÊNo.716 [¸µµ­»ö¤Ø]¡Ë
¡¡¤Î£²Ê¬³ä¤ÎÆüì·Á¡ÊÁ°È¾Éôʬ(p-1)¸Ä¤È¸åȾÉôʬ£±¸Ä¤è¤ê¡¢Á°È¾¤ÈÁ´ÂΤÎȿž¡Ë¤È¤Ê¤ê¤Þ¤¹¡£
 

¾®ºîÉÊ

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2010ǯ 1·î31Æü(Æü)08»þ40ʬ56ÉÃ
ÊÖ¿®¡¦°úÍÑ
  £±¡Á£±£°¤ÎÈÖ¹æ¡ÊƱ°ì¥Þ¡¼¥¯¤Ç¡Ë¤Î¥«¡¼¥É¤ò½àÈ÷¤·

£±¡¥µÒ¤ËÅÅÏÃÈÖ¹æ¤ò²¿µ¤¤Ëʹ¤¯¡£¡Ê¤¿¤À¤·£´¤Ä¤Î¿ô»ú¤Ï¤¹¤Ù¤Æ°Û¤Ê¤Ã¤Æ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
¤½¤¦¤Ç¤Ê¤¤¤Ê¤é¡¢Â¾¤Î¿ô»ú¤ò¹Í¤¨¤Æ¤â¤é¤¦¡£¡Ë
¡ãÎã¡ä
µÒ¤ÎÈֹ桧£¹£²£¶£µ
¤³¤ì¤ò¾®¤µ¤¤½ç¤Ëʤ١¢´ð½à¿ô¤È¤¹¤ë¡£
´ð½à¿ô¡¡¡§£²£µ£¶£¹

£²¡¥£±£°Ëç¤Î¥«¡¼¥É¤ò¾å¤«¤é¤¹¤Ù¤Æ΢¸þ¤­¤Ç
£²ÈÖÌܤˣ¹
£µÈÖÌܤˣ²
£¶ÈÖÌܤˣ¶
£¹ÈÖÌܤˣµ
¤Î¥«¡¼¥É¤¬°ÌÃÖ¤¹¤ë¤è¤¦¤Ë¡Ê£°¤Ï¥«¡¼¥É£±£°¤Çºî¶È¤¹¤ë¡£¡Ë²¿µ¤¤Ë¥»¥Ã¥È¤·¤Æ¤ª¤¯¡£
¾¤Î°ÌÃ֤Υ«¡¼¥É¤Ï²¿¤Ç¤â¤è¤¤¡£
¡ãƬ¤ÎÃæ¤ÇÅÅÏÃÈÖ¹æ¤È´ð½à¿ô¤òÂбþ¤µ¤»¤Æºî¶È¤¹¤ë¡£¡ä

£³¡¥¤³¤Î¥Ñ¥±¥Ã¥È¤ò¥Õ¥©¡¼¥ë¥¹¥·¥ã¥Ã¥Õ¥ë¤·
Àè¤ÎÊýË¡¤Ç´ð½à¿ô¤Î¿ô»ú¤¬É½¸þ¤­¤Ë½Ð¸½¤¹¤ëÁàºî¤ò¤ä¤ë¡£
±éµ»Åª¤Ë¤Ï¡¢Ç¡²¿¤Ë¤â̵¤ºî¤Ë¤ä¤Ã¤Æ¤¤¤ë¤È´¶¤¸¤µ¤»¤ë¤è¤¦¤Ë¡¦¡¦¡¦
¡Ö¤³¤ì¤é¤ò¤è¡¼¤¯º®¤¼¤Þ¤¹¡£¡×¤Ê¤É¤Î¸ý¾å¤È¶¦¤Ëºî¶È¤¹¤ë¡£
¤³¤ÎÎã¤Ç¤Ï
£±²óÌÜ¡§¾å¤«¤é£±Ëç»ý¤Á¾å¤²¤Ò¤Ã¤¯¤êÊÖ¤·¤Æ¸µ¤ËÌ᤹
£²²óÌÜ¡§£²Ëç»ý¤Á¾å¤²Æ±¤¸¤¯ÊÖ¤·¤ÆÌ᤹
£³²óÌÜ¡§£´Ëç
£´²óÌÜ¡§£¶Ëç
£µ²óÌÜ¡§£¸Ëç
£¶²óÌÜ¡§£¹Ëç

¤³¤Î¤È¤­ºÇ¸å¤ÎÁàºî¤Ç¥È¥Ã¥×¤Ë£´Ëç¤Îɽ¸þ¤­¥«¡¼¥É¡Ê£µ¡¤£¶¡¤£²¡¤£¹¤Î½çÈÖ¡Ë
¤¬Íè¤ë¤«¤é¡¢ºÇ¸å¤Î»þ¤Ë¥Ñ¥±¥Ã¥È¤ò¤Ò¤Ã¤¯¤êÊÖ¤·¤Ê¤¬¤é¤³¤ì¤¬¥Ü¥È¥à¦¤ØÍè¤ë¤è¤¦¤Ë»ý¤ÁÂؤ¨¤ë¡£

£´¡¥¾å¤«¤é£µËç¤ò¿ô¤¨¼è¤ê¡Ê¤¹¤Ù¤Æɽ¸þ¤­¥«¡¼¥É¡Ë±¦¼ê¤Ë»ý¤Ä¡£

£µ¡¥»Ä¤Ã¤¿º¸¼ê¤Î¥Ñ¥±¥Ã¥È¤È¥Ñ¡¼¥Õ¥§¥È¡¦¥ê¥Õ¥ë¡¦¥·¥ã¥Ã¥Õ¥ë¤ò¤¹¤ë¡£
¡¡¡Ê±¦¼ê¤«¤éÀ褺£±ËçÍî¤È¤·¡¢¼¡¤Ëº¸¼ê¤«¤é£±Ëç¡¢¼¡¤Ë±¦¼ê¤è¤ê£±Ëç¡¢¡¦¡¦¡¦¤È¸ò¸ß¤Ë¥Ñ¥é¥Ñ¥é¤È¥Æ¡¼¥Ö¥ë¤Ë¥«¡¼¥É¤ò³ú¤ß¹ç¤ï¤»¤Ê¤¬¤éÍî¤È¤·¤Æ¤¤¤¯¡£¡§´·¤ì¤ë¤È´Êñ¤Ç¤¹¡£¡Ë

£¶¡¥¥«¡¼¥É¤ò·¤¨¡¢¥Ñ¥±¥Ã¥È¤ò¤¹¤Ù¤Æ¤Ò¤Ã¤¯¤êÊÖ¤·¤Æ±¦¼ê¤Ë»ý¤Ä¡£
¡¡¡¡¡ÖÅÅÏÃÈÖ¹æ¤Ï²¿¤Ç¤·¤¿¤Ã¤±¡©¡×¤È³Îǧ¤ò¤È¤ê
¡¡¡¡¥Æ¡¼¥Ö¥ë¤Ø¥Ñ¥±¥Ã¥È¤ò¥ê¥Ü¥ó¥¹¥×¥ì¥Ã¥É¤·¤Æ²¼¤µ¤¤¡£
¡¡¡¡¡ö¡ö£¹¡ö£²¡ö£¶¡ö£µ¡ö¡¡¡¡¡¡¡¡¡Ê¡ö¤Ï΢¸þ¤­¥«¡¼¥É¡Ë
¡¡¡¡¤ÇʤӤޤ¹¡£


µÒ¤ò¶Ã¤«¤»¤ë¤è¤¦¤Ë¤¹¤ë¤Î¤ÏÂçÊѤǤ¹¡£
 

¤³¤ÎÌ䤤¤Ï¥×¥í¥°¥é¥à²Äǽ¤Ç¤¹¤«¡©

 Åê¹Æ¼Ô¡§GAI  Åê¹ÆÆü¡§2010ǯ 1·î31Æü(Æü)09»þ44ʬ45ÉÃ
ÊÖ¿®¡¦°úÍÑ
  £±¡°£³¡Ü£²¡°£³¡Ü£³¡°£³¡Ü¡¦¡¦¡¦¡¦¡Ü£î¡°£³
¡á£±¡ö£±¡°£²¡Ü£²¡ö£²¡°£²¡Ü£³¡ö£³¡°£²¡Ü¡¦¡¦¡¦¡¦£î¡ö£î¡°£²
¡á¡Ê£±¡Ü£²¡Ü£³¡Ü¡¦¡¦¡¦¡¦¡Ü£î¡Ë¡°£²¡Ê¡á¡Ð£î¡Ê£î¡Ü£±¡Ë/£²¡Ñ¡°£²¡Ë

¤Î¤è¤¯ÃΤé¤ì¤¿´Ø·¸¼°¤Ï

°ìÊÕ¤¬£±¤ÎÀµÊý·Á¤¬£±¸Ä
°ìÊÕ¤¬£²¤ÎÀµÊý·Á¤¬£²¸Ä
°ìÊÕ¤¬£³¤ÎÀµÊý·Á¤¬£³¸Ä
¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦
°ìÊÕ¤¬£î¤ÎÀµÊý·Á¤¬£î¸Ä
¤ò»È¤Ã¤Æ¡¢°ìÊÕ¤¬£î¡Ê£î¡Ü£±¡Ë/2¡¡¤ÎÀµÊý·Á¤òÉߤ­µÍ¤á¤ë²ÄǽÀ­¤ò¼¨º¶¤¹¤ë¡£

¤µ¤ÆËÜÅö¤Ë¤³¤Î¤³¤È¤ò¼Â¸½¤Ç¤­¤ë¤Î¤Ï£î¤¬¤¤¤¯¤Ä¤Î¤È¤­¤Ç¤·¤ç¤¦¤«¡©
¤½¤ÎºÇ¾®ÃͤòÄ´¤Ù¤Æ¤¯¤À¤µ¤¤¡£¡Ê£î¡ä£±¤Î¾ò·ï¤Ç¡Ë
¤Þ¤¿¤³¤Î»þ¤ÎÉߤ­µÍ¤á¿Þ¤Ï¡©