Bonjour!
This time we’re playing a slots game, no, not in a casino. That’s gambling! Gambling is bad! We’re programming our own version, well… fixing someone else’s version of slots.
I would like to remind you that I’m not allowed to give the correct solution to part 3 its challenges. I will however guide you a bit through the process and show you what my results are.
REXX Language Syntax
Modify SLOTS REXX code enabling FRUIT.? variable to contain a fruit value
So let’s go back and read what IBM has to say. The scripts starts a do loop at line 20. At line 24, 26 and 28 the VIEW.# variable get sets to a random fruit name value. BUT there seems to be a problem at line 28. This line requires a modification. Once we fix it, we need to execute it again.
Pick the odd one out, fix it and execute. Let me do that.
The third fruit now shows correctly! Nice!
Modify SLOTS REXX code to acknowledge a win
Hmm… there still seems to be an issue when you win a game of slots. The error is caused by line 73, we need to fix that, our intern misspelled something. Damn you Brian! Let’s investigate the issue.
So, this again is a game of spot the odd one out. But there’s only one to compare the other one to. High chance of failure and high chance of success. Love it! Fix line 73 please 😉 Let me fix it and execute it again.
Two hours later I finally won a game. But I don’t really know the correct 5 digit safe box key. Time to review the code! Type end to exit the code.
Review SLOTS REXX code to determine the 5 digit safe deposit box key
Time to get our minds dirty. We must read the code in order to win this thing!
Ok we need to take a look at line 63 to 78. The key is 2001. Then we have an array n with 6 numbers in it. After that there’s a loop that iterates of the array n. When the current iteration is either 1 or 2 then it skips the iterations? Assuming iterate is the same as continue in JavaScript or PHP. Then, otherwise, it just add the current index of the array to key.
I know what to do. Time to get the calculator. I got the number, do you? If you’re desperate, take a look at line 81 😉
Do like the screenshot above and let’s see if we get the right output.
View p3.output member #02 for winnings deposited
I have censored the number, but my winnings are deposited!
Did you win?
Are you also a millionaire? I am! Time to buy that mainframe I always wanted, IBM, expect a call soon!
So key will be 02001+33333 because iteration stops at 2 and after 2 there is 3 but it’s not correct.
how do i get the correct 5 digit safe box key..please help
Hi! I got the answer, (and the desired output), but I do not understand the hint on line 81. How does (what is says) relate to the number?
Sorry, I am K.
Hope this screenshot helps clarify
https://gyazo.com/128bef0c222522c091e9115d05dc9b5b
It’s replacing the main key on line 000064 with line 000075 therefore when line 000081 is triggered it will grab the stored value from 75 hence being your hint.
Again, hope this helps and best of luck on the final countdown of the challenge 🙂
for color-coding, go to the “Command ===>” and type HILITE AUTO
Thanks a lot for the screenshot Scotty, as I was finally able to put two and two together and complete this challenge. Much appreciated!
how you got the answer?
I am at whit’s end here. I am ready to quit this competition. I cannot figure this out.
Hi Anonymous
Don’t give up yet! You can do it! What are you having issues with?
Kind regards,
– Kevin
I am having issues reading the array to get the key. Any resources to use to get this? Line 81 is no help.
I am also having issues! What to do???
Just remove comments from line 81. You will get the key.
You got the answer ??? Wr u changed lines ..
Basically change line 81.
Then run the program, until you get all three matching.
Once you get all three matching, you get the number.
You will then have put the number and click enter.
If you did all the previous direction correctly, then you’ll get output.
On line
??: I changedredacted by KevinOn line
??: I changedredacted by KevinIs there any other lines I need to edit?
Do I need to type a certain character to run the program correctly?
(after typing ex on SLOTS)
Hi Mig
Yes, you need to win the slots game and then enter the correct number. To execute REXX you indeed need to execute using the ‘ex’ line command.
Kind regards,
– Kevin
the correct key would be: 02001 + 55555?
How do I find the right combination?
Hello,
check the logic please in loop again! It wouldn’t be correct number.
That was a really nice challenge!
Hi Kevin,
I feel we are cheating a little, because we know this from last year challenge 😉
Maybe next year they will change this challenge step!
Georges
Hi Georges
I honestly was afraid it was the same challenge, but they had a different approach, good! This challenge was also much soon than last year 🙂
Kind regards
-Kevin