I am trying to advance my Julia language skill and (some concepts). Therefore am trying to work throw the book “Deep Learning and the Game of GO” but not writing the Code in Python but in Julia.
I get some problems with writing own packages and use it:
I have a file called manvbot.jl
include("dlgo/DLGO.jl")
function main()
boardsize = 9
game = newgame(boardsize)
...
main()
``
with this file I wanna use a local package.
Folder: dlgo
Files: DLGO.jl, gotypes.jl, goboard_slow.jl, ...
As you can see I include the module from DLGO.jl
```julia
module DLGO
__precompile__(false)
include("gotypes.jl")
include("goboard_slow.jl")
include("utils.jl")
include("agent/base.jl")
include("agent/helpers.jl")
include("agent/naive.jl")
export newgame
end
The problem is that I cannot find, the function newgame which is included in the file goboard_slow.jl ( shorted version below)
mutable struct Move{}
point::Point
ispass::Bool
isresign::Bool
end
struct GoString{}
color::Player
stones::Set{Point}
liberties::Set{Point}
end
mutable struct Board{}
numrows::UInt8
numcols::UInt8
grid::Set{Point}
end
mutable struct GameState
board::Board
nextplayer::UInt8
previousstate::Union{GameState, Nothing}
lastmove::Union{Move, Nothing}
end
function newgame(boardsize::UInt)
board = Board(boardsize)
return GameState(board, black, Nothing, Nothing)
end
I am wondering why I can’t find the file newgame function? Error: ERROR: LoadError: UndefVarError: newgame not defined
From my understanding I include the code from the file (including the function) in the modul as the full code/text, which I again do in the in manvbot.jl script. Why is the function than undefined? Do I have any misscontecptions?