Matt Todd
2006-09-12 22:10:50 UTC
Is it possible to have equivalent example blocks of code for the languages?
I'd be willing to submit a few...
cities = %w[ London
Oslo
Paris
Amsterdam
Berlin ]
visited = %w[Berlin Oslo]
puts "I still need " +
"to visit the " +
"following cities:",
cities - visited
vs...
$cities = array("London",
"Oslo",
"Paris",
"Amsterdam",
"Berlin");
$visited = array("Berlin", "Oslo");
print "I still need" .
"to visit the " .
"the following cities: \n" .
implode("\n", array_diff($cities, $visited));
Yeah, it is ugly, isn't it?
M.T.
I'd be willing to submit a few...
cities = %w[ London
Oslo
Paris
Amsterdam
Berlin ]
visited = %w[Berlin Oslo]
puts "I still need " +
"to visit the " +
"following cities:",
cities - visited
vs...
$cities = array("London",
"Oslo",
"Paris",
"Amsterdam",
"Berlin");
$visited = array("Berlin", "Oslo");
print "I still need" .
"to visit the " .
"the following cities: \n" .
implode("\n", array_diff($cities, $visited));
Yeah, it is ugly, isn't it?
M.T.