Skip to content

Instantly share code, notes, and snippets.

@masonforest
Created October 12, 2012 23:03
Show Gist options
  • Save masonforest/3882135 to your computer and use it in GitHub Desktop.
Save masonforest/3882135 to your computer and use it in GitHub Desktop.
Connascence of Position (CoP) Problem Ruby 1.9
def do_things(puppie_count, missle_count)
puts "Played with #{puppie_count} puppies"
puts "Launched #{missle_count} missles"
end
puts "Everything is Fine"
do_things(5,0)
do_things(10,0)
do_things(12,0)
do_things(0,5)
puts "Oh Shit!"
=begin
Output:
Everything is Fine
Played with 5 puppies
Launched 0 missles
Played with 10 puppies
Launched 0 missles
Played with 12 puppies
Launched 0 missles
Played with 0 puppies
Launched 5 missles
Oh Shit!
=end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment