thraxil.org:

Reply to: A Simple Programming Puzzle Seen Through Three Different Lenses

Good article, thanks.

The concept is to pick all two-state combinatations,
and there is an easy, fast, accurate model for this.

It is called “combinations without repetitions”
and can be implemented like this in pseudocode:

while state1 = states.shift
for state2 in states
# your code here… no need to skip cases
end
end


formatting is with Textile syntax. Comments are not displayed until they are approved by a moderator. Moderators will not approve unless the comment contributes value to the discussion.

namerequired
emailrequired
url
remember info?