Debug and Rate AI code
Posted: 20 Jun 2022 16:07
I found an open AI and decided to have it write a batch file, tell me whats wrong with it (because it doesnt work) and rate the AIs skill level.
Here is what was asked:
"Write batch file code for windows 7 that uses a key to encrypt and decrypt messages in window."
Here is what was asked:
"Write batch file code for windows 7 that uses a key to encrypt and decrypt messages in window."
Code: Select all
@echo off
setlocal
set key=1234
:start
echo Enter 1 to encrypt a message, 2 to decrypt a message, or 3 to exit
set /p choice=
if %choice%==1 (
echo Enter the message to encrypt:
set /p message=
for /f "tokens=*" %%a in ('%message%') do set "encrypted=!encrypted!%%a"
echo The encrypted message is: %encrypted%
)
if %choice%==2 (
echo Enter the message to decrypt:
set /p message=
for /f "tokens=*" %%a in ('%message%') do set "decrypted=!decrypted!%%a"
echo The decrypted message is: %decrypted%
)
if %choice%==3 exit
goto start