Blog edition
vers. 1.2.19

the Nailbox

Honeypot for bots. Don't submit or you'll get banned!

Other programs

Some other programming related stuff I've been working on...

[first|1|2|last]

[view]

Ants

2010-06-29 11:31 by Nailbar
Got carried away reading about cellular autonama so I decided to make my own ant farm.

It works in Firefox and uses the HTML5 canvas so in theory it should work on any HTML5 enabled browser.

Enjoy!

ants.html

Basically it generates a couple of ants with a random set of 8 genes which dictates what color the underlying pixel will turn into, and how the ant will move to the next pixel, depending on what color the current pixel is.

Click Zap to mutate an ant, and Kill to restart an ant in a new place with completely random genes.

The eight genes are sets of three numbers each; Activation color, New color, Action. If a gene is "641" then this means that if the ant steps on a pixel with color 6, then it will turn that pixel into color 4, and turn right.

Action codes; 0=forward, 1=turn right, 2=turn left, 3=reverse.

For example, the gene set of 022,152,201,372,440,562,620,721, which was generated randomly by the program, turned out to be Langton's Ant:

langtons_ant.jpg

Since JavaScript is very hackable, here's the code to make one of the ants into Langton's ant:

javascript:a[0].g1=[2,5,0,7,4,6,2,2]; a[0].g2=[2,2,1,2,0,2,0,1]; a[0].x=400; a[0].y=300; updategenes(0);

Just copy-paste into the browsers address bar and press Return while the program is running. You may need to tweak the a[0].x, and a[0].y parts to place the ant in an empty spot so it won't tangle up with other ants.

Update

Updated the ant program so it's not limited to a fixed number of ants or genes.

ants.jpg

ants-1.1.html

[Add comment]

[view]

WebSpace

2010-04-16 22:05 by Nailbar
I don't know if that name is taken or whatever, but I put together a small browser based JavaScript space shoot-em-up.

Really crappy controls. Sorry about that.

Here's a live version: http://www.waxjism.org/nail/stuff/webspace/

And here's the source: webspace.tar.gz

And here are some graphics from the game:

http://www.waxjism.org/nail/stuff/webspace/pics/p2.pnghttp://www.waxjism.org/nail/stuff/webspace/pics/p3.pnghttp://www.waxjism.org/nail/stuff/webspace/pics/p4.pnghttp://www.waxjism.org/nail/stuff/webspace/pics/e3.pnghttp://www.waxjism.org/nail/stuff/webspace/pics/t6.pnghttp://www.waxjism.org/nail/stuff/webspace/pics/t7.pnghttp://www.waxjism.org/nail/stuff/webspace/pics/t8.png

[Add comment]

[view]

BugHunt

2010-01-17 09:29 by Nailbar
Being stuck with no Internet access and nothing but a fresh Windows Installation made me do the only logica thing I could think of; Program a JavaScript game in Notepad.

So here I present to you BugHunt!

bughunt.html

Or BLEH!, as it was initially called.

It's not standards compliant. I don't know if it works in anything other than Firefox 3.5.5 for Windows XP. It's just something quick and simple I had to make to calm down.

[Add comment]

[view]

Plenty of fun

2009-04-03 23:56 by Nailbar
I found my stash! With that I'm referring to my old website and all the random games I've posted there. This is from the time when I had a lot more time on my hands, and was just learning all these new programming languages.

Here's a list of what I've found. These are all windows programs (works in XP, I just checked) but should work well in Wine too (only the 3D programs worked but if you get the right dll the VisualBasic progs should work too).

  • Hunt102.zip
    This is a compiled QBasic game where you do your best to evade the evil dots that follow you.
  • bsim3d.zip
    This is one of the best things I've done in 3D; a truck driving simulator where you drive a truck, including a trailer, over a randomly generated landscape. I don't remember all the keys but at least I know you use the arrow keys to move the truck, and V to change camera mode. Then there are some keys for regenerating, or modifiyng the terrain too.
  • fig017.zip
    Despite the file name this program is called Fighter III. You drive a space ship and fight against waves of enemy fighters. This game features an increasing tech level so you don't have to use the same ship all the time. Press F1 for in-game help.
  • life.exe
    This is some kind of simple prey-predator game of life, made in Visual Basic. You can click on the world window in order to add predators (left mouse button), and prey (right mouse button).
  • linakrak.exe
    Another simple program made in Visual Basic. Click on the screen with the mouse button in order to regenerate the world. The creatures will dig and create borders between colonies.
  • nwn914.zip
    Space Figher aka Fighter I. This is the original space duel game in C++ upon which all my other space duel games are based on (like Red Roids and Miniduel). It's in black and white because I didn't know how to use colors back then.
  • rro026.zip
    Red Roids 0.26. This is a later game based on the Fighter series. This one features a level editor and a story line! The physics are kinda diffult, though.
  • rro105.zip
    Red Roids 1.05. This is almost identical to Red Roids 0.26 but is more complete. I think the story even has an ending.
  • rro106.zip
  • This is where I lost interest in developing Red Roids 1. This version is missing the readme.txt, or whatever it may be called, so you'll have to grab that from rro105.zip. The reason I packaged and posted this is that this one features a ship editor too. Here are the screen shots...
    rro106a.gif
    rro106c.gif rro106e.gif shp001a.gif
  • rro222.zip
    Um... Yeah. This is my attempt at making a strategy game based on the Red Roids world. I lost interest after a while so it's not really finished. You just spawn there with your base and a bunch of ships. Then you produce more ships and attack all the enemy bases and they respawn and you keep doing this until your base is destroyed. There is a hud, though. The screen shots are from older versions without the hud.
    rro218a.jpg rro218b.jpg rro218c.jpg rro218d.jpg
  • snake.zip
    This is something like a screen saver. You just start it, and after a while some patterns start to appear. Made this in Visual Basic.
  • snakers.zip
    This is a two player snake game. One of my first programs that I made in C++. A snakes goal would be to eat boxes and grow bigger while avoiding the other snakes tail. Both snakes can be controlled by human or AI players.
  • snaketrail.2a2.zip
    Basically the same thing as snake.zip, but this is done in C++ and may look and perform better.
  • spacebattle.exe
    Really simple space battle simulator where all you can do is click on the screen to add new mother ships. The AI takes care of the rest. Kinda like a screen saver. Made it in Visual Basic.
  • stars.exe
    Some kind of galaxy simulator in Visual Basic. All I remember is that you klick on the screen with the mouse to create a world, Return replays the world in fast forward, Space centers on the current star, Arrow keys moves the camera, Plus and Minus Zooms the camera, and Page up and Page down selects next and previous star.
  • tnks205.exe
    A simple one player tank battle game I made in Visual Basic. You move your tank using the arrow keys and shoot with the left mouse button. Kill all enemy tanks and the next wave will come after you stop moving around.
  • tunnel010.zip
    This is my first attempt on making a First Person Shooter. I ended up with a random-world-generator and nothing else. Still interesting, though.
    tunnel007.jpg tunnel008.jpg tunnel009.jpg tunnel010.jpg

There were also some non-compiled QBasic games which I will not post at this moment. Maybe I'll package them with the QBasic intrepreter, or as compiled... Or maybe just the code if anyone requests it.

[Add comment]

[view]

YouTube double size

2009-02-28 19:02 by Nailbar
For some annoying reason my browser crashes when I try to watch YouTube videos in fullscreen. Perhaps it's just some bug in the Linux version of the flash player, or something like that. My screen is big enough to make the default YouTube window too small so I've added this page: [youtube.html] for playing the videos at a double size. Yeay!

You'll need the video code (http://www.youtube.com/watch?v=IRQoAcsIdj0) marked here in bold.

[Add comment]

[view]

Follow image links

2009-01-06 12:39 by Nailbar
Just copy this code to the browsers address bar and press Return. If it complains about pop-ups, just select allow, refresh the page, and run the script again. You will get the twenty first images as pop-up windows, or in Firefox' case, new tabs.

javascript:if(list){ for(var i=pops+19;i>=pops;i--) if(list[i]) var temp=window.open(list[i]); var temp=pops+=20; }else{ var list=new Array(); var pops=0; var traceit=function(elmnt){ if(elmnt.tagName=="A"){ var temp=elmnt.href; var type=temp.substr(temp.length-4); for(var i=0;i<list.length;i++) if(list[i]==temp) temp=""; if(temp && (type==".jpg" || type==".png" || type==".gif" || type==".JPG" || type==".PNG" || type==".GIF")) list[list.length]=temp; } for(var i=0;i<elmnt.childNodes.length;i++) traceit(elmnt.childNodes[i]); }; traceit(document.body); for(var i=pops+19;i>=pops;i--) if(list[i]) var temp=window.open(list[i]); var temp=pops+=20; }

Run the code again to get the next 20 images.

2009-01-06 12:39 by Nailbar
I updated the script so the 20 images will come in the right order. The popping will now start with the picture further down in the list and work itself upwards. That way you'll get the popup containing the topmost image last and at the top of the stack.

2009-01-06 12:40 by Nailbar
Note that this doesn't work on the images in the Nailbox. Sry.

[Add comment]

[first|1|2|last]

by Martin Wikström

Updated: 2010-06-29 11:31