constants

package
v0.0.0-...-5f38bd8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2014 License: MIT Imports: 0 Imported by: 3

Documentation

Index

Constants

View Source
const EXIT_MESSAGE = "(Press any key to exit..)\n"
View Source
const VICTORY_MESSAGE = "Congratulations!\n" +
	"How about trying a larger puzzle?\n"
View Source
const WELCOME_MESSAGE = "Welcome to 15-puzzle!\n" +
	"\n" +
	"~~~~~ How to play ~~~~~\n" +
	"Use the arrow keys to slide tiles around\n" +
	"VI keys (h,j,k,l) also work\n" +
	"\n" +
	"~~~~~ How to win ~~~~~\n" +
	"Slide the tiles until all numbers are in (reading) order\n" +
	"Remember: tiles can only slide towards the empty space\n" +
	"Press Q (or Ctrl-C) if you want to give up\n" +
	"\n" +
	"~~~~~ Have fun! ~~~~~\n" +
	"(Press any key to start playing..)\n"

Messages

Variables

Map input events to sliding directions

View Source
var POSSIBLE_SLIDING_DIRECTIONS = []SlidingDirection{
	SLIDE_UP, SLIDE_RIGHT, SLIDE_DOWN, SLIDE_LEFT,
}

Create array with possible sliding directions for scrambling

Functions

This section is empty.

Types

type InputEvent

type InputEvent int

Create custom events for key presses (so we don't leak lib structs)

const (
	INPUT_UP InputEvent = iota
	INPUT_RIGHT
	INPUT_DOWN
	INPUT_LEFT
	INPUT_QUIT
)

type SlidingDirection

type SlidingDirection int

Create enum with sliding directions

const (
	SLIDE_UP SlidingDirection = iota
	SLIDE_RIGHT
	SLIDE_DOWN
	SLIDE_LEFT
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL