8 Card Programming Challenges

Challenges list below…

  1. Question: Do you have a Nine?
    Goal: Run the program. Check the “Left Hand Value”. If it is 9 then the answer is yes. If “Left Hand Value” is not a 9 then the answer is no.
  2. Question: Do you have a 2 or a 10?
    Goal: Run the program. Check the “Left Hand Value”. If it is 2 or 10 then the answer is yes. If “Left Hand Value” is not a 2 or 1 0 then the answer is no.
  3. Question: Do you have a 2 and a 10?
    Goal: Run the program. Check the “Left Hand Value” and see if it is a 2. Check the “Right hand Value” and see if it is a 10. If the hands are not on a 2 & 10 as described above then the answer to the question is no.
  4. Question: How many 2s do you have?
    Goal: Run the program. Check the “Left Hand Position”. The “Left Hand Position” will be the number of 2s that you have.
  5. Question: What is the smallest card?
    Goal: Run the program. Check the “Left Hand Value”. The “Left Hand Value” will be the smallest card.
  6. Action: Move the smallest card to Position 0. (Read about the swap command at the bottom of this page)
  7. Action: Move the smallest card to Position 0 and the largest card to position 7.
  8. Action: Shift all card one position to the right (the card in position seven should
    move to position zero).
  9. Action: Sort the cards from smallest to largest.
  • For  challenges 6+ you will need to move cards. To move cards you will need the SWAP command (S). The swap command moves cards not hands. It will move the left hand card to the right hand position and move the right hand card to the left hand position. To enable this command you will need to edit your IDE URL as shown below…
    https://mxepstein.com/HML/?swap=true&cards=48530296&code=X