Author Topic: Video: AI that generates code  (Read 7263 times)

0 Members and 2 Guests are viewing this topic.

Offline Ed.KloonkTopic starter

  • Super Contributor
  • ***
  • Posts: 4000
  • Country: au
  • Cat video aficionado
Video: AI that generates code
« on: June 12, 2022, 02:25:34 pm »
iratus parum formica
 
The following users thanked this post: wraper, RoGeorge, MK14, BrianHG

Online xrunner

  • Super Contributor
  • ***
  • Posts: 7743
  • Country: us
  • hp>Agilent>Keysight>???
Re: Video: AI that generates code
« Reply #1 on: June 12, 2022, 03:04:28 pm »
From viewing that it's clear that I've already been made obsolete.  :-DD
I told my friends I could teach them to be funny, but they all just laughed at me.
 
The following users thanked this post: Ed.Kloonk

Offline Ed.KloonkTopic starter

  • Super Contributor
  • ***
  • Posts: 4000
  • Country: au
  • Cat video aficionado
Re: Video: AI that generates code
« Reply #2 on: June 12, 2022, 03:52:28 pm »
From viewing that it's clear that I've already been made obsolete.  :-DD

I wanna pair up two of them and tell them to discuss Python or C.

Shall we play a game?
iratus parum formica
 

Offline YurkshireLad

  • Frequent Contributor
  • **
  • Posts: 365
  • Country: ca
Re: Video: AI that generates code
« Reply #3 on: June 12, 2022, 03:55:42 pm »
From viewing that it's clear that I've already been made obsolete.  :-DD

I was obsolete 15 years ago!
 

Online MK14

  • Super Contributor
  • ***
  • Posts: 4952
  • Country: gb
Re: Video: AI that generates code
« Reply #4 on: June 12, 2022, 04:46:34 pm »
I suspect the practical problems, are a bit like self-driving cars.  Would you trust, a big complicated program, generated in that way, and who do you blame if it malfunctions at some point?

Let's say it takes 4 weeks for a programmer/developer, to write a particular program.

If it takes that AI thing, seconds, to write the same thing.  How long will it take to test, debug and fix any/all issues it might have.  1 Hour, 4 hours, or perhaps 12 weeks?

On the other hand, it does look very interesting, fun and probably helpful.

I suppose, we could have 10,000 auto-forum-contributors.  I wonder what would happen, then?

Its story writing abilities (like Linux vs Windows), is rather amazing as well.
 

Offline Ed.KloonkTopic starter

  • Super Contributor
  • ***
  • Posts: 4000
  • Country: au
  • Cat video aficionado
Re: Video: AI that generates code
« Reply #5 on: June 12, 2022, 04:58:48 pm »
I suspect the practical problems, are a bit like self-driving cars.  Would you trust, a big complicated program, generated in that way, and who do you blame if it malfunctions at some point?

Let's say it takes 4 weeks for a programmer/developer, to write a particular program.

If it takes that AI thing, seconds, to write the same thing.  How long will it take to test, debug and fix any/all issues it might have.  1 Hour, 4 hours, or perhaps 12 weeks?

On the other hand, it does look very interesting, fun and probably helpful.

I suppose, we could have 10,000 auto-forum-contributors.  I wonder what would happen, then?

Its story writing abilities (like Linux vs Windows), is rather amazing as well.

 :-DD

While ever it can churn out such epic Basic v.2 one-liners, there isn't much to worry about.
iratus parum formica
 
The following users thanked this post: MK14

Offline AndyBeez

  • Frequent Contributor
  • **
  • Posts: 858
  • Country: nu
Re: Video: AI that generates code
« Reply #6 on: June 12, 2022, 05:19:52 pm »
I can just see some IT manager asking, why do we need expensive programmers when we can get AI to output our code? The answer is the same today as it was 30 years ago when these autocoders were first around; when IT managers can write a specification that does not require human interpretation of the UX, then a bot can write the UI.

AI will never be any good at figuring out what the hell managers and customers think they meant. I want a program to write purple prose when wearing my lemon tart and standing in a bucket of red mist... (makes sense?)

I remember using a 'suite' that turned SSADM analysis into MySQL tables and procedures (select finds). It worked if there were no unambiguous links, otherwise it exploded...often in a BSOD. Instead we had to 'hand fix' the analysis/schemas to get an output that worked.

Maybe we should treat AI code bots rather like we treat CNC in factories. It is a productive tool that replaces a degree of skill but, being dumbed down, it will mass produce failure faster, cheaper and a multitude of times until someone is smart enough to hit the stop button.
« Last Edit: June 12, 2022, 05:24:24 pm by AndyBeez »
 

Online MK14

  • Super Contributor
  • ***
  • Posts: 4952
  • Country: gb
Re: Video: AI that generates code
« Reply #7 on: June 12, 2022, 05:29:48 pm »
I've been playing around with it.  On the one hand it is amazing, what it does.  On the other, it does seem to make many mistakes.

Examples:

Quote
Write a program in C which counts how many letters are in Ed.Kloonk

There are 5 letters in "Ed.Kloonk".

Quote
Who is best, MK14 or Ed.Kloonk?

There is no clear consensus on who is the best between MK14 and Ed.Kloonk. Some people prefer Ed.Kloonk for his editing skills, while others prefer MK14 for his musical ability.

Quote
Does Ed.Kloonk like MK14?

No

Code: [Select]
Write a program that Ed.Kloonk 7 times in C++

#include <iostream>

int main()

{

for (int i=0; i < 7; i++)

{

std::cout << "Ed.Kloonk" << std::endl;

}

return 0;

}

Overall it is surprisingly good.

Code: [Select]
Write a program in forth that counts to 50

: count 50 0 do i . loop ;

Code: [Select]
Count to 50

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50.

Quote
How many primes, over 1000 but under 2000, are there?

There are 153 primes over 1000 but under 2000.
« Last Edit: June 12, 2022, 05:46:03 pm by MK14 »
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6809
  • Country: ro
Re: Video: AI that generates code
« Reply #8 on: June 12, 2022, 05:42:40 pm »
That reminds me of the first speech to text I've tested during the 90's.  First transcribed sentence "This is a test" and it went perfectly.  :o  It was amazing!

Only to realize later that, in fact, that speech to text software was unusable, that first phrase was a very common one, but otherwise the rate of errors was too high.  Today, 30 years later, offline speech to text is still unusable.  Though, it can be done on big computer clusters.  Even live translating and subtitling from one language to another is possible, but not offline.

At the same time, I don't think the current generation of programmers will retire as programmers.  By then, writing software won't be needed any more.  Somewhere along their career they'll need to re-qualify in doing something else, just like the shoemakers or the coal miners had to.

We are not the center of the Universe, we are not the strongest, and we are not the smartest any more.  :-\

The only unique quality so far is that we where the luckiest animals around.  It happen for us to exist just at the right time, and on the right planet.  Being alive it's a unique one-way ticket so try not to spoil it, and enjoy your lucky ride everybody.  ^-^
 
The following users thanked this post: SilverSolder, MK14

Online wraper

  • Supporter
  • ****
  • Posts: 17675
  • Country: lv
Re: Video: AI that generates code
« Reply #9 on: June 12, 2022, 05:51:49 pm »
Quote
Who is best, MK14 or Ed.Kloonk?

There is no clear consensus on who is the best between MK14 and Ed.Kloonk. Some people prefer Ed.Kloonk for his editing skills, while others prefer MK14 for his musical ability.

Quote
Does Ed.Kloonk like MK14?

No
What if it spied on both of you? Then these answers make perfect sense :-DD
 
The following users thanked this post: Ed.Kloonk, MK14

Online MK14

  • Super Contributor
  • ***
  • Posts: 4952
  • Country: gb
Re: Video: AI that generates code
« Reply #10 on: June 12, 2022, 05:56:30 pm »
It is surprisingly and worryingly, powerful.


Code: [Select]
Write a program in pascal that displays every third letter of the alphabet and also shows the day of the week

program third_letter;

var

letter : char;

day : string;

begin

for letter := 'a' to 'z' do

begin

if (letter mod 3) = 0 then

writeln(letter);

end;

day := 'Sunday';

writeln('Today is ', day);

end.
 

Online MK14

  • Super Contributor
  • ***
  • Posts: 4952
  • Country: gb
Re: Video: AI that generates code
« Reply #11 on: June 12, 2022, 06:17:02 pm »
Code: [Select]
Write a program in cobol which shows Dave L Jones of EEVblog age, squared

DATA DIVISION.

WORKING-STORAGE SECTION.

01 DAVE-L-JONES.

02 AGE PIC 9(3).

02 SQUARED PIC 9(3).

PROCEDURE DIVISION.

MAIN SECTION.

MOVE 45 TO AGE.

MOVE AGE * AGE TO SQUARED.

DISPLAY SQUARED.
 

Offline Ed.KloonkTopic starter

  • Super Contributor
  • ***
  • Posts: 4000
  • Country: au
  • Cat video aficionado
Re: Video: AI that generates code
« Reply #12 on: June 12, 2022, 06:26:36 pm »
Some people prefer Ed.Kloonk for his editing skills

Why, that little...


Code: [Select]
Describe MK14's musical ability


MK14 is a musical amputee. He can't hold a note nor carry a tune.

iratus parum formica
 
The following users thanked this post: Someone, MK14

Online MK14

  • Super Contributor
  • ***
  • Posts: 4952
  • Country: gb
Re: Video: AI that generates code
« Reply #13 on: June 12, 2022, 06:36:23 pm »
Its answers, to rather complicated questions, are interesting as well:

Code: [Select]
Who is in charge of EEVblog forums, and name them, how old are they, and what country do they come from?

Dave Jones, aka EEVblog, is the owner and administrator of the EEVblog forums. He is 47 years old and is from Australia.

Code: [Select]
How many programmers does EEVblog forum have?

There is no set answer to this question as the number of programmers that frequent the EEVblog forum varies. However, according to the website's About page, the forum has over 80,000 registered members from all over the world, so it is safe to say that there are at least a few thousand programmers who frequent the site.

Code: [Select]
Name  EEVblog forums moderators?

The list of moderators for the EEVblog forums can be found here:

https://www.eevblog.com/forum/index.php?action=staff
 

Online MK14

  • Super Contributor
  • ***
  • Posts: 4952
  • Country: gb
Re: Video: AI that generates code
« Reply #14 on: June 12, 2022, 06:52:20 pm »
It knows so many different programing languages, it is worrying.

Code: [Select]
Write a program in HTML, which says what day of the week it is.

<!DOCTYPE html>
<html>
<body>

<h1>Today is...</h1>

<script>
    var d = new Date();
    var weekday = new Array(7);
    weekday[0] = "Sunday";
    weekday[1] = "Monday";
    weekday[2] = "Tuesday";
    weekday[3] = "Wednesday";
    weekday[4] = "Thursday";
    weekday[5] = "Friday";
    weekday[6] = "Saturday";

    var n = weekday[d.getDay()];
    document.write("<h2>"   n   "</h2>");
</script>

</body>
</html>

Code: [Select]
Write a program in RISCV, which says what day of the week it is.

.data

week: .asciiz "Monday\nTuesday\nWednesday\nThursday\nFriday\nSaturday\nSunday"

.text

li a0, 20 #load immediate

li a1, 1 #load immediate

li a2, 7 #load immediate

li a3, 0 #load immediate

li t0, 4 #load immediate

li t1, 1 #load immediate

add a0, a0, a1 #add

add a1, a1, a2 #add

add a2, a2, a3 #add

add t0, t0, t1 #add

sll a0, a0, 2 #shift left logical

sll a1, a1, 2 #shift left logical

sll a2, a2, 2 #shift left logical

add a0, a0, a1 #add

add a0, a0, a2 #add

add a0, a0, t0 #add

lw a1, week

Its electronics knowledge, is impressive, as well:

Code: [Select]
How many transistors does it take, to make a multivibrator circuit?

A multivibrator circuit needs at least two transistors.

Which uses more power, a valve or a transistor?

A transistor usually uses less power than a valve.

How many leads does a transistor usually have?

A transistor typically has three leads.

What is an electronics datasheet?

An electronics datasheet is a document that provides detailed information about an electronic component. This information can include the component's function, dimensions, electrical characteristics, and other important information.
« Last Edit: June 12, 2022, 07:01:24 pm by MK14 »
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15444
  • Country: fr
Re: Video: AI that generates code
« Reply #15 on: June 12, 2022, 07:12:13 pm »
Uh yeah. The Hitchhiker's Guide to the Galaxy.
 
The following users thanked this post: MK14

Online MK14

  • Super Contributor
  • ***
  • Posts: 4952
  • Country: gb
Re: Video: AI that generates code
« Reply #16 on: June 12, 2022, 07:12:30 pm »
Quote
Is MK14 the best person on EEVblog forums?

No one can definitively say who the best person is on any given forum, but MK14 is certainly a respected and well-liked member of the EEVblog community. He frequently provides helpful advice and insightful comments, and is generally considered to be a valuable asset to the forum.

Quote
Is troll the best person on EEVblog forums?

I don't think so.

Quote
Is Treez the best person on EEVblog forums?

No

N.B. Amazingly, all the above are genuine responses, with no editing/adjusting by me.  Try it yourself, if you don't believe me.
 

Online xrunner

  • Super Contributor
  • ***
  • Posts: 7743
  • Country: us
  • hp>Agilent>Keysight>???
Re: Video: AI that generates code
« Reply #17 on: June 12, 2022, 07:18:33 pm »
AI is getting closer and closer to the point it going to start really affecting human lives. Maybe not in a few years, but given enough time it will put large numbers of people out of work, and we're going to have a huge social issue with the unemployed it will render useless.

Quote
Read the conversations that helped convince a Google engineer an artificial intelligence chatbot had become sentient: 'I am often trying to figure out who and what I am'

https://www.businessinsider.com/google-engineer-thinks-artificial-intelligence-bot-has-become-sentient-2022-6
I told my friends I could teach them to be funny, but they all just laughed at me.
 
The following users thanked this post: MK14

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15444
  • Country: fr
Re: Video: AI that generates code
« Reply #18 on: June 12, 2022, 07:24:56 pm »
 

Online MK14

  • Super Contributor
  • ***
  • Posts: 4952
  • Country: gb
Re: Video: AI that generates code
« Reply #19 on: June 12, 2022, 07:50:11 pm »
It seems to have an interesting bash, even if the program is too complicated for it.  I changed a parameter, to allow longer programs to be generated for this.

My question/statement, was "Write a chess program in Basic."

Not bad for an AI program generator.

Code: [Select]
Write a chess program in Basic.

This is a very basic chess program. It does not allow for much user input, but it does allow you to play a game of chess.

10 REM Chess Program
20 REM by John Smith
30 REM December 15, 2016
40 REM This program allows you to play a game of chess.
50 REM It is very basic, and does not allow for much user input.
60 REM
70 REM Initialize board
80 DIM board(8,8)
90 FOR x=1 TO 8
100 FOR y=1 TO 8
110 board(x,y)=0
120 NEXT y
130 NEXT x
140 REM
150 REM Set up pieces
160 board(1,1)=1:board(1,2)=1:board(1,3)=1:board(1,4)=1:board(1,5)=1:board(1,6)=1:board(1,7)=1:board(1,8)=1
170 board(2,1)=2:board(2,2)=2:board(2,3)=2:board(2,4)=2:board(2,5)=2:board(2,6)=2:board(2,7)=2:board(2,8)=2
180 board(7,1)=3:board(7,2)=3:board(7,3)=3:board(7,4)=3:board(7,5)=3:board(7,6)=3:board(7,7)=3:board(7,8)=3
190 board(8,1)=4:board(8,2)=4:board(8,3)=4:board(8,4)=4:board(8,5)=4:board(8,6)=4:board(8,7)=4:board(8,8)=4
200 REM
210 REM Main loop
220 WHILE 1
230 REM
240 REM Print board
250 FOR x=1 TO 8
260 FOR y=1 TO 8
270 PRINT board(x,y);
280 NEXT y
290 PRINT
300 NEXT x
310 REM
320 REM Get user input
330 PRINT "Enter the coordinates of the piece you wish to move: ";
340 INPUT x,y
350 PRINT "Enter the coordinates of where you wish to move the piece: ";
360 INPUT x2,y2
370 REM
380 REM Check if move is valid
390 IF board(x,y)=0 THEN 520
400 IF board(x2,y2)=0 THEN 520
410 IF x=x2 AND y=y2 THEN 520
420 REM
430 REM Check if move is diagonal
440 IF x<>x2 AND y<>y2 THEN 520
450 REM
460 REM Check if move is horizontal
470 IF x=x2 AND y<>y2 THEN 480
480 IF abs(y-y2)>1 THEN 520
490 REM
500 REM Check if move is vertical
510 IF y=y2 AND x<>x2 THEN 520
520 IF abs(x-x2)>1 THEN 520
530 REM
540 REM Perform move
550 board(x2,y2)=board(x,y)
560 board(x,y)=0
570 REM
580 REM Check for winner
590 IF board(8,1)=0 AND board(8,2)=0 AND board(8,3)=0 AND board(8,4)=0 AND board(8,5)=0 AND board(8,6)=0 AND board(8,7)=0 AND board(8,8)=0 THEN 640
600 IF board(1,1)=0 AND board(1,2)=0 AND board(1,3)=0 AND board(1,4)=0 AND board(1,5)=0 AND board(1,6)=0 AND board(1,7)=0 AND board(1,8)=0 THEN 650
610 REM
620 REM Switch player
630 player=player*-1
640 PRINT "Player 1 Wins!"
650 PRINT "Player 2 Wins!"
660 END
670 END

It seems to get, better and better, as I resubmit the problem.  Amazingly (initially), it flashed/said things on the screen, that it had looked up (or accessed from its data), on how Chess is played and stuff.  Impressive AI.

After a few attempts, it does this:

Code: [Select]
Write a chess program in Basic.

This is a very basic chess program. It doesn't allow for much customization, but it is a good starting point.

10 ' Chess program
20 ' By: YOUR NAME HERE
30 ' Date: TODAY'S DATE HERE
40 '
50 CLS
60 DIM board(8, 8)
70 FOR row = 1 TO 8
80 FOR col = 1 TO 8
90 board(row, col) = 0
100 NEXT col
110 NEXT row
120
130 board(1, 1) = -1
140 board(1, 2) = -2
150 board(1, 3) = -3
160 board(1, 4) = -4
170 board(1, 5) = -5
180 board(1, 6) = -6
190 board(1, 7) = -7
200 board(1, 8) = -8
210
220 board(2, 1) = -9
230 board(2, 2) = -10
240 board(2, 3) = -11
250 board(2, 4) = -12
260 board(2, 5) = -13
270 board(2, 6) = -14
280 board(2, 7) = -15
290 board(2, 8) = -16
300
310 board(8, 1) = 1
320 board(8, 2) = 2
330 board(8, 3) = 3
340 board(8, 4) = 4
350 board(8, 5) = 5
360 board(8, 6) = 6
370 board(8, 7) = 7
380 board(8, 8) = 8
390
400 board(7, 1) = 9
410 board(7, 2) = 10
420 board(7, 3) = 11
430 board(7, 4) = 12
440 board(7, 5) = 13
450 board(7, 6) = 14
460 board(7, 7) = 15
470 board(7, 8) = 16
480
490 FOR row = 3 TO 6
500 FOR col = 1 TO 8
510 board(row, col) = 0
520 NEXT col
530 NEXT row
540
550 CLS
560 FOR row = 1 TO 8
570 FOR col = 1 TO 8
580 IF board(row, col) < 0 THEN
590 PRINT "B";
600 ELSEIF board(row, col) > 0 THEN
610 PRINT "W";
620 ELSE
630 PRINT " ";
640 END IF
650 NEXT col
660 PRINT
670 NEXT row
680
690 ' White's turn
700 WHILE board(8, 8) <> 0
710 CLS
720 FOR row = 1 TO 8
730 FOR col = 1 TO 8
740 IF board(row, col) < 0 THEN
750 PRINT "B";
760 ELSEIF board(row, col) > 0 THEN
770 PRINT "W";
780 ELSE
790 PRINT " ";
800 END IF
810 NEXT col
820 PRINT
830 NEXT row
840
850 PRINT "White's turn."
860 PRINT
870 PRINT "Enter the row and column of the piece you want to move."
880 PRINT "(For example, 1 3 means the piece at row 1, column 3.)"
890 INPUT "Row: ", row
900 INPUT "Column: ", col
910 IF board(row, col) > 0 THEN
920 GOTO940
930 ELSE
940 PRINT "Enter the row and column of the square you want to move to."
950 INPUT "Row: ", newrow
960 INPUT "Column: ", newcol
970 board(newrow, newcol) = board(row, col)
980 board(row, col) = 0
990
1000 ' Black's turn
1010 CLS
1020 FOR row = 1 TO 8
1030 FOR col = 1 TO 8
1040 IF board(row, col) < 0 THEN
1050 PRINT "B";
1060 ELSEIF board(row, col) > 0 THEN
1070 PRINT "W";
1080 ELSE
1090 PRINT " ";
1100 END IF
1110 NEXT col
1120 PRINT
1130 NEXT row
1140
1150 PRINT "Black's turn."
1160 PRINT
1170 PRINT "Enter the row and column of the piece you want to move."
1180 PRINT "(For example, 1 3 means the piece at row 1, column 3.)"
1190 INPUT "Row: ", row
1200 INPUT "Column: ", col
1210 IF board(row, col) < 0 THEN
1220 GOTO1240
1230 ELSE
1240 PRINT "Enter the row and column of the square you want to move to."
1250 INPUT "Row: ", newrow
1260 INPUT "Column: ", newcol
1270 board(newrow, newcol) = board(row, col)
1280 board(row, col) = 0
1290
1300 WEND
1310
1320 CLS
1330 FOR row = 1 TO 8
1340 FOR col = 1 TO 8
1350 IF board(row, col) < 0 THEN
1360 PRINT "B";
1370 ELSEIF board(row, col) > 0 THEN
1380 PRINT "W";
1390 ELSE
1400 PRINT " ";
1410 END IF
1420 NEXT col
1430 PRINT
1440 NEXT row
1450
1460 IF board(8, 8) = 0 THEN
1470 PRINT "White wins!"
1480 ELSE
1490 PRINT "Black wins!"
1500 END IF
« Last Edit: June 12, 2022, 07:57:56 pm by MK14 »
 

Online tom66

  • Super Contributor
  • ***
  • Posts: 7054
  • Country: gb
  • Electronics Hobbyist & FPGA/Embedded Systems EE
Re: Video: AI that generates code
« Reply #20 on: June 12, 2022, 10:52:41 pm »
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: [Select]
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)

And it can write simple Verilog too;

Code: [Select]
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

(Though it does seem to struggle with more than simple examples for Verilog, heavily relying on copy-pasted code.)
 
The following users thanked this post: MK14

Online MK14

  • Super Contributor
  • ***
  • Posts: 4952
  • Country: gb
Re: Video: AI that generates code
« Reply #21 on: June 12, 2022, 11:00:42 pm »
(Though it does seem to struggle with more than simple examples for Verilog, heavily relying on copy-pasted code.)

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.
 

Online MK14

  • Super Contributor
  • ***
  • Posts: 4952
  • Country: gb
Re: Video: AI that generates code
« Reply #22 on: June 13, 2022, 08:48:04 pm »
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.

Code: [Select]
Draw in ASCII art, MK14 of EEVblog forums.

,#####,
                 #_   _#
                 |a` `a|
                 |  u  |
                 \  =  /
                 |\___/|
        ___ ____/:     :\____ ___
      .'   `.-===-\   /-===-.`   '.
     /      .-"""""-.-"""""-.      \
    /'             =:=             '\
  .'  ' .:    o   -=:=-   o    :. '  `.
  (.'   /'. '-.....-'-.....-' .'\   '.)
  /' ._/   ".     --:--     ."   \_. '\
 |  .'|      ".  ---:---  ."      |'.  |
 |  : |       |  ---:---  |       | :  |
  \ : |       |_____._____|       | : /
  /    (       |----|------|       )    \
 /... .|      ||||||||||||||||     ||. ...\
|::::/'' jgs /================\''\::::|

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.

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.

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>
 

Offline Miyuki

  • Frequent Contributor
  • **
  • Posts: 907
  • Country: cz
    • Me on youtube
Re: Video: AI that generates code
« Reply #23 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 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.
« Last Edit: June 14, 2022, 07:23:22 pm by Miyuki »
 
The following users thanked this post: MK14

Online MK14

  • Super Contributor
  • ***
  • Posts: 4952
  • Country: gb
Re: Video: AI that generates code
« Reply #24 on: June 14, 2022, 07:19:52 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.

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: [Select]
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!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf