Les membres ayant 30 points peuvent parler sur les canaux annonces, projets et hs du chat.
La shoutbox n'est pas chargée par défaut pour des raisons de performances. Cliquez pour charger.
Soutenir Planète Casio !

Ce site vous plait ?

Ajoutez ce bouton sur votre site ou sur les forums pour soutenir Planète-Casio et sa communauté :

Le code à mettre sur votre site :

Ou dans votre signature :

Et rejoignez-nous sur :

Merci de votre soutien !

Défi
Retour liste des défis
Output challenge 2
Difficulté : Moyen
Défi ajouté par : Calcloverhk le 12-02-2024 18:43
CalcloverhkHors ligneMembrePoints: 347 Défis: 10 Message
Question ou texte du défi :
This question is similar to the original challenge. If you get the correct answer from that challenge, this one should be easier for you.

Here is a sample program:
For 1→A To 7
Locate A+1,A,A
Next


This should generate output like below:
 1
  2
   3
    4
     5
      6
       7


Now, append 4 lines of simplest code so that the final display becomes:
1
2
3
4
5
6
7


Note that you can only use Locate once. ":", "⇒", "◢" and all clear commands are prohibited

Votre réponse au défi :

Þ ã Ý à á â


Commentaires :
Pages: 1, 2 | Suivante

LephenixnoirHors ligneAdministrateurPoints: 24348 Défis: 170 Message
Posté le 12-02-2024 à 19:22 | #
I'm wondering if the solution is really unique with these constraints... I can already see a trivial solution with another loop where two lines are interchangeable, and neither order is the correct answer, though they both work on-calc.
Tuper4Hors ligneMembrePoints: 850 Défis: 19 Message
Posté le 12-02-2024 à 19:23 | #
I sent him a PM with a response that should work, I am waiting his response
:/
CalcloverhkHors ligneMembrePoints: 347 Défis: 10 Message
Posté le 12-02-2024 à 19:27 | #
@Lephenixnoir @Tuper4
Edited the constraints. Now I think it should only have 1 possible solution
Tuper4Hors ligneMembrePoints: 850 Défis: 19 Message
Posté le 12-02-2024 à 19:30 | #
Ok, now it's better,
Tuper4Hors ligneMembrePoints: 850 Défis: 19 Message
Posté le 12-02-2024 à 19:35 | #
There's still another solution :/
Click to see
I will delete it
For 1→A To 7
Locate A+1,A,A
Next
ClrText
For 1→A To 7
Locate 1,A,A
Next
CalcloverhkHors ligneMembrePoints: 347 Défis: 10 Message
Posté le 12-02-2024 à 19:36 | #
You cannot use ClrText as said in the description
Tuper4Hors ligneMembrePoints: 850 Défis: 19 Message
Posté le 12-02-2024 à 19:36 | #
Oops... Sorry
LephenixnoirHors ligneAdministrateurPoints: 24348 Défis: 170 Message
Posté le 12-02-2024 à 19:42 | #
Found it. Sweet!
Tuper4Hors ligneMembrePoints: 850 Défis: 19 Message
Posté le 12-02-2024 à 19:50 | #
For 1→A To 7
Locate 1,A,A
Next
Return
For 1→A To 7
Locate A+1,A,A
Next
This one works with me I appended the 4 lines in the begening of the code
CalcloverhkHors ligneMembrePoints: 347 Défis: 10 Message
Posté le 12-02-2024 à 19:53 | #
The part you need to answer is in the end of the sample program

Pages: 1, 2 | Suivante

Planète Casio v4.3 © créé par Neuronix et Muelsaco 2004 - 2024 | Il y a 98 connectés | Nous contacter | Qui sommes-nous ? | Licences et remerciements

Planète Casio est un site communautaire non affilié à Casio. Toute reproduction de Planète Casio, même partielle, est interdite.
Les programmes et autres publications présentes sur Planète Casio restent la propriété de leurs auteurs et peuvent être soumis à des licences ou copyrights.
CASIO est une marque déposée par CASIO Computer Co., Ltd