Jump to content

Concours blanc informatique


alyscst
Go to solution Solved by bunot,

Recommended Posts

Coucou, j'ai essayé de faire le concours blanc d'informatique tout à l'heure et ça ma mis une grosse claque, je n'ai réussit que le premier exercice et tout le reste rien.

Je voulais savoir si ceux qui ont réussit si ils voudraient bien poster leurs programmes pour que je puisse m'entraîner et essayer de comprendre.

Merci d'avance

Link to comment
Share on other sites

  • Ancien Responsable Matière
  • Solution

Je suis désolé je sais pas partager les programmes j'ai pas mieux qu'un bon vieux copier/coller (attention les yeux)

Peindre le motif 2 :

x=y=0
for i in range(14):
    if surCaseMarquee():
        peindreCase()
    est()
for i in range(14):
        if surCaseMarquee():
            x = colonneRobot()
            y+=1
        ouest()
z = x + y

nord()
for i in range(8):
    
    w = True
    for i in range (14):
        if surCaseMarquee() and not(x < colonneRobot() < z):
            w = False
        est()
    
    y = x = 0
    for i in range(14):
        if surCaseMarquee():
            if w == True:
                peindreCase()
            x = colonneRobot()
            y+=1
        ouest()
    z = x + y
    
    nord()

Lui il est plus court ça va

C'est chiffre manquant:


for i in range(5):
    ligne = input()
    bunot = ligne.split(" ")
    y = 0
    for i in range (9):
        w = False
        y +=1
        for x in range(len(bunot)):
            if bunot[x] == str(y):
                w = True
        if w == False:
            print(y)

Et enfin tour de Hanoï (d'ailleurs si quelqu'un a plus court j'aimerais bien voir car il fait 100 blocs pile c'est vraiment pas passé loin...):

bulot = [[4,3,2,1],[0]*4,[0]*4]

for i in range (6):
    ligne = input()
    x = int(ligne[0])-1
    y = int(ligne[2])-1
    w = v = False
    
    for u in range(4):
        if bulot[x][-u-1] != 0 and w == False:
            nombre = bulot[x][-u-1]
            bulot[x][-u-1] = 0
            w = True
    
    for u in range(4):
        if bulot[y][u] == 0 and v == False:
            bulot[y][u] = nombre
            v = True

for i in range (3):
    sortie = ""
    for u in range(4):
        if bulot[i][u] != 0:
            sortie += str(bulot[i][u])+" "
    print(sortie)

Link to comment
Share on other sites

il y a 9 minutes, bunot a dit :

Je suis désolé je sais pas partager les programmes j'ai pas mieux qu'un bon vieux copier/coller (attention les yeux)

Peindre le motif 2 :

x=y=0
for i in range(14):
    if surCaseMarquee():
        peindreCase()
    est()
for i in range(14):
        if surCaseMarquee():
            x = colonneRobot()
            y+=1
        ouest()
z = x + y

nord()
for i in range(8):
    
    w = True
    for i in range (14):
        if surCaseMarquee() and not(x < colonneRobot() < z):
            w = False
        est()
    
    y = x = 0
    for i in range(14):
        if surCaseMarquee():
            if w == True:
                peindreCase()
            x = colonneRobot()
            y+=1
        ouest()
    z = x + y
    
    nord()

Lui il est plus court ça va

C'est chiffre manquant:


for i in range(5):
    ligne = input()
    bunot = ligne.split(" ")
    y = 0
    for i in range (9):
        w = False
        y +=1
        for x in range(len(bunot)):
            if bunot[x] == str(y):
                w = True
        if w == False:
            print(y)

Et enfin tour de Hanoï (d'ailleurs si quelqu'un a plus court j'aimerais bien voir car il fait 100 blocs pile c'est vraiment pas passé loin...):

bulot = [[4,3,2,1],[0]*4,[0]*4]

for i in range (6):
    ligne = input()
    x = int(ligne[0])-1
    y = int(ligne[2])-1
    w = v = False
    
    for u in range(4):
        if bulot[x][-u-1] != 0 and w == False:
            nombre = bulot[x][-u-1]
            bulot[x][-u-1] = 0
            w = True
    
    for u in range(4):
        if bulot[y][u] == 0 and v == False:
            bulot[y][u] = nombre
            v = True

for i in range (3):
    sortie = ""
    for u in range(4):
        if bulot[i][u] != 0:
            sortie += str(bulot[i][u])+" "
    print(sortie)

Merci beaucoup vraiment je vais essayer de comprendre !

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...