[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]

Comfy Programming Challenge Thread

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: 294
Thread images: 35

File: e3a4ef2bb014fce26fd754dd22b0ed05.png (305KB, 1920x1080px) Image search: [Google]
e3a4ef2bb014fce26fd754dd22b0ed05.png
305KB, 1920x1080px
sit back, relax, and code

rolling
>>
>>57816044
Alright let's see what we get.
>>
>>57816044
Roland P. Number, Esq.
>>
>>57816044
(__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D (__)__)::::::::D
>>
>>57816072
how the fuck do you even do name art in ascii?
>>
>>57816140
oh come on that shit's fucking easy
>>
>>57816044
rrrrrollin
>>
>>57816147
I have some ideas, but all of them involve the boring as fuck concept of making an ASCII art for every single letter. Reroll because fuck that
>>
>>57816044
rolll
>>
>>57816044
time tog go ff
>>
File: special_ops.jpg (92KB, 528x960px) Image search: [Google]
special_ops.jpg
92KB, 528x960px
>>57816044
rollin
>>
rll
>>
>>57816044
Ok, let's see.
>>
>>57816044
Rollin in my skin.
>>
File: 1471477048757.png (549KB, 1920x1080px)
1471477048757.png
549KB, 1920x1080px
>>57816044
>not posting the v4
>>
>>57816437
rerolsb
>>
>>57816437

demn nice
>>
>>57816044
Rolllllling my dick off
>>
>>57816700
Roooling my second dick of because name gen is lame.
>>
>>57816437
i would like to fuck myself
>>
>>57816044
rollang
>>
>>57816437
ROL
>>
>>57816437
jokes on you, I already did seam carving for university
>>
>>57816044
rollin
>>
>>57816044
rollan
>>
rollingè
>>
>>57816044
roll
>>
ROLLINGGGGGGGGGG
>>
>>57816044
roll

(don't know what half of the tasks mean desu)
>>
roll()
>>
>>57816437
rollin'
>>
>>57816044
Rawl
>>
>>57818125
re-roll because fuck web dev.
>>
>>57816044
They see me rollin'
>>
>>57818161
What the fuck is a linked list
>>
>>57816044
nig
>>
>>57818170
an archaic datastructure that has terrible cache performance and is only useful for silly coding interview questions. Just reroll.
>>
>>57818170
>>57818181

Then #70. Can I use comfy python3 or do I have to do it in shit c++ they teach at my uni?
>>
roll()
>>
>>57816437
How many loc would the red and purple challenges take?
How much time would a decent programmer have to spend on them to get a decent result?
>>
print ('roll')
>>
Rolling. No newb stuff please, I want something at least as interesting as an emulator to do.
>>
>>57816044
rollo
>>
>>57816044
roll
>>
>>57816044
need to improve muh noob skeelz.
rollan
>>
>>57816044
push
>>
first year undergrad here, please give something within reason RNG.
>>
>>57819010

var randomstring = Math.random().toString(36).slice(-8);

>>
what the fuck is a
> method ringing simulator
?
Google search has rustled my jimmies..

Can someone point me in the right direction?
>>
>>57819027
>create a torrent program

I'll give this a shot at least, but this waaay beyond anything I've done before. I hope the torrent protocol spec isn't like 500 pages.

>>57819035

Math.random() uses a cryptographically flawed PRNG
>>
>>57819080
It said a password generator, not a secure password generator.
>>
File: 1478903438503.jpg (122KB, 884x884px)
1478903438503.jpg
122KB, 884x884px
Ayyyyyyyyyyyyy lemon
>>
anything interesting for me to waste a couple hours on?
>>
File: 1467627885074.jpg (130KB, 766x864px) Image search: [Google]
1467627885074.jpg
130KB, 766x864px
>>57816437
roll
>>
>>57819027
I also might as well do the v3 one while I'm at it, since it's trivial.

function fibonnaciSequence(iterations) { 
var sequence = 1;
var prev = 0;
var current = 1;

if (iterations == 0) return undefined;

for (var i = 0; i < iterations; i++) {
current += prev;
prev = current - prev;
sequence += ', ' + current;
}

return sequence;
}


Sample output: "1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, 121393, 196418, 317811, 514229, 832040, 1346269"
>>
>>57816044
ROLLING LOL XDDDDDDDDD
>>
>>57816044
Rolling. I am new to coding.
>>
>>57816437
rollan
>>
I'll do it if it takes less than 5 min
>>
rate ascii digital clock
date | sed 's/^.* \([0-9]*.[0-9]*\):.*$/\1/' | figlet
>>
rool
>>
>>57819331
>dungeons and dragons with AI
Fuck off. Reroll
>>
roll-oll
>>
time to learn more python
>>
>>57816044
seems to be well balanced. rol
>>
>>57819339
nice.
Would it be possible to get it working on 4 lines, so I could put it on an hd44780 display?
>>
>>57819273
Will implement better input checking and large number handling next I guess, what language is good for this? I only know C++, Java and Javascript but I don't mind learning something new.

Otherwise I'll probably just do it in C++.
>>
>>57816044

Roll me, muddafucca
>>
File: 2016-12-03-162719_876x461_scrot.png (34KB, 876x461px) Image search: [Google]
2016-12-03-162719_876x461_scrot.png
34KB, 876x461px
>>57819360
it looks weird with 4 lines
>>
>>57819460
okay then nvm. maybe will use it if I have another nice lcd which has more than 4 lines
>>
File: 2016-12-03-163940_948x257_scrot.png (18KB, 948x257px) Image search: [Google]
2016-12-03-163940_948x257_scrot.png
18KB, 948x257px
>>57819536
you could do this, though it is uglier

3 lines
>>
>>57816437
i fucking hate myself
>>
>>57816044
im doin it
>>
>>57816044
rollin'
>>
File: roll.jpg (31KB, 480x360px) Image search: [Google]
roll.jpg
31KB, 480x360px
>>
roll>>57816437
roll
>>
>>57816437
Those difficulties don't make much sense, but ok.
>>
>>57820000
Four zeros is the n-body sim, right?
>>
>>57816437
Roll
>>
rollan
>>
Reroll
>>
File: wat.png (17KB, 75x150px) Image search: [Google]
wat.png
17KB, 75x150px
>>57816437
>122 Design a game engine in unity
>>
rell
>>
rall
>>
>>57816044
let's roll
>>
>>57820281
wtf are variable vectors in pong?
>>
I'll give this a go. Some of these are way more work than others.
>>
>>57816044
roll but i wont do it
>>
>>57816044
givin it a roll
>>
File: fuckyou.png (14KB, 517x396px) Image search: [Google]
fuckyou.png
14KB, 517x396px
>>57819315
Tried a few different ways and then found this solution to be the easiest.
>>
>>57820455
Now for a reroll
>>
>>57820455
You should try doing it by yourself instead of just using a premade reverse function
>>
>>57819802
reroll
>>
>>57820502
for fucks sake, I got 2 again, reroll
>>
>>57816044
roll for freedom
>>
>>57820483
You got it, boss. Seems more feasible for my level of understanding than a Chip 8 emulator anyway.
>>
>>57820394
e.g. that one. reroll.
>>
>>57816437
roll
>>
rolling?
>>
>>57819452

Aaaaaaand one for tomorrow
>>
. roll .
>>
>>57820643
Does anybody have any links to good examples of that?
>>
>>57816437
rollinggggg
>>
>>57820517
'notha roll
>>
>>57816044
roll
>>
>>57816044
asdfsadfas
>>
roollll
>>
>>57816437
Roll
>>
Roland
>>
>>57816044
rollef
>>
>>57816044
fuckit why not
>>
>>57816044

Rolling, hope I get telnet client!
>>
>>57821539

"Perlin noise algorithm" -- never heard of that, wow thanks for teaching me something, /g/
>>
Rollan
>>
>>57816044
it's not like I'm going out anyway, rolling
>>
I Wanna so something nice
>>
>>57816044
r-r-r-rollin
>>
>>57816437
rollin
>>
rollin
just fuck my shit up
>>
>>57821719

import sys

if sys.hexversion < 0x3000000:
inp = raw_input
else:
inp = input

def get_int(prompt):
while True:
try:
return int(inp(prompt))
except ValueError:
pass

HEIGHT = get_int('4')
WIDTH = get_int('4 ')
>>
ITS SUMMER WHERE I LIVE BOIS
TIME TO SMOKE A JOINT POP A BEER AND CODE IN THE BACKYARD
>>
>>57821632
okay, just no, rerolling
>>
>>57816437
rolling
>>
File: fuck.png (17KB, 510x409px) Image search: [Google]
fuck.png
17KB, 510x409px
>>57820483
thanks for pushing me
>>
>>57816437
Always wandered - why bootloader is "Fuck you"?

If by "bootloader" it means something like grub that will be able at least boot into linux and windows - then yes, its quite challeneging but "Difficult" at most.

If its just requires to be able to boot from the media at all and just display Hello World or whatever than its just trivial.
>>
>>57816437

Rolling v4! Awww yeah.
>>
>>57821852

Actually already did that on codingame.com, rerolling

>>57816437
>>
>>57816044
rollin'
>>
Already working on 82, but sure I'll roll for my next one
>>
>>57821898
oh fuck that
>>
>>57821826
re rolling
>>
>>57820040
Here I go http://jsbin.com/soqisoyeha/1
Drag nbodies to screen with mouse
Please rate and review
>>
>>57822059
Good luck dude, i like your determination. Keep going and try to push yourself :)
>>
>>57821164

http://bl.ocks.org/anonymous/c64dc1287f55dede9adbc69d6e0530c2
>>
>>57816437

go
>>
>>57816044
rawl
>>
>>57816437
Rolling.
>>
>>57816437
roll
>>
>>57816044
Rollang
>>
>>57823877
>tfw you don't have enough skills to do it
>>
>>57816044
Roll
>>
>>57816044
>>
>>57816044
roool
>>
>>57816044
Philosophy roll
>>
rolloll
>>
Rollin'
>>
>>57816044
something not gay
>>
>>57816437
rolling, if the number is even I'll do it in python, if the number is odd I'll do it in C.
>>
>>57816044
rawl
>>
>>57816044
roll
>>
>>57816044
rollin like a river
>>
>>57816437
Rolling rolling rolling
>>
>>57816044
Noob roll
>>
>>57816044
Roll
>>
Roleerino
>>
Rollerino
>>
>>57816178
You might be able to convert the text to an image and use edge detection to identify lines then just use various ASCII to best fill in the lines. But honestly making an ASCII for each letter will be way easier
>>
File: 1480347139937.jpg (33KB, 629x505px)
1480347139937.jpg
33KB, 629x505px
roll in the bed
>>
>>57821826
no problem
>>
bepis
>>
File: 1479687188203.jpg (109KB, 640x572px)
1479687188203.jpg
109KB, 640x572px
>>57816044
rollin
>>
rowl
>>
File: warez.png (114KB, 437x948px) Image search: [Google]
warez.png
114KB, 437x948px
>>57816437
roll
>>
>>57816044
Rollin'
>>
>>57816044
rick roll
>>
>>57826070
"OpenAI Gym Project"

fuck that, too vague.

reroll
>>
rolang
>>
>everyone rolls no one programs
>>
Rolin
>>
holy fuck g , i wasted 3 hours for this shit, finally done.

question was ulam spiral
>>
>>57826245
atleast show code
>>
>>57826330
its pretty bare

import math
import sys
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'

def disable(self):
self.HEADER = ''
self.OKBLUE = ''
self.OKGREEN = ''
self.WARNING = ''
self.FAIL = ''
self.ENDC = ''

def isprime(a):
b = math.ceil(math.sqrt(a))
b = int(b)

for i in range(b-1):
if(a%(i+2) == 0):
return 0
return 1

print("Enter number")
n = int(sys.stdin.readline())

x = math.sqrt(n)//1

x = int(x)

if(x%2 == 0):
x = x + 1


spiral = [[0 for m in range(x)] for n in range(x)]
coordx=x//2
coordy=x//2
spiral[coordx][coordy]= 1

or1 = [m for m in range(1,x)]
or1.append(x-1)
or2 = [m for m in range(1,x)]
(or1.extend(or2))
or1.sort()


std = [1,2,3,4]
arr = []
lenght = len(or1)
for m in range(0,lenght//4):
arr.extend(std)
for m in range(0,lenght%4):
arr.append(m+1)


gc = 2
count = 0
for a in or1:
dire = arr[count]

for b in range(a):
if (dire == 1):
coordx = coordx
coordy = coordy +1
spiral[coordx][coordy]= gc

if (dire == 2):
coordx = coordx -1
coordy = coordy
spiral[coordx][coordy]= gc
if (dire == 3):
coordx = coordx
coordy = coordy-1
spiral[coordx][coordy]= gc
if (dire == 4):
coordx = coordx+1
coordy = coordy
spiral[coordx][coordy]= gc
gc = gc + 1

count = count + 1


for u in range(x):
for v in range(x):
if (isprime(spiral[u][v])):
print (bcolors.FAIL + "*" + bcolors.ENDC,end=""),
else:
print("*",end=""),
print("\r")
>>
>>57826375
Oh you.
>>
>>57816044
Rolling
>>
>>57826330
oh shit>>57826386
am i shit tier?
>>
>>57816044
Rolling because it's saturday night and I have no life.
>>
>>57816437
roll
>>
>>57816044
Reply
>>
>>57826418
You should've used code markup instead of just pasting your code as a comment.
>>
>>57826427
use strict;
use warnings;

sub fib {
my $val = shift;
if ($val < 2) {
return $val
}
return fib($val-1) + fib($val-2);
}

# Sample
print fib(7);


Rolling again...
>>
>>57816044
Roll
>>
>>57816044
they see me rolling the hating
>>
>>57826529
lol using middle east meme language
>>
>>57816044
why not
>>
>>57826571
Re-rolling... cause I'm too tired to make that.
>>
>>57826525
http://pastebin.com/Rn8JFQgp
>>
>>57816044
Roll
>>
>>57816044
need to learn C++ at some point. might aswell n0w. roll
>>
>>57826529
Praise the KEK:
use strict;
use warnings;

sub enKek {
my $msg = shift;
my $keked = "";
foreach my $letter (split("", $msg)) {
for (my $i = 0; $i < ord($letter); $i++) {
$keked .= "kek";
}
$keked .= "KEK";
}
return $keked;
}

sub deKek {
my $msg = shift;
my $unkeked = "";
foreach my $token (split("KEK", $msg)) {
my @num = ($token =~ /kek/g);
$unkeked .= chr(scalar(@num));
}
return $unkeked;
}

# Sample
my $msg = enKek("I spend a lot of time at R9K");
print $msg ."\n";
print deKek($msg) ."\n";
>>
>>57826738
already did an expression parser. but ok why not
>>
>>57816044
dolan
>>
>>57826529
what kind of meme lang is this ?
>>
>>57826593
>>57826867
Young faggots don't even know Perl. It's the better version of Python, Ruby, PHP, etc.
>>
File: 1479172032858.jpg (314KB, 900x594px) Image search: [Google]
1479172032858.jpg
314KB, 900x594px
I don't even know how to program but I'll do my best
>>
>>57816437
rolling
>>
>>57816044
Rolling. Maybe I will do something this week other than homework.
>>
>>57825932
Done. Re-rollin.
>>
>>57827689
post the source m8
>>
>>57827689
Fuck that. Re-roll.
>>
>>57827695
R8 and B8


import java.util.Scanner;

public class ASCIITree32 {

public ASCIITree32(int h) {
int space = h + 1;
String star = "*";

for (int j = 0; j < h; j++) {
for (int i = 0; i < 3; i++) {

for (int s = 0; s < space; s++) {
System.out.print(" ");
}

System.out.println(star);
star += "**";
space -= 1;
}
star = star.substring(0, star.length() - 4);
space += 2;
}

String stump = "";
for (int i = 0; i < (h + 1); i++) {
stump += " ";
}
for (int i = 0 ; i < h; i++) {
System.out.println(stump + "|");
}
}

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int n = -1;

try {
while (n < 0) {
System.out.println("Enter tree height > 0!");
n = s.nextInt();
}
} catch (Exception e) {
System.out.println("What the fuck did you enter you little bitch?!");
}

new ASCIITree32(n);

}

}
>>
>>57816044
Roll
>>
cocksucker
>>
cu de lasanha
>>
>>57827729
Also another junk ass solution

import java.util.Scanner;

public class Cipher29 {

public Cipher29() {
Scanner s = new Scanner(System.in);
int mode = 0;

while (true) {
System.out.println("Select mode:\r\n\t1. Encrypt");
System.out.println("\t2. Decrypt");
System.out.println("\t0. Exit");
mode = s.nextInt();
if (mode == 1 || mode == 2) {
System.out.println("Result:\t" + cipher(mode, s));
} else if (mode == 0) {
break;
}
}
}

private String cipher(int mode, Scanner s) {

int key;
String msg;
String result = "";
int c;

System.out.println("Enter password:");
key = s.nextInt();
s.nextLine();

if (mode == 1) {
c = key;
} else {
c = (-1) * key;
}

System.out.println("Enter message:");
msg = s.nextLine().toLowerCase();

for (int i = 0; i < msg.length(); i++) {

char ch = msg.charAt(i);

if (ch + c <= 'z') {
result += (char) (ch + c);
} else {
result += (char) (ch + c - 26);
}

}

return result;

}

public static void main(String[] args) {
new Cipher29();
}

}
>>
>>57816044
Rolling
this could be interesting
>>
hitler used java
>>
>>57816437
also hitler used a bit of python 3
>>
File: 6WXfuI7.jpg (163KB, 500x800px) Image search: [Google]
6WXfuI7.jpg
163KB, 500x800px
Roll
>>
>>57816044
Rolling
>>
File: tumblr_neqzaxIVsU1siqzczo3_500.jpg (64KB, 500x449px) Image search: [Google]
tumblr_neqzaxIVsU1siqzczo3_500.jpg
64KB, 500x449px
>>57816044
Love calculator for me?
>>
File: 1425359238137.jpg (29KB, 1366x768px) Image search: [Google]
1425359238137.jpg
29KB, 1366x768px
>rolling
>>
File: 1425359755909.jpg (280KB, 1920x1080px) Image search: [Google]
1425359755909.jpg
280KB, 1920x1080px
>>57828440
gay one more time
>>
File: 1480339584917.jpg (46KB, 594x960px) Image search: [Google]
1480339584917.jpg
46KB, 594x960px
>>57816437
sure
>>
File: cat-in-bed.jpg (30KB, 500x375px) Image search: [Google]
cat-in-bed.jpg
30KB, 500x375px
>>57816044
Roll m8s
>>
File: cat-considering-life.jpg (42KB, 480x477px) Image search: [Google]
cat-considering-life.jpg
42KB, 480x477px
>>57816044
roll
>>
>>57819067
method ringing is a group of people playing handbells. So don't google method ringing sim, instead youtube "method ringing bells".
>>
>>57816044
roll
>>
>>57819273
fib(1) is 0
>>
>>57816044
Role
>>
>>57816044
roll
>>
eh im drunk fuck it
>>
>>57826893
i did anon. perl is also a sysadmins best friend
>>
rollerinoo
>>
>>57816044
rolan
>>
I've never actually followed through on one of these.
>>
>>57816437
rollllllllllan
>>
>>57816044

roll get
>>
>>57816437
>>
>>57816044
Rolling
>>
>>57816044
r o l l i n g
>>
I'm about to be on a roll
>>
>>57816044
rolling
>>
Penes
>>
>>57816437
>highest prime factor
Bonus: I don't use for loops.

function isPrime(n){
return Array.apply(null, Array(n)).
map(function(a,i){return i + 1}).
filter(function(num){return num > 1 && num < n && n % num === 0}).
length === 0 && n >= 2;
}

function highestPrime(num){
return Array.apply(null, Array(num)).map(function(a,i){return i + 1}).
filter(function(n){return num % n === 0 && isPrime(n)}).
reduce(function(a,b){return a >= b ? a : b});
}
>>
>>57816044
rawl
>>
ok
>>
>>57816044
Roll
>>
>>57816044
rollan
>>
File: IMG_20161113_125154.jpg (234KB, 1280x960px) Image search: [Google]
IMG_20161113_125154.jpg
234KB, 1280x960px
roll
>>
>>57816044
Rolanda
>>
>>57816044
Rollur
>>
stalin used haskell
>>
File: thats-how-we-roll.jpg (96KB, 500x500px) Image search: [Google]
thats-how-we-roll.jpg
96KB, 500x500px
>>57816044
>>
>>57816044
lets try this
>>
File: collatz.png (5KB, 600x200px)
collatz.png
5KB, 600x200px
Made a visualization of collatz conjecture in php.
Wasn't that hard, but it was fun.
>>
>>57816437
le rolling for some weekend work
>>
File: 21321423.png (10KB, 602x134px) Image search: [Google]
21321423.png
10KB, 602x134px
What the frick is not constant about i? I mean i did put the const modifier before i right RIGHT?
>>
>>57834047
forgot to replace char in the first line with int, shit doesnt work either way tho
>>
>>57833927
fuckin meme fibonaci
def fibonnaci(n):
i=0
j=1
for m in range (0,n):
print j
tmp = i+j
i=j
j= tmp


not even trying
>>
Spinning.
>>
>>57834100
Use a better language next time:
let fibonnaci n =
let rec loop i j = function
| m when m = n -> j
| m -> loop j (i + j) (succ m) in
loop 0 1 0
;;
>>
comfy af roll
>>
>>57834152
reroll
>>
something good and fun pls
>>
>>57816437
rollin rollin rollin
>>
rawl
>>
File: thumb-350-559128.jpg (34KB, 350x219px) Image search: [Google]
thumb-350-559128.jpg
34KB, 350x219px
Roll! just the thread i was hoping for
>>
>>57816437
Roll and praise Kek
>>
Im booored
>>
>>57816437
Why not both
>>
>>57816044
roll
>>
>>57834338

Being a coding noob, the java calculator program is the one i was always struggling with..... i guess the universe is trying to tell me something
>>
>>57816044
reroll
>>
>>57816044
r
>>
>>57835303
<?php
echo gmdate("H:i:s", $seconds);
?>

xd
>>
>>57835320
h=float(input("Height(m) "))
w=float(input("Weight(kg) "))
print(w/(h**2))

reroll
>>
rollin rolling rolling
>>
>>57816437
Doin dis, ROLL
>>
File: 1479083233232.jpg (358KB, 1280x720px) Image search: [Google]
1479083233232.jpg
358KB, 1280x720px
>>57816044
rollin
>>
File: qmark.jpg (2KB, 117x125px) Image search: [Google]
qmark.jpg
2KB, 117x125px
>>57835508
what the actual fuck is a love calculator?!
>>
>>57835543
Open for interpretation, I assume.
>>
>>57835543
calculate your love for cocks
hint: just divide by zero
>>
>>57835467
#PIPY
from decimal import *
n=int(input("Digits?"))
getcontext().prec=n
pi=[]

for x in range(n):
pi.append((1/Decimal(16)**x)*(Decimal(4)/(8*x+1)-Decimal(2)/(8*x+4)-Decimal(1)/(8*x+5)-Decimal(1)/(8*x+6)))

print(sum(pi))
>>
>>57835594
you can skip building the list by using a generator comprehension.

print(sum((1/Decimal(16)**x)*(Decimal(4)/(8*x+1)-Decimal(2)/(8*x+4)-Decimal(1)/(8*x+5)-Decimal(1)/(8*x+6))
for x in range(n)))
>>
>>57816044
roll in the poll
>>
>>57816044
roll
>>
>>57835619
Didn't think about that!

Also, REROLL
>>
>>57835665
How is Youtube to MP3 'easy'? O_O
>>
>>57816044
ror
>>
>08. Love Calculator

Well, that was easy:
def LoveCalc():
return 0
.
>>
I'll have a cheeky roll.
>>
File: 2016-12-04-094710_1364x746.png (107KB, 1364x746px) Image search: [Google]
2016-12-04-094710_1364x746.png
107KB, 1364x746px
>>57835508
>>57835543
Ok here's my shitty and ARBITRARY love calculator.

#lang typed/racket

(: score (String . -> . Nonnegative-Integer))
(define (score s)
(foldl + 0 (map char->integer (string->list s))))

(: love (String String . -> . Nonnegative-Exact-Rational))
(define (love a b)
(/ (abs (- (score a) (score b))) 500))

(module+ main
(define a (read-line))
(define b (read-line))
(if (and (string? a) (string? b))
(displayln (format "Your love score between ~a and ~a is ~a"
a
b
(love a b)))
(displayln "Bad input.")))
>>
>>57835825
lol fuck this rerolling
>>
Rule
>>
R O L L I N
>>
>>57816044
Hmmmmm
>>
>>57835677
I thinked too hard and I can't do this. Reroll.
>>
>>57835970
Easy

for x in range(100):
print((x*(x+1))/2)
>>
>>57818198
Thinks c++ is shit. Go home pajeet
>>
>>57816044
Rolling
>>
>>57816044
What is 69? Socket programming?
>>
>>57816044
Roll
>>
>>57816044
roll
>>
>>57816044
llor
Thread posts: 294
Thread images: 35


[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.