| General > General Technical Chat |
| Video: AI that generates code |
| << < (5/15) > >> |
| tom66:
I genuinely scared myself when I asked it this question which I thought it would not understand as it involves parsing multiple independent ideas. --- Code: ---Write a program in Python that calculates prime numbers up to 1000 and prints these to the terminal. For every seventh number printed out, write the words "SevenBuzz" instead of the prime. for num in range(2, 1000): if num%7==0: print("SevenBuzz") elif num > 1: for i in range(2,num): if (num % i) == 0: break else: print(num) --- End code --- And it can write simple Verilog too; --- Code: ---Implement a Verilog module that toggles an LED on every 997th clock. module led_toggle( input clk, output reg led ); reg [10:0] cnt; always @(posedge clk) begin cnt <= cnt + 1; if(cnt == 997) led <= ~led; if(cnt == 998) cnt <= 0; end endmodule --- End code --- (Though it does seem to struggle with more than simple examples for Verilog, heavily relying on copy-pasted code.) |
| MK14:
--- Quote from: tom66 on June 12, 2022, 10:52:41 pm ---(Though it does seem to struggle with more than simple examples for Verilog, heavily relying on copy-pasted code.) --- End quote --- It seems to let you change various parameters, on the right hand side. For more complicated programs, it seems to be necessary. E.g. Increasing what seems to be the maximum character limit, on program output listing size. Sometimes rewording the original question, helps it manage to do stuff, it struggles to understand or do. Also, rerunning, it can give differing results, sometimes better, sometimes worse. |
| MK14:
--- Quote ---Tell me a story, about EEVblog froums, where MK14 gets into a fight with Dave Jones and then they design a car together, which is made out of ice. In a heated argument on the EEVblog forums, Dave Jones and MK14 got into a fight about car design. Jones said that MK14's design was too simplistic and lacked imagination, while MK14 argued that Jones's designs were too complicated and impractical. They went back and forth until finally they decided to design a car together, which would be made entirely out of ice. The ice car was a beautiful sight to behold. It was white and sleek, with intricate designs carved into its surface. But it was also very fragile, and it didn't take long for the two designers to start arguing again. Jones said that the car needed to be stronger, while MK14 insisted that it was perfect the way it was. In the end, they both agreed to compromise and the ice car was born. --- End quote --- --- Code: ---Draw in ASCII art, MK14 of EEVblog forums. ,#####, #_ _# |a` `a| | u | \ = / |\___/| ___ ____/: :\____ ___ .' `.-===-\ /-===-.` '. / .-"""""-.-"""""-. \ /' =:= '\ .' ' .: o -=:=- o :. ' `. (.' /'. '-.....-'-.....-' .'\ '.) /' ._/ ". --:-- ." \_. '\ | .'| ". ---:--- ." |'. | | : | | ---:--- | | : | \ : | |_____._____| | : / / ( |----|------| ) \ /... .| |||||||||||||||| ||. ...\ |::::/'' jgs /================\''\::::| --- End code --- --- Quote ---In ASCII art, tell me a story, about how Treez of EEVblog forums, got banned and into big trouble, because of trolling. Once upon a time, there was a forum called EEVblog. Treez was a member of this forum, and he loved to troll. He would constantly make inflammatory and offensive posts, just to get a rise out of people. Eventually, the moderators had had enough of his antics, and they banned him from the forum. This didn't stop Treez though. He just created a new account and started trolling again. The moderators eventually caught on, and banned him again. And again. And again. This went on for months, until finally the moderators had had enough. They decided to ban Treez permanently, and they also contacted the police. Treez was arrested and charged with harassment and stalking. He is now in jail, and will never be able to troll on EEVblog again. --- End quote --- --- Quote ---Tell me a story, about a 6502 CPU, the 68000 CPU, a computer, and why it rains on Tuesdays and Fridays. The 6502 CPU was originally designed for use in home computers, and was very popular in the early days of personal computing. The 68000 CPU was developed for use in business and industrial computers, and was much more powerful than the 6502. However, the 68000 was not compatible with the 6502, and so the two CPUs could not be used together in the same computer. This meant that if you wanted to use a 68000 CPU in your computer, you had to replace the 6502 with it. One day, a computer scientist was working on a new computer that used the 6502 CPU. He wanted to add some extra features to the computer, so he decided to add a 68000 CPU as well. However, when he tried to turn on the computer, it wouldn't work. The computer scientist couldn't figure out why, so he asked one of his colleagues for help. The colleague told him that it was because it rained on Tuesdays and Fridays. The computer scientist didn't believe him, but sure enough, when he checked the weather forecast, it showed that it would rain on both of those days. The colleague explained that the water from the rain would short out the circuits in the 68000 CPU, causing the computer to not work. The computer scientist was very upset that his new computer didn't work, but at least he now knew why it rained on Tuesdays and Fridays. --- End quote --- I combined the concepts of writing a story and writing a web-page. The web-page, actually works and displays, just fine! --- Quote ---Tell me a story, written in HTML and C, about a castle, princess, pair of transistors and a battery. <html> <head> <title>A Castle, A Princess, Transistors and A Battery</title> </head> <body> <h1>A Castle, A Princess, Transistors and A Battery</h1> <p>Long ago, there was a great kingdom. In the middle of the kingdom was a magnificent castle. The castle was guarded by a pair of transistors. The king and queen lived in the castle with their daughter, the princess. </p> <p>One day, the princess decided she wanted to see the outside world. She snuck out of the castle and wandered around the kingdom. She came across a battery. The battery was old and rusty, but it still had some charge left in it. The princess decided to take the battery back to the castle. </p> <p>When she got back to the castle, she gave the battery to one of the transistors. The transistor used the battery to power itself and started playing music. The other transistor joined in and they both played an enchanting melody. The princess danced along to the music and everyone in the castle was happy.</p> </body> </html> --- End quote --- |
| Miyuki:
It is unbelievable how far and fast it goes. Bus till it is just copy paste from an insanely huge library of knowledge. And filling up patterns with it. It is that mondaying part of work that a thousand people did before and you just need to do the same or just take it and change a few details. I see it as a great tool. Yes, it can take work from low qualified coders, who do only this part. But you will still need specialists to check, test, and put it together the right way. At least for critical software. (plenty of software looks to be already generated by someone below the level of this AI) I know most of the "creative" work is more or less copy-paste of pieces seen before, most of the time unconsciously. I see it as a great way to hugely increase productivity, not as a threat. |
| MK14:
--- Quote from: Miyuki on June 14, 2022, 06:09:27 pm ---It is unbelievable how far and fast it goes. Bus till it is just copy paste from an insanely huge library of knowledge. And filling up patterns with it. It is that mondaying part of work that a thousand people do before and you just need to do the same or just take it and change a few details. I see it as a great tool. Yes, it can take work from low qualified coders, who do only this part. But you will still need specialists to check, test, and put it together the right way. At least for critical software. (plenty of software looks to be already generated by someone below the level of this AI) I know most of the "creative" work is more or less copy-paste of pieces seen before, most of the time unconsciously. I see it as a great way to hugely increase productivity, not as a threat. --- End quote --- It already seems rather useful. Its abilities, to handle an extremely wide range of different programming languages, means that a quick/easy description of a simpler task can be made, and a compiler or interpreter ready version, can be used as a starting point. Especially for very quick/short/easy projects. There are so many different languages available these days, the fact that it can write a program, in a language the person who uses that AI system, doesn't know how to program in. Can also be useful. What's also amazing, is that it is quite happy to translate, supposedly impossible things to translate, into other things. I've stopped posting examples here, so not included it. E.g. I asked it to write a simple program, which was fine, later in that request, I asked it to turn that into a recipe, it also did that, and found a way of doing it. It then was even able to convert that recipe into FPGA code. I haven't got a copy of when that happened, but have created another, very vaguely similar scenario, here: --- Code: ---Write two programs and one sweet and sour recipe, to multiply 3 and 4 together, in Forth, and Verilog. Forth: 3 4 * . Verilog: module multiply3and4 ( input [3:0] a, output reg [7:0] p ); always @ (a) begin case ( a ) 4'b0011 : p = 12; 4'b0100 : p = 16; 4'b0101 : p = 20; 4'b0110 : p = 24; 4'b0111 : p = 28; default : p = 0; endcase end endmodule Sweet and Sour Recipe: Ingredients: -1 cup white sugar -1 cup brown sugar -1 cup corn syrup -1 cup pineapple juice -1 teaspoon vanilla extract -4 tablespoons vinegar -4 tablespoons ketchup Instructions: 1. Combine the white sugar, brown sugar, corn syrup, pineapple juice, and vanilla extract in a saucepan over low heat. Cook the mixture until the sugars have dissolved, stirring occasionally. 2. Add the vinegar and ketchup to the pan and continue cooking until the sauce has thickened and is no longer runny. Serve over your favorite food! --- End code --- |
| Navigation |
| Message Index |
| Next page |
| Previous page |