General > General Technical Chat

Video: AI that generates code

<< < (3/15) > >>

MK14:
It is surprisingly and worryingly, powerful.



--- Code: ---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.
--- End code ---

MK14:

--- Code: ---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.
--- End code ---

Ed.Kloonk:

--- Quote from: MK14 on June 12, 2022, 06:17:02 pm ---Some people prefer Ed.Kloonk for his editing skills

--- End quote ---

Why, that little...



--- Code: ---Describe MK14's musical ability


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


--- End code ---

MK14:
Its answers, to rather complicated questions, are interesting as well:


--- Code: ---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.
--- End code ---


--- Code: ---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.
--- End code ---


--- Code: ---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
--- End code ---

MK14:
It knows so many different programing languages, it is worrying.


--- Code: ---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>
--- End code ---


--- Code: ---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
--- End code ---

Its electronics knowledge, is impressive, as well:


--- Code: ---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.
--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod