Hello world...

10:10

Expert Member
Joined
Oct 9, 2022
Messages
1,696
Reaction score
830
Location
Ogies Mpumalanga
Java:
public class HelloWorld {
// how not to use a String
    public static void main(String[] args) {
int[] array = {72, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100, 33};
        for (int i : array) {
System.out.print((char)i);
        }
    }
}


Yea... blame load shedding... :unsure:
 
Indentation is off
Used Java

!Rejected
Java:
public class NotHelpful {
    public static void main(String[] args) {
        int[] array = {110, 111, 116, 32, 104, 101, 108, 112, 102, 117, 108};
        for (int i = 0; i < array.length; i++) {
            if (i != 6) {
                System.out.print((char)array[i]);
            }
        }
    }
}

I actually didn't just copy and paste the above, it actually took a while to figure it out. I am sure I am not the first, but there are only so many ways to write something. Also, thanks for stealing my thunder a-hole
 
Last edited:
Java:
public class HelloWorld {
// how not to use a String
    public static void main(String[] args) {
int[] array = {72, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100, 33};
        for (int i : array) {
System.out.print((char)i);
        }
    }
}


Yea... blame load shedding... :unsure:
Blame loadshedding for what? The fact that you're an amateur at coding?
 
Blame loadshedding for what? The fact that you're an amateur at coding?
I was trying to inject some humour. The hope was that others would pick up on it and put their first code here, so we can all have a smile each time we read all of it. Just a bit of fun, really.

That little project is over 6 months old now, I have since coded many more ideas but will not share them here. The coolest one I did was a search algorithm to find stuff using multiple browsers and search engines at the same time. I wanted to see if they give the same result or not.

I wanted to place them here, but this environment is so toxic, so out of balance, that one can only expect to find the worst responses. I can understand why this section of the forum is basically dead. Thankfully, you are not the representation of our local coding community. I actually had a warm welcome and each morning I have over a 50 messages telling me how I can improve my code or telling me how good it worked. Awesome people.

You can keep this little corner of hell for yourselves, there are better places, and I created a few new social accounts. The interaction is amazing, the fun we have on a day-to-day basis is really inspiring.

Whatever this section of the forum represent is just toxic in its entirety.
 
I was trying to inject some humour. The hope was that others would pick up on it and put their first code here, so we can all have a smile each time we read all of it. Just a bit of fun, really.

That little project is over 6 months old now, I have since coded many more ideas but will not share them here. The coolest one I did was a search algorithm to find stuff using multiple browsers and search engines at the same time. I wanted to see if they give the same result or not.

I wanted to place them here, but this environment is so toxic, so out of balance, that one can only expect to find the worst responses. I can understand why this section of the forum is basically dead. Thankfully, you are not the representation of our local coding community. I actually had a warm welcome and each morning I have over a 50 messages telling me how I can improve my code or telling me how good it worked. Awesome people.

You can keep this little corner of hell for yourselves, there are better places, and I created a few new social accounts. The interaction is amazing, the fun we have on a day-to-day basis is really inspiring.

Whatever this section of the forum represent is just toxic in its entirety.

1676438322274.jpeg
 
I was trying to inject some humour. The hope was that others would pick up on it and put their first code here, so we can all have a smile each time we read all of it. Just a bit of fun, really.

That little project is over 6 months old now, I have since coded many more ideas but will not share them here. The coolest one I did was a search algorithm to find stuff using multiple browsers and search engines at the same time. I wanted to see if they give the same result or not.

I wanted to place them here, but this environment is so toxic, so out of balance, that one can only expect to find the worst responses. I can understand why this section of the forum is basically dead. Thankfully, you are not the representation of our local coding community. I actually had a warm welcome and each morning I have over a 50 messages telling me how I can improve my code or telling me how good it worked. Awesome people.

You can keep this little corner of hell for yourselves, there are better places, and I created a few new social accounts. The interaction is amazing, the fun we have on a day-to-day basis is really inspiring.

Whatever this section of the forum represent is just toxic in its entirety.
Give them hell bro. They don’t deserve you.
 
I was trying to inject some humour. The hope was that others would pick up on it and put their first code here, so we can all have a smile each time we read all of it. Just a bit of fun, really.

That little project is over 6 months old now, I have since coded many more ideas but will not share them here. The coolest one I did was a search algorithm to find stuff using multiple browsers and search engines at the same time. I wanted to see if they give the same result or not.

I wanted to place them here, but this environment is so toxic, so out of balance, that one can only expect to find the worst responses. I can understand why this section of the forum is basically dead. Thankfully, you are not the representation of our local coding community. I actually had a warm welcome and each morning I have over a 50 messages telling me how I can improve my code or telling me how good it worked. Awesome people.

You can keep this little corner of hell for yourselves, there are better places, and I created a few new social accounts. The interaction is amazing, the fun we have on a day-to-day basis is really inspiring.

Whatever this section of the forum represent is just toxic in its entirety.
I would not get offended by a bespoke hamster expat and a depressed furry.

You OP lacks context and people can't read your brain. Maybe if you started the thread with "Post your first code" it would help for some better context.

Here is one my first Java:
IMG_20190116_183722.jpg
 
I would not get offended by a bespoke hamster expat and a depressed furry.

You OP lacks context and people can't read your brain. Maybe if you started the thread with "Post your first code" it would help for some better context.

Here is one my first Java:
View attachment 1476265
Pathetic.

Look at that "shape"! What is it supposed to be? A leaf? A blue waffle? You will never make it through a barista stand up. Quit now while you're behind!
 
I was trying to inject some humour. The hope was that others would pick up on it and put their first code here, so we can all have a smile each time we read all of it. Just a bit of fun, really.

That little project is over 6 months old now, I have since coded many more ideas but will not share them here. The coolest one I did was a search algorithm to find stuff using multiple browsers and search engines at the same time. I wanted to see if they give the same result or not.

I wanted to place them here, but this environment is so toxic, so out of balance, that one can only expect to find the worst responses. I can understand why this section of the forum is basically dead. Thankfully, you are not the representation of our local coding community. I actually had a warm welcome and each morning I have over a 50 messages telling me how I can improve my code or telling me how good it worked. Awesome people.

You can keep this little corner of hell for yourselves, there are better places, and I created a few new social accounts. The interaction is amazing, the fun we have on a day-to-day basis is really inspiring.

Whatever this section of the forum represent is just toxic in its entirety.
So both your humour and code need work. This is a good place to learn.
 
Meh Java boy here....

Try a real language. :p

Code:
#include <iostream>

int main() {
    int helloWorld[] = {72, 101, 108, 108, 111, 44, 32, 87, 111, 114, 108, 100, 33, 0};

    for (int i = 0; helloWorld[i] != 0; i++) {
        std::cout << char(helloWorld[i]);
    }
   
    return 0;
}
 
I was trying to inject some humour. The hope was that others would pick up on it and put their first code here, so we can all have a smile each time we read all of it. Just a bit of fun, really.

That little project is over 6 months old now, I have since coded many more ideas but will not share them here. The coolest one I did was a search algorithm to find stuff using multiple browsers and search engines at the same time. I wanted to see if they give the same result or not.

I wanted to place them here, but this environment is so toxic, so out of balance, that one can only expect to find the worst responses. I can understand why this section of the forum is basically dead. Thankfully, you are not the representation of our local coding community. I actually had a warm welcome and each morning I have over a 50 messages telling me how I can improve my code or telling me how good it worked. Awesome people.

You can keep this little corner of hell for yourselves, there are better places, and I created a few new social accounts. The interaction is amazing, the fun we have on a day-to-day basis is really inspiring.

Whatever this section of the forum represent is just toxic in its entirety.

Lighten up, Francis.
 
Also Chatgpt makes things stupid easy.

Here's a HLSL pixel shader using a text string.

Code:
cbuffer ConstantBuffer : register(b0)
{
    float4x4 WorldViewProj;
};

Texture2D<float4> fontTexture : register(t0);
SamplerState sampler : register(s0);

static const string TEXT_PHRASE = "Hello World!";

float GetSignedDistance(float2 p)
{
    float4 font = fontTexture.Sample(sampler, p);
    float distance = length(font.rgb);
    return (font.a < 0.5) ? -distance : distance;
}

struct PixelInput
{
    float4 position : SV_POSITION;
    float2 uv : TEXCOORD0;
};

float4 PS(PixelInput input) : SV_Target
{
    float2 uv = input.uv;
    uv.y = 1.0 - uv.y;
    float distance = GetSignedDistance(uv);
    float4 color = float4(1, 1, 1, saturate((distance - 0.5) / 0.1));
    return color;
}

technique10 DrawText
{
    pass P0
    {
        SetVertexShader(NULL);
        SetPixelShader(CompileShader(ps_4_0, PS()));
    }
}

:p
 
Top
Sign up to the MyBroadband newsletter
X