Login
Immutable PageDiscussionInfoAttachments
kakakaya/Product/BASIC/RandomCheck

MMA

RandomCheck

RANDOMIZE
LET n=0
DO
   LET t=0
   DO
      LET i=0
      LET w=0
      LET l=0
      DO
      !0>=a>1とする
         LET a=RND
         !aが0<=a<5ならlose、5<=a<1ならwin
         IF a>=0.5  THEN
            LET w=w+1
         ELSE 
            LET l=l+1
         END IF
         LET i=i+1
      LOOP UNTIL i=100
      IF w>l THEN
         LET wt=wt+1
      ELSEIF l>w THEN
         LET lt=lt+1
      ELSE 
         LET dt=dt+1
      END IF
      LET t=t+1
   LOOP UNTIL t=10
   IF wt>lt THEN
      LET awt=awt+1
   ELSEIF lt>wt THEN
      LET alt=alt+1
   ELSE 
      LET adt=adt+1
   END IF
   LET n=n+1
LOOP UNTIL n=100
PRINT "Win=";awt;"Lose=";alt;"Draw=";adt
END

kakakaya/Product/BASIC/RandomCheck (last edited 2011-12-12 19:03:09 by kakakaya)