Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: New competition: do you accept the challenge?! :-)

From: sant4:wanadoo at: 8-Nov-2007 2:30

;A tricky really really fast solution: ;just to say that if we would know the finality of the algorhitm, we would probably use a tricky and really fast solution. print "START..." s1: now/time/precise blk: [i #"," j #"-"] str: make block! 4000 insert/dup str blk 500 str: skip str 2 repeat j 500 [ str: skip change str j 3 ] str: head str finale: make string! 50000 i: 0 loop 10000 [ i: i + 1 str2: to string! reduce cp/part str 5 ; the trick is here, if you cp/part the block before to reduce it, it's really fast. finale: insert finale copy/part next str2 4 ] print "STOP!" print length? head finale print (now/time/precise - s1)