KARBYTES_JOURNAL_2023_ENTRY_213
Today I used the OpenAI chatbot Playground web interface by entering text into a text field and clicking a submit button after typing in plain-text input. AI-generated plain text output is generated within seconds of me pressing the submit button. What follows is a transcript of one of my first ten “conversations” with the chatbot (a web page interface which implements the ChatGPT API service).
(The following dialogue involves karbytes submitting an instruction to write a C++ program which generates an array of one hundred random integers (which are each no smaller than 0 and no larger than 99) and then prints those array values to the command line. After the AI output the C++ code, karbytes copied and pasted that code into a blank document in a text editor and saved that document as openai_karbytes_28_march_2023_sample_program.cpp. Then karbytes compiled and executed that C++ code and copy and pasted that program output (which is a sequence of nonnegative integers separated by one space character) to the bottom of this web page main content section).
Note that the green highlighted text was generated by the artificial intelligence which karbytes was interacting with and not by karbytes. Note that karbytes inserted space characters between the angle bracket characters which enclose C++ library names (so that the WordPress web page server would not misinterpret those C++ preprocessing directives as HTML web page source code tags).
preset_web_page: https://platform.openai.com/playground/p/S1ZPEr5wneFWkPcXsmoGHrNsg
preset_name: openai_karbytes_28_march_2023
* * *
Write a C++ program which creates an int type array of 100 elements, stores a random integer no larger than 99 in each element of that array, and which prints the array values to the command line.
#include < iostream > #include < cstdlib > #include < ctime > int main() { // Create an int array of 100 elements int arr[100]; // Seed random number generator srand(time(0)); // Generate a random number no larger than 99 and store in each element of the array for (int i = 0; i < 100; i++) { arr[i] = rand() % 100; } // Print the array values for (int i = 0; i < 100; i++) { std::cout << arr[i] << " "; } std::cout << std::endl; return 0; }
program_output:
41 40 77 12 81 77 98 18 96 27 19 68 5 16 63 0 81 12 44 64 17 99 43 86 89 99 91 70 30 32 73 23 24 2 35 5 80 86 75 28 13 95 48 70 63 63 71 44 76 15 60 93 66 56 31 7 55 74 78 85 6 3 8 31 6 96 36 38 82 12 66 47 59 66 18 74 29 89 18 5 56 30 50 22 86 33 81 94 7 59 79 14 63 40 97 21 88 85 59 70
This web page was last updated on 28_MARCH_2023. The content displayed on this web page is licensed as PUBLIC_DOMAIN intellectual property.