2 years ago

#66864

test-img

LorenzoLearningCurve

Netlogo Expected literal - A different one

let country-list csv:from-file "countries20.csv"

A CSV file with 20 country names in a single row is stored in a Netlogo list.

I need to extract one random element from this list into the variable base-country, so:

set base-country one-of country-list

This is where I get the infamous Expected a literal value error. As I looked at previous posts on this as well as the CSV and List section of Netlogo resources, I already know I should use probably the "list" primitive, and so I did try it:

let country-list (list csv:from-file "countries20.csv")

but I get the same Expected a literal value error at the same line:

set base-country one-of country-list

list

netlogo

literals

0 Answers

Your Answer

Accepted video resources