Jump to content

What was your first program?

OhadShwartzman

So.. what was your first memorable program? How did you learn? What program was it in? Today would you fix anything/make it more efficient?

For me, I made a calculator in java, it was terribly inefficient but I felt good with it.

 

 

LET THE POSTING BEGIN!

 

Link to comment
Share on other sites

Link to post
Share on other sites

Well I am sure 99% of people will say they displayed "Hello World!" on their screen

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Hunter115 said:

some weird adrion os

a traffic light system with leds

Link to comment
Share on other sites

Link to post
Share on other sites

A random php  program taking POST input and doing some basic Math.

[cnyrmb@TheBeast-Arch ~]$ java -jar print_footer.jar

Main Rig:

i7-4790K - Asrock Z97 Extreme 6 - EVGA 1070 FTW - 16GB HyperX Fury @ 1866 - 120GB 840 EVO -  1TB WD Blue - XFX XTR 750W (80+ Gold) - Arch Linux/Win10

Link to comment
Share on other sites

Link to post
Share on other sites

If Java, It was string of "Hello, Java" still using it on university studies.

If xcode (iOS), It was a company app we been working then we decided to closed the whole project.

For Android, It was an app loaded with an update-able page, So we can control the content, it was about tech news.

Link to comment
Share on other sites

Link to post
Share on other sites

made tonnes of things but my first real program was a test based browser.

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, vorticalbox said:

made tonnes of things but my first real program was a test based browser.

Test based, nice

 

I think my first not hello world program was a craptastic network based computer manager. The idea was to have a master program with which I could control basic functions of other computers on the network, but never managed much more than shutdown/restart

I am good at computer

Spoiler

Motherboard: Gigabyte G1 sniper 3 | CPU: Intel 3770k @5.1Ghz | RAM: 32Gb G.Skill Ripjaws X @1600Mhz | Graphics card: EVGA 980 Ti SC | HDD: Seagate barracuda 3298534883327.74B + Samsung OEM 5400rpm drive + Seatgate barracude 2TB | PSU: Cougar CMX 1200w | CPU cooler: Custom loop

Link to comment
Share on other sites

Link to post
Share on other sites

First was Conway's Game of Life written in C with a GUI made with Allegro. Then I switched to Python and made some basic games for PSP, the first of course being Pong which I somehow still have the code for

Spoiler

import time, psp2d, random
scr = psp2d.Screen()
img = psp2d.Image(480,272)
fnt = psp2d.Font('font.png')
pad = psp2d.Controller()
y,z,yy,wee,cscore,pscore,x,diff = 116,126,116,0,0,0,232,2
we = random.randint(1,4)
def map():
    global y,yy,x,z
    img.clear(psp2d.Color(0,0,0))
    img.fillRect(0, 0, 5, 480, psp2d.Color(0,255,0))
    img.fillRect(0, 0, 480, 5, psp2d.Color(0,255,0))
    img.fillRect(0, 267, 480, 5, psp2d.Color(0,255,0))
    img.fillRect(475, 0, 5, 272, psp2d.Color(0,255,0))
    img.fillRect(238, 6, 4, 260, psp2d.Color(0,0,100))
    img.fillRect(5, y, 10, 40, psp2d.Color(255,255,255))
    img.fillRect(465, yy, 10, 40, psp2d.Color(255,255,255))
    pscores = str(pscore)
    cscores = str(cscore)
    fnt.drawText(img,7,6,pscores)
    fnt.drawText(img,450,6,cscores)
    fnt.drawText(img,x,z,'O')
def move():
    global yy, diff, z
    s = random.randint(1,2)
    if diff == 20:
        yy = z - 10
    elif s == 1:
        if z > yy:
            yy += 7 + diff
        else:
            yy -= 7 + diff
def ballmovea():
    global diff, z, x
    if diff == 20:
        z += 7
        x += 7
    else:
        z += diff
        x += diff
def ballmoveb():
    global z, x, diff
    if diff == 20:
        z += 7
        x -= 7
    else:
        z += diff
        x -= diff
def ballmovec():
    global x, z, diff
    if diff == 20:
        z -= 7
        x += 7
    else:
        z -= diff
        x += diff    
def ballmoved():
    global x, z, diff
    if diff == 20:
        z -= 7
        x -= 7
    else:
        z -= diff
        x -= diff
def movement():
    global z, wee, we, cscore, pscore, x, y, yy
    if z >= 245:
        if wee == 1:
            ballmovec()
            we = 3
        else:
            ballmoved()
            we = 4
    elif z <= 2:
        if wee == 3:
            ballmovea()
            we = 1
        else:
            ballmoveb()
            we = 2
    elif x < 14:
        if y - 11 < z < y + 29:
            if wee == 4:
                we,wee = 3,3
                ballmovec()
            elif wee == 2:
                we,wee = 1,1
                ballmovea()
        else:
            cscore += 1
            x,z,yy,y = 232,126,116,116
            map()
            scr.blit(img)
            scr.swap() 
            while True:
                pad = psp2d.Controller()
                if pad.cross:
                    break
    elif 448 < x:
        if yy - 11 < z < yy + 29:
            if wee == 1:
                we,wee = 2,2
                ballmoveb()
            elif wee == 3:
                we,wee = 4,4
                ballmoved()
        else:
            pscore += 1
            x,z,yy,y = 232,126,116,116
            map()
            scr.blit(img)
            scr.swap() 
            while True:
                pad = psp2d.Controller()
                if pad.cross:
                    break
    elif we == 1:
        ballmovea()
        wee = 1
    elif we == 2:
        ballmoveb()
        wee = 2
    elif we == 3:
        ballmovec()
        wee = 3
    elif we == 4:
        ballmoved()
        wee = 4
def speed():
    global diff
    while True:
        map()
        diffs = str(diff)
        fnt.drawText(img,160,130,diffs)
        scr.blit(img)
        scr.swap()        
        pad = psp2d.Controller()
        if pad.cross:
            break
        elif pad.up:
            diff += 1
            time.sleep(.3)
        elif pad.down:
            if diff == 1:
                pass
            else:
                diff -= 1
                time.sleep(.3)
def main():
    global x, we, wee, diff, speed, pscore, cscore, z, y, yy
    speed()
    while True:
        pad = psp2d.Controller()
        movement()
        move()
        map()
        scr.blit(img)
        scr.swap()
        if pad.up:
            if y - 3 <= 4:
                pass
            else:
                y -= 3
        elif pad.down:
            if y + 43 >= 268:
                pass
            else:
                y += 3
        elif pad.l:
            y,yy,z,x,pscore,cscore = 116,116,126,323,0,0
            speed()
if __name__ == '__main__':
    try:
        main()
    except:
        import traceback
        traceback.print_exc(file = file('trace.txt', 'w'))
    

    

 

 

1474412270.2748842

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, straight_stewie said:

I think I actually started with "Hello World". Looks like I'm the odd man out

 

21 hours ago, dexxterlab97 said:

Well I am sure 99% of people will say they displayed "Hello World!" on their screen

I ment a program with some use, but thats nice too! Thank you for sharing this!

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, NoGravityPanda said:

 

I ment a program with some use, but thats nice too! Thank you for sharing this!

include <stdio.h>
int main()
{

printf("Hello World!");

return 0;

}

Don't tell me that Hello World is useless

Link to comment
Share on other sites

Link to post
Share on other sites

17 minutes ago, NoGravityPanda said:

I ment a program with some use, but thats nice too! Thank you for sharing this!

I'm not really willing to share the source of my first "real" program, because they are all project Euler solutions.

ENCRYPTION IS NOT A CRIME

Link to comment
Share on other sites

Link to post
Share on other sites

If by "memorable" you mean the first project that was somewhat larger and complex. A MOD/S3M player with a graphical view of what's happening inside when the music is playing. 

Link to comment
Share on other sites

Link to post
Share on other sites

2D fireworks "game" in Game Maker (+Game Maker Language)

Desktop: Intel i9-10850K (R9 3900X died 😢 )| MSI Z490 Tomahawk | RTX 2080 (borrowed from work) - MSI GTX 1080 | 64GB 3600MHz CL16 memory | Corsair H100i (NF-F12 fans) | Samsung 970 EVO 512GB | Intel 665p 2TB | Samsung 830 256GB| 3TB HDD | Corsair 450D | Corsair RM550x | MG279Q

Laptop: Surface Pro 7 (i5, 16GB RAM, 256GB SSD)

Console: PlayStation 4 Pro

Link to comment
Share on other sites

Link to post
Share on other sites

First program I was really proud with was a C++ program that the purpose of it was to simply add numbers together; but, the constraints were that numbers had to be at least 2147483647 the average int upper limit without overflowing into the sign bit. My teacher gave us no boundaries really other than that but it had to be read in from the user so the user could give any number of digits and the program would have to compensate and it had to be returned after the operation. what I ended up doing was when reading in the obnoxiously large number it would store it as a string from the string it would use a loop to convert it into an int array but because i wanted to still add the numbers, i stored the numbers into the array backwards. So for example, if number 123 was read in the array would have an array of num1[3] with num1[0] = 3 num1[1] = 2 num1[2] =1 it would then add the numbers of each array and if it would carry add one to the next spot then at the end if(numfinal[x] != 0) {cout << numfinal[x];} and then once the carried number is either outputted or not it would loop through the array spitting out each number till the beginning of the array which was the end of the number.

 

Edit:

Actually found the original file i submitted and looks like some of my memory is a little rusty on it but it is still great imo. Here it is for anyone that would even be curious to look at it.https://drive.google.com/open?id=0BzmkRZqbCg0RZ0ZoMDZSUXBhSUU

Link to comment
Share on other sites

Link to post
Share on other sites

Back in the school days I created my first program, which could solve quadratic equations. 

Link to comment
Share on other sites

Link to post
Share on other sites

My first was a custom calculator written in Java to prove to my guild in WoW that we weren't dpsing a boss down fast enough (or future bosses, for that matter), though that stayed private.

My first public stuff was a series of WoW Addons (not "technically" programs but meh) that have since been removed from Curse and helped with guild-management.

CPU - Ryzen 7 3700X | RAM - 64 GB DDR4 3200MHz | GPU - Nvidia GTX 1660 ti | MOBO -  MSI B550 Gaming Plus

Link to comment
Share on other sites

Link to post
Share on other sites

The first that I was happy that I knew how to do it (not  just text mode programs to learn how to code at school, or copy paste programs from books) ...

 

I learned from some books how to incorporate assembly code snippets into Pascal programs (Borland Pascal, precursor of Delphi programming languages)  and used this to make my program switch the video output from DOS text mode to 1024x768 (which was what the 14" CRT monitors we had at school supported) and to enable mouse pointer in the graphical mode (normally nothing built in the DOS era programming language to do this)

Then i added code so that you could drag mouse from left to right and basically draw a waveform on the screen and when you moved the mouse in a corner, the code would go from left to right and emit that sound frequency in the computer speaker in a loop until you clicked on a mouse button. Made some nice sound effects this way, and my classroom kids were impressed. 

 

I moved from Pascal to Visual Basic (6) , some of my best programs were some educational games designed to help young children do math (which were sold in Portugal and around that country I think, it was quite some time ago) ... and these days I kinda moved on to making websites (where it's mostly php and javascript) and playing with microcontrollers (C code on PIC, AVR etc)

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×