Splitting of string at an interval

Dave Angel davea at davea.name
Tue Apr 9 02:28:51 EDT 2013


On 04/08/2013 10:38 PM, Steven D'Aprano wrote:
> On Mon, 08 Apr 2013 21:09:08 -0400, Roy Smith wrote:
>
>>> There's a whole competition about writing the smallest program which
>>> outputs the song "99 bottles of beer":
>>>
>>> http://codegolf.com/99-bottles-of-beer
>>
>> I see the top 10 entries are all written in Perl.  I suppose this says
>> something.
>
>
> When I write my own programming language, it will include a one-character
> built-in command to perform 99 bottles of beer, just so my language will
> always be the winner.
>
> In fact, I may make it a bare . so that not only will it be the shortest
> program, but also the smallest program in terms of number of non-white
> pixels.
>

But do we need a shebang line?  If so, then make sure the interpreter 
name is also one character long.

I expect there's a character with fewer pixels than the period, but the 
utf-8 version of it would be more than one byte long.  But you could 
define your language with a default encoding that happens to map said 
character to a single byte.

The Wang word processor (proprietary hardware and OS) used a single 
pixel for \x20, and the no pixels for the \xff.  This way spaces were 
"visible" with a faint dot, more or less in the middle of the cell 
block.  It defined other symbols for other control characters like tab 
and newline.  I'm still looking for a similar feature for emacs (on 
Ubuntu), but so far I've been disappointed by the results.

Libreoffice has a similar feature, enabled by 
View->NonPrintingCharacters, but the dotted space is way too bold, 
basically a period that's higher in its cell.

-- 
DaveA



More information about the Python-list mailing list