[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Post your retard code. Worst wins five_xs_str = (('x'

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 65
Thread images: 7

File: 1443964814793.png (16KB, 360x315px) Image search: [Google]
1443964814793.png
16KB, 360x315px
Post your retard code.
Worst wins

five_xs_str = (('x' * 5)[0] * 5)[::-1]
'xxxxx'
>>
>>58188124
>>
>>58188124
bool isTrue(const bool& expression)
{
if(expression == true)
{
return true;
}
else
{
isFalse(expression);
}
}

bool isFalse(const bool& expression)
{
if(expression == false)
{
return false;
}
else
{
isTrue(expression);
}
}
>>
>>58188189
>>>/deletThis/
>>
>>58188189
Forgot the return before calling isFalse and isTrue, well, even cringier this way I guess.
>>
Import drool
Def tooEarly() :
While True:
If fuckdisshiet == 1:
Print "kill me"
Else:
drool.drool(drool.GIVE_ME_COFFEE)
Print "thx fag"

tooEarly()
>>
>>58188124
Sadly, I can't post your DNA code, OP
>>
Function isEmpty(arr) {
Try {
Arr[0];
Return false;
}
Catch {
Return true;
}
}
>>
>>58188124
unsigned my_strlen(char *s) {
unsigned i = 0;
start:
i = i + 1;
if(*(s+i)) goto start;
return i;
}
>>
>>58188124
//~+~+~+~+~+~литa кoд являeтcя цвгимиpa 
//~+~+~+~opигинaл мaтepиaл дoнaт вopyй~

import.*
public class 133710r|){
public static void main (String[] blazeitdaily){

methodOne();}

public void methodOne(){
System.out.print("H");
System.out.print("E");
System.out.print("L");
System.out.print("L");
System.out.print("O");
System.out.print(" ");
System.out.print("W");
System.out.print("O");
System.out.print("R");
System.out.print("L");
System.out.print("D);
return;}}
>>
I posted this a few months ago
1156     rn = random.randint(1, 100)
1157 if floor <= 5:
1158 if rn <= 25:
1159 return 0
1160 if rn > 25 and rn <= 50:
1161 return 10
1162 if floor == 3:
1163 if rn > 50 and rn <= 75:
1164 return 30
1165 if rn > 75 and rn <= 88:
1166 return 0
1167 if rn > 88:
1168 return 10
1169 if floor > 3 and floor <= 5:
1170 if rn > 50 and rn <= 75:
1171 return 20
1172 if rn > 75:
1173 return 30
1174 if rn > 50 and rn <= 75:
1175 return 0
1176 if rn > 75:
1177 return 10
1178 if floor > 5 and floor <= 10:
1179 if rn <= 25:
1180 return 40
1181 if rn > 25 and rn <= 50:
1182 return 50
1183 if floor == 8:
1184 if rn > 50 and rn <= 75:
1185 return 60
1186 if rn > 75 and rn <= 88:
1187 return 40
1188 if rn > 88:
1189 return 50
1190 if floor > 8 and floor <= 10:
1191 if rn > 50 and rn <= 75:
1192 return 60
1193 if rn > 75:
1194 return 70
1195 if rn > 50 and rn <= 75:
1196 return 40
1197 if rn > 75:
1198 return 50
1199 if floor > 10:
1200 if rn <= 25:
1201 return 80
1202 if rn > 25 and rn <= 50:
1203 return 90
1204 if floor == 13:
1205 if rn > 50 and rn <= 75:
1206 return 100
1207 if rn > 75 and rn <= 88:
1208 return 80
1209 if rn > 88:
1210 return 90
>>
>>58188189
Wow
>>
when i was babby programmer i wrote this by hand.
I thought less code = more fast

function doesCollideFull(x,y,w,h,x2,y2,w2,h2){return!(x2>=w+x||x>=w2+x2||y2>=h2+y||y>=h2+y2)}
>>

int crash(int i)
{
i = 0;

crash(i + 1);

return i;
}
>>

long long add (long long a, long long b)
{
long long sum;
sum = a + b;
return sum;
}
>>
onClikc={(e) => {
e.preventDefault();
socket.on('new:message', (message) => {
socket.emit('sent:message', (message) => (
{ ...message, userName = this.state.userName }
)
});
}}
>>
>>58188994
click*
>>
#include <stdio.h>
void print(char* s) {
printf("%s\n", s)}
int main() {


print("Hello World!") ;
print("I've accomplished python in C") ;


}
>>


template<typename Ty, typename TyAlloc, template <typename, typename> typename T, typename TyLambda>
T<Ty, TyAlloc> where(const T<Ty, TyAlloc>& list, TyLambda&& lambda)
{
T<Ty, TyAlloc> filtered_list;
for(T<Ty, TyAlloc>::const_iterator it = list.begin(); it != list.end(); it++)
{
if(lambda(*it))
filtered_list.push_back(*it);
}

return filtered_list;
}

>>
print("Hello, World!")

Do I win?
>>
var toString = {}.toString;

module.exports = Array.isArray || function (arr) {
return toString.call(arr) == '[object Array]';
};
>>
#include <stdio.h>
#include <limits.h>

int main()
{
malloc(ULONG_MAX);
return 0;
}
>>
>>58188124
Task task = new Task(() => {while(true){return new Task(() =>{Console.Write("&")}}} 
>>
>>58188189
bool b = false;
std::cout << isFalse(b);

>false
>>
>>58188189
bool isTrue(bool& exp);
bool isFalse(bool& exp);

bool isTrue (bool& exp) {
if (!isFalse(exp))
return true;
else
return false;
}

bool isFalse (bool& exp) {
if (!isTrue(exp))
return true;
else
return false;
}
>>
File: bigger.png (7KB, 392x91px) Image search: [Google]
bigger.png
7KB, 392x91px
Looks like DDG wrote some.
>>
Winner:
    int main (int argc, char *argv[]) {

}
>>
cd code
cd..
cd..
cd..
cd ..
ls
cd code
cd ..
cd
>>
>>58188189
does this compile? That's fucking awesome!
>>
>>58190474
fuck off karly
>>
Someone post that graduate meme where he writes a program that waits 24 hours to check tomorrow's date
>>
>>58188189
bool isFalse(const bool& expression, bool isFalse = false)
{
if (expression == false)
{
return isFalse(expression, true)
}
else if (isFalse == true) {
return isFalse == true;
}
else
{
if (isTrue(expression)) {
return isFalse(expression,true);
} else {
return isFalse == true;
}
}
}
>>
>>58190716
>return

bool isFalse(const bool& expression, bool isFalse = false)
{
bool result;
if (expression == false)
{
result = isFalse(expression, true)
}
else if (isFalse == true) {
result = isFalse == true;
}
else
{
if (isTrue(expression)) {
result = isFalse(expression,true);
} else {
result = isFalse == true;
}
}

return result;
}


step up nigga
>>
>>58190425
Looks like you're a fucking retard.
>>
>>58188189
> parameters are refs

Doesn't this mean that the parameters have to be lvalues? You can't do isTrue(a == 5) now, right?
>>
>>58191950
If the parameter is a const-reference then it will accept rvalues; so all's fine.
>>
bool rand_bool(void) {
return false; //flipped a fair coin, tails
}
[/code

saw a comic like this somewhere a long time ago. can't find it again
>>
>>58188124
#include <iostream.h>
int main(void);
/*
...
*/
>>
>>58194428
xkcd random number
>>
if(someFlag.toString().length() < 5) { ... } 
>>
>>58189468
"C++ was a mistake"
t. Bjarne
>>
Float x;
Float xx;
Float xxx;
Float xxxx;
Float xxxxx;
Float xxxxxx;
So on and so forth
>>

def count(n):
a, b = 0, 4
sums = 1
count = 0
if len(n) == 4:
for i in n:
i = int(i)
sums *= i
check.append(sums)
else:
while a < len(n):
for i in n[a:b]:
i = int(i)
sums *= i
count += 1
if count == 4:
check.append(sums)
sums = 1
count = 0
a += 4
b += 4


this felt pretty bad desu
>>
>>58196020
wasn't that from the guy that wrote battleship in 10,000 lines?
>>
File: cs-graduate.png (116KB, 1515x663px) Image search: [Google]
cs-graduate.png
116KB, 1515x663px
>>58188124
Pic related
>>
>>58188582
Comp error
>>
>>58188189
Ironically, I've seen this shit in productioncode. JavaScript mind you, so it was webdev shitters.
>>
>>58196197
I think so.
>>
>>58188859
fuk
>>
/*
*This function returns an int ;D
* an int is a number without a decimal!
*/
int max(int a, int b)
{

if(a < b)
return b;
/*return b if a is less than b*/
else if(a > b && b < a)
return a;
/*return a if a is greather than b*/
else
/*else returns 5 because I'm so random yay :D*/
return 5;
)
/*this is the end of the program! see you guys later XD*/
>>
>>58190474
kek.
>>58200550
Who really wrote this.
>>
>>58188124
 game.workspace=nil 
>>
int main(void) {
write(1, "Hello World\n", 14);
}
>>
File: kode_with_klossy.jpg (230KB, 869x1776px) Image search: [Google]
kode_with_klossy.jpg
230KB, 869x1776px
>>58200573
>>
>>58201334
See >>58200550
>>
File: 21453453242.jpg (86KB, 480x480px) Image search: [Google]
21453453242.jpg
86KB, 480x480px
>>58201334
>comments
>>
File: 1437788279928.png (77KB, 694x801px) Image search: [Google]
1437788279928.png
77KB, 694x801px
>>58190626
>>
>>58201334
this is fake stop posting it REEEEEE it triggers me
>>
>>58200602

Nice roblox script
>>
>>58189425
>printf("%s\n", s)
Are you retarded? You can just do printf(s).
>>
float Q_rsqrt( float number )
{
long i;
float x2, y;
const float threehalfs = 1.5F;

x2 = number * 0.5F;
y = number;
i = * ( long * ) &y; // evil floating point bit level hacking
i = 0x5f3759df - ( i >> 1 ); // what the fuck?
y = * ( float * ) &i;
y = y * ( threehalfs - ( x2 * y * y ) ); // 1st iteration
// y = y * ( threehalfs - ( x2 * y * y ) ); // 2nd iteration, this can be removed

return y;
}


t. karlie
>>
>>58190474
KEK
/thread
>>
public class NonClosingSystemOutStream extends FilterOutputStream {
public NonClosingSystemOutStream() {
super(System.out);
}

@Override
public void close() throws IOException {
this.out.flush();
}
}
>>
File: 1482553443801.png (824KB, 678x621px) Image search: [Google]
1482553443801.png
824KB, 678x621px
#code which find the number of different possible binary strings of length n
def num_strings(n, i):
string = ""
if convert_binary(i) == n * "1":
return i
for j in xrange(i + 1, i + 5000):
if num_strings(n, j) > 0:
return num_strings(n, j)
return 0


def convert_binary(n):
string = ""
while n >= 2:
string += str(n % 2)
n /= 2
string += str(n)
return reverse(string)


def reverse(s):
rev = ""
max = len(s) - 1
for char in s:
for i in xrange(max + 1):
if i == max:
rev = rev + s[i]
max -= 1
return rev

def prompt():

print num_strings(input("Enter length of bit string: "), 0)

prompt()

prompt()
>>
>>58202401
That has no newline.
That person was looming for puts.
Thread posts: 65
Thread images: 7


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.