mjstrasser / letter-diamond

Simple code to generate a diamond-shaped printout of letters from A to Z.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

letter-diamond

A simple program that prints out diamond-shaped patterns of letters.

Usage

Run from this directory using:

./go.sh LETTER [LETTER ...]

Where LETTER is an upper- or lower-case letter from A to Z. Lower-case letters are converted to upper-case. Multiple letters can be specified, separated by spaces.

For example:

./go.sh C f
  A
 B B
C   C
 B B
  A
     A
    B B
   C   C
  D     D
 E       E
F         F
 E       E
  D     D
   C   C
    B B
     A

On unrecognised input the program prints the message INVALID INPUT.

If the program has not been compiled, SBT will compile and test it first.

Prerequisites

Scala and SBT to build.

On Mac, Homebrew installs both with:

brew install scala
brew install sbt

Java is a pre-requisite for Scala (you knew that already, didn’t you).

About

Simple code to generate a diamond-shaped printout of letters from A to Z.


Languages

Language:Scala 88.2%Language:Shell 11.8%