Skip to content

Commit

Permalink
fixed some comment typos
Browse files Browse the repository at this point in the history
  • Loading branch information
m1gwings committed Sep 1, 2020
1 parent b40c547 commit a834b72
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions drawer/drawer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
func TestNewDrawer(t *testing.T) {
_, err := NewDrawer(-1, 1)
if err == nil {
t.Errorf("you shouldn't be able to create a drawer wiht negative width")
t.Errorf("you shouldn't be able to create a drawer with negative width")
}
_, err = NewDrawer(1, -1)
if err == nil {
t.Errorf("you shouldn't be able to create a drawer wiht negative height")
t.Errorf("you shouldn't be able to create a drawer with negative height")
}
_, err = NewDrawer(1, 5)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions tree/stringify.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func stringify(t *Tree) *drawer.Drawer {

// w and h represent respectively width and height of the drawer to return
// w is the max between the width of dVal + 2 (considering the box) and the width of the one child
// h is equal to the height of dVal + 2 (considering the box) + 1 (considreing the "pipe") + the height of dChild
// h is equal to the height of dVal + 2 (considering the box) + 1 (considering the "pipe") + the height of dChild
w := int(math.Max(float64(dValW+2), float64(dChildW)))
// Ensuring that w is odd
w += 1 - w%2
Expand Down Expand Up @@ -175,7 +175,7 @@ func stringify(t *Tree) *drawer.Drawer {
var w int
if dValW+2 > childrenW {
w = dValW + 2
// If parent width is greater than children width, children get centered by shifing each child
// If parent width is greater than children width, children get centered by shifting each child
for i := 0; i < nChildren; i++ {
childrenLeft[i] += (w - childrenW) / 2
childrenMiddle[i] += (w - childrenW) / 2
Expand Down
2 changes: 1 addition & 1 deletion tree/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
)

// Tree describes the node of a tree with atmost two children.
// Tree describes the node of a tree with almost two children.
type Tree struct {
val NodeValue
parent *Tree
Expand Down

0 comments on commit a834b72

Please sign in to comment.