Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INGI1131 (Oz 2) - Ajout de solutions d'APE 2-4-5 #813

Merged
merged 4 commits into from
May 6, 2020

Conversation

Dj0ulo
Copy link
Contributor

@Dj0ulo Dj0ulo commented Apr 13, 2020

No description provided.

@Dj0ulo Dj0ulo closed this Apr 15, 2020
@MartinBraquet
Copy link
Collaborator

Pourquoi as-tu fermé la PR ? =)

@Dj0ulo
Copy link
Contributor Author

Dj0ulo commented Apr 17, 2020

Il y a eu une erreur dans les greetings (j'ai pas compris pourquoi) et les changements ne s'appliquaient pas malgré que tu les aies approuvés. Je me suis dis que ça n'avait juste pas fonctionné... Mais c'est la première fois que je fais un Pull Request, j'ai peut-être mal compris un truc :)

@Dj0ulo Dj0ulo reopened this Apr 17, 2020
@Peiffap
Copy link
Collaborator

Peiffap commented Apr 17, 2020

@Dj0ulo L'erreur avec le greetings n'a rien à voir avec ta PR en l'occurrence, et nous sommes justement en train de l'enlever (#814). Pour ce qui en est d'approuver, ce n'est pas en approuvant que les changements sont acceptés, pour cela il faut merge la pull request. En général, les administrateurs essaient de review tous les trois la PR avant de merge, du coup ici il y avait encore des reviews à faire.
Je vois que tu as rouvert la PR, du coup on s'en chargera, et elle sera fermée automatiquement quand on est tous d'accord pour accepter les changements.

Copy link
Collaborator

@Jimvy Jimvy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merci pour ta contribution !
Concernant les solutions que tu as apportées/qui étaient déjà présentes : il y en a beaucoup qui ne sont pas tail-recursive. Je ne sais pas dans quelle mesure on a insisté sur la récursivité terminale dans le cours ; tout ce que je sais dire, c'est que c'est généralement une propriété très importante en programmation fonctionnelle (sinon elle n'a pas de sens), donc je trouverais dommage que dans les solutions proposées il n'y ait pas de versions tail-recursive.
(Si tu n'as pas les versions tail-recursive, je peux te les retrouver. Ou les réinventer sur le moment, ça se retient ^^)

fun {Flatten List}
case List
of nil then nil
[] H|T then {Append {Flatten H} {Flatten T}}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Il y a une version plus optimisée que celle utilisant Append, je sais pas si tu vois laquelle, mais elle peut être utile à présenter ici.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non je ne vois pas vraiment comment faire sans Append pour l'instant :/

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

local
   fun {DoFlatten Xs Start End}
      case Xs of
         X|Xr then S S1 in
         if {DoFlatten X S S1}
         then S=Start {DoFlatten Xr S1 End}
         else S2 in Start=X|S2 {DoFlatten Xr S2 End}
         end
      [] nil then Start=End true
      else false
      end
   end
in
   fun {Flatten X}
      Start in if {DoFlatten X Start nil} then Start else X end
   end
end

Ça ne me manque pas ce cours...

src/q6/oz-INGI1131/exercises/APE2/q11.oz Show resolved Hide resolved
src/q6/oz-INGI1131/exercises/APE2/q5.oz Show resolved Hide resolved
@gauone gauone mentioned this pull request Apr 18, 2020
@MartinBraquet
Copy link
Collaborator

Comme mentionné dans #811, on va merger cette PR avant.
Il y a des modifs à faire suite aux commentaires ? Si oui, par @Dj0ulo ou un admin ?

@Dj0ulo
Copy link
Contributor Author

Dj0ulo commented Apr 26, 2020

Il y a la nouvelle solution Flatten de @Peiffap, jsp si elle est déjà appliquée à la PR ou si il faut faire une manip en plus

@MartinBraquet
Copy link
Collaborator

SI tu l'approuves, tu peux faire un commit sur ta branche locale et puis push online.

@Dj0ulo
Copy link
Contributor Author

Dj0ulo commented Apr 26, 2020

Voilà c'est bon pour moi !

@@ -0,0 +1,25 @@
declare
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'aurais laissé les deux solutions ici. Peut-être d'abord celle-ci et en-dessous la plus simple.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok je fais ça

@MartinBraquet
Copy link
Collaborator

Merci ! @Jimvy ou @Peiffap , vous pouvez merger quand c'est bon svp ? :)

Copy link
Collaborator

@Peiffap Peiffap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd have to check whether my repo for the class still has some missing answers.

src/q6/oz-INGI1131/exercises/APE2/q10.oz Outdated Show resolved Hide resolved
Copy link
Collaborator

@Peiffap Peiffap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jimvy Any reasons not to merge? Otherwise this is good to go.

Also, I'll open a ticket concerning the potentially missing solutions to pull from my personal repository.

@Peiffap Peiffap merged commit a3d778f into Gp2mv3:master May 6, 2020
@Peiffap
Copy link
Collaborator

Peiffap commented May 6, 2020

Thanks a lot @Dj0ulo!

gauone added a commit to gauone/Syntheses that referenced this pull request May 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants