How do I make a long list?

I'm trying to make a flag guesser game, but no part of me wants to sit down and manually add the names of every country to a list.

I tried using the sentence to list block so I could just copy paste a bunch of country names and it would seperate them into different items of a list. However, that splits up the names of countries with multiple words (eg. United States becomes two different items).

Is there any way I can easily complete this task? Or will I just need to tough out the tedious work

Thanks in advance :slight_smile:

Post a project example, link, or screenshot:

Depending on the input format I would probably …

  1. use the SENTENCE TO LIST block like, apparently, you already tried; and then manually correct for the countries with composite names, OR
  2. use the SPLIT BY block, if the countries are separated by something other than a single whitespace.

Still, entering the flags seems like a harder job to me, isn’t it?

What I propose is using country codes instead of the names of countries, and find a list of country codes you can easily code-paste into a untitled script pic block, and copypaste the country codes into it. Now set the [ v] input to "word" and add a untitled script pic (2) block into it. You should get something like this:
untitled script pic (1), the "Countries" variable being the list of all the countries. You can now use your list for anything. I recomend using country codes because some country names use multiple words and it would ruin the code.

If you just obtain a dataset of countries in a csv file - you can just drag the file into Snap! and it will convert it to a list

I got this one from World countries available in multiple languages, in CSV, JSON, PHP, SQL and XML formats, with associated alpha-2, alpha-3, and numeric codes as defined by the ISO 3166 standard, and with national flags included

Neat, didn't know Snap could do that

Dragging in a CSV is The Right Thing, because you don't want to drag in flag pictures one by one either! But for future reference, when you have a handful of names with embedded spaces, one way to handle that is to use one of the bazillion special-purpose spaces in Unicode, such as WORD JOINER U+2060, which seems to be the official one for that purpose, or, among many other weird ones, SIGNWRITING LOCATION-WALLPLANE SPACE U+1DA7F, whatever that is. They look like spaces, but Snap! doesn't recognize them as spaces for splitting purposes.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.