Jump to content




MineSweeper


  • You cannot reply to this topic
13 replies to this topic

#1 stoneLeaf

  • New Members
  • 10 posts

Posted 08 March 2012 - 10:23 PM

Here's my first lua script.

MineSweeper

A classic minesweeper game.

Some of the features:
  • 3 difficulty levels
  • dynamically fits any terminal size greater or equal to 28x6
  • optimized for SMP (it sends as few as possible text changes to clients)
  • sends redstone signals depending on the game output (feature suggested by Neowulf)
    - if the game is won, a 2 seconds signal to the back (could be used to trigger a door)
    - if the game is lost, a 1 second signal to the bottom (could be used to trigger a TNT block)
    These are the default values, they can be modified by editing the top of the source file.
Attached Image: minesweeper_v1.0.1.screen1.pngAttached Image: minesweeper_v1.0.1.screen2.png

Installation

Available on cc-get, simply type:
cc-get install minesweeper

If you want to instal it manually, the source code is available on the script cc-get page (click on the 'minesweeper' file).

Changelog

<1.1>
* scores implemented
* fixed a critical bug introduced in 1.0.3
<1.0.3>
* the first square uncovered will never be a mine
<1.0.2>
* sends redstone signals depending on the game output
<1.0>
* initial release

#2 passinglurker

  • New Members
  • 88 posts

Posted 08 March 2012 - 10:40 PM

hmmm if I fail will it set off a tnt block underneath the terminal?

#3 stoneLeaf

  • New Members
  • 10 posts

Posted 08 March 2012 - 10:58 PM

View Postpassinglurker, on 08 March 2012 - 10:40 PM, said:

hmmm if I fail will it set off a tnt block underneath the terminal?
That'd be an interesting feature :mellow:/>

#4 nitrogenfingers

    Lua Professor

  • Members
  • 551 posts
  • LocationAustralia

Posted 08 March 2012 - 11:15 PM

Nice!

#5 Neowulf

  • Members
  • 33 posts

Posted 08 March 2012 - 11:21 PM

Player wins, send a pulse out the back of the computer (to open a door or something).
Player loses, send a pulse out the bottom of the computer (to trigger the TNT pile beneeth their feet).

#6 passinglurker

  • New Members
  • 88 posts

Posted 08 March 2012 - 11:32 PM

or add terminal controlled turtles for a more user friendly game of "real" minesweeper the turtles could even be used to repair and randomize the playing field

#7 stoneLeaf

  • New Members
  • 10 posts

Posted 09 March 2012 - 12:00 AM

View PostNeowulf, on 08 March 2012 - 11:21 PM, said:

Player wins, send a pulse out the back of the computer (to open a door or something).
Player loses, send a pulse out the bottom of the computer (to trigger the TNT pile beneeth their feet).
Thanks for the tip, it's now implemented!

View Postpassinglurker, on 08 March 2012 - 11:32 PM, said:

or add terminal controlled turtles for a more user friendly game of "real" minesweeper the turtles could even be used to repair and randomize the playing field
I thought about that, I'll see if I find time to code it.

#8 Wolvan

  • New Members
  • 384 posts
  • LocationIn the TARDIS

Posted 10 March 2012 - 09:07 AM

View PoststoneLeaf, on 09 March 2012 - 12:00 AM, said:

View Postpassinglurker, on 08 March 2012 - 11:32 PM, said:

or add terminal controlled turtles for a more user friendly game of "real" minesweeper the turtles could even be used to repair and randomize the playing field
I thought about that, I'll see if I find time to code it.
I could help with this :mellow:/>

#9 stoneLeaf

  • New Members
  • 10 posts

Posted 10 March 2012 - 05:21 PM

View PostWolvan, on 10 March 2012 - 09:07 AM, said:

View PoststoneLeaf, on 09 March 2012 - 12:00 AM, said:

View Postpassinglurker, on 08 March 2012 - 11:32 PM, said:

or add terminal controlled turtles for a more user friendly game of "real" minesweeper the turtles could even be used to repair and randomize the playing field
I thought about that, I'll see if I find time to code it.
I could help with this :mellow:/>
You're free to use my code as long as you license your work under the GPL.

I was thinking the turtle(s) could start by laying out a surface layer, which would hide the TNT placed afterwards underneath. Then the computer would be used to control the uncovering process of the field. It would be some kind of "real life" enactment of the game action.

#10 Wolvan

  • New Members
  • 384 posts
  • LocationIn the TARDIS

Posted 10 March 2012 - 05:46 PM

View PoststoneLeaf, on 10 March 2012 - 05:21 PM, said:

View PostWolvan, on 10 March 2012 - 09:07 AM, said:

View PoststoneLeaf, on 09 March 2012 - 12:00 AM, said:

View Postpassinglurker, on 08 March 2012 - 11:32 PM, said:

or add terminal controlled turtles for a more user friendly game of "real" minesweeper the turtles could even be used to repair and randomize the playing field
I thought about that, I'll see if I find time to code it.
I could help with this :mellow:/>
You're free to use my code as long as you license your work under the GPL.

I was thinking the turtle(s) could start by laying out a surface layer, which would hide the TNT placed afterwards underneath. Then the computer would be used to control the uncovering process of the field. It would be some kind of "real life" enactment of the game action.
I could help with the controlling that is

#11 stoneLeaf

  • New Members
  • 10 posts

Posted 17 March 2012 - 09:38 PM

Updated.
1.0.3: the first square uncovered will never be a mine

#12 stoneLeaf

  • New Members
  • 10 posts

Posted 23 March 2012 - 10:03 AM

Updated.

[1.1]
* scores implemented
* fixed a critical bug introduced in 1.0.3

#13 Ian-Moone

    The Germ

  • New Members
  • 124 posts
  • LocationLiverpool (no I am not a Scouser Im form Holland)

Posted 23 March 2012 - 10:09 AM

a few edits here and there and it could be a survival game if you die you die in minecraft not just on the game help im confusing myself

#14 stoneLeaf

  • New Members
  • 10 posts

Posted 23 March 2012 - 10:20 AM

View PostVandie, on 23 March 2012 - 10:09 AM, said:

a few edits here and there and it could be a survival game if you die you die in minecraft not just on the game help im confusing myself
Already possible, in a way, since you can place a TNT block underneath which will be powered when a game is lost :(/>





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users