Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2]

Author Topic: Marking out big circles  (Read 5170 times)

Firnagzen

  • Bay Watcher
  • [CURIOUSBEAST_INSANE]
    • View Profile
Re: Marking out big circles
« Reply #15 on: June 18, 2009, 08:35:38 am »

Look at it this way. A circle, by definition, is the collection of points which all have equal distance to a single point, called center.

And in DF, diagonal movement costs as much as straight movement. This means that what we uneducated humans call a square is actually a perfectly round and pretty dwarven circle!

... Well, I want something that looks like a circle to me, the omniscient controller of them dwarves.

Anyway, I like the MS paint idea. Thanks!
Logged
Christ, are you dwarves or are you elves? If you think Hell has too many demons, then you kill them till the population reaches an acceptable number.

Peewee

  • Bay Watcher
  • Watcher Of Bays
    • View Profile
Re: Marking out big circles
« Reply #16 on: June 18, 2009, 08:54:51 am »

For the lazy:

Spoiler (click to show/hide)

Shamelessly copied from... er... somewhere, I forgot  ;D

*grabs a copy of that image before it's lost*

gtmattz

  • Bay Watcher
  • [PREFSTRING:BEARD]
    • View Profile
Re: Marking out big circles
« Reply #17 on: June 18, 2009, 10:43:34 am »

For the lazy:

Spoiler (click to show/hide)

Shamelessly copied from... er... somewhere, I forgot  ;D

*grabs a copy of that image before it's lost*
*follows suit*
Logged
Quote from: Hyndis
Just try it! Its not like you die IRL if Urist McMiner falls into magma.

yuhhaur

  • Bay Watcher
    • View Profile
Re: Marking out big circles
« Reply #18 on: June 18, 2009, 10:46:22 am »

*grab it and then find out that it is already grabbed*
Logged

Priha

  • Escaped Lunatic
    • View Profile
Re: Marking out big circles
« Reply #19 on: June 19, 2009, 03:32:21 pm »

Here's an ahk-script by Rysith from this thread http://www.bay12games.com/forum/index.php?topic=30589.0
Code: [Select]
;One full circle
#c::
circleQuarter("{NumPadDown}","{NumPadUp}","{NumPadRight}","{NumPadLeft}",0,4)
circleQuarter("{NumPadRight}","{NumPadLeft}","{NumPadUp}","{NumPadDown}",0,4)
circleQuarter("{NumPadUp}","{NumPadDown}","{NumPadLeft}","{NumPadRight}",0,4)
circleQuarter("{NumPadLeft}","{NumPadRight}","{NumPadDown}","{NumPadUp}",0,4)
exit

;Quarter-circle
circleQuarter(up,down,left,right,inner,outer)
{
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)
}

move(right,1)
x++
}
move(up,1)
move(left,outer)
y++
x := 0
}
move(down,outer)
}

;Utility functions
dig(dir,number)
{
send d
send {Enter}
move(dir, number)
send {Enter}
}

move(dir,number)
{
loop {
if number <= 0
{
break
}
send %dir%
number--
}
}

The circle template is from the same thread.
Logged
Pages: 1 [2]