Skip to content

Instantly share code, notes, and snippets.

@Gavinok
Last active December 27, 2020 06:52
Show Gist options
  • Save Gavinok/f5220531ba0fddd932edf518cff61c52 to your computer and use it in GitHub Desktop.
Save Gavinok/f5220531ba0fddd932edf518cff61c52 to your computer and use it in GitHub Desktop.
.\" From the actual video
.\" to compile run
.\" groff -p -ms -Tpdf tree.ms > tree.pdf
.TL
Merry Christmas To Everyone
.AU
From: Gavin
.SH
.LP
.PS
brances = 5
define ball {
circle rad 0.1 at last spline.start fill color "red"
}
define treecolor % color "green" %
for i = 1 to brances do {
spline left 0.1 then up right treecolor
if i != 1 then {
ball
}
move to last spline.end
}
TOPOFTREE: ""
for i = 1 to brances do {
spline down right then left 0.1 treecolor
if i != 1 then {
ball
}
move to last spline.end
}
centerX = TOPOFTREE.c.x
bottomY = last spline.end.y
box with .n at (centerX, bottomY) fill color "brown"
line from last spline.end to last box.ne treecolor
line from last box.nw to 1st spline.start treecolor
move down 2
define star {
"\M[yellow]\D'P -2 -2 2 0 -2 +2 1 -3'\M[]"
}
move to TOPOFTREE + (0.07, -0.14) star
.PE
.\" to compile run
.\" groff -p -ms -Tpdf tree_groff.ms > tree_groff.pdf
.TL
Merry Christmas To Everyone
.AU
From: Gavin
.SH
.LP
.\"
.\" - [ ] invis[ible]
.\" - [ ] fill[ed] [VALUE]
.\" - [ ] color
.\" - [ ] line locations
.\" - [ ] .start
.\" - [ ] .end
.\" - [ ] .center
.\" - [ ] with
.PS
branches = 5
define ball {
circle rad 0.05 at last spline with .$1 at last spline.start fill color "red"
}
for i = 0 to branches do {
spline left 0.1 then up right color "green"
if i != 0 then {
ball(e)
}
move to last spline.end
}
TOPOFTREE:
for i = 0 to branches do {
spline down right then left 0.1 color "green"
if i != 0 then {
ball(w)
}
move to last spline.end
}
centeroftreeX = TOPOFTREE.c.x
bottomoftreeY = 1st spline.start.y
box ht 2 wid .5 at TOPOFTREE with .n at (centeroftreeX, bottomoftreeY - 0.3) fill color "brown"
line from last spline.end to last box.ne color "green"
line from last box.nw to 1st spline color "green"
move down
define star {
"\M[yellow]\D'P -2 -2 2 +0 -2 +2 1 -3'\M[]"
}
move to TOPOFTREE + (0.07, -0.13)
star
.PE
.\" This is a neatroff and plan9 pic compatable alternative
.PS
branches = 5
define ball {
circle rad 0.05 at last spline with .$1 at last spline.start fill
}
for i = 0 to branches do {
spline left 0.1 then up right
if i != 0 then {
ball(e)
}
move to last spline.end
}
TOPOFTREE: ""
for i = 0 to branches do {
spline down right then left 0.1
if i != 0 then {
ball(w)
}
move to last spline.end
}
centeroftreeX = TOPOFTREE.c.x
bottomoftreeY = 1st spline.start.y
box ht 2 wid .5 at TOPOFTREE with .n at (centeroftreeX, bottomoftreeY - 0.3) fill
line from last spline.end to last box.ne
line from last box.nw to 1st spline
move down
define star {
"\m[3]\D'P -2 -2 2 +0 -2 +2 1 -3'\m[]"
}
move to TOPOFTREE + (0.07, -0.13)
star
.PE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment