Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #54024
| From | "Robert L." <No_spamming@noWhere_7073.org> |
|---|---|
| Newsgroups | comp.lang.forth |
| Subject | Rosetta: Generate Chess960 starting position |
| Date | 2017-01-15 13:54 +0000 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <o5futk$1rsv$1@gioia.aioe.org> (permalink) |
the bishops must be placed on opposite color squares (i.e.
they must be an odd number of spaces apart or there must be an
even number of spaces between them)
the King must be between two rooks (with any number of other
pieces between them all)
Ruby:
positions = %w(r n b q k b n r).permutation.select{|ary|
(ary.rindex("b") - ary.index("b")).odd? and
(ary.index("r") .. ary.rindex("r")).include?(ary.index("k"))
}.uniq ;
puts "There are #{ positions.size } positions." ;
puts "The first three:" ;
puts positions.take(3).map(&:join) ;
puts "The last three:" ;
puts positions.last(3).map(&:join)
===>
There are 960 positions.
The first three:
rnbqkbnr
rnbqkbrn
rnbqknrb
The last three:
qbbnrkrn
qbbnrnkr
qbbnnrkr
In Forth?
--
Here Levy is in effect saying: Jewish ethnocentrism is the opposite of
ethnocentrism. Hence, Jewish ethnocentrism is supremely good, whereas every
other ethnocentrism is supremely bad.
theoccidentalobserver.net/2016/02/bernard-henri-levy-on-wars-and-anti-nationalism-its-judaism-stupid
Back to comp.lang.forth | Previous | Next | Find similar | Unroll thread
Rosetta: Generate Chess960 starting position "Robert L." <No_spamming@noWhere_7073.org> - 2017-01-15 13:54 +0000
csiph-web