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.159 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.158 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.157 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.156 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.155 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.154 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.153 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.152 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.151 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.150 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.149 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.148 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.147 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.146 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.145 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.144 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.143 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.142 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.141 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.140 tracks/julia/exercises/robot-name/example.jl