Bay 12 Games Forum

Please login or register.

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

Author Topic: Logic gate mechanisms?  (Read 1223 times)

mickel

  • Bay Watcher
    • View Profile
Logic gate mechanisms?
« on: November 15, 2007, 05:42:00 pm »

I know we can make them with floodgates etc. but it might still be kinda cute with a couple of specialised mechanisms that take two inputs and any amount of outputs. You know, AND, OR, XOR, NOT, etc.

Perhaps not all that useful in the fortress, but it might make fun puzzles for adventure mode, what do I know?

Logged
I>What happens in Nefekvucar stays in Nefekvucar.

Armok

  • Bay Watcher
  • God of Blood
    • View Profile
Re: Logic gate mechanisms?
« Reply #1 on: November 15, 2007, 06:53:00 pm »

Seconded.
Logged
So says Armok, God of blood.
Sszsszssoo...
Sszsszssaaayysss...
III...

qwertyuiopas

  • Bay Watcher
  • Photoshop is for elves who cannot use MSPaint.
    • View Profile
    • uristqwerty.ca, my current (barren) site.
Re: Logic gate mechanisms?
« Reply #2 on: November 15, 2007, 07:04:00 pm »

Gearbox option?
Needs mechanisms to add functions?
Logged
Eh?
Eh!

Len B

  • Bay Watcher
    • View Profile
Re: Logic gate mechanisms?
« Reply #3 on: November 15, 2007, 07:19:00 pm »

Hey, we need to do something with all that stone.  Mechanisms would be perfect.  Dwarves should make Legos out of stone.
Logged
Len, "The Staplerlord", Mighty Evil Master of the Office Supplies.<BR>Len has been grumpy lately. He slept in a meager bedroom recently.<BR>Len likes bicycles, ninjas, the color clear, and succubi for their suckulence.<BR>  When possible, he prefers to consume souls of the marginally damnned just before the last spark of hope expires deep within.

Capntastic

  • Bay Watcher
  • Greetings, mortals!
    • View Profile
    • A review and literature weblog I never update
Re: Logic gate mechanisms?
« Reply #4 on: November 15, 2007, 07:36:00 pm »

So long as these options don't clutter up the already crammed 'make stuff' menus then I wouldn't mind.
Logged

JustOnePixel

  • Bay Watcher
    • View Profile
Re: Logic gate mechanisms?
« Reply #5 on: November 15, 2007, 07:49:00 pm »

Actually, with the addition of water-sensitive pressure plates, you probably could do that.
Logged
Tessie! 'nuf said' McGreevy shouted,
we're not here to mess around!
Boston, you know we love you madly,
hear the crowd roar to your sound!
Don't blame us if we ever doubt ya, you know we couldn't live without ya!
RED SOX!  You are the only, only, only!

Tacroy

  • Bay Watcher
    • View Profile
Re: Logic gate mechanisms?
« Reply #6 on: November 16, 2007, 04:39:00 am »

Hey cool! Assuming an infinite supply of water, you could conceivably build AND, OR and NOT gates in Dwarf Fortress using only flood gates and water-sensitive pressure plates - which means that the game itself is semi-Turing complete!

Actually, on further thought, I think it would only work with a "chunky" liquid like magma, that will only go down z-levels and not back up them. I'm not entirely sure it works this way, but in any case you must make sure that the input on one path does not contaminate the input on another.

code:

Legend:
-, +, | : liquid path
# : Flood gate
> : Down a level
_ : Pressure plate
~ : some water source
* : water-impervious wall

AND gate:

--_-+
   |
   >--##--
   |
--_-+

The pressure plates each open one floodgate, and hence must both be activated in
order to pass liquid.

OR gate:

--_-+
   |
   >--#
   |
--_-+

Both pressure plates are linked to the one floodgate, making it so that
activating either one will open the thing. Honestly, the floodgate is sort of
unnecessary here.

NOT gate:

--_-*+-#---
    |
    ~

I'm not certain if floodgates will work like this (I haven't played around much
with pressure plates) but in this case you need the floodgate to default to
open, and only close if water comes in. I think doors work like this.


And there you have it, a fortress that exhibits both Turing and NP completeness (assuming infinite tape- err, I mean depth)

Edit: it was messing with the page width.

[ November 16, 2007: Message edited by: Tacroy ]

Logged

mickel

  • Bay Watcher
    • View Profile
Re: Logic gate mechanisms?
« Reply #7 on: November 16, 2007, 07:30:00 am »

quote:
Originally posted by Capntastic:
<STRONG>So long as these options don't clutter up the already crammed 'make stuff' menus then I wouldn't mind.</STRONG>

Well, the mechanic's shop has exactly one option. It's gonna take some fiddling, but I'm sure we can wedge a couple of more in.   ;)

Logged
I>What happens in Nefekvucar stays in Nefekvucar.

PresidentEvil

  • Bay Watcher
    • View Profile
Re: Logic gate mechanisms?
« Reply #8 on: November 16, 2007, 04:33:00 pm »

quote:
Originally posted by Tacroy:
<STRONG>Hey cool! Assuming an infinite supply of water, you could conceivably build AND, OR and NOT gates in Dwarf Fortress using only flood gates and water-sensitive pressure plates - which means that the game itself is semi-Turing complete!

Actually, on further thought, I think it would only work with a "chunky" liquid like magma, that will only go down z-levels and not back up them. I'm not entirely sure it works this way, but in any case you must make sure that the input on one path does not contaminate the input on another.

code:

Snip!
[ November 16, 2007: Message edited by: Tacroy ]

</STRONG>


You sure know your logic. Some other gates:

code:

Compact OR: Smaller circuits are better!
-_-+
  >-#
-_-+

Compact AND:
-_-+
  >-##
-_-+

Logical NOR: The final floodgates will only open (or close, if you swing that way) if all four initial plates are flooded.
-_+
 >-##-_+
-_+     |
       >-##
-_+     |
 >-##-_+
-_+

 


I'll do NAND and XOR later tonight.

[ November 16, 2007: Message edited by: PresidentEvil ]

Logged
I will mod in plastic as a resource.  I will then tweak the Dwarven civ entry so that coins are only made out of plastic, and are called "credit cards".
I will make dwarves purchase things with bushels of credit cards.  It will be a mockery of both systems.
It will be stupid.  But it will be gloriously stupid.

qwertyuiopas

  • Bay Watcher
  • Photoshop is for elves who cannot use MSPaint.
    • View Profile
    • uristqwerty.ca, my current (barren) site.
Re: Logic gate mechanisms?
« Reply #9 on: November 16, 2007, 05:49:00 pm »

In an older thread, water powered ones were discussed.
a vertical XOR from before 3D DF:
code:

water
#A#B#
#.c.#
#B#A#
drain
uppercase: floodgate
lowercase: pressure plate
letter shows linkage.

Logged
Eh?
Eh!

GreyMario

  • Bay Watcher
    • View Profile
Re: Logic gate mechanisms?
« Reply #10 on: November 16, 2007, 06:38:00 pm »

Now that's confusing, guys. I think my brain just fried.

Also, hi qwer  :D

Logged
t''s not illegal. The government just doesn''t want you doing it.

Draco18s

  • Bay Watcher
    • View Profile
Re: Logic gate mechanisms?
« Reply #11 on: November 17, 2007, 02:20:00 am »

First person to post a save of a 32bit CPU built entirely within dwarf fortress wins a cookie.  If 32 bit isn't feasible, then the largest value.

First person to post a save of 1KB of RAM built entirely within dwar fortress wins a cookie (why only 1 kilobyte?  because 1 bit of RAM takes a good number of gates).

Obviously, use pumps to get your liquid of choice to flow upwards.

Logged

Shujaa

  • Bay Watcher
    • View Profile
Re: Logic gate mechanisms?
« Reply #12 on: November 17, 2007, 07:40:00 am »

Don't think the NOT gate above will work, you can't change the default position of a floodgate to be open. Try this:

~---H_*    

-----_--#-- (H=floor hatch)

needs a constant or recycling water source for the northern part, which goes over the plate and keeps the floodgate open. Water entering the south circuit trips the pressure plate linked to the floor hatch, removing the water and closing the floodgate.

[ November 17, 2007: Message edited by: Shujaa ]

Logged

Frobozz

  • Bay Watcher
    • View Profile
Re: Logic gate mechanisms?
« Reply #13 on: November 17, 2007, 09:47:00 am »

I don't see why you couldn't hook up a lever to the NOT's floodgate as well as a pressure plate to set the default position.
Logged

qwertyuiopas

  • Bay Watcher
  • Photoshop is for elves who cannot use MSPaint.
    • View Profile
    • uristqwerty.ca, my current (barren) site.
Re: Logic gate mechanisms?
« Reply #14 on: November 17, 2007, 09:58:00 am »

code:

input:
0,0   1,0   0,1   1,1
#A#B# #~#B# #A#~# #~#~#
#.c.# #~~~# #~~~# #~c~#
#B#A# #B#~# #~#A# #~#~#


If a floodgate does not work, a drawbridge will since a drawbridge can act like an inverted floodgate even in the old version.

All this(except the visualization) was discussed in a pre-DF_27_#### thread.

And they also discussed how floor hatches would work too, unless they worked in a diffrent way than expected.

Logged
Eh?
Eh!
Pages: [1] 2