Skip to content

Commit

Permalink
COMPAT: Use print_array for showarray
Browse files Browse the repository at this point in the history
  • Loading branch information
oyamad committed Aug 11, 2018
1 parent 98caef4 commit 09ca42a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/normal_form_game.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ Authors: Daisuke Oyama
=#

# 0.6/0.7 compatibiity
@static if !isdefined(Base, :print_array)
print_array(io::IO, X::AbstractArray) =
Base.showarray(io, X, false, header=false)
else
const print_array = Base.print_array
end


const opponents_actions_docstring = """
`opponents_actions::Union{Action,ActionProfile,Nothing}` : Profile of N-1
opponents' actions. If N=2, then it must be a vector of reals (in which case
Expand Down Expand Up @@ -41,7 +50,7 @@ Base.summary(player::Player) =
function Base.show(io::IO, player::Player)
print(io, summary(player))
println(io, ":")
Base.showarray(io, player.payoff_array, false, header=false)
print_array(io, player.payoff_array)
end

# payoff_vector
Expand Down

0 comments on commit 09ca42a

Please sign in to comment.