Top 20

1 0x00h 701 pts
2 boris39 701 pts
3 neoxquick 682 pts
4 maf-ia 663 pts
5 thefinder 644 pts
6 benito255 608 pts
7 mego 591 pts
8 madbat2 581 pts
9 Mart 554 pts
10 Stupefy 533 pts
11 nikokks 513 pts
12 tehron 504 pts
13 Kithyane 502 pts
14 plucth 480 pts
15 egosum 473 pts
16 CoYoTe99 416 pts
17 Undr 415 pts
18 Zeta 415 pts
19 loonies2 411 pts
20 Armavica 410 pts

Full ranking

Shoutbox

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.

26 Feb - 5:54 pm

contest 22 is not concerned by the issue I found, and seems to be working (I suppose you don't have 500 error on this one ?). Your solutions are indeed rejected, but I did not check them yet

26 Feb - 3:25 pm

The validation for contest 22 also seems to be wrong (it's not accepting solutions that are clearly correct). I submitted bug report yesterday.

26 Feb - 9:59 am

Ok I fixed the issue It is higly possible that other challenges are impacted, so don't hesitate to tell meif you encounter this again. Thank you for reporting

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