On your first program that built you for programming?

For me, it was an If statement, I am excited, since then I believed that computers are very smart, or I can at least make it understandable because of it.

+5
source share
41 answers

When I first started learning programming with QBASIC, the whole idea of ​​flow control using if statements and loops was great. I think it was only a few days after I found out about the if statement in which I built my first game, "Choose Your Adventure." Looking back, I know that this must have been terribly inefficient and massive in terms of lines of code, but the fact that I could fork this story using nothing but the statements were wonderful.

+4
source

For many of us familiar with computers in the late 70s or early 80s, the first program we saw looked like this:

10 PRINT "Commodore sucks!  "
20 GOTO 10

(Commodore can be replaced with Apple, Atari, or TRS-80.)

GOTO is amazing.

+17

# 2:)

, , - .

SumDigits, . : SumDigits (1234) → 10

. .

string SumDigits(int value) {
  if ( value > 10 ) {
    return SumDigits(value/10) + (value%10);
  }
  return value;
}

, .

, :)

+11

. .

( ), , .


.

, :

  • , .
  • .
  • , " " , , , .
  • .
+8

QBasic, , :

INPUT "What your name?", a$
PRINT "Hi, "; a$; "!"

- PRINT , . INPUT !

+7

.

Turbo Pascal, , . , , - .

, , , , - ! - , ...:)

+4

- , ZX Spectrum - , - , .

, , , , - , .

+3

? "HELLO WORLD"

+3

BASIC (BASIC , ):

10 INPUT A
20 INPUT B
30 LET C = A + B
40 PRINT C

, ( !)... , , , .

+3

, . ,

// a commment!
int /* whoa, an inline comment! */ a;

;)

+3

Loops + Arrays . , - , .

+3

FOR - 6 , lil 'LOGO Turtle, - , , .

+3

, . , Gwbasic. 0 100 . , :

10 print 1
20 print 2
30 print 3
40 print 4

- , WTF - . . - (, - ), . , , .

10 SET i = 0
20 IF i > 100 THEN GOTO 60
30 PRINT i
40 SET I = I + 1
50 GOTO 20
60 REM END LOOP

Thats 6 100!!! . , .:-) .

+3

Fortran, , if, , . -

     integer n

     n = 1
  20 if (n .le. 100) then
        n = 2*n
        write (*,*) n
        goto 20
     endif
+3

-

, , .

 MyList.Any(p => p.IsCurrent)

.. .

+3

, , . . , qbasic:).

, :)

+2

.

, , . , Visual Basic 6 , C, , .

. , , , , . , "whaaa?"

, . Computing, , , .

+1

, . , .

,

? , . , , - . "" , .

, , . .

+1

IF-GOTO.

. , , .

.

+1

C.

C, .

. , . - . , :).

C, .

Java, , "" .

+1

PRINT 3 + 4
7. . !!! ? . , , . .

Backgound: - (Robotron KC 85/1), . , . , , , , . "PRINT" . , . 1986 , 12 . ( , ).

+1

qBasic, 10 - 12, , " " - . . , , .

HTML PHP, , , , , :)

+1

, LINQ. , , ", ". LINQ, .

+1

DBase II , - , , , . . WOW , ! 300- 8- Compugraphic. . ...

+1

. , , , . , .

+1

while while, ,

+1

, x86:

mov ax, 13h
int 10h
mov ax, 0a000h
mov es, ax

, , , , , -.

+1

. , , . , - , , ( ). , , , .

, , , , , , . .

0

BASIC B eginners A ll P urpose S ymbolic I nstruction

0

++, .

Basic, Pascal .. ++ ! , !

And such tiny changes can have very important consequences: ++ I am different from i ++ in different ways. And ++ translates this right down to machine code. Therefore, upon learning about this, I had direct access to CORE MACHINE. Imagine the power!

Having learned about this, I wanted to know all the other strange operations and corners of the C language.

0
source

All Articles