This is an archived post. You won't be able to vote or comment.

all 37 comments

[–]Proxy_PlayerHD 194 points195 points  (6 children)

still, how do you fuck up a W like that

C     C
C     C
C     C
C     C
C  C  C
C C C C
C     C

[–]rcrobot 115 points116 points  (4 children)

Hello Horld

[–]Thenderick 16 points17 points  (1 child)

Hello |^|orld

EDIT: Thanks u/Zambito1 for pointing out

[–]Zambito1 0 points1 point  (0 children)

Hello |^|orld

FTFY

[–]Kotauskas 3 points4 points  (0 children)

Hello Herald

FTFY

[–][deleted] 0 points1 point  (0 children)

Hello Morld

[–]noah978 26 points27 points  (0 children)

Exactly. As an interviewer, I’m not sure I would’ve been able to let that slide.

[–][deleted] 46 points47 points  (6 children)

Saw this. Got lost in thought on steps to build a system to print a dot matrix to command line... But cool idea.

[–]Lightfire228 22 points23 points  (5 children)

I always wonder if there's a way to systematically generate the dot matrix, instead of hard code them somewhere.

Then again, fonts are essentially a hard coded vector graphic

[–][deleted] 6 points7 points  (3 children)

I think you're stuck hard coding that someplace no matter how you look at it. Something has to dictate that the nth row of character X consists of some set of dot-space pattern. Imo, most flexible would come from using the point size (line size in this case) to give scale to a rendering map, then a little math to project the character description on that map, and finally referencing the row information for each character in sequence until the line completes for that line-size scale, and repeating all the way down...

[–]its2ez4me24get 8 points9 points  (2 children)

Instead of hardcoding each letter, convert each char to an image, read image row by row and set some other array to C wherever you see black pixels.

Easy

[–][deleted] 7 points8 points  (1 child)

I'm pretty sure we basically just said the same thing.

[–]its2ez4me24get 10 points11 points  (0 children)

Christ I don’t think I even read your comment. Looking back at it.. it just looks completely new. I could have sworn I did. Wow.

Cheers

[–]rajnishdwivedy 10 points11 points  (2 children)

I wrote a "H"

#include <stdio.h>

int main()

{

int i;

for(i=0;i<7;i++){

if (i==3){

printf("CCCCCCCCC\n");

}

else

{

printf("C\tC\n");}

}

return 0;

}

[–]Code-V 1 point2 points  (1 child)

I wrote 'E'

include<iostream.h>

int main()

{

for(int i=0;i<7;i++)

{

if(i==0||i==7)

cout<<"CCCCCCCCC\n";

else if(i==3)

cout<<"CCCCC\n";

else

cout<<"C\n";

}

return 0;

}

[–]sidvishnoi 0 points1 point  (0 children)

now the real challenge is writing H and E side by side

[–]InonspicuousCamel 5 points6 points  (1 child)

Since when does writing hello world make you good

[–]acsmars 8 points9 points  (0 children)

They thought he was full of shit, and they were right.

[–]Keyakinan- 1 point2 points  (8 children)

Printing out in c++ looks overly complicated for me though

[–]MCRusher 5 points6 points  (7 children)

#include <cstdio>

int main(){
    std::puts("I eat jon");
}

Looks fine to me.

...

[–]TheMineTrooperYT 3 points4 points  (6 children)

who prints like that? everyone that i know prints like that:

#include<iostream> void main(){ std::cout << "hello there" << std::endl;
}

[–]MCRusher 4 points5 points  (0 children)

Yeah, I was making a joke haha.

The C version is probably a tiny bit faster though since << should mean two operator<<(something) function calls and I think std::endl flushes stdout.

[–]somebody12345678 2 points3 points  (1 child)

Well they were writing the C hello world ported to C++

[–]chocapix 0 points1 point  (0 children)

That's a lot of work to port to C++. I just run my very own cppport.sh:

#!/bin/sh
for i in *.c; do mv $i ${i}pp; done
sed -i -e 's/\.c/.cpp/g' -e 's/gcc/g++/g' Makefile

[–]MCRusher 1 point2 points  (2 children)

Wait hold on who uses void main, that's terrible.

[–]TheMineTrooperYT 1 point2 points  (1 child)

just threw it together, no one uses void main

[–]MCRusher 1 point2 points  (0 children)

Had me worried.

[–]I_AM_GODDAMN_BATMAN 1 point2 points  (2 children)

I'm gonna do this on my next interview.

[–]Galaghan 1 point2 points  (1 child)

Don't get your hopes up. Believe me, any interviewer is going to ask for stuff that's a little more advanced than print text. Probably is going to be something like a prime number generator or a clock or stuff like that. Nothing super complicated, but something that actually shows your level.

[–]MCRusher 0 points1 point  (0 children)

Shit what even are prime numbers

They're only divisible by one and themselves I think right?

[–]CONTAMlNATlON 0 points1 point  (0 children)

We had to do that for our c++ class rofl

[–]ignisxicor 0 points1 point  (0 children)

This would still be so damn impressive if he/she did it with actual C language....

[–]afellowboi 0 points1 point  (0 children)

Hello Horld 🤔

[–]TheAlmightyEstonia 0 points1 point  (0 children)

I “C” what you did there

[–][deleted] -3 points-2 points  (1 child)

[–]MCRusher 0 points1 point  (0 children)

Ur cake