Top 20

1 0x00h 694 pts
2 boris39 694 pts
3 neoxquick 675 pts
4 maf-ia 657 pts
5 eax 656 pts
6 thefinder 638 pts
7 benito255 603 pts
8 nikokks 596 pts
9 mego 587 pts
10 madbat2 578 pts
11 plucth 560 pts
12 Mart 548 pts
13 Stupefy 528 pts
14 rostale 514 pts
15 tehron 501 pts
16 Kithyane 496 pts
17 egosum 469 pts
18 malose 426 pts
19 CoYoTe99 413 pts
20 Undr 411 pts

Full ranking

Shoutbox

6 Nov - 8:17 am

Bonjour, un léger problème sur l'épreuve 10 : Une fois réussie, le champ "points earned" indique 72 au lieu de 7 En revanche sur le site le nombre de points comptabilisés est bien 7 Merci pour ce site génial !

21 Oct - 9:48 pm

Équation du challenge 52 corrigée, merci

16 Oct - 8:43 am

Bonjour, il y a aussi un problème d'affichage "invalid equation" dans le challenge 52. Merci

14 Oct - 8:57 pm

Barbapapou l'équation du challenge 29 a été corrigée

4 Oct - 10:30 am

Bonjour, il y a un problème avec l'affichage d'une équation dans le challenge 29

24 Aug - 7:10 pm

@rostale, en effet l'épreuve 21 ne fonctionne plus depuis un moment, pour l'instant on a pas prévu de temps pour la réparer je pense qu'on va finir par la supprimer tout simplement. @nikokks, ok je t'envoie un mail

22 Aug - 11:40 pm

Salut Metatr0n. pourrait on avoir une discussion en MP. J'imagine que tu as mon mail. Ce serait pour discuter de microcontest en general.

28 Jul - 10:38 pm

Pouvez-vous vérifier l'épreuve Email (21) ? En effet, je ne reçois pas d'email de la part du site. Merci

28 Jul - 7:29 pm

Bonjour et merci. Cependant, j'ai résolu le challenge qui me posait pb, donc plus rien à demander... pour l'instant.

28 Jul - 1:48 pm

Ça devrait être réparé maintenant

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