Skip to content

Instantly share code, notes, and snippets.

@nextacademy-private
Created August 31, 2014 09:08
Show Gist options
  • Save nextacademy-private/5505d24b7496a1e0e83f to your computer and use it in GitHub Desktop.
Save nextacademy-private/5505d24b7496a1e0e83f to your computer and use it in GitHub Desktop.
Nested Arrays
# Objective 2: Chessboard
# Objective 3: Data table
@nech0701
Copy link

nech0701 commented Mar 3, 2016

chessboard = []
chessboard << ["wr","wk","wb","wq","wk","wb","wk","wr"]
chessboard << ["wp","wp","wp","wp","wp","wp","wp","wp"]
chessboard << ["","","","","","","","",]
chessboard << ["","","","","","","","",]
chessboard << ["","","","","","","","",]
chessboard << ["","","","","","","","",]
chessboard << ["bp","bp","bp","bp","bp","bp","bp","bp"]
chessboard << ["br","bk","bb","bq","bk","bb","bk","br"]

p chessboard[0][0]

data_array = []
data_array = [ [ "Number","Name,Position","Points per Game" ],
[ "12","Joe Schmo","Center",[14,32,7,0,23] ],
[ "9","Ms. Buckets","Point Guard",[19,0,11,22,0] ],
[ "31","Harvey Kay","Shooting Guard",[0,30,16,0,25] ],
[ "18","Sally Talls","Power Forward",[18,29,26,31,19] ],
[ "22","MK DiBoux","Small Forward",[11,0,23,17,0] ], ]

p data_array[3][3]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment