Re: The Nim way to do this

2018-03-09 Thread jzakiya
Thanks! Where in the docs are these methods?

Re: The Nim way to do this

2018-03-09 Thread JohnS
let primes = [7, 11, 13, 17, 19, 23, 29, 31] #1 if 7 in primes: echo("Found it!") #2 echo primes.find(13) I don't think count does what you think it does. According to [the docs](https://nim-lang.org/docs/sequtils.html#count,openArray%5BT%5D,T) it "Returns

The Nim way to do this

2018-03-09 Thread jzakiya
I've looked through the docs but haven't found the answer to this. I have an array of integers (prime numbers) and I want to: 1) determine if some number is included in the array and 2) return the index value of the number in the array. In Ruby/Crystal I can do the following. What are the