I'm using Inform 6.31 and Frotz.
I've tried using
Code:
Zcharacter table '@{2660}' '@{2663}' '@{2665}' @{2666};
to add the symbols for the card suits to the character set, but I can't get them to display properly in the interpreter. They show up as those annoying white boxes instead symbols for Spades, Diamonds, etc.. Using the same code, I can get other special unicode characters to display properly, but not those ones. Here's the full code I'm trying to implement:
Code:
Zcharacter table '@{2660}' '@{2663}' '@{2665}' '@{2666}';
Array pack_of_cards --> 52;
[Shuffle i j;
for (i=1:i<52:i++) {
j = random(i+1) - 1;
pack_of_cards-->i = pack_of_cards-->j; pack_of_cards-->j = i;
}
];
[Card n;
switch(n%13) {
0: print "Ace";
1 to 9: print n%13 + 1;
10: print "Jack"; 11: print "Queen"; 12: print "King";
}
print " of ";
switch(n/13) {
0: print "@{2660}"; 1: print "@{2663}";
2: print "@{2665}"; 3: print "@{2666}";
}
];
[Main i;
! Create the pack in "factory order":
for (i=0:i<52:i++) pack_of_cards-->i = i;
! Shuffle the cards:
Shuffle();
print "The pack has been shuffled into the following order:^";
for (i=0:i<52:i++)
print (Card) pack_of_cards-->i, "^";
];
This was actually taken right out of the designer's manual, except for the addition of these unicode characters and a few other minor adjustments. Originally, in the Card routine it printed "Hearts", "Spades", etc.. I thought it would be nice if I could get it to print the appropriate symbols instead. Any idea why this doesn't work or how I could get it to work? Thank you!