Skip to content

This library prints strings in pre-defined shapes

License

Notifications You must be signed in to change notification settings

senpathi/printy

Repository files navigation

printy (in development)

This library prints strings in pre-defined shapes

Rectangle

package main

import "github.com/senpathi/printy"

func main() {
	str := `This is a sample string to print in senpathi/printy Rectangle`
	printy.PrintInRectangle(str, 16, 1)
}
Output:
* * * * * * * * * * * * * * * * * ** *
*  This is a sample string to print  *
*   in senpathi/printy Rectangle     *
* * * * * * * * * * * * * * * * * ** *

Triangle

package main

import "github.com/senpathi/printy"

func main() {
	str := `This is a sample string to print in senpathi/printy Triangle`
	printy.PrintInTriangle(str)
}
Output:
            *
           * *
          *   *
         *  T  *
        *  his  *
       *   is a  *
      *   sample  *
     *   string t  *
    *  o print in   *
   *  senpathi/prin  *
  *  ty Triangle      *
 * * * * * * * * * * * *

Circle

package main

import (
	"github.com/senpathi/printy"
)

func main() {
	str := `This is a sample string to print in senpathi/printy Circle`
	printy.PrintInCircle(str)
}
Output: 
         ***** *****             
     **               **         
   *      This is a      *       
  *     sample string     *      
 *    to print in senpa    *     
 *    thi/printy Circle    *     
 *                         *     
  *                       *      
   *                     *       
     **               **         
         ***** *****   

About

This library prints strings in pre-defined shapes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages