Monday, September 2, 2013

Starting to work with Whitespace

I have decided to tackle problem 36 with the Whitespace Programming Language. For the uninitiated, it is a programming language where the only legal characters are space, tab, and newline. So,it is just a little hard to work with. I have started doing work on problem 36, but I have a while to go...the problem involves finding palindromes, so I am pretty sure I will want an order of magnitude method (so that it is possible to easily compute "first digit equals last digit", etc - no strings in Whitespace). I have that done at least, below is the code for the [base 10] order of magnitude method: I will need a base 2 one eventually, but thats a pretty easy change...well, not entirely trivial because variables aren't exactly a walk in the park, but not too bad either. The code also includes it running on a test case of 64. I don't think this post will preserve whitespace, so https://dl.dropboxusercontent.com/u/34972177/PELC/e36Real.ws

 
  

    
      
    
          

     
 
       
    
    
 
  

 

      
   
 

    
       
   
      
 
        
       
 
   

    
          

    
 
         
 
  



No comments:

Post a Comment