Reputation: 171
Below is part of my code, I have many rooms called r# and have put them in lists of their respective rows, however at the end I am trying to put all these lists together to form a large list including all rooms. I am not trying to make a list of the separate lists but a list of all the rooms! Line 9 seems to be the problem, seems I am using the cons operator wrong
let r58 = {id=58;item=pot2;n=0;e=0;s=51;w=0;complete=false}
let r59 = {id=59;item=m13;n=60;e=0;s=55;w=0;complete=false}
let row11 = [r58;r59]
let r60 = {id=60;item=m8;n=61;e=0;s=59;w=0;complete=false}
let r61 = {id=61;item=m9;n=0;e=0;s=60;w=0;complete=false}
let row12 = [r60;r61]
let roomlist = row1::row2::row3::row4::row5::row6::row7::row8::row9::row10::row11::row12
roomlist
Upvotes: 2
Views: 76
Reputation: 80744
To concatenate multiple lists, use List.concat
:
List.concat [row1; row2; row3; ... row12]
Upvotes: 3