J’ai vraiment envie de m’améliorer en programmation

OP
LS

LutinSoyeux

il y a 8 mois

J'allais raconter ma vie mais le titre suffit

RM

RandomMovement9

il y a 8 mois

Bah code

EL

eliaqim

il y a 8 mois

oui, eh bien travaille dans ce sens

GK

grosKikiModerne

il y a 8 mois

Code moi l'algorithme de César 2.1

ZA

Zaibre

il y a 8 mois

Pourquoi faire, ChatGPT programme pour toi

-N

-Nagatoro

il y a 8 mois

Programation ? C'est à dire ?
Dév Web ? Mobile ? Automatisation ? IoT ? AI ?

LC

LaChonkleu2

il y a 8 mois

Tu as un bac bro en cybersécurité le sang

OP
LS

LutinSoyeux

il y a 8 mois


Code moi l'algorithme de César 2.1

function caesarCipher(str, shift) {
if (shift < 0) {
return caesarCipher(str, shift + 26);
}

let encryptedText = '';

for (let i = 0; i < str.length; i++) {
let char = str[i];

if (char.match(/[A-Z]/)) {
encryptedText += String.fromCharCode((char.charCodeAt(0) - 65 + shift) % 26 + 65);
} else if (char.match(/[a-z]/)) {
encryptedText += String.fromCharCode((char.charCodeAt(0) - 97 + shift) % 26 + 97);
} else {
encryptedText += char;
}
}

return encryptedText;
}

let text = "Bonjour tout le monde!";
let shift = 3;
let encrypted = caesarCipher(text, shift);
console.log("Texte chiffré:", encrypted);

GK

grosKikiModerne

il y a 8 mois

Ok ça semble fonctionner. Allons-y pour du RSA maintenant

GK

grosKikiModerne

il y a 8 mois

Beaucoup plus hard que le césar

GS

GodzillaSupreme

il y a 8 mois

Go arrêter l'OP j'aurai assez de concurrence à la fin de mes études