The Daily WTF: Curious Perversions in Information Technology
Welcome to TDWTF Forums Sign in | Join | Help
in Search

Stupid Coding Tricks: Sudoku solver in Whitespace!

Last post 05-20-2009 5:53 PM by FraGag. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 05-19-2009 11:53 PM

    Stupid Coding Tricks: Sudoku solver in Whitespace!

    Yes, I know. I have way too much time on my hands. 

    I wanted to practice some of what I learned from my recent compilers class (hey, I enjoy the subject), so I designed a simple LISP-like language that compiles to Whitespace. Of course, I wanted to write a small (but not trivial) application in it to test out the compiler. A sudoku solver - basically just a simple depth first search algorithm - seemed the perfect choice.

    http://rapidshare.com/files/235032340/sudoku.ws

    The Whitespace interpreter is here: http://compsoc.dur.ac.uk/whitespace/


  • 05-20-2009 1:09 AM In reply to

    Re: Stupid Coding Tricks: Sudoku solver in Whitespace!

     hehe, very clever.  I like how almost nobody writes IN whitespace, buy instead compiles TO it.  I'm wondering why you didn't paste your source?

  • 05-20-2009 1:27 AM In reply to

    Re: Stupid Coding Tricks: Sudoku solver in Whitespace!

    The web tends to screw up white-space formatting (I've played around a bit on the "Preview" tab, but it seems to convert all tabs into spaces). If you want, I could post a long string of 's', 't', and 'n' so you can do a search & replace in a text edtior. Being a 12k file though, that kinda borders on spamming.

  • 05-20-2009 2:24 AM In reply to

    • ammoQ
    • Top 10 Contributor
    • Joined on 04-13-2005
    • Vienna.Austria.Europe.Earth
    • Posts 3,515

    Re: Stupid Coding Tricks: Sudoku solver in Whitespace!

    thread moved to funny stuff (IMO a better fit than the sidebar wtf)
    beanbag girl 4ever ... or maybe Astah girl?
  • 05-20-2009 2:31 AM In reply to

    Re: Stupid Coding Tricks: Sudoku solver in Whitespace!

     

    ammoQ:
    thread moved to funny stuff (IMO a better fit than the sidebar wtf)

     Darnit! I should have waited until tomorrow morning to post this, just before everyone started work. Nobody's gonna see it here.

  • 05-20-2009 11:47 AM In reply to

    Re: Stupid Coding Tricks: Sudoku solver in Whitespace!

    Huf Lungdung:
    Being a 12k file though, that kinda borders on spamming.
    You could post it to basepint.
    ╩юфют√ь ёЄЁрэшЎрь яюЁр эр яхэёш■.

    #TDWTF @ SlashNET was merged into #codelove @ the same network. You're still welcome to drop by. I guess.
  • 05-20-2009 12:40 PM In reply to

    Re: Stupid Coding Tricks: Sudoku solver in Whitespace!

    Thanks. That's a really cool website.

    http://whitespace.pastebin.com/f761fc4b5

    Note that you can't copy & paste the code because it seems to add indented line numbers. Use the "download" link instead.

     

  • 05-20-2009 1:47 PM In reply to

    Re: Stupid Coding Tricks: Sudoku solver in Whitespace!

    Huf Lungdung:
    Note that you can't copy & paste the code because it seems to add indented line numbers. Use the "download" link instead.

    You're using IE, aren't you?

    Interestingly enough, Firefox doesn't add line numbers, but inserts octothorpes between lines. Opera doesn't add anything.

    ╩юфют√ь ёЄЁрэшЎрь яюЁр эр яхэёш■.

    #TDWTF @ SlashNET was merged into #codelove @ the same network. You're still welcome to drop by. I guess.
  • 05-20-2009 2:30 PM In reply to

    Re: Stupid Coding Tricks: Sudoku solver in Whitespace!

     Umm... no. I am using FireFox, but it wasn't adding hash symbols. 

    As long as it doesn't add white-space characters, it should be good. The problem was that the line numbers were indented.

  • 05-20-2009 5:53 PM In reply to

    • FraGag
    • Not Ranked
    • Joined on 09-23-2006
    • Les Coteaux, QC, Canada
    • Posts 39

    Re: Stupid Coding Tricks: Sudoku solver in Whitespace!

    Alternatively, one could also copy and paste the text from the text area at the bottom of the page. This should preserve the whitespace characters correctly (it does at least in Firefox).

Page 1 of 1 (10 items)
Powered by Community Server (Non-Commercial Edition), by Telligent Systems