Skip to content

Commit 80edde8

Browse files
authored
Merge pull request #133 from fohristiwhirl/master
Improvements to Go starter kit
2 parents d223104 + c628bc7 commit 80edde8

File tree

7 files changed

+20
-13
lines changed

7 files changed

+20
-13
lines changed

starter_kits/Go/src/main/MyBot.go renamed to starter_kits/Go/src/MyBot.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ package main
22

33
import (
44
"fmt"
5-
"hlt"
6-
"hlt/gameconfig"
7-
"hlt/log"
85
"math/rand"
96
"os"
107
"os/signal"
118
"strconv"
129
"syscall"
1310
"time"
11+
12+
"./hlt"
13+
"./hlt/gameconfig"
14+
"./hlt/log"
1415
)
1516

1617
func gracefulExit(logger *log.FileLogger) {

starter_kits/Go/src/hlt/Entities.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ package hlt
22

33
import (
44
"fmt"
5-
"hlt/gameconfig"
6-
"hlt/input"
5+
6+
"./gameconfig"
7+
"./input"
78
)
89

910
// Entity - Base entity structure
@@ -60,7 +61,7 @@ func (s *Ship) GetID() int { return s.E.id }
6061
// IsFull - Returns true if the ship is full
6162
func (s *Ship) IsFull() bool {
6263
var maxHalite, _ = gameconfig.GetInstance().GetInt(gameconfig.MaxHalite)
63-
return s.Halite > maxHalite
64+
return s.Halite >= maxHalite
6465
}
6566

6667
// MakeDropoff - Creates command to turn the ship into a dropoff

starter_kits/Go/src/hlt/Game.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ package hlt
22

33
import (
44
"fmt"
5-
"hlt/gameconfig"
6-
"hlt/input"
7-
"hlt/log"
5+
6+
"./gameconfig"
7+
"./input"
8+
"./log"
89
)
910

1011
// Game - Structure holding all metadata for the game

starter_kits/Go/src/hlt/GameMap.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ package hlt
22

33
import (
44
"fmt"
5-
"hlt/input"
5+
6+
"./input"
67
)
78

89
// GameMap - Top level structure for the game map

starter_kits/Go/src/hlt/Player.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ package hlt
33
import (
44
"errors"
55
"fmt"
6-
"hlt/input"
6+
7+
"./input"
78
)
89

910
// Player - Structure to hold all information about a player

starter_kits/Go/src/hlt/gameconfig/Constants.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ package gameconfig
33
import (
44
"bytes"
55
"fmt"
6-
"hlt/log"
76
"regexp"
87
"strconv"
98
"sync"
9+
10+
"../log"
1011
)
1112

1213
// Game setting keys

starter_kits/Go/src/hlt/input/Input.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ package input
22

33
import (
44
"bufio"
5-
"hlt/log"
65
"io"
76
"os"
87
"regexp"
98
"strconv"
109
"sync"
10+
11+
"../log"
1112
)
1213

1314
// Input - Reads from the game runner, helps with parsing

0 commit comments

Comments
 (0)