ForumsProgramming ForumHello World.

26 15662
Tookman
offline
Tookman
87 posts
Nomad

The world can be intense. War, politics, and greed corrupt it, this is a simple coffee shop like way of bringing all of us programmers together. Talk about whatever in this article, anything at all, us programmers have (almost) always been the weird ones, but here, we can talk about things that the idiots in our lives wouldn't understand, we can talk about things that make the smart-Alecs look like dumb-Alecs, and us look cool, but those other people don't have to know. This is a forum for us codies to talk over, because we all know (from that first program) that uncomplicated things can fill you with enjoyment. Relax, my friends, and talk to one-another.

  • 26 Replies
weirdlike
offline
weirdlike
1,299 posts
Prince

I'm the one who made the image...

Is that true @MrDayCee ? I am gullible as heck, and those really are different programming styles

@Doombreed I do it because it is easier to read, it also leaves a very long code so it is not really optimal for condensed programming.

Doombreed
offline
Doombreed
7,022 posts
Templar

I imagined so... I would personally prefer a program with some more lines of code, if it is easier to read... Maybe like this:

#include
#define SIZE 10

main()
{
int Numbers[SIZE], temp, a, i;

for(i=0; i0; i--)
{
Numbers[i] = Numbers[i-1];
}

Numbers[0]=temp;
for (i=0; i

Doombreed
offline
Doombreed
7,022 posts
Templar

Sorry it doesn't show up fully...

#include <stdio.h>
#define SIZE 10

main()
{
int Numbers[SIZE], temp, a, i;

for(i=0; i<SIZE; i++)
{
printf("Insert an integer: &quot;
scanf("%d", &a);
Numbers[i] = a;
}

temp = Numbers[9];

for (i=9; i>0; i--)
{
Numbers[i] = Numbers[i-1];
}

Numbers[0]=temp;
for (i=0; i<SIZE; i++)
{
printf(" %d", Numbers[i]);
}
}

It intentionally has no check as to wether the number inserted is actually an integer.

weirdlike
offline
weirdlike
1,299 posts
Prince

hmm I am not sure what you are trying to achieve there, but if I am in a scenario where I need an integer I use

you can also declare the number as an integer when you cast the for loop

Math.floor(number);
Doombreed
offline
Doombreed
7,022 posts
Templar

I don't know about that Math.Floor(number) thing..I am still green as they come when it comes to programming sorry

yeah, that too... But I prefer to declare everything at once if possible.

Anyway, what this program does is take the numbers you inserted and move them one place right each on the array, with the last number being moved to the first place.

MrDayCee
offline
MrDayCee
14,745 posts
King

@weirdlike I merely meant that I have no clue as to what the programming lines say/mean, so I'd be the artist making the image, since that's my strenght!

Doombreed
offline
Doombreed
7,022 posts
Templar

oh pardon me @MrDayCee , but , I thought artists made, well, you know, art

Hectichermit
offline
Hectichermit
1,828 posts
Bard

Ironically it doesn't matter where the braces are :P

Also try programming in a language that doesn't use them , like python

Its just syntax,

I use a magic button that cleans up the code/formats it for me :P

Doombreed
offline
Doombreed
7,022 posts
Templar

Ironically it doesn't matter where the braces are :P

Well, it doesn't matter in terms of how the program works. But they do matter when trying to read 700 lines of code, especially when said code has many repetitions in each other

I use a magic button that cleans up the code/formats it for me :P

At least you don't belong to the other side

awsomejazz123
offline
awsomejazz123
346 posts
Scribe

A magic button? All I use is the delete button... lol

Hectichermit
offline
Hectichermit
1,828 posts
Bard

Some IDE's have tools that autoformat code.

Showing 16-26 of 26