Top 20

1 0x00h 697 pts
2 boris39 697 pts
3 neoxquick 678 pts
4 maf-ia 660 pts
5 thefinder 640 pts
6 benito255 605 pts
7 mego 589 pts
8 madbat2 580 pts
9 plucth 561 pts
10 Mart 551 pts
11 eax 550 pts
12 nikokks 546 pts
13 Stupefy 530 pts
14 tehron 503 pts
15 Kithyane 498 pts
16 egosum 471 pts
17 CoYoTe99 415 pts
18 Undr 413 pts
19 Zeta 413 pts
20 Armavica 408 pts

Full ranking

Shoutbox

25 May - 12:07 pm

NGXKGTFWPGODKPGPFQTOKIIVNCJCYVNIWIPVTIFQYDNCKVYPW

9 Apr - 2:10 pm

Yeah this email challenge is a pain in the ***. Sorry about that, we might even remove it in the future, i will see if we find time to fix it

2 Apr - 7:03 am

The Email challenge (#21) appears to be broken again. No mail is being received. Tried with multiple mail services to no avail.

12 May - 11:47 am

Working again now.

10 May - 4:05 pm

Hello, sorry for the late answer, in fact yes there is an issue with the mail, we will try to fix it quickly. Thanks for reporting

7 May - 6:07 pm

Hi there is a issue for the challenfe Email (number 21). I don't receive a mail on any of them: gmail, hotmail, yahoo. do i fail or is it the challenge ?

28 Feb - 10:35 am

Yes we fixed it

27 Feb - 10:00 pm

Thank you, just validated contest22. The solution checker seems to have been fixed.

27 Feb - 8:40 am

Yes several solutions are accepted of course. I will check one of your answers

26 Feb - 7:51 pm

No 500 error, but the solutions I'm submitting can be verified to be correct. It can't be that only one configuration is accepted, right? - as there are multiple correct configurations for each problem.

Connection
Password forgotten

Support usx

You like µContest ?
Support us by voting (fun and difficulty) for µContest on WeChall :)
If you have not already, take the opportunity to link your Wechall
account to µContest in order to be able to vote !

Thank you

Contests list :: Miscellaneous :: Card Trick (46)

Summary

ID : 46
Points : 15
Validations :
Challenge page
Report a bug

Description


Thanks to boris39 for this challenge !

In this challenge, you will wear the magician’s cloak. You will have to find the initial sequence of cards, which leads to a final sequence proposed by your audience.

Steps of the trick

You ask your audience to take N cards in a set of 52 cards.

Example: your audience takes N = 10 cards

You ask your audience to put these cards face up.

Example: your audience puts in front of you 10 cards, as following:



You also ask your audience to write a list of N-2 numbers on a paper, each number could be 1 , 2 or 3.

Example : your audience writes the list:

3-1-3-2-3-2-2-1

You take another set of cards, and you get the 10 same cards as your audience's cards. Then you arrange these 10 cards in a magical way, which only you know (the great magician your are).

So you have a tidy pile of cards, faces down, in your hand.

You flip the card on the top of your pile, and you put it under the first card of your audience's cards:

You flip the 7 of clubs:



You then read the 1st number written on the paper : it is 3

So you perform 3 times the following action: You take the card on the top of your pile, and you put it under your pile, face down.

Then you flip the card on the top of your pile, and you put it under the second card of your audience's cards:

You flip the ace of spades:



You read the 2nd number written on the paper : it is 1

So you perform 1 time the following: You take the card on the top of your pile, and you put it under your pile, face down.

So once you have 2 cards in your pile. Then you flip the card on the top of your pile, you put it under the penultimate card of your audience's cards ; and you flip the last card of your pile that you put under the last card of your audience's cards.

Finally you have the same sequence as your audience :



Steps of the challenge

You get the number of cards selected by your audience in the variable N. This number will be between 20 and 52 (full set).

You also get the final sequence of the cards your audience chose, as a string, in the variable final_sequence.

Names of cards are written with the first letter of their suit + a number/word for the value.
Exemple : C_7 is the 7(value) of Clubs(suit).
D_Jack is the Jack(value) of Diamonds(suit).

For the sequence indicated in the example:



You should get the string:

final_sequence = “C_7;S_Ace;D_10;H_2;C_5;H_8;D_Jack;C_4;C_6;S_7”

Finally, you get the list of numbers written by the audience, as a string, in the variable cards_passed.

For the list indicated in the example: 3-1-3-2-3-2-2-1

You should get the string:

cards_passed = “3;1;3;2;3;2;2;1”

Then you have to return the initial sequence of cards you prepared (your pile faces down) for your trick.

You have to return this sequence in the variable initial_sequence, as a string formatted like the initial sequence you got.

For the example indicated you should send the string:

Initial_sequence = “C_7;H_2;H_8;C_6;S_Ace;C_5;D_10;C_4;D_Jack;S_7“




Variables


Name Type Description
Variables to get
nb_of_cardsIntegerintNumber of cards used for the trick
final_sequenceStringchar*The final cards sequence , placed on the table from the left to the right
cards_passedStringchar*Number of cards put under the pile, for each step
Variables to send back
initial_sequenceStringchar*The initial cards sequence , faces down , from the top to the bottom of the pile