Tech Fun: Emoji C

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,301
So what should 😈.h contains to compile the C code below ?

C:
$ cat 🤡.c
#include "😈.h"

ℤ 𝑓(ℤ 𝑥, 𝛼** 𝑦) {
  🗣("🎉 %s\n", 𝑦[1]);
  💋 0;
}

$ gcc -o 🤡 🤡.c
$ ./🤡 👩‍👩‍👧‍👧
🎉 👩‍👩‍👧‍👧

@theMKR surely know what to do right ?
No global variables required.
wink wink
:)
 

theMKR

Banned
Joined
Nov 3, 2016
Messages
70,933
Reaction score
13,557
So what should 😈.h contains to compile the C code below ?

C:
$ cat 🤡.c
#include "😈.h"

ℤ 𝑓(ℤ 𝑥, 𝛼** 𝑦) {
  🗣("🎉 %s\n", 𝑦[1]);
  💋 0;
}

$ gcc -o 🤡 🤡.c
$ ./🤡 👩‍👩‍👧‍👧
🎉 👩‍👩‍👧‍👧

@theMKR surely know what to do right ?
No global variables required.
wink wink
:)
global_variables.h ?
 

theMKR

Banned
Joined
Nov 3, 2016
Messages
70,933
Reaction score
13,557
how come it prints out icecream ppl.

why not ice cream ppl ppl ?
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,301
@theMKR
Still haven't figure out ?
Not so long ago, someone in the forum keep posting some C source code in Chinese characters.
The Emoji version is just a derivative of it.

Code:
$ cat 测试.c
#include "中文.h"

整数 主要(整数 论据数, 字** 论据) {
  打印(字串"说:世界,您好。"回车, 论据[一]);
  回 零;
}

$ gcc -o 测试 测试.c
$ ./测试 某某
某某说:世界,您好。

I replied to the post with the Chinese C source code version(above is the improved version) to show if one's so bend on using it as a joke, I will show a non-joke instead.

:)
 
Last edited:

xcodes

Great Supremacy Member
Joined
Dec 15, 2013
Messages
63,915
Reaction score
29,185
So what should 😈.h contains to compile the C code below ?

C:
$ cat 🤡.c
#include "😈.h"

ℤ 𝑓(ℤ 𝑥, 𝛼** 𝑦) {
  🗣("🎉 %s\n", 𝑦[1]);
  💋 0;
}

$ gcc -o 🤡 🤡.c
$ ./🤡 👩‍👩‍👧‍👧
🎉 👩‍👩‍👧‍👧

@theMKR surely know what to do right ?
No global variables required.
wink wink
:)


😈 seems to be stdio.h

ℤ seems to be int

𝑓 should be main

a should be of type char

🗣 seems to be printf

🎉 should be some kind of message

💋 should be return

🤡 should be just any valid filename

👩‍👩‍👧‍👧 should be some characters input

y is a char pointer


so it could be re-written as

C:
$ cat mychar.c

#include <stdio.h>

int main (int argc, char** argv) {
  printf("The second character displays is %s\n", 𝑦[1]);
  return 0;
}

$ gcc -o mychar mychar.c
$ ./mychar Today is a sunny day

The second character displays is o


just guessing ... haha ...
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,301
😈 seems to be stdio.h

ℤ seems to be int

𝑓 should be main

a should be of type char

🗣 seems to be printf

🎉 should be some kind of message

💋 should be return

🤡 should be just any valid filename

👩‍👩‍👧‍👧 should be some characters input

y is a char pointer


so it could be re-written as

C:
$ cat mychar.c

#include <stdio.h>

int main (int argc, char** argv) {
  printf("The second character displays is %s\n", 𝑦[1]);
  return 0;
}

$ gcc -o mychar mychar.c
$ ./mychar Today is a sunny day

The second character displays is o


just guessing ... haha ...

This is not a guessing game. I didn’t replace anything manually like you. My code will compile properly if the proper header file is provided.

So what should the header file contains?
I am actually surprised this can actually be a challenge. I was thinking when I posted it that someone whom knows C will find this trivial.

:)
 

xcodes

Great Supremacy Member
Joined
Dec 15, 2013
Messages
63,915
Reaction score
29,185
This is not a guessing game. I didn’t replace anything manually like you. My code will compile properly if the proper header file is provided.

So what should the header file contains?
I am actually surprised this can actually be a challenge. I was thinking when I posted it that someone whom knows C will find this trivial.

:)


bro davidktw, wow you mean you can compile these codes with these icons? didn't know it can be done ...

still, the header file should be stdio.h to me ... maybe you want to reveal it ... :)
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,301
bro davidktw, wow you mean you can compile these codes with these icons? didn't know it can be done ...

still, the header file should be stdio.h to me ... maybe you want to reveal it ... :)
I thought in the posts above, I have already shown you how I compile and executed them using GCC ?

C:
$ cat 😈.h
#include <stdio.h>

#define 𝑓 main
#define 🗣 printf
#define 💋 return
typedef int ℤ;
typedef char 𝛼;

C:
$ cat 中文.h
#include <stdio.h>

#define 主要 main
#define 打印 printf
#define 回 return
#define 回车 "\n"
#define 字串 "%s"
#define 零 0
#define 一 1
typedef int 整数;
typedef char 字;

:)
 

xcodes

Great Supremacy Member
Joined
Dec 15, 2013
Messages
63,915
Reaction score
29,185
I thought in the posts above, I have already shown you how I compile and executed them using GCC ?

C:
$ cat 😈.h
#include <stdio.h>

#define 𝑓 main
#define 🗣 printf
#define 💋 return
typedef int ℤ;
typedef char 𝛼;

C:
$ cat 中文.h
#include <stdio.h>

#define 主要 main
#define 打印 printf
#define 回 return
#define 回车 "\n"
#define 字串 "%s"
#define 零 0
#define 一 1
typedef int 整数;
typedef char 字;

:)


bro davidktw, ok I see it ... thanks for sharing ... :)
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,301
haha ... just like magic, once you learn the trick behind, it's easier to understand ... :)

C doesn’t just come with the compiler. There is always the C preprocessor before it. Otherwise your #include wouldn’t even work.

There is indeed a lot of magic that can be played before the C parsing starts. Feel free to read up the latest standards of C and see what the preprocessor can do.

:)
 

xcodes

Great Supremacy Member
Joined
Dec 15, 2013
Messages
63,915
Reaction score
29,185
C doesn’t just come with the compiler. There is always the C preprocessor before it. Otherwise your #include wouldn’t even work.

There is indeed a lot of magic that can be played before the C parsing starts. Feel free to read up the latest standards of C and see what the preprocessor can do.

:)

like to see more "magic" to be shared with us ... haha ... :)
 
Important Forum Advisory Note
This forum is moderated by volunteer moderators who will react only to members' feedback on posts. Moderators are not employees or representatives of HWZ Forums. Forum members and moderators are responsible for their own posts. Please refer to our Community Guidelines and Standards and Terms and Conditions for more information.
Top