I think I had a really nice solution where I used the index from a list to get the relations of rock, paper and scissors. So for example I always win if my opponents index +1 (modulo 3) equals my index and so on. This way I didn't have to define every situation and could just compare the indices.
@riddhiman29262 жыл бұрын
yup i did this way
@benkester15182 жыл бұрын
Wait you put logic in the code rather than putting the answer in the code? Is that...legal?
@DanDanilyuk2 жыл бұрын
I ran a dictionary as well with keys equal to each line without splitting them
@mathnovice88862 жыл бұрын
Damn, I didnt think of dictionary, so instead I write a very longggggg if else statement lmao. Well done btw
@codingtoad2 жыл бұрын
learning moment I can remember that same feeling .... just keep coding you will get better that is at least what I keep telling myself...
@aderegil2 жыл бұрын
I'll use dictionaries next time. Thanks for the video. I did the combinations concatenating both movements and then simple ifs because I think is clear and short: if set == "AX" or set == "BY" or set == "CZ": score += 3 # draw if set == "AZ" or set == "BX" or set == "CY": score += 0 # loose if set == "AY" or set == "BZ" or set == "CX": score += 6 # win
@batlin2 жыл бұрын
I ended up switching from multiple case expressions in part 2, but... my brain was about 4 times slower than yours.
@CantLoseTheBlues2 жыл бұрын
Was using dicts as well.. why vim though ?
@mieispeeking2 жыл бұрын
I've no idea what the question in part 2 is asking. Can anybody explain it for me plsss? Thanks.
@jonathanpaulson50532 жыл бұрын
If you played the move in each game that would make you lose/draw/win, what would your score be? Instead of X Y Z telling you what move you played, it’s telling you whether you lost/drew/won and you have to figure out what move you played.
@Racrdude242 жыл бұрын
And here I thought I was clever using mods with offsets when I could have just made a table with an entry for every outcome 🤦♂
@hypercodedOld2 жыл бұрын
haha same, i guess in certain scenarios its just faster to hardcode everything
@Kirarak2 жыл бұрын
@@hypercodedOld the thing is you can't predict part two... somewhat robust solution can often help you down the road...
@NKCSS2 жыл бұрын
Just doing all the permutations was clever 😊Did it in a data-driven way myself, but spent 52 minutes on it (drawback of streaming, you can easily tell just how long you took to do it 🤣)
@derekc.gorman5952 жыл бұрын
See my first thought was to use a dictionary but I've never used one before so I was getting confused. Just used a bunch of if else statements lol
@miunify2 жыл бұрын
do i have to submit my github repo or just the answer?????
@jonathanpaulson50532 жыл бұрын
Just the answer. GitHub is not required! I’m just using it so people can see my final code.
@bertrodgers24202 жыл бұрын
What colour scheme is this please?
@jonathanpaulson50532 жыл бұрын
Windows Terminal
@toshiro65892 жыл бұрын
i like your videos because i have same logic as you, but i am not very good at python.From all youtubers that soleve puzzles i cann keep up with you on easy ones. thank you