For creating/viewing fractals, I like the aptly-named
Fractal ExplorerFor those who want automatic circles, I've been using a combination of Quickfort and this:
;
; AutoHotkey Version: 1.x
; Language: English
;
;
;Code originally by "Rysith". See thread http://www.bay12games.com/forum/index.php?topic=30589.0
;I've modified it a bit, added many comments, and tried to bring all the useful variables into one place with an eye towards eventually giving this thing an interface.
;I've also set it to use ControlSend, so that it can run in the background while you browse the internet or something. It should work, as long as you only use the mouse while it runs.
;All credit for this goes to rysith. I'm just making surface changes, I can't even comprehend how the core code works.
;
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
;WinActivate, "Dwarf Fortress" ;Cant remember why Im not using these, but I'm sure I had a good reason.
;WinWaitActive, "Dwarf Fortress"
Sleep 5000 ;5 seconds before it starts pressing buttons. Probably don't need this since we're using ControlSend, but better safe than sorry.
;<<<<<MOST PEOPLE SHOULD ONLY NEED TO CHANGE THESE 3 SETTINGS>>>>>
arg1=13 ;Inner diameter
arg2=48 ;Outer diameter
digMode="r" ;Currently supports ramp, dig, and up/down stair
;Untested, but this loop should allow you to traverse levels, just set the number, and un-comment the "ControlSend > Dwarf Fortress" line below.
;The program should move down 1 level after each circle
loop, 1
{
;Each of these lines makes one quarter of the circle. Comment them out appropriately for a half/quarter circle
circleQuarter("{NumPadDown}","{NumPadUp}","{NumPadRight}","{NumPadLeft}",arg1,arg2,digMode) ;Bottom left
circleQuarter("{NumPadRight}","{NumPadLeft}","{NumPadUp}","{NumPadDown}",arg1,arg2,digMode) ;Bottom right
circleQuarter("{NumPadUp}","{NumPadDown}","{NumPadLeft}","{NumPadRight}",arg1,arg2,digMode) ;Top right
circleQuarter("{NumPadLeft}","{NumPadRight}","{NumPadDown}","{NumPadUp}",arg1,arg2,digMode) ;Top left
;ControlSend,,>,Dwarf Fortress
}
exit
;You shouldn't have to change much beyond this point, unless you need more dig modes.
;Quarter-circle
circleQuarter(up,down,left,right,inner,outer,digMode)
{
x := 0
y := 0
innerBound := % inner*inner
outerBound := % outer*outer
loop,%outer%
{
loop,%outer% ; For a square that is as large as the outer radius
{
if((x*x)+(y*y) <= outerBound && (x*x)+(y*y) >= innerBound)
{
dig(right,0,digMode)
}
move(right,1)
x++
}
move(up,1)
move(left,outer)
y++
x := 0
}
move(down,outer)
}
;Utility functions
dig(dir,number,digMode)
{
;I can't for the life of me get ControlSend to accept a string variable, so in the meantime, just add more if statements to support more dig modes.
if digMode = "d"
{
ControlSend,, d ,Dwarf Fortress
}
if digMode = "i"
{
ControlSend,, i ,Dwarf Fortress
}
if digMode = "r"
{
ControlSend,, r ,Dwarf Fortress
}
ControlSend,, {Enter} ,Dwarf Fortress
move(dir, number)
ControlSend,, {Enter} ,Dwarf Fortress
Sleep 10
}
move(dir,number)
{
loop {
if number <= 0
{
break
}
ControlSend,, %dir% ,Dwarf Fortress
number--
Sleep 10
}
} It's based on code posted
here by Rysith that I modified to make it easier for me to use. It's still very unpolished, requires AutoHotKey, and you have to alter most of the variables by hand, but the I think the comments do an OK job of pointing out what to change.
Best of all, this one uses ControlSend, so you can (sort of) switch/use to other programs while it's running. I've found it's best to stick to light web browsing, as using the keyboard too much, or doing anything too strenuous can cause it to get de-synced.
All credit goes to Rysith for this thing. I've made some cosmetic changes, but the core algorithm is untouched, mostly because I can't for the life of me understand how it works.