Skip to content

Instantly share code, notes, and snippets.

@johnboker
Created May 6, 2016 03:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnboker/a57af1cd12eaf2fcf980127882ad10a6 to your computer and use it in GitHub Desktop.
Save johnboker/a57af1cd12eaf2fcf980127882ad10a6 to your computer and use it in GitHub Desktop.
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