Well, as this isn't the most challenging challenge, I decided to challenge myself ;)
Here is an answer in the stack-based programming language Factor.
! is an integer even?:even?(int--?)2mod0=;! is an integer a multiple of ten?:multiple-of-ten?(int--?)10mod0=;! helper word (that's a 'function' in factor) for prime? :(prime?)(intm--?)2dup<=[t2nip][2dupmod0=[f2nip][1+(prime?)]if]if;! is an integer prime?:prime?(int--?)2(prime?)! all three tests applied to a single integer, output as an array:all-three(int--seq)2dup[prime?][even?][multiple-of-ten?]tri*3array;5all-three!
! --- Data stack:! { t f f }clear10all-three!
! --- Data stack:! { f t t }
I've never tried anything like this before, so I'd be interested in some feedback if any is available.
Conversely, if anyone would like me to explain what on earth is going on above, please ask and I'll do my best. I really enjoyed writing it.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Well, as this isn't the most challenging challenge, I decided to challenge myself ;)
Here is an answer in the stack-based programming language Factor.
I've never tried anything like this before, so I'd be interested in some feedback if any is available.
Conversely, if anyone would like me to explain what on earth is going on above, please ask and I'll do my best. I really enjoyed writing it.