Jump to content




Minesweeper with Pistons

game command

2 replies to this topic

#1 Lion4ever

  • Members
  • 91 posts

Posted 10 December 2015 - 01:48 AM

This is a very simple program which generates a minesweeper game in your wolrd. Each spot is 3*3 and 4 blocks high and can be activated with the stone plate on top. The number on blocks pushed up by the pistons indicate the number of surrounding mines.

pastebin get rg3Bx79Z minesweeper
minesweeper [cells in x-dir] [cells in z-dir] [mines] [min x corner of board] [min y] [min z]

#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 11 December 2015 - 01:57 AM

I stepped on a mine. It was glorious.

Spoiler

It would be nice if the script could be run without parameters. Trying it seems to reliably cause it build over the command computer midway, interrupting itself.

If there's anything above the play area (eg raised indicator blocks from the last play), building a minefield in that spot may bug out.

I'm also having a little trouble figuring out how the indicator blocks work. When you stomp a pad which has no mines around it, the surrounding area gets triggered, which is good; but the amount of indicators that show up around the border is wrong, meaning you have to manually stomp all the pads around the perimeter anyway in order to get them to appear correctly.

I can't help but think that the way to go would be to wire up the whole grid with bundled cables. This'd theoretically allow you to connect a 256x256 play area to one side of the command computer, which could then remain running - allowing it to eg detect when the game is won. This'd also allow you to setblock some different colours for your indicators, making the board easier to "read".

But I have to admit that feels like cheating, when compared to your piston set up. It's pretty cool as it is.

Edited by Bomb Bloke, 10 February 2016 - 11:27 PM.


#3 Lion4ever

  • Members
  • 91 posts

Posted 29 December 2015 - 03:09 PM

View PostBomb Bloke, on 11 December 2015 - 01:57 AM, said:

It would be nice if the script could be run without parameters. Trying it seems to reliably cause it build over the command computer midway, interrupting itself.

If there's anything above the play area (eg raised indicator blocks from the last play), building a minefield in that spot may bug out.
Fixed that. It is now one block above the computer.


View PostBomb Bloke, on 11 December 2015 - 01:57 AM, said:

I'm also having a little trouble figuring out how the indicator blocks work. When you stomp a pad which has no mines around it, the surrounding area gets triggered, which is good; but the amount of indicators that show up around the border is wrong, meaning you have to manually stomp all the pads around the perimeter anyway in order to get them to appear correctly.
Yeah, the wiring is a big difficult, if there is only a 3*2*3 area to work with. Because of that only the indicator blocks on the side of the next spots are activates (only redstone dust and no redstone repeaters are used)

View PostBomb Bloke, on 11 December 2015 - 01:57 AM, said:

I can't help but think that the way to go would be to wire up the whole grid with bundled cables. This'd theoretically allow you to connect a 256x256 play area to one side of the command computer, which could then remain running - allowing it to eg detect when the game is won. This'd also allow you to setblock some different colours for your indicators, making the board easier to "read".
There could be command blocks under the pressure plates which triggers the spot action like displaying a number with /title, /tellraw or /setblock sign.

But that would not be survival like and would not be able to explode at all.
The disadvantage with cables is that there can be computercraft without the cables and that the computer must not restart for the game to work...





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users