View Single Post
Old 2008-03-26, 00:45   #2
kar_bon
 
kar_bon's Avatar
 
Mar 2006
Germany

2×1,423 Posts
Default

here is another enhancement for LLRnet:

insert the following red lines into 'llrnet.lua' (around line# 187, function 'Work()') and all found primes will be written in a seperate file called 'primes.txt':

Code:
(...)
	 -- check user interruption
	 if stopCheck() then
	    return -- return with no error
	 end
      end

   if result == 0  then
     local file = openfile("primes.txt", "a")
     write(file, format("%s %s\n", k, n))
     closefile(file)
   end

      SemaWait(semaphore)

      -- add the result in tosend table and file
      local tbl = { t = t, k = k, n = n, 
(...)
the primes in this file are formatted as one prime per line with 'k n' values.

karsten
kar_bon is offline   Reply With Quote