From 5421607ce4b72725cc6260aa0b2bceba98e90ddb Mon Sep 17 00:00:00 2001
From: Djokzer <abivarmank@gmail.com>
Date: Sat, 11 Dec 2021 12:04:13 +0100
Subject: [PATCH] Pulled main

---
 .gitignore      |  3 ++-
 polynome.py     |  2 +-
 reed_solomon.py | 21 +++++++++++++++++++--
 3 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/.gitignore b/.gitignore
index d5e4f15..5fb58af 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
-**/__pycache__
\ No newline at end of file
+**/__pycache__
+**/test.py
diff --git a/polynome.py b/polynome.py
index a807c3e..6d28631 100644
--- a/polynome.py
+++ b/polynome.py
@@ -45,5 +45,5 @@ class polynome():
         # Using horner method
         res = 0
         for i in range(len(self.coefs) - 1, -1, -1):
-            res = (res * x + self.coefs[i]) % self.prime_mod
+            res = (res * x + self.coefs[i])
         return res
diff --git a/reed_solomon.py b/reed_solomon.py
index 698cc4a..d6ae2ad 100644
--- a/reed_solomon.py
+++ b/reed_solomon.py
@@ -1,9 +1,26 @@
 # Created on 09/12/2021
 from polynome import *
 from inverse_mult import *
+from itertools import combinations
 
 def get_possibilities(l: list):
-	pass
+
+	# Transforme the list in list of tupples with their indexes
+	for x, _ in enumerate(l):
+		l[x] = (x, l[x])
+
+	# ! la valeur 20 est hardcodée. Paramètre de fonction ??
+
+	l_fixe = l[20:] # Liste contenant aucune erreur
+	l_posi = l[:20] # Liste contenant des erreurs, 
+
+	p = list(combinations(l_posi, 2))
+
+	for x, y in enumerate(p):
+		p[x] = list(y)
+		p[x].extend(l_fixe)
+
+	return p
 
 def lagrange_compute(l: list) -> polynome:
 	list_s = [0] * len(l)
@@ -37,4 +54,4 @@ if __name__ == '__main__':
 	#print(list_)
 	poly = lagrange_compute(list_)
 	poly.show()
-	#print(poly.evaluate(0))
\ No newline at end of file
+	#print(poly.evaluate(0))
-- 
GitLab