Created
May 6, 2016 03:00
-
-
Save johnboker/a57af1cd12eaf2fcf980127882ad10a6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Drawing; | |
namespace CrackTheCode | |
{ | |
class MainClass | |
{ | |
public static void Main (string[] args) | |
{ | |
var txt = System.IO.File.ReadAllText ("../../SETI_message.txt"); | |
Console.WriteLine (txt.Length); | |
var n = 359; | |
using (var img = new Bitmap (n, 5300)) { | |
for (var i = 0; i < txt.Length; i++) { | |
var c = txt [i] - '0'; | |
//Console.WriteLine (c); | |
img.SetPixel (i % n, i / n, c == 0 ? Color.White : Color.Black); | |
} | |
img.Save ("output.png", System.Drawing.Imaging.ImageFormat.Png); | |
img.Dispose (); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment