Salutos les bladinautes développeurs.
J'attends parler de ChatGPT depuis un certain temps. En me baladant sur le site OpenAi, je suis tombé ChatGPT et Codex.
Je pose une question : code un jeu pong en C++, puis en C#, puis en JavaScript... A chaque fois le truc me pond le programme en moins de deux minutes ( pour visualiser toutes les lignes, ça devient payant ).
Ex : calculatrice basique en Cobol ( 3s.)
IDENTIFICATION DIVISION.
PROGRAM-ID. CALCULATOR.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 RESULT PIC 9(10).
01 OPERAND1 PIC 9(10).
01 OPERAND2 PIC 9(10).
01 OPERATOR PIC X.
PROCEDURE DIVISION.
DISPLAY "Enter first operand: " WITH NO ADVANCING
ACCEPT OPERAND1
DISPLAY "Enter second operand: " WITH NO ADVANCING
ACCEPT OPERAND2
DISPLAY "Enter operator (+, -, *, /): " WITH NO ADVANCING
ACCEPT OPERATOR
EVALUATE OPERATOR
WHEN "+"
ADD OPERAND1 TO OPERAND2 GIVING RESULT
WHEN "-"
SUBTRACT OPERAND2 FROM OPERAND1 GIVING RESULT
WHEN "*"
MULTIPLY OPERAND1 BY OPERAND2 GIVING RESULT
WHEN "/"
DIVIDE OPERAND1 BY OPERAND2 GIVING RESULT
END-EVALUATE
DISPLAY "Result: " RESULT
STOP RUN.
La même question en JavaScript :
function calculate() {
// Get the operands and operator from the form
var operand1 = document.getElementById("operand1").value;
var operand2 = document.getElementById("operand2").value;
var operator = document.getElementById("operator").value;
// Convert the operands to numbers
operand1 = parseFloat(operand1);
operand2 = parseFloat(operand2);
// Perform the appropriate operation
var result;
switch (operator) {
case "+":
result = operand1 + operand2;
break;
case "-":
result = operand1 - operand2;
break;
case "*":
result = operand1 * operand2;
break;
case "/":
result = operand1 / operand2;
break;
}
// Display the result
document.getElementById("result").innerHTML = result;
}
Et on a droit à une petite explication à la fin :
This program defines a function called calculate that performs the calculation when called. The function gets the operands and operator from the form using the getElementById function, and converts the operands to numbers using the parseFloat function.
The function then uses a switch statement to perform the appropriate operation based on the operator. The result of the operation is stored in a variable called result.
Finally, the function displays the result to the user by setting the innerHTML property of an element with the ID result.
Je poste des programmes simples pour pas flooder.
Sur les forum, des devs l'utilisent déjà pour corriger les erreurs.
Sachant que cette AI est balbutiante mais déjà assez impressionnante, pensez vous que cela pourrait sonner le glas du développement par les humains ?..
Je suis dev et compositeur pour jeux indie. Déjà l'IA commence à toucher à la musique ( même si ce n'est pas parfait, ça reste largement écoutable. ) , la peinture, photo...
Qu'en pensez-vous ?
J'attends parler de ChatGPT depuis un certain temps. En me baladant sur le site OpenAi, je suis tombé ChatGPT et Codex.
Je pose une question : code un jeu pong en C++, puis en C#, puis en JavaScript... A chaque fois le truc me pond le programme en moins de deux minutes ( pour visualiser toutes les lignes, ça devient payant ).
Ex : calculatrice basique en Cobol ( 3s.)
IDENTIFICATION DIVISION.
PROGRAM-ID. CALCULATOR.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 RESULT PIC 9(10).
01 OPERAND1 PIC 9(10).
01 OPERAND2 PIC 9(10).
01 OPERATOR PIC X.
PROCEDURE DIVISION.
DISPLAY "Enter first operand: " WITH NO ADVANCING
ACCEPT OPERAND1
DISPLAY "Enter second operand: " WITH NO ADVANCING
ACCEPT OPERAND2
DISPLAY "Enter operator (+, -, *, /): " WITH NO ADVANCING
ACCEPT OPERATOR
EVALUATE OPERATOR
WHEN "+"
ADD OPERAND1 TO OPERAND2 GIVING RESULT
WHEN "-"
SUBTRACT OPERAND2 FROM OPERAND1 GIVING RESULT
WHEN "*"
MULTIPLY OPERAND1 BY OPERAND2 GIVING RESULT
WHEN "/"
DIVIDE OPERAND1 BY OPERAND2 GIVING RESULT
END-EVALUATE
DISPLAY "Result: " RESULT
STOP RUN.
La même question en JavaScript :
function calculate() {
// Get the operands and operator from the form
var operand1 = document.getElementById("operand1").value;
var operand2 = document.getElementById("operand2").value;
var operator = document.getElementById("operator").value;
// Convert the operands to numbers
operand1 = parseFloat(operand1);
operand2 = parseFloat(operand2);
// Perform the appropriate operation
var result;
switch (operator) {
case "+":
result = operand1 + operand2;
break;
case "-":
result = operand1 - operand2;
break;
case "*":
result = operand1 * operand2;
break;
case "/":
result = operand1 / operand2;
break;
}
// Display the result
document.getElementById("result").innerHTML = result;
}
Et on a droit à une petite explication à la fin :
This program defines a function called calculate that performs the calculation when called. The function gets the operands and operator from the form using the getElementById function, and converts the operands to numbers using the parseFloat function.
The function then uses a switch statement to perform the appropriate operation based on the operator. The result of the operation is stored in a variable called result.
Finally, the function displays the result to the user by setting the innerHTML property of an element with the ID result.
Je poste des programmes simples pour pas flooder.
Sur les forum, des devs l'utilisent déjà pour corriger les erreurs.
Sachant que cette AI est balbutiante mais déjà assez impressionnante, pensez vous que cela pourrait sonner le glas du développement par les humains ?..
Je suis dev et compositeur pour jeux indie. Déjà l'IA commence à toucher à la musique ( même si ce n'est pas parfait, ça reste largement écoutable. ) , la peinture, photo...
Qu'en pensez-vous ?