Skip to content

exercice1 - #1

Open
luckymusk5 wants to merge 4 commits into
calculator_gradesfrom
kotlin_calculator_grade
Open

exercice1#1
luckymusk5 wants to merge 4 commits into
calculator_gradesfrom
kotlin_calculator_grade

Conversation

@luckymusk5

Copy link
Copy Markdown
Owner

Cette fonction processList prend un tableau d’entiers et une condition (lambda) et renvoie un nouveau tableau contenant uniquement les éléments qui satisfont cette condition. Elle parcourt chaque élément du tableau, teste la condition, et ajoute l’élément au résultat si la condition est vraie. Par exemple, en passant la condition “être pair”, elle renvoie [2, 4, 6] à partir de [1, 2, 3, 4, 5, 6].

@Odile-hol Odile-hol left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

bravo pour le travaille

Comment thread exercice1_kotlin/exercice1.kt

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Le code est très propre

Là où en Dart on aurait dû utiliser une Collection For ou transformer la Map en .entres pour filtrer, l'usage de associate Withet filter ici montre bien la puissance de la bibliothèque standard Kotlin.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

j'aime le fait que tu as utilisé le filter car le code est plus cours et c'est plus efficace

@luckymusk5 luckymusk5 closed this Mar 31, 2026
@luckymusk5 luckymusk5 reopened this Mar 31, 2026
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.

2 participants