diff --git a/TP1/ADN.ts b/TP1/ADN.ts index 02204f4247cacadb023a52f4ba6973555504c402..81b1398411ce85bb51e4af55999c829935cc3d65 100644 --- a/TP1/ADN.ts +++ b/TP1/ADN.ts @@ -1,7 +1,9 @@ -function estADN( aDN:string):boolean { - for(let c of aDN) - if (c !== 'A' && c !== 'C' &&c !== 'T' && c !== 'G'){ - return false +function estADN(seq: string): boolean { + for (let c of seq) { + if (c !== "A" && c !== "C" && c !== "G" && c !== "T") { + return false; + } } - return true -} + + return true; +} \ No newline at end of file diff --git a/TP1/ADN2.ts b/TP1/ADN2.ts index a90ca6572a2b8604887a2b5b3c975d2fe919e31d..20f3b427274610a79e2063171e0b020ef2d2a1aa 100644 --- a/TP1/ADN2.ts +++ b/TP1/ADN2.ts @@ -1,12 +1,10 @@ -function transcrit( aDN:string):string { - let result = ''; - for(let i = 0; i < aDN.length; i++){ - if (aDN[i] === 'T'){ - result += 'U'; - } - else{ - result += aDN[i]; - } +function transcrit(seqADN: string): string { + let seqARN = ""; + + for (let c of seqADN) { + if (c === "T") seqARN += "U"; + else seqARN += c; } - return result -} + + return seqARN; + } \ No newline at end of file diff --git a/TP1/ADN3.ts b/TP1/ADN3.ts index a5f92877d712ac4b0890d1f4d2061145a4f1a8a9..b1abb8c066334e1f25a556ad08562b3ba0bf0b1a 100644 --- a/TP1/ADN3.ts +++ b/TP1/ADN3.ts @@ -1,7 +1,8 @@ -function baseComplentaire( b:string):string { - if (b === 'A') return 'T'; - if (b === 'T') return 'A'; - if (b === 'G') return 'C'; - if (b === 'C') return 'G'; - return ''; -} \ No newline at end of file +function baseComplémentaire(base: string): string { + if (base === "A") return "T"; + else if (base === "T") return "A"; + else if (base === "C") return "G"; + else if (base === "G") return "C"; + else return ""; + } + \ No newline at end of file diff --git a/TP1/ADN4.ts b/TP1/ADN4.ts index 78395d5ce58bc1fd8624d32764947bd974d64d38..662413c7b499d0203286a603532299669949d26f 100644 --- a/TP1/ADN4.ts +++ b/TP1/ADN4.ts @@ -1,7 +1,9 @@ -function sequenceComplInver( aDN:string):string { - let result = ""; - for(let i = aDN.length-1; i > 0; i--){ - result += baseComplementaire(aDN[i]); - return result; +function séquenceComplémentaireInversée(seq: string): string { + let seqInv = ""; + + for (let c of seq) { + seqInv = baseComplémentaire(c) + seqInv; } + + return seqInv; } \ No newline at end of file diff --git a/compterendu.txt b/compterendu.txt deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/ex1tab.ts b/ex1tab.ts deleted file mode 100644 index fb2e2f1a6b3601a4394da1463404f677476029e4..0000000000000000000000000000000000000000 --- a/ex1tab.ts +++ /dev/null @@ -1,7 +0,0 @@ -function ecri_nombre(n:number): void { - for(let i=0; i<n; i++){ - let valeur = prompt(`Donner le nombre num ${i+1}`); - valeur=Number(valeur); - if(!isNaN(valeur)) console.log(valeur); - } -} \ No newline at end of file diff --git a/ex2tab.ts b/ex2tab.ts deleted file mode 100644 index b68070a8df7afe58136f857d346ffbeab92d78d4..0000000000000000000000000000000000000000 --- a/ex2tab.ts +++ /dev/null @@ -1,12 +0,0 @@ -function ajouterUn(tab: Array<number>): void { - for (let i in tab) tab[i] = 1 + tab[i]; - } - let tab = [1, 2, 3, 4, 5]; - ajouterUn(tab); - -function plusUn(tab:Array<number>): Array<number>{ - let result : Array<number>; - for(let i=0; i<tab.length, i++) - result[i] = tab[i] + 1; - return result; -} \ No newline at end of file diff --git a/ex3tab.ts b/ex3tab.ts deleted file mode 100644 index abddaa3906d8bbd025344ebb0e0751c6def1bf24..0000000000000000000000000000000000000000 --- a/ex3tab.ts +++ /dev/null @@ -1,5 +0,0 @@ -function rotation(tab: Array<number>): void { - let temp = tab[tab.length - 1]; - for (let i = tab.length; i>0; i++) - tab[i] = tab[i-1]; -} \ No newline at end of file diff --git a/src/helloworld.ts b/src/helloworld.ts deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000