Knuth Shuffle on the TI-85:
:ClLCD :Disp "KNUTH SHUFFLE" :Disp "How many items?" :Prompt N : :seq(x,x,1,N,1)→S :For(I,1,N) :round(rand*(dimL S)+.4999,0)→D :S(D)→TEMP :S(I)→S(D) :TEMP→S(I) :End : :Disp S
Ta-dah.
和谐社会???喝血社会!!!
Knuth Shuffle on the TI-85:
:ClLCD :Disp "KNUTH SHUFFLE" :Disp "How many items?" :Prompt N : :seq(x,x,1,N,1)→S :For(I,1,N) :round(rand*(dimL S)+.4999,0)→D :S(D)→TEMP :S(I)→S(D) :TEMP→S(I) :End : :Disp S
Ta-dah.
0 Comments:
Post a Comment « Home