Square but not cube: Difference between revisions

Content added Content deleted
(Added Rust and Swift solutions)
(Added Arturo implementation)
Line 276: Line 276:
1024
1024
1089</pre>
1089</pre>

=={{header|Arturo}}==
<lang rebol>squares: map 1..100 => [&^2]
cubes: map 1..100 => [&^3]

print "Square but not cube:"
print first.n:30 select squares => [not? in? & cubes]
print "Square and cube:"
print first.n:3 select squares => [in? & cubes]</lang>

{{out}}

<pre>Square but not cube:
4 9 16 25 36 49 81 100 121 144 169 196 225 256 289 324 361 400 441 484 529 576 625 676 784 841 900 961 1024 1089
Square and cube:
1 64 729</pre>


=={{header|AutoHotkey}}==
=={{header|AutoHotkey}}==