For example, if I wanted to make a map that contains 6 random numbers, and the keys i wanted should be something like rand_1, rand_2, etc.? How could I make that happen in Soroban? I think I know how I could do that in normal Rust, but I can't quite figure out how to do it with the soroban-sdk?
For example, if we were rolling 6 dice, like Yahtzee, here's some sample code of what I'm thinking about:
let mut return_map = map![&env];
for i in 1..=6 {
let rolled_value = prng.u64_in_range(1..=6);
// this line is where i'm not sure...
return_map.set(symbol_short!("rand_{}", i), rolled_value);
I hope that at least somewhat makes sense. I know using the {} inside symbol_short doesn't work, but that's kindof what I've got in mind. I've also tried making the key using BytesN, and I can get it to "technically work" as the map keys, but what I'd really like is for the return map to give back the user (rand_1, 2), (rand_2, 4), (rand_3, 1), ...).
Would love to hear thoughts on how/if it's possible. Thanks!