1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
$Cave = [System.Drawing.Bitmap]::FromFile( '.\juan2.jpg' ) $cave $i=0 $a=0 $array = @() for ($y = 0;$y -lt $Cave.Height;$y+=1) { for ($x = 0;$x -lt $Cave.Width;$x+=1) { $col=$Cave.GetPixel($x,$y).Name if ($i -lt $Cave.Width -1) { switch ($col) { "ff000000" { Write-Host "X" -BackgroundColor Black -ForegroundColor White -NoNewLine $array += "X" } default{ Write-Host " " -BackgroundColor white -NoNewLine $array += " " } } $i=$i+1 if ($a -lt 9){$a=$a+1} else{$a=0} } else { Write-Host " " $array += "*" $i=0 $a=0 } } } ######### #Negative ######### $uu="" foreach ($p in $array) { if ($p -eq "*") { write-Host $p -BackgroundColor Black -ForegroundColor White $uu=$uu+"`n" } else { write-Host $p -BackgroundColor Black -ForegroundColor White -NoNewLine $uu=$uu+$p } } |