18.7.06

Pentomination!

My latest personal project, on which I have been working for a few weeks, attempts to draw words using pentominos. (Like Tetris pieces, but with one more 'mino'.) It's written in PHP, and I've got it doing things like

[] [] []
[] [][] [] []
[][] [][] [] [] [][][]
[] [] [][] [][] [][]
which spells 'hello', and

[1]
[1][1][2][2] [4][4][4][5][5]
[1] [2][2][3][3][3][4] [5]
[1] [2][3] [3][4][5][5]
which is the word 'pants'. (For the confused, the pentominos are crammed together, distinguished by number.) While this is a good start, especially since I haven't before done anything like kerning letters together, I plan for the script to be able to create things like

_
_ _ | | _
_____| | ___ | |_ | |___| |
|_ _| |_| . | |_ |_ _| | _| |_
| | |_ | _| | | |_| | | |_| _|
|_| |_|_| |_|_____|_|___|_|

___ _
_ | _| _ | |_ _
| |_| |_____| |_ _____ | _|___ _| |_
| . | | . _|_ |_| _ | | | . _|_ _|
|___|_|___| |___|_| |_| |_|___| |_|

_ _ ___
| | ___ _| |___ _ ___| _|
| |_ |_ |_| _| _| _____ | | . | |
_| | |_| |_ | |_| | | . _|_| | _| |
|___|_____| |_|_|___| |___|_____|_| |_|

_ _
_____| | ___ | |___ ___ _ _ _
|_ _| |_| . | | | . |_ |___| | _| |_____| |_
| | |_ | _| | |_ | | |_ _| | . | . _| _|
|_| |_|_| |___|_| |___|_| |___|___|___|

with a single command, and, ultimately, generate heavily customizable graphics in real time for websites such as mine (ooo...pentomino word of the day!). Once I finish one, the other should shortly follow, so expect several further updates.

EDIT: Here's one of my early experiments, showing the graphical style I had settled on:



Since I am still planning to follow this prototype, consider it a preview of what's to come.

2 comments:

Anonymous said...

How difficult would it be to change the program to draw with more minos per character, or less minos per character, but with the ability to use more than one piece per character? Right now, letters it's creating are difficult to read, but you could create some pretty cool looking shapes with more complex building pieces, perhaps?

I'm a complete layman with this stuff, so forgive any unknowing stupidity on my part.

Bug said...

Congratulations! You are the 2nd person ever to comment on my blog! You get a cookie.

Yes, the are hard to read as they are, built of ASCII blocks. I'm not quite sure what you mean by minos/char, but as to fancier building blocks, did you have something like this in mind?

That image was actually an early experiment (not generated), and I still plan to generate graphics very similar to this.