TD 1A#

ensae_teaching_cs.td_1a.optimisation_contrainte.Arrow_Hurwicz (F, C, X0, p0, epsilon = 0.1, rho = 0.1, do_print = True)

On implémente l’algorithme de Arrow-Hurwicz d’une façon générique. Cela correspond au problème d’optimisation …

ensae_teaching_cs.td_1a.cp2048.Game2048 (self, game = None)

Implements the logic of the game 2048.

ensae_teaching_cs.td_1a.cp2048.evaluate_strategy (fct_strategy, ntries = 10)

Applies method best_move until gameover starting from the current position. Repeats ntries times and the maximum number in every try.

ensae_teaching_cs.td_1a.vigenere.CasseVigenere (message)

Appelle les deux fonctions DecodeVigenereLongueurCle et DecodeVigenereCle pour casser le code de Vigenère.

ensae_teaching_cs.td_1a.edit_distance (mot1, mot2)

Computes the edit distance between two strings.

ensae_teaching_cs.td_1a.classiques.str2date (s, format = “%d/%m/%Y”)

convertit une chaîne de caractères en datetime