Skip to content

Commit 85206f4

Browse files
committed
Remove rm
1 parent 7703ef0 commit 85206f4

File tree

3 files changed

+43
-3
lines changed

3 files changed

+43
-3
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ jobs:
5959
key: ${{ secrets.OMEGA_SSH_KEY }}
6060
known_hosts: ${{ secrets.KNOWN_HOSTS }}
6161
- name: Deploy with docker
62-
run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} -p ${{ secrets.SSH_PORT }} "docker stop bethanyj28_battlesnek; docker pull ghcr.io/bethanyj28/battlesnek:latest; docker run --name bethanyj28_battlesnek --restart unless-stopped --rm -d --network=proxy ghcr.io/bethanyj28/battlesnek:latest"
62+
run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} -p ${{ secrets.SSH_PORT }} "docker stop bethanyj28_battlesnek; docker pull ghcr.io/bethanyj28/battlesnek:latest; docker run --name bethanyj28_battlesnek --restart unless-stopped -d --network=proxy ghcr.io/bethanyj28/battlesnek:latest"
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package clairvoyant
2+
3+
import "github.com/bethanyj28/battlesnek/internal"
4+
5+
// Snake is a clairvoyant implementation of snake
6+
type Snake struct {
7+
lookahead int
8+
}
9+
10+
// NewClairvoyantSnake creates a new clairvoyant snake
11+
func NewClairvoyantSnake(lookahead int) Snake {
12+
if lookahead == 0 {
13+
lookahead = 1
14+
}
15+
return Snake{lookahead: lookahead}
16+
}
17+
18+
// Move decides which move is ideal based on seeing the future
19+
func (s *Snake) Move(state internal.GameState) (internal.Action, error) {
20+
moves := drillDown(state, s.lookahead)
21+
22+
return internal.Action{Move: moves.move}, nil
23+
}
24+
25+
// Info ensures the snake is stylin and profilin
26+
func (s *Snake) Info() internal.Style {
27+
return internal.Style{
28+
Color: "#00cc99",
29+
Head: "beluga",
30+
Tail: "freckled",
31+
}
32+
}
33+
34+
type route struct {
35+
move string
36+
food int
37+
hazard int
38+
}
39+
40+
func drillDown(state internal.GameState, lookahead int) route {
41+
return route{}
42+
}

internal/battle/util/util.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package util
22

33
import (
4-
"fmt"
54
"math"
65

76
"github.com/bethanyj28/battlesnek/internal"
@@ -158,7 +157,6 @@ func IntrovertSnake(self internal.Battlesnake, others []internal.Battlesnake, li
158157
avgDist = dist / len(evalSnakes)
159158
}
160159

161-
fmt.Println(avgDist)
162160
if avgDist > limit {
163161
dirs = append(dirs, dir)
164162
}

0 commit comments

Comments
 (0)