Thank you to those who helped me with the coding of my final puzzle, especially the coding of Ryan Veeder. I am now trying to add images to the code. The code says:
To present a tarot challenge:
repeat with leftovercard running through tarot cards enclosed by the location:
remove leftovercard from play;
let layout be a list of tarot cards;
add the correct card to layout;
let badcard1 be a random incorrect tarot card;
add badcard1 to layout;
let badcard2 be a random incorrect tarot card;
add badcard2 to layout;
sort layout in random order;
repeat with newcard running through layout:
now newcard is in the location;
say "The gypsy places [the list of visible tarot cards] before you and tells you to pick the right one.";
Each of the image entries is coded this way:
figure of image Eight of Cups is in the file Cups08.jpg.
figure of image Nine of Cups is in the file Cups09.jpg.
figure of image Ten of Cups is in the file Cups10.jpg.
what needs to be added to the first code above would look like:
display the figure of image printed name of correct card;
display the figure of image printed name of bardcard1;
display the figure of image printed name of bardcard2;
Which does not work. Other things that I tried that did not work:
display the figure of image correct card;
which obviously wonāt work because this isnāt the name of the image
display the figure of image "[printed name of correct card]"
Did not work, either.
Any help would be appreciated, as always. Thank you!
I think you might need to do something like this- although itās a bit repetitive with 78 cards to assign picture files to:
Figure of Ace of Cups is the file "Ace of Cups.jpg".
Figure of Two of Cups is the file "Two of Cups.jpg".
A card is a kind of thing. A card has a figure name called picture.
The Ace of Cups and the Two of Cups are cards carried by the player.
The picture of the Ace of Cups is Figure of Ace of Cups.
The picture of the Two of Cups is Figure of Two of Cups.
After examining a card:
display the picture of the noun.
The key is that āfigure of ___ā isnāt a phrase, itās the name of a value. Peterās suggestion of making the figure a property of the thing is the best way to do this.
Note that itās Figure of Ace of Cups is the file "Ace of Cups.jpg"not Figure of Ace of Cups is in the file āAce of Cups.jpgā.
Also, as Daniel mentioned Figure... (in this case Figure of Ace of Cups) is, in its entirety, a name and could in fact be any arbitrary name unrelated to the name of the card or the name of the file, except that it has to start with Figure.
So you could, if you wanted, write:
Figure 1 is the file "Ace of Cups.jpg".
Figure 2 is the file "Two of Cups.jpg".
The picture of Ace of Cups is Figure 1.
The picture of Two of Cups is Figure 2.
etc.
etc.
Wouldnāt be the first time I was wrong. Hereās what I typed:
The Ace of Cups is a tarot card. The picture of Ace of Cups is figure of Ace of Cups.
The Two of Cups is a tarot card. The picture of Two of Cups is figure of the Two of Cups.
and also
A tarot card is a kind of thing. A tarot card has a figure name called picture
If I try to compile just these three changes I get the error message:
In the sentence āThe picture of Ace of Cups is figure of Ace of Cupsā, it looks as if you intend āThe picture of Ace of Cups is figure of Ace of Cupsā to be asserting something, but that tries to set the value of the āpictureā property to a tarot card - which must be wrong because this property has to be a figure name.
I also shortened the figure entry to what you described:
figure Ace of Cups is the file "Cups01.jpg".
figure Two of Cups is the file "Cups02.jpg".
Iām sure itās just my learning to code is the issue but I canāt see why code (as least the first two changes) isnāt working when yours is.
Now, based on your code, I made a couple of changes to the original code:
To present a tarot challenge:
repeat with leftovercard running through tarot cards enclosed by the location:
remove leftovercard from play;
let layout be a list of tarot cards;
add the correct card to layout;
let badcard1 be a random incorrect tarot card;
add badcard1 to layout;
let badcard2 be a random incorrect tarot card;
add badcard2 to layout;
sort layout in random order;
repeat with newcard running through layout:
now newcard is in the location;
silently try examining newcard;
say "The gypsy places [the list of visible tarot cards] before you and tells you to pick the right one.";
instead of examining tarot card:
display the picture of the noun;
This works except the pictures of the tarot cards donāt appear in the same order as they are printed out The first picture is always the correct picture. Iām not seeing why this isnāt arranging them in the same order.
[the list of visible tarot cards] lists the cards in the location in the reverse order they were moved there, which ends up as being the reverse of their order in layout. Try
say "The gypsy places [layout] before you and tells you to pick the right one.";