Zhang-Suen thinning algorithm: Difference between revisions

m
→‎{{header|Wren}}: Changed to Wren S/H
imported>Arakov
m (→‎{{header|Wren}}: Changed to Wren S/H)
 
(One intermediate revision by one other user not shown)
Line 1,750:
int count := 0;
for (int i := 0,; i < nbrs.Length - 1,; i += 1)
{
if (self[r + nbrs[i][1]][c + nbrs[i + 1][0]] == $35)
Line 1,763:
int count := 0;
for (int i := 0,; i < nbrs.Length - 1,; i += 1)
{
if (self[r + nbrs[i][1]][c + nbrs[i][0]] == $32)
Line 1,781:
int count := 0;
var group := nbrGroups[step];
for(int i := 0,; i < 2,; i += 1)
{
for(int j := 0,; j < group[i].Length,; j += 1)
{
var nbr := nbrs[group[i][j]];
Line 1,806:
firstStep := firstStep.Inverted;
for(int r := 1,; r < self.Rows - 1,; r += 1)
{
for(int c := 1,; c < self.Columns - 1,; c += 1)
{
if(self.proceed(r,c,toWhite,firstStep))
Line 1,815:
};
toWhite.forEach::(p){ self[p.y][p.x] := $32 };
toWhite.clear()
}
Line 1,824:
var it := self.enumerator();
it.forEach::(ch){ console.print(ch," ") };
while (it.next())
{
console.writeLine();
 
it.forEach::(ch){ console.print(ch," ") }
}
}
Line 5,052:
=={{header|Wren}}==
{{trans|Kotlin}}
<syntaxhighlight lang="ecmascriptwren">class Point {
construct new(x, y) {
_x = x
9,476

edits