I've tried signing up, and have become bored waiting for my registration email.

Here's my answer ....
on mouseUp
   local tInput
   put fld "FieldIn" into tInput
   if the number of words in tInput <> 2 or \
         word 1 of tInput is not a number or \
         word 2 of tInput is not a number then
      ask "must give 2 numbers"
      exit mouseUp
   end if

   local  tAPrime, tANonPrime

   repeat with i = 2 to word 2 of tInput
      if tANonPrime[i] then next repeat
      if i >= word 1 of tInput then put true into tAPrime[i]
      repeat with j = i+i to word 2 of tInput step i
         put true into tANonPrime[j]
      end repeat
   end repeat

   local tt
put "The number of primes between" && tInput && "is" && the number of lines in the keys of tAPrime & CR into fld "F"
   put the keys of tAPrime  into tt
   sort lines of tt numeric

   put "and they are" & CR & tt after fld "F"


end mouseUp
Alex

On 06/09/2015 20:42, AndyP wrote:
I've added a new question to the LiveCode coding challenge section of my
site.

Determine Pi from an image of a circle

http://2108.co.uk/questions/ <http://2108.co.uk/questions/>

There has been 1 partial solution to the previous question

Primes between 20 and 700

Anyone feel up to improving on the current solution?



-----
Andy Piddock


My software never has bugs. It just develops random features.

Copy the new cloud space, get your free 15GB space now:
Get Copy


Script editor Themer for LC http://2108.co.uk

PointandSee is a FREE simple but full featured under cursor colour picker / 
finder.
http://www.pointandsee.co.uk  - made with LiveCode
--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/New-Coding-Challenge-added-tp4696094.html
Sent from the Revolution - User mailing list archive at Nabble.com.

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to