Water collected between towers: Difference between revisions

Content added Content deleted
m (→‎{{header|C sharp|C#}}: changed to more efficient character counting a the end.)
m (→‎{{header|Visual Basic .NET}}: Changed to more efficient character counting at the end.)
Line 1,264: Line 1,264:
' Then count the remaining characters with the Len() function.
' Then count the remaining characters with the Len() function.
Console.Write("Block {0} retains {1,2} water units.{2}", i + 1,
Console.Write("Block {0} retains {1,2} water units.{2}", i + 1,
Len(Replace(Replace(Replace(blk, lf, ""), "██", ""), " ", "")) \ 2, lf)
(Len(blk) - Len(Replace(blk, "≈≈", ""))) \ 2, lf)
Next
Next
End Sub</lang>
End Sub</lang>