27.7.06

Let it be hosted; let it be posted.

I have the script online at my old website, and I have a project page for those who want to learn more about my pento project.

EDIT: Direct access to the script isn't working, becuase the server is being stupid with permissions. When I get it fixed, you'll be able to see the word of the day in the sidebar, too.

Look out, Hyrule!

It's Camp Hyrule for me this summer. The virtual week-long summer camp, organized by Nintendo online administrators (NOA), is a sandbox of Nintendo-related online activities, including live chats and bulletin boards, Flash games, and unpredictable occurences. Campers are organized into cabins, which act as competing teams in many of the activities; prizes are awarded to members of the winning cabin.

Registration is still open through today, so get moving if you want in.

21.7.06

Completoration!

I've had much free time lately, so I've finished the PNG pentomino generator. Have a look!

This is the default image:

The script also has several parameters other than the word to penominify, such as

color,

size,

and bevel (depth).

Also soon to come is background color! Of course, since my script can let the background be transparent, that is probably the style of choice for most websites.

I'll soon give links to the source, once I get it hosted. I still want to be able to print some neat ASCII art pentominos, but expect to see a Pentomino Word of the Day or something in the sidebar soon.

EDIT: Heh, you've probably noticed the extra space at the top of each image. I'll try to get rid of that.

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.

7.7.06

Old S|<0oL tools

CS Lab on Wednesday introduced us to something new and exciting: the dot utility. Er, it's actually around 15 years old, but it's still as functional as ever. Here's how to draw a simple flowchart, for example:

First, I type this bit of extremely simple code into the file Flowchart.dot, so simple that many people reading this should be able to understand it:

digraph Flowchart {
node1 [label="Program starts", shape=rect, style=rounded];
node2 [label="Ask user's age", shape=parallelogram];
{
rank=same;
node3 [label="18 or older?", shape=diamond];
branch [label="Quit the game", shape=rect, style=rounded];
}
node4 [label="Finish starting up", shape=rect, style=rounded];

node1 -> node2 -> node3;
node3 -> branch [label="NO"];
node3 -> node4 [label="YES"];
}

...then I type dot -Tpng Flowchart.dot -o Flowchart.png on the command line, and I get this:



Very slick, no? All I need to specify are the nodes and the connections between them, along with a few parameters for node shape, etc., in order to produce a nice, polished flowchart/graph/thing. Why are we fiddling with graphics and flowcharts, though? Well, we're currently studying directed graphs and shortest-path problems, and in order to help visualize the problem, we use dot.

Even neater is the fact that this utility, as well as several other similar ones (e.g. that draw radial or circular graphs), were recently packaged up with the name GraphViz and released under an open-source license, so that anyone can easily make a graph of the courses needed to complete their major:



Not that anyone besides me actually opts for Computer Engineering.