4 ms·
I teach programming and have experimented with Codetry Readings(C)(TM);) (think beat poet) I have not hit the sweet spot of reading the code in idiomatic spoken
by prosaic-hacker 4y ago
I teach programming and have experimented with Codetry Readings(C)(TM);) (think beat poet) I have not hit the sweet spot of reading the code in idiomatic spoken language to match to idiomatic code language. Work in progress.
But now with added AI. I guess we could do better with better Chatbot-FU.
GPT-Chat code and description
Request:
python program that takes two numbers on the command line and counts backwards from the first in steps of the second while the value is positive.
Oops did not know it would not preserve format
Moved to google docs
https://docs.google.com/document/d/1aKeY1xYalymWIWY7pjoP7NxwzdU5W8r0f4tXTW1JXbo/edit?usp=sharing https://docs.google.com/document/d/1aKeY1xYalymWIWY7pjoP7Nxw...
Request
describe this code to a non programmer
This code is a program written in the Python language. It takes two numbers as input from the command line and counts backwards from the first number in steps of the second number, until the value reaches zero.
The program first checks if the two required numbers are provided as inputs from the command line. If either of the numbers is missing or cannot be converted to an integer, the program outputs an error message and terminates.
If the inputs are valid, the program sets the first number as the starting point, and begins counting backwards by the second number. It outputs each number as it counts, and stops counting when the value reaches zero.
For example, if the first number is 17 and the second number is 3, the program would output the numbers 17 14 11 8 5 2 in that order.