Post Reply 
little math/programming problems April 2023
05-15-2023, 09:26 PM (This post was last modified: 05-15-2023 11:09 PM by Gilles.)
Post: #10
RE: little math/programming problems April 2023
My (New)RPL version :
Code:
« → Loop 
  « 0 
    1 Loop START
      5 'NbDe' LSTO  
      0 'TotalJet' LSTO 
      WHILE NbDe REPEAT
        1 'TotalJet' STO+  0 'NewDe' LSTO 
        1 NbDe START
          RAND 6 * 
          CASE
            DUP 5 ≥ THEN 3 'NewDe' STO+ END
            DUP 4 ≥ THEN 2 'NewDe' STO+ END
          END
          DROP 
        NEXT
        NewDe 'NbDe' STO 
      END
      TotalJet + 
    NEXT
    Loop / 
  »
»
Size : 296 Bytes

Execution on my laptop and HP50g, NewRPL
Code:
Loops    Time(s)    Result  Time 
         Laptop             HP50g
----------------------------------
1000     0.015      5.438    4.1
10000    0.285      5.4475   39
100000   2.912      5.48428  389 (ratio vs PC ~ 133 )
1E6      30.99      5.49546  ++
10E6     311.79     5.49432  ++
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: little math/programming problems April 2023 - Gilles - 05-15-2023 09:26 PM



User(s) browsing this thread: 2 Guest(s)