genfloortxt

package
v0.0.0-...-ce97658 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

README

Simple 2D Text Floorplan Renderer in Golang (WIP)

This package provides a little demo on how to 'render' walls as unicode characters, imitating the cp437 symbol set.

Input!

alt text

Map!

alt text

Documentation

Overview

Package genfloortxt renders a primitive floor plan read from an ASCII file to the console. NOTE: In future I plan to add some procedural generation bits to it.

Index

Constants

View Source
const (
	CellWall   = '#'
	CellWindow = 'W'
	CellDoor   = 'D'
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Plan

type Plan struct {
	Height int
	Width  int
	// contains filtered or unexported fields
}

Plan represents a parsed floorplan.

func ReadPlan

func ReadPlan(r io.Reader) *Plan

ReadPlan reads a floor plan from the given reader.

func (*Plan) Render

func (p *Plan) Render() (lines []string)

Render 'renders' the floor plan to an array of strings.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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