Post Reply 
Summation based benchmark for calculators
08-29-2019, 07:03 PM
Post: #187
RE: Summation based benchmark for calculators
(08-24-2019 08:07 PM)toml_12953 Wrote:  I ran the nqueens program below on an Nspire CX II CAS in about 2.9 seconds. I really wish the Nspire had an RTC for more accurate measurements.

Thank you for testing. For more accuracy at fast and very fast results, I've used an outer loop:

Code:
Define nqueens()=
Prgm
  Local a,n,r,s,t,x,y
  8->r
  newList(r)->a
  For n,1,10
    0->s
    0->x
    Loop
      x+1->x
      r->a[x]
      Loop
        s+1->s
        x->y
        While y>1
          y-1->y
          a[x]-a[y]->t
          If t=0 or x-y=abs(t) Then
            0->y
            a[x]-1->a[x]
            While a[x]=0
              x-1->x
              a[x]-1->a[x]
            EndWhile
          EndIf
        EndWhile
        If y=1
          Exit
      EndLoop
      If x=r
        Exit
    EndLoop
  EndFor
  Disp s
EndPrgm

(Auto or Exact Mode)

Calculator Benchmark
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Summation based benchmark for calculators - xerxes - 08-29-2019 07:03 PM



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