Sha256: 47d09a56ee4596748fc93f1dfc8704f071025b3388c09792e9f6a07a24c38d36

Contents?: true

Size: 307 Bytes

Versions: 200

Compression:

Stored size: 307 Bytes

Contents

# http://docs.julialang.org/en/stable/stdlib/numbers/#random-numbers

new_name() = join(map(x->Char(x), rand(65:90, 2))) * repr(rand(100:999))

mutable struct Robot
    name::AbstractString

    Robot() = new(new_name())
end

function reset!(instance::Robot)
    instance.name = new_name()
    instance
end

Version data entries

200 entries across 200 versions & 1 rubygems

Version Path
trackler-2.2.0.5 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.0.4 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.0.3 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.0.2 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.0.1 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.0.0 tracks/julia/exercises/robot-name/example.jl
trackler-2.1.0.55 tracks/julia/exercises/robot-name/example.jl
trackler-2.1.0.54 tracks/julia/exercises/robot-name/example.jl
trackler-2.1.0.53 tracks/julia/exercises/robot-name/example.jl
trackler-2.1.0.52 tracks/julia/exercises/robot-name/example.jl
trackler-2.1.0.51 tracks/julia/exercises/robot-name/example.jl
trackler-2.1.0.50 tracks/julia/exercises/robot-name/example.jl
trackler-2.1.0.49 tracks/julia/exercises/robot-name/example.jl
trackler-2.1.0.48 tracks/julia/exercises/robot-name/example.jl
trackler-2.1.0.47 tracks/julia/exercises/robot-name/example.jl
trackler-2.1.0.46 tracks/julia/exercises/robot-name/example.jl
trackler-2.1.0.45 tracks/julia/exercises/robot-name/example.jl
trackler-2.1.0.44 tracks/julia/exercises/robot-name/example.jl
trackler-2.1.0.43 tracks/julia/exercises/robot-name/example.jl
trackler-2.1.0.42 tracks/julia/exercises/robot-name/example.jl