Skip to content

Commit aeb09b3

Browse files
author
ceferisbarov
committed
Partially updated to 0.7
1 parent 97be346 commit aeb09b3

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

src/1dim.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#1-dim CAs
22

33
#Elementary & totalistic CA with r-nearest neighbor and k states
4-
type CellularAutomaton
4+
mutable struct CellularAutomaton
55

66
#user given values
77
N::Int #code

src/2dim.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#Two dimensional Cellular Automaton
44
#TODO: Change naming to be consistent
5-
type CA2d
5+
mutable struct CA2d
66

77
#User given values
88
k::Int #Number of states

test/conway_test.jl

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module ConwayTest
22

3-
using Base.Test
3+
using Test #Base.Test was deprecated
44

55
using CellularAutomata
66
export blinker_test, turbine_test
@@ -41,17 +41,18 @@ end
4141
# Function to test Conway's turbine automota which repeats every ninth step
4242
function turbine_test()
4343
init = Array{Int}(zeros(20,20))
44-
init[4, 4:9] = 1
45-
init[5, 4:9] = 1
44+
# Using `A[I...] = x` to implicitly broadcast `x` across many locations is deprecated. Replaced them with .=
45+
init[4, 4:9] .= 1
46+
init[5, 4:9] .= 1
4647

47-
init[4:9, 11] = 1
48-
init[4:9, 12] = 1
48+
init[4:9, 11] .= 1
49+
init[4:9, 12] .= 1
4950

50-
init[11, 7:12] = 1
51-
init[12, 7:12] = 1
51+
init[11, 7:12] .= 1
52+
init[12, 7:12] .= 1
5253

53-
init[7:12, 4] = 1
54-
init[7:12, 5] = 1
54+
init[7:12, 4] .= 1
55+
init[7:12, 5] .= 1
5556

5657
ca = CA2d([3], [2,3], init, 18)
5758

test/runtests.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
include("conway_test.jl")
2-
using ConwayTest
2+
using .ConwayTest #Local modules have to be preceded with a dot
33
turbine_test()
44
blinker_test()
55

0 commit comments

Comments
 (0)