[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vr / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / asp / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / qst / sci / soc / sp / tg / toy / trv / tv / vp / wsg / wsr / x] [Settings] [Search] [Home]
Board
Settings Home
/g/ - Technology



Thread archived.
You cannot reply anymore.



File: programming socks.gif (35 KB, 80x70)
35 KB
35 KB GIF
#include <stdio.h>

typedef struct{
char char1, char2, char3, char4, char5, char6, char7, char8, char9, char10, char11, char12, char13;
} str;


int main(){
str hello;
char *str;

hello.char1 = 'H';
hello.char2 = 'e';
hello.char3 = 'l';
hello.char4 = 'l';
hello.char5 = 'o';
hello.char6 = ' ';
hello.char7 = 'W';
hello.char8 = 'o';
hello.char9 = 'r';
hello.char10 = 'l';
hello.char11 = 'd';
hello.char12 = '!';
hello.char13 = '\0';
str = &hello.char1;

printf("%s\n", str);

return 0;
}
>>
Hello World
English
>>
>>66708914
say "Hello World!"
>>
." Hello world"
>>
cyka blyad
russian
>>
>>66708914
int
main ()
{
puts("Hello World");
}
>>
>>66708914
puts {hello world}
>>
>>66709035
$ echo "puts {hello world}" | gcc -xc -o hello - && ./hello
<stdin>:1:6: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
>>
Пpивeт cвeт
>>
>>66708997
Убит ceбя пидapac
>>
main = putStrLn "Hello World! "
>>
>>66709051
$ echo "puts {hello world}" | tclsh
hello world
>>
fn main () {
putstrln!("Hello world!");
}
>>
>>66709084
never heard of this language; weird.
>>
>>66708914
>alofa lalolagi
Subhumanish
>>
>>66709100
tcl / tk is a reasonably famous (defunct i think) graphic toolkit for linux
>>
>>66708914
Ööliä läikkyy
Finnish
>>
>>66708914
sudo xbps-install -Sy espeak
espeak "hello world"
>>
>>66709122
It's still getting bugfixes and new features at a steady rate.
>>
"Hello world!\n";
>>
vim helloworld

IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO-WORLD.
* simple hello world program
PROCEDURE DIVISION.
DISPLAY 'Hello world!'.
STOP RUN.
>>
#!/bin/bash

printf "Hello World!\n"
>>
>>66708914
ld hl,data
loop:
ld a,(hl)
out ($98),a
cp 0
jp nz,loop
ret
data: .db "hello world!",0
>>
>>66708914
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main () {
char *str;

str = (char *) malloc(15);
strcpy(str, "hello world!");
printf("%s", str);
free(str);
return 0;
}
>>
Guten tag
Fuck I suck at Deutsch
>>
echo "Hello, World!"
>>
Hallo wereld
>>
$letters = array("H","e","l","l","o"," ","W","o","r","l","d");

foreach ($letters as $letter) {
$message .= $letter;
}
echo $message;
>>
#!/usr/bin/env ciao-shell

main(_) :-
write('Hello world!'), nl.
>>
#include <stdio.h>
#define H "Hello world!"

main(){
printf("%s", H);
return 0;
}
>>
File: 1505170110878.jpg (245 KB, 1132x1698)
245 KB
245 KB JPG
>>66709603
>
main(){
>>
>>66708914


fun main(args: Array<String>) {
Optional.of("hello world")
.ifPresent { msg -> println(msg) }
}
>>
>>66709529
why would you do that
>>
>>66708914
пpивeт миp
>>
>>66708914
This is why people see C programmers as code monkeys.
>>
File: wat.png (4 KB, 185x186)
4 KB
4 KB PNG
>OP posts innovative, efficient, cutting-edge code
>everyone else posts boring shit
>>
>>66709638
hi OP,

please don't do that to structs

thanks,
james x
>>
>>66709659
>please don't use structs as data structures
huh?
>>
Bonjour le monde !
Froglang
>>
>>66708914
section .text 
global _start
_start:
mov edx,len
mov ecx,msg
mov ebx,1
mov eax,4
int 0x80
mov ebx,0
mov eax,1
int 0x80
section .data
msg db "Hello, world!",0xa
len equ $ - msg
>>
#lang racket/base

(printf "~a"
(list->string
(map integer->char
(map
(lambda (num)
(+ (/ num 420) 69))
'(1260 13440 16380 16380 17640 -15540 21000 17640 18900 16380 13020 -15120 -24780)))))
>>
>>66709073
Пиздyй нaхyй шпиoн cpaный
>>
Hello worlds a hard program so I build a DSL in kotlin to make it easier and more modular for y'all.

PART 1 (defintion)


class HelloWorldContext(private var state: String = "") {
fun append(char: String) {
state += char
}

fun run() {
println(state)
}

operator fun plusAssign(char: String) {
state += char
}
}

fun buildHelloWorld(cont: HelloWorldContext.() -> Unit) {
cont.invoke(HelloWorldContext(""))
}

fun HelloWorldContext.h(cont: (HelloWorldContext.() -> Unit)? = null) {
this += "h"
if (cont == null) {
this.run()
} else {
cont.invoke(this)
}
}

fun HelloWorldContext.e(cont: (HelloWorldContext.() -> Unit)? = null) {
this += "e"
if (cont == null) {
this.run()
} else {
cont.invoke(this)
}
}


fun HelloWorldContext.o(cont: (HelloWorldContext.() -> Unit)? = null) {
this += "o"
if (cont == null) {
this.run()
} else {
cont.invoke(this)
}
}

fun HelloWorldContext.space(cont: (HelloWorldContext.() -> Unit)? = null) {
this += " "
if (cont == null) {
this.run()
} else {
cont.invoke(this)
}
}

fun HelloWorldContext.w(cont: (HelloWorldContext.() -> Unit)? = null) {
this += "w"
if (cont == null) {
this.run()
} else {
cont.invoke(this)
}
}

fun HelloWorldContext.r(cont: (HelloWorldContext.() -> Unit)? = null) {
this += "r"
if (cont == null) {
this.run()
} else {
cont.invoke(this)
}
}

fun HelloWorldContext.l(cont: (HelloWorldContext.() -> Unit)? = null) {
this += "l"
if (cont == null) {
this.run()
} else {
cont.invoke(this)
}
}

fun HelloWorldContext.d(cont: (HelloWorldContext.() -> Unit)? = null) {
this += "d"
if (cont == null) {
this.run()
} else {
cont.invoke(this)
}
}

>>
using System;

public class HelloWorld
{
public static void main(String[] args)
{
Console.WriteLn("Hello World!");
}
}
>>
>>66709697
PART 2 (usage)


fun main(args: Array<String>) {
buildHelloWorld {
h {
e {
l {
l {
o {
space {
w {
o {
r {
l {
d()
}
}
}
}
}
}
}
}
}
}
}
}


look at how simple this was, isnt kotlin amazing? you should try it instead of becomming a rust tranny!
>>
>>66708914
echo '1488'
>>
>>66709709
But that 's "i check under my bed for jews every night because i can feel the nose poking", not hello world.
>>
>>66709697
decided to refactor it a bit to show you the beauty of kotlin


class HelloWorldContext(private var state: String = "") {
fun append(char: String) {
state += char
}

fun run() {
println(state)
}

operator fun plusAssign(char: String) {
state += char
}
}

typealias Cont = (HelloWorldContext.() -> Unit)
typealias MaybeCont = Cont?

fun buildHelloWorld(cont: Cont) {
cont.invoke(HelloWorldContext(""))
}

fun MaybeCont.runOrContine(ctx: HelloWorldContext) {
if (this == null) {
ctx.run()
} else {
this.invoke(ctx)
}
}

fun HelloWorldContext.h(cont: MaybeCont = null) {
this += "h"
cont.runOrContine(this)
}

fun HelloWorldContext.e(cont: MaybeCont = null) {
this += "e"
cont.runOrContine(this)
}


fun HelloWorldContext.o(cont: MaybeCont = null) {
this += "o"
cont.runOrContine(this)
}

fun HelloWorldContext.space(cont: MaybeCont = null) {
this += " "
cont.runOrContine(this)
}

fun HelloWorldContext.w(cont: MaybeCont = null) {
this += "w"
cont.runOrContine(this)
}

fun HelloWorldContext.r(cont: MaybeCont = null) {
this += "r"
cont.runOrContine(this)
}

fun HelloWorldContext.l(cont: MaybeCont = null) {
this += "l"
cont.runOrContine(this)
}

fun HelloWorldContext.d(cont: MaybeCont = null) {
this += "d"
cont.runOrContine(this)
}
>>
>>66709773
echo '88'
>>
>>66709681
Я из бывшeй Югocлaвии, идиoт
>>
>>66709545
Hallo Welt
>>
echo hello world
>>
>>66708914

That's easy OP, in my language of choice it would be simply

"Hello, world."
>>
File: recursion.jpg (4 KB, 256x256)
4 KB
4 KB JPG
>>66709677
>racket
based
>>
HolyC, God's programming language
"Hello, World!\n"; 
>>
>>66708914
print('Hello World')

Nothing wrong with Python
>>
>>66710239
It is too slow and high level for some tasks.
But for many, many, many tasks, you're better off waiting the 20 seconds python will take to run rather than spending several hours into something that will execute in 5 seconds.
>>
>>66708914
void main()
{
import std.stdio : writeln;
writeln = "Hello World!";
}
>>
bump quality thread
>>
>>66709510
did you forget to increment hl? also wouldn't you want to compare to 0 before outputting? (if input is an empty string, which it isn't in this case, but...)
>>
+[-[<<[+[--->]-[<<<]]]>>>-]>-.---.>..>.<<<<-.<+.>>>>>.>.<<.<-.
>>
main(argc, argv)
int argc;
char **argv;
{
printf("Hello World");
return 0;
}
>>
:then:(_ X) |> X

:prints:() |> ()
:prints:(X R) |> :then:(:printc:X :prints:R)
:prints:(X) |> :printc:X

:main:() |> :prints:'Hello World'
>>
Does the english language count?
Hello World
>>
hallo wereld
>>
>>66712532
what abomination is this?
>>
IO.puts "Hello world"
>>
>>66708914
require("hello-world").greetWorld()
>>
#include <iostream>

int main(){
std::cout << "Hello, world." << std::endl;
std::flush(cout);
std::flush(endl);
return 0;
}
>>
Sveika, pasaule!
>>
package main

import "fmt"

func main() {
fmt.Println("Hello World")
}
>>
>>66712817
Something I wrote during my IT bachelor's. Here's fizzbuzz for you (sans some helper rules):
# Fizzbuzz

%:import:(read) |> r.

:do:(_ _ :Xs:X) |> :Xs:X
:do:(_ _ _ _ :Xs:X) |> :Xs:X


:if:(|T :Xa:X :_:_) |> :Xa:X
:if:(|F :_:_ :Ya:Y) |> :Ya:Y

:fizzbuzz:(101) |> ()
:fizzbuzz:(X) |> :do:(
:r.printn:X
:if:(
:==:(:mod:(X 3) 0)
:r.prints:" Fizz"
()
)
:if:(
:==:(:mod:(X 5) 0)
:r.prints:" Buzz"
()
)
:printc:'\n'
:fizzbuzz:(:+:(X 1))
)

:main:() |> :fizzbuzz:(1)
>>
PRINT "Hello World!"
>>
niggers
>>
>>66713645
? "Hello World"
is shorter and still in BASIC.
>>
move over faggots
https://play.rust-lang.org/?gist=a35ffcde768e7544efa1e4b7170d9c14
>>
>>66708914
gonna larp as apple user:
<html>
<p>hello world</p>
</html>
>>
recursivePrint [] = putChar '\n'
recursivePrint (x:xs) = putChar x >> recursivePrint xs

main = recursivePrint "Hello World"
>>
Alexa say hello world
>>
+[-[<<[+[--->]-[<<<]]]>>>-]>-.---.>..>.<<<<-.<+.>>>>>.>.<<.<-.
>>
>>66715349
>>.<
uwu




Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.