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.1.119 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.118 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.117 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.116 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.115 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.114 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.113 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.111 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.110 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.109 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.108 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.107 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.106 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.105 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.104 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.103 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.102 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.101 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.100 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.99 tracks/julia/exercises/robot-name/example.jl