Jump to content
Banner by ~ Ice Princess Silky

Programming thread.


I_wesley125

Recommended Posts

I am not that much of a programmer nowadays, but i know C++, bit of C, and python,

a little of HTML.

 

I think ill stick with C in the future, i have found java to be a mess, especially on Linux.

 

Java script looks pretty cool, if i ever did any web related i would use that.

 

Honestly i am not very confident at coding :(, i feel like i know what i am doing,

but when actually writing it, i have trouble putting it together, i have been a bit slow at learning, i hope

in the upcoming year i will get better, i would love to write a simple platform

game :).

 

i have been reading this lately: http://c.learncodethehardway.org/book/

and i my confidence is boosting up, and i am better at fixing my own errors,

but i am still a little slow.

Edited by superponylinux
  • Brohoof 1
Link to comment
Share on other sites

I am not that much of a programmer nowadays, but i know C++, bit of C, and python,

a little of HTML.

 

I think ill stick with C in the future, i have found java to be a mess, especially on Linux.

 

Java script looks pretty cool, if i ever did any web related i would use that.

 

Honestly i am not very confident at coding :(, i feel like i know what i am doing,

but when actually writing it, i have trouble putting it together, i have been a bit slow at learning, i hope

in the upcoming year i will get better, i would love to write a simple platform

game :).

 

i have been reading this lately: http://c.learncodethehardway.org/book/

and i my confidence is boosting up, and i am better at fixing my own errors,

but i am still a little slow.

 

This guy has great tutorials.

http://thenewboston.org/

  • Brohoof 2
Link to comment
Share on other sites

game maker language muthafuckaz!

 

Yeah, I know. I don't belong here. I'll leave now XD

 

I know a little python and HTML, but not enough to do much with either :/

Link to comment
Share on other sites

Honestly i am not very confident at coding :(, i feel like i know what i am doing,

but when actually writing it, i have trouble putting it together, i have been a bit slow at learning, i hope

in the upcoming year i will get better, i would love to write a simple platform

game :).

 

You should definitely check out the tutorials at the site that Rainbow--Dash linked to. Thenewboston isa great resource for learning how to program.

 

Just remember one thing though, no matter how slow it seems to be, just keep on coding. Programming is a lot like math in that it takes a lot of practice to get a handle on it. Trust me though, if you keep at it, then you will see yourself improving more and more with every line of code that you write.

Link to comment
Share on other sites

This guy has great tutorials.

http://thenewboston.org/

 

These look awesome :)

 

 

You should definitely check out the tutorials at the site that Rainbow--Dash linked to. Thenewboston isa great resource for learning how to program.

 

Just remember one thing though, no matter how slow it seems to be, just keep on coding. Programming is a lot like math in that it takes a lot of practice to get a handle on it. Trust me though, if you keep at it, then you will see yourself improving more and more with every line of code that you write.

 

thank you, i will keep on trying :) i know giving up is never the answer.

  • Brohoof 2
Link to comment
Share on other sites

I, myself, am mostly using PHP lately, even though some Javascript too, but mostly for AJAX which in the end is just a matter of a few lines with jQuery.

Link to comment
Share on other sites

What I find funny is how people distinguish between Scripting and Programming languages. Technically there aren't many true scripting languages. Shell scripts and Batch scripts are generally scripting languages, all others are really programming languages.

 

What is true is that when we teach someone to program is we teach them how to make script like applications.

Link to comment
Share on other sites

  • 3 weeks later...

Found the programming thread! :D As for what I know and have done with the languages I know:

 

- Java

------- Wrote an XML Schema parser from scratch for a contest I received 2nd place in for the State of Virginia

------- A game or two, pretty crappy though -- used JOGL/jSDL for graphics

- C

------- An indie game currently in production, using SDL for graphics/audio, and I'm doing all the pixel art myself (I have a friend composing the chiptunes, fortunately)

------- Prizm game development (most of my games are found here: http://www.cemetech....wprofile&u=2150 )

- Ruby

------- Setup a sort of website thing using rails, just for fun, really, though.

------- A set of IRC bots devoted to moderating the channels I control on EFNet

------- A library intended to port Juntions in the Perl 6 Quantum::SuperPosition module to Ruby 1.8+

- z80 Assembly

------- An operating system kernel for Zilog z80-based embedded systems: http://www.cemetech....?t=7422&start=0

------- Console application for ti83+/84+(SE) calculators, with commands similar to those in *nix systems

------- A few small games for 83+/84+(SE) graphing calculators, nothing big

- SuperH Assembly

------- Hacking the Casio fxCG10/20 calculator, helped document the LCD driver, and led the (successful) expedition on software overclocking: http://cemetech.net/news.php?id=509

------- Wrote part of my latest game for it in it (http://cemetech.net/...ode=file&id=721)

- Haskell

------- An hSDL-based game (pretty simple, since Haskell is super mathematically based, and I hate math :P )

Edited by Ashbad
  • Brohoof 1
Link to comment
Share on other sites

Oh you're programming in Ruby! Awesome, I'm discovering ruby and rails myself, and already got plans for a pony related website!

Link to comment
Share on other sites

That is actually interesting. Tell me more.

 

 

I'm surprised that little thing stood out to you as the coolest one :P but explain I shall!

 

I entered into a competition with two other programmers, one of which a very good friend of mine, being pushed up to do it as we were our AP Computer Science teacher's best students, since we knew Java well enough to get a perfect on the AP exam, and knew things way past that. It was for a competition hosted by IDT (Innovative Defense Technologies) for high school students in Virginia, where we had to solve the "real world problem" of reading data, sending it over the internet, and parsing/displaying it in real time on a client side instance of the application. We split up roles, where one man took over the GUI (using the Swing library and a custom design skin), my good friend took up most of the networking concepts, and I helped some with the networking and wrote all of the data parsing/displaying code (plus I also put together the smexy readme that scored us points enough to push us up a rank.)

 

The data to be parsed was in XML format, and the structure of these files were based on a standard XML Schema file. Here were the official guidelines:

 

 

[standard Requirements]

1. The sending component shall accept an xml schema file (.xsd) as input (command line or gui) to define a message structure.

2. The receiving component shall accept an xml schema file (.xsd) as input (command line or gui) to define a message structure.

3. The sending and receiving components shall support messages that are comprised of the following simple data types: boolean, byte, short, int, long, float, double, and string.

4. The sending component shall form a transmittable message based upon the message definition.

5. The sending component shall read an xml file as the source of a message’s data.

6. The sending and receiving component shall connect to each other with TCP sockets using an IP address and port number.

7. The sending component shall send the transmittable message to the receiving component.

8. The receiving component shall receive the transmittable message from the sending component.

9. The receiving component shall display the contents of each message received in real time.

[bonus Requirements]

10. The sending and receiving components shall support messages that include simple objects comprised of primitive data types (one level of nesting in xml data file – for an example see ‘status message’).

11. The receiving component shall read an xml file (accepted through command line or gui) as the source of an expected results message.

12. The receiving component shall form an expected result message based upon data.

13. The receiving component shall compare the contents of the message received from the sending component with the contents of the expected results message and indicate if they are the same.

 

Which were pretty vague, honestly. We had to do at least the standard requirements to be able to be a valid entry, but bonus requirements would score extra points. We had all the standard ones done in a day, and finished the bonus ones over the next week. After that, we went super extra mode and added many additional things to our entry:

 

- support of multiple clients through the receiving server component (each client was identified by their IP address)

- batch sending of files (you can select a folder of XML files, and parse them against the Schema file and send them all together)

- ability to detect connection status between server and clients

 

We received 2nd place at awards ceremony because 1st place's entry was less prettyful, so to speak, but slightly more reliable. It was very close, they won by 1.33 points (out of a possible 120 -- they got 100.00, we got 98.66). We still won $750 for our school, and iPod touches for each of us (IIRC, they won iPhones or something).

 

As for the README and Solution, we're officially allowed to share it, but the company actual has legal rights over it (they plan on using the top submissions as part of an actual contracted solution with the US Government's Defense Department, from what they told us at the awards ceremony). I believe this version in my dropbox is the complete version we submitted, but I may be wrong: http://dl.dropbox.co...18220/ohs_1.zip (AS the README says, please extract it entirely before using it for it to work properly). I'm unsure if that packs example XML and XML Schema files into it to use, but if not I can always post some here.

 

 

Any more questions? :P I'd me ecstatic to describe some of my cooler projects in more detail, such as the embedded systems OS kernel (which actually helped me land a super internship this summer with the Naval Academy in Baltimore), or my indie game for PC platforms.

 

 

Oh you're programming in Ruby! Awesome, I'm discovering ruby and rails myself, and already got plans for a pony related website!

 

Ruby programmers brohoof! *fistbumps* I find that in general, Ruby is an incredibly fun language to use. I love especially how it provides a nice mix of OOP, functional programming, and pythonic feel all into one (plus, it's easily extended in C, which is my favorite language!)

Edited by Ashbad
  • Brohoof 1
Link to comment
Share on other sites

I consider myself to be fairly good with PHP. I can definitely write complete, fully functional sites using PHP, MySQL, HTML, and CSS (though I know very little AJAX/Javascript, so they're not the most dynamic of sites).

 

Additionally, I know a bit of a language called "AutoIT", which is a hybird scripting/programming language. The primary function of AutoIT is to write scripts to automate tasks and functions, but you can make fully functional, GUI-based computer programs with it. I primarily use it for automating repetitive portions of my job, as well as pranking.

 

I've also taken classes about Java, Visual Basic.Net, and ASP.Net (based on VB.Net). I know a little bit of those languages, but I wouldn't say that I'd be able to make practical, usable applications/websites using them.

Link to comment
Share on other sites

  • 4 weeks later...

here is a pathfinding class I wrote, can anyone think of a way that I may improve it?

 

//note: GetPixel(x,y,p) should be replaced with whatever function you use to get map data from

//note: PutPixel(x,y,c,p) should be replaced with whatever darwing system you will use

//note: you should see that I draw on 3 pages, page 2 is the map data, page 1 is the points (curent,destination, and destination node) as well as the debug info

//note: and page 0 is the displayed page draw to the screen

 

#define random(num)(int)(((long)rand()*(num))/(RAND_MAX+1))

#define randomize() srand(time(NULL)) //Seed random numer genorator;

#define Ex 0.10f

#define Plus 0.14f

class AI

{

private:

int mx,my; //map offset

int lx,ly; //curent location

int px,py; //Previous location

int t_map; //moves spent on map

int desX,desY; //destination point

int destX,destY;//destination node

int brainMatrix[54][34]; //matrix for pathfining data

int there1;

// functions //

void Move();

void AILine(int x1,int y1,int x2,int y2,int w);

void AISLine(int x1,int y1,int x2,int y2);

void Calculate(int tx, int ty);

void Compare(int clear);

void Clear(); //clears

public:

// functions //

AI();

~AI();

void Setup();

void SetDest(int x1, int y1);

void Run(int deBug);

int There();

};

 

//AI Class functions

void AI::Setup()

{mx=0;my=0;lx=15;ly=15;SetDest(lx,ly);};

 

void AI::Compare(int clear)

{int tx,ty;

for(tx=0;tx<54;tx++)

{for(ty=0;ty<34;ty++)

{if(!clear&&brainMatrix[tx][ty]>0)Calculate(tx,ty);

if(clear&&1==GetPixel(tx+mx,ty+my,2))brainMatrix[tx][ty]=0;

}

}

};

 

void AI::Calculate(int tx,int ty)

{float m=1.2;

if(1==GetPixel(tx+mx,ty+my,2))m=1.7;

if(tx<53)brainMatrix[tx+1][ty]+=brainMatrix[tx][ty]*Plus*m;

if(tx>0) brainMatrix[tx-1][ty]+=brainMatrix[tx][ty]*Plus*m;

if(ty<33)brainMatrix[tx][ty+1]+=brainMatrix[tx][ty]*Plus*m;

if(ty>0) brainMatrix[tx][ty-1]+=brainMatrix[tx][ty]*Plus*m;

if(tx<53&&ty>0) brainMatrix[tx+1][ty-1]+=brainMatrix[tx][ty]*Ex*m;

if(tx>0&&ty>0) brainMatrix[tx-1][ty-1]+=brainMatrix[tx][ty]*Ex*m;

if(tx<53&&ty<33)brainMatrix[tx+1][ty+1]+=brainMatrix[tx][ty]*Ex*m;

if(tx>0&&ty<33) brainMatrix[tx-1][ty+1]+=brainMatrix[tx][ty]*Ex*m;

};

 

void AI::Clear()

{int tx,ty;for(tx=0;tx<54;tx++){for(ty=0;ty<34;ty++){brainMatrix[tx][ty]=0;}}};

 

void AI::AISLine(int x1,int y1,int x2,int y2)

{int dx=x2-x1,dy=y2-y1;dx/=3;dy/=3;

 

AILine(x1,y1,x2,y2,2);

AILine(x2-dx,y2,x2,y2,8);

AILine(x2,y2-dy,x2,y2,8);

AILine(x1,y1,x2-dx,y2,24);

AILine(x1,y1,x2,y2-dy,24);

};

 

void AI::AILine(int x1,int y1,int x2,int y2, int w)

{//Bresenham's integer Line algorithm for a line from (x1,y1) to (x2,y2)

//this is the line the AI follows

int i,x=x1,y=y1,dx=x2-x1,dy=y2-y1,sy=1,sx=1,swap=0,H=0;

if (dy<0){sy=-1;dy=-dy;}if (dx<0){sx=-1;dx=-dx;}

if (dy>dx){swap=dx;dx=dy;dy=swap;swap=1;}

int dx2=dx+dx,dy2=dy+dy,e=dy+dy-dx;

for (i=1;i<=dx;i++)

{if(x>=0&&x<54&&y>=0&&y<34&&x2>=0&&x2<54&&y2>=0&&y2<34)

{H=sqrt((x-x2)*(x-x2)+(y-y2)*(y-y2));

brainMatrix[x][y]+=int(H*w);

}

if(e>=0)

{if(swap==1)x+=sx;else y+=sy;

e-=dx2;

}

if (swap==1)y+=sy;else x+=sx;

e+=dy2;

}

};

 

void AI::Move()

{int order[4],i;

t_map++;

px=lx;py=ly;

i=1+(t_map/2);

 

//if destination is set on a wall reset the point

if(GetPixel(desX,desY,2)==1)

{SetDest(random(317)+2,random(197)+2);}

 

if(lx>0) order[0]=brainMatrix[lx-1][ly]; else order[0]=0;

if(lx<53)order[1]=brainMatrix[lx+1][ly]; else order[1]=0;

if(ly>0) order[2]=brainMatrix[lx][ly-1]; else order[2]=0;

if(ly<33)order[3]=brainMatrix[lx][ly+1]; else order[3]=0;

 

if(order[0]>order[1]&&order[0]>order[2]&&order[0]>order[3]) lx--;

if(order[1]>order[0]&&order[1]>order[2]&&order[1]>order[3]) lx++;

if(order[2]>order[0]&&order[2]>order[1]&&order[2]>order[3]) ly--;

if(order[3]>order[0]&&order[3]>order[1]&&order[3]>order[2]) ly++;

if(t_map>16)

{destX=lx;destY=ly;t_map=0;}

 

if(lx==destX&&ly==destY)

{mx=mx+destX-27;my=my+destY-17;

lx=27;ly=17;

if(mx<0){lx+=mx;mx=0;}

if(my<0){ly+=my;my=0;}

if(mx>266){lx-=(266-mx);mx=266;}

if(my>166){ly-=(166-my);my=166;}

t_map=0;

}

else

{

if(desX>mx)//go right

destX=53-random(i);

if(desX<mx)//go left

destX=random(i);

if(desY>my)//go down

destY=33-random(i);

if(desY<my)//go up

destY=random(i);

if(desX-mx<54&&desX-mx>0)

destX=desX-mx+random(5)-2;

if(desY-my<34&&desY-my>0)

destY=desY-my+random(5)-2;

 

if(desX-mx<54&&desX-mx>0&&desY-my<34&&desY-my>0)

{destX=desX-mx;destY=desY-my;}

}

if(lx+mx==desX&&ly+my==desY)

{SetDest(random(317)+2,random(197)+2);}

};

 

void AI::SetDest(int x1, int y1)

{desX=x1;desY=y1;

there1=1;

};

 

void AI::Run(int deBug)

{Clear();

 

brainMatrix[destX][destY]=255;

AISLine(lx,ly,destX,destY);

Compare(0);

brainMatrix[lx][ly]=0;

for(int i=0;i<random(3)-1;i++){Compare(0);}

brainMatrix[px][py]=0;

Compare(1);

Move();

 

if(deBug){int tx,ty;for(tx=0;tx<54;tx++){for(ty=0;ty<34;ty++){if(brainMatrix[tx][ty])PutPixel(tx+mx,ty+my,brainMatrix[tx][ty],1);}}}

 

PutPixel(lx+mx,ly+my,random(100)+50,1);

PutPixel(desX,desY,random(100)+50,1);

PutPixel(desX,desY,0,2);

PutPixel(destX+mx,destY+my,80,1);

};

 

int AI::There()

{if(there1){there1=0;return 1;}return 0;};

 

void AI::AI()

{there1=0;};

 

void AI::~AI()

{};

Link to comment
Share on other sites

I've programmed stuff in Basic and attempted to do stuff in C++ but I kinda suck at it, but my dad does it for a living.

I didn't inherit programming skills apparently. :lol:

Link to comment
Share on other sites

Oh my x) This thread still exists!

 

Even though I am still working on that Pony Website with RoR I also now picked up node.js! ( Which is in Javascript )

  • Brohoof 1
Link to comment
Share on other sites

(edited)

Alright, hither they be. Here is hoping I recall all of them. Yes, some of them are debatable in their relevence (such as the game modding languages and scripting languge), but I shall list them here for completeness. Or ego-boosting. Either way.

 

Client-Side

HTML (Extensively. My first, starting when CSS was much less widely-used and I did not really know how to make W3C-standard code - It took me a while to learn to code for browsers other than IE)

XHTML (Extensively. Learned much later, but only debatably should be listed separately)

XML (Moderately)

CSS (Extensively. If you count this as a programming language by even the loosest stretch of the term)

Javascript (Extensively. My first after basic HTML, starting with my tinkering with variables on existing programs)

Server-Side

SQL (Moderately)

PHP (Moderately)

Programming

Java (Extensively-ish. Still a lot to uncover)

C (Moderately)

C++ (Moderately)

C# (Moderately)

Visual Basic .NET (Extensively)

I also worked a bit in pre-.NET

ActionScript (Extensively-ish)

I got a cliffnotes version of assembly, but have yet to use or really dig into it.

I have edited Lua a number of times, though never fully learned it

Game Modding Languages

WML (Lightly. Wesnoth Markup Language, for Battle for Wesnoth)

Decorate (Extensively. ZDoom)

ACS (Moderately. Also ZDoom)

SpiderMonkey (Moderately. Technically does not count for this category, but since I only used it in Sphere, I still think of it as a modding language for some reason)

Edited by Joat
  • Brohoof 1
Link to comment
Share on other sites

(edited)

I gamedev in C#. Currently using Mono and OpenTK (cross-platform OpenGL/AL/CL bindings) for a 3D action-adventure-RPG game. I love the power and simplicity of C#, and I always go back to it when I try another language <3

 

I also built this little site to dump or find game ideas :)

http://ideaguy.99k.org/index.php

 

EDIT:

Actually just found this idea gem:

"a cross between yu-gi-oh and the hunger games"

Edited by Boreal
Link to comment
Share on other sites

(edited)

I started with Game Maker, then learnt VB, and now I'm learning Python and C++. I've started to hate python because its a typefree language and does all these other things that just irritate me.

 

EDIT: I use Notepad++ for most of my programming. Who else does?

Edited by Raptor_a22
Link to comment
Share on other sites

C# but I gotta learn OpenTK. I also know html css and the extreme basics of js, vb and batch

next time a teacher forces you to write something on the board 500 times, Write this:

 

 

#include <studio.h>

int main(void)

{

int count;

for (count = 1; count < = 500; count + +);

printf(«I WILL NOT TALKIN TO MY FRIENDS IN CLASS.n»);

return 0;

}

 

how about batch?

for %%a in /l (1 1 500) do echo I WILL NOT TALKIN TO MY FRIENDS IN CLASS.

But console languages like batch are always more efficient...I think

Link to comment
Share on other sites

But console languages like batch are always more efficient...I think

 

Oh my, don't open that can of worms x) Efficiency is not something you can really discuss objectively as there are way too many situations where each language excels.

Link to comment
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!

Join the herd!

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...