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.78 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.77 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.76 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.75 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.74 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.73 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.72 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.71 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.70 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.69 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.68 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.67 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.66 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.65 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.64 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.63 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.62 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.61 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.60 tracks/julia/exercises/robot-name/example.jl
trackler-2.2.1.59 tracks/julia/exercises/robot-name/example.jl