Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Chat about coding with OpenAI

EkBass

Bronze Coder
So, finally i decided to test this thing i have heard of about. After having fun with it last evening, i wanted to see what it can do.
Now first i asked it to create something with JS, like build a bouncing balls to canvas etc. I did help it a lot. It really can do magic stuff, but like human it does f**c up time to time.

But with out any code, i just gave it next message.

Please create a game with C# in console following next rules.
1. Human player versus cpu
2. Normal six side dice
3. Both throws a dice once, then it's opponents turn to throw.
4. Value of throw is added to player personal totalvalue
5. Both can once half their totalvalue. If player choose so, totalvalue is dived by 2. Use integers
6. Both can throw as many times as they want except if totalvalue goes over 19, player loose
7. If player totalvalue is 19, he wins
8. Player can choose not to throw anymore, but other one can still throw dice aslong as possible.
9. Print cpu decisions on screen too.
10. The one who ends closer to 19 wins



It replied "Sure, here is a simple game that follows the rules you have specified:" and did write around 60 lines of code. I tried it with Visual Studio and compiled just fine. Now there was some logic issues thoug. It allowed dividing the totalvalue endlessly and there was no any logic behind of it, so it did half randomly 50% times. So i gave it a new message. You misunderstood. Either one can half their totalvalue only once. Please add some thinking to code when cpu should half its totalvalue
It replied "I apologize for misunderstanding your requirements. Here is an updated version of the game that allows each player to half their total value only once and adds some logic for the CPU to decide whether to half its total value:"


Now next code was fixed what comes for halfing the total only once. Logic when cpu does half its total was bit silly, it does so if total is 15 or more. There is still 4 out of 6 chance to get closer of 19, but who im talking here.

By studying the screen i noticed that cpu had half its value at one point, but there was no message about it. So i send it a message "add somekind of output when cpu half its totalvalue so human knows it" but fortunately i got "Too many requests in 1 hour. Try again later." error message. I had some fun with it before asking this game, so i can blame only myself here.

Anyway, ill wait and ask to do previous thing. Beside of that, ill ask to rethink some algorithm when cpu should half its total value. And ask for a new game. Once its done, ill paste whole code here.

Once the code is done, im considering to ask AI to port it to some other language, just for fun. What i have seen for now, AI wont replace professional coders yet. Maybe in future, but not yet. But its good enough to create code for some purposes. What i studied its logic with JS, it can create collision detection etc. But then i asked questions as programmer does. Now i play dumb.
 
This was a fun read, especially since I've been hearing a lot about OpenAI/ChatGPT recently.

When you mentioned the errors it made, it made me begin to think about the possibility of tools like this being used by students to cheat or possibly just be lazy when developing programs. If it used to lazily develop programs, does this mean as well that we could be seeing a flood of new apps and games that we may think are written by humans but are actually written by robots?(sort of like with the AI and art situation)

As much as I am very negative and biased against AI, I do believe it has potential to do some good - I like smart home devices and just being able to ask for a song or search information for me, but I do have a problem with the data-harvesting practices, for example. It could also serve elderly or disabled people well - provided their homes are wired up with smart devices(lights and switches, chairs, etc.) - and allow them to get by in life a bit easier.

Whilst a lot of people seem to be very negative, trying to predict that by 2040, for example, we'll have AI indistinguishable from humans, for example, I don't think so. This decade and the next will hold some major breakthroughs in AI, but if we're to reach anything 'humanoid', I don't believe that it will happen until nearer the end of the 21st century(somewhere between 2060-2100). There's still a lot of research to be done, a lot of flaws to fix, and a lot of concerns to address - that last point is crucial, as governments could hinder progress in the field of AI for better or worse.

AI in my opinion, will not replace art or programming as in the skill: people will always be toying about with other's code or drawing or painting their pets; AI may take those skills in the workplace, but I don't see that happening for another century or two(I mean, look at self-checkouts in supermarkets! Absolute nightmares! Or automated assistants not even able to recognise certain accents due to the thickness of some). I'm quite happy with our Star Trek-like automated assistants - once we go beyond that, I think our concerns start to become reasonable, even if some may be exaggerated.
 
Very cool answer.

I didnt take in notice, that it could be used to get homeworks done or as easy way to build new apps. With my experience for now, it cant be used to do that. Maybe it behaves like that in purpose.

Anyway, result and more info of my experience is here.

Will i use it in future? Yes, for sure. It is awesome thing to do small and repeated issues which i hate to do.
I did write a code by myself that with nodejs contacts AI API and sends parameter as question and then writes the prompt of AI to console screen. Then i had to go out to teach my doughter to drive a car, so i pasted my code to ChatGPT and asked it to adjust the with following rules.

1. Connect to API
2. Use readline to receive user input.
3. Pass user input to AP and console.log the reply
4. Keep connection alive and wait next user input to be passed for API
5. If user input is "exit" or "bye" terminate connection and program.

It did pretty good job, i did only a minor adjustments.

So for a certain tasks its a awesome thing, but i would definately try to use it for nothing more than decently simple tasks.
 
I didnt take in notice, that it could be used to get homeworks done or as easy way to build new apps. With my experience for now, it cant be used to do that. Maybe it behaves like that in purpose.
I'm not saying it would, but that it is a possibility in the future. It would be up to the developers too to address concerns like these because it would obviously cause a bit of havoc within schools and app stores would seemingly be flooded with thousands of new apps everyday(the Android app store is bad enough). It's important to remember though that these tools often work from data that has been gathered from interactions with thousands of users: if it starts getting repeated answers(e.g. 'Build an app that does X', 'Build a program that does X', 'Construct a piece of software to do X'), it could potentially begin to start seeing and constructing patterns from these responses - alongside the problem of thousands of apps flooding app stores, we could potentially see a lot of apps hold the same design patterns and so it wouldn't surprise me if a lot of people began to get confused as to why so many products look the same.

I don't know what it would look like if students used it to cheat: ChatGPT seems to be doing a good job at mimicking human writing, with the occasional flaw that makes it seem robotic. To avoid students cheating on their papers with tools like ChatGPT, I suppose that is where exams actually have a purpose: to test the student's knowledge. I could ask ChatGPT to write me a research paper write now on a certain subject and it would probably come out alright, but it may not reflect my actual knowledge and so alternative methods of examining students is needed if tools like ChatGPT are going to end up in the hands of the masses.
 
Yes, i actually read from the news paper this morning about this problem.

On the otherhand it is great tool for many. I dont see anything wrong if we can automise some simple programming tasks with AI. Atleast in current level it cant produce long and complicated softwares, atleast without major problems on them which then requires more than noob level programmer to fix them.

Maybe this thing should instead of offering finished program, give a human readable explanations how some goal can be reached. Maybe some examples etc. but not finished code.

What comes for exams etc. for graduationg to something, i think (atleast for now) those should be arranged in closed enviroment where peoples has no access to this kind of services and they must use their brains instead. Or maybe to read from a book.
 
On the otherhand it is great tool for many. I dont see anything wrong if we can automise some simple programming tasks with AI. Atleast in current level it cant produce long and complicated softwares, atleast without major problems on them which then requires more than noob level programmer to fix them.
I suppose that there aren't any problems with using it for certain parts of programming(i.e. building and compiling a program, checking for errors, recommending what to write etc.) Perhaps using it to build programs for inspiration too, it could be useful. Once it can build fully functional programs with very few errors/warnings, I think then is a point to be reasonably concerned at.

Maybe this thing should instead of offering finished program, give a human readable explanations how some goal can be reached. Maybe some examples etc. but not finished code.
Like a sort of guide! Same way with what I was saying about using it to check for errors/warnings, recommendations, etc. The thing is we need to take into account the size of the goal: a full program would be difficult to provide the steps to achieve for but if it was something small like input-checking, I'm sure it could handle that no bother.

What comes for exams etc. for graduationg to something, i think (atleast for now) those should be arranged in closed enviroment where peoples has no access to this kind of services and they must use their brains instead. Or maybe to read from a book.
Definitely. I think after the pandemic with some exams being held online, we could get an idea of what people could get up to if they have the internet at their fingertips, so any sort of access to technology should be prohibited into the near future.
 
I watch WPT matches time to time at tv, and the players has acces to internet via phones they are allowed to use during the game. With a pretty minor fine tunings, imagine what this kind of AI could affect.
Yes, there is a human factor allways present but these peoples plays against each other for years and in best scene hundreds and hundreds of times. It is also possible to feed the AI a games just by following a tv or so. From a certain player, it would be possible to feed hes action from even thousands of games. Certain issues by each person will mostlikely be able to predict.
 
Back
Top Bottom