[ / / / / / / / / / / / / / ] [ dir / random / 93 / biohzrd / hkacade / hkpnd / tct / utd / uy / yebalnia ]

/g/ - Technology

Make /g/ Great Again
Name
Email
Subject
REC
STOP
Comment *
File
Password (Randomized for file and post deletion; you may also set your own.)
Archive
* = required field[▶Show post options & limits]
Confused? See the FAQ.
Embed
(replaces files and can be used instead)
Options
dicesidesmodifier

Allowed file types:jpg, jpeg, gif, png, webp,webm, mp4, mov, swf, pdf
Max filesize is16 MB.
Max image dimensions are15000 x15000.
You may upload5 per post.


File: 1444327324743.png (301.88 KB,1920x1080,16:9,1437249350965.png)

 No.3529 [Last50 Posts]

>you roll it

>you code it

>you post it

Time to get fit. Any language you prefer. No re-rolls boys.

____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3530

>>3529


#include <iostream>

double calc_factorial(int n);

int main()
{
int n;
std::cout << "enter a number >= 0 to calculate factorial: \n";
std::cin >> n;
while(n < 0){
std::cin.clear();
std::cout << "enter a number >= 0 to calculate factorial: \n";
std::cin >> n;
}
std::cout << calc_factorial(n) << std::endl;

return 0;
}

double calc_factorial(int n)
{
if(n == 0){
return 1;
}else{
return n * calc_factorial(n - 1);
}
}

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3531

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3532

>>3531

>31

ah hell nah

On a sidenote, I hope someone gets 23. We need one for 8chan.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3548

File: 1444396879913.png (273.77 KB,645x660,43:44,fear.png)

I don't even know what some of the things actually refer to but let's see. Hopefully it's not too hard ;_;

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3583

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3584

>>3583

that one looks fun anon.

I need to write a list container today, but I will roll for a new exercise. Fully expect 84 on account of /g/ being slow.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3595

Rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3596

>>3595

Fuck you guys.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3598

rollyn

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3600

Cool, I'll try.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3601

>>3600

<button onclick="namesFunction()">click</button>

<p id="output"></p>

<script>

document.write("<style>b{color:green}</style>");

function namesFunction() {

var x = document.getElementById("output");

var y = [

"<b>Bob</b> \

<br>Specialty: master fapper \

<br>Education: high school dropout",

"<b>Jil</b> \

<br>Specialty: huge cunt \

<br>Education: college paper",

"<b>Jak</b> \

<br>Specialty: can put large dildos into his anus \

<br>Education: middle school",

"Rob text text text...",

"Tom text text text...",

"Bil text text text...",

"Kim text text text...",

"Joe text text text...",

"Mel text text text...",

"Meg text text text..."

];

x.innerHTML = y[Math.floor(Math.random() * 10)];

}

</script>

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3602

>>3601

Cool anon. I don't do web stuff but lately I've been picking up javascript for firefox extensions.

<button> is html tag and namesFunction() is the callback when clicked?

Here is my shitty paint program from >>3584

It's not yet fully implemented and has some errors (not a 1-to-1 correspondence between what is shown and what is saved, keeping track of all those points is slow eventually and isn't the best approach. Group paint isn't functional yet. Also, not the best OOP...)

http://pastebin.com/mcTWSZjZ

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3623

File: 1445245418038.png (13.87 KB,329x485,329:485,battleship.png)

>>3583

I'm back, /g/. I got it mostly working, pending some UI improvements and additional testing.

Eventually I plan to implement multiplayer over TCP and maybe also do a gui.

https://bitbucket.org/snickerbockers/battleship

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3624

>>3623

Looking through it now, cool anon.

Also, I'm rollin' for a new exercise.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3628

Lets see dis shiz

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3629

>>3628

>[object Object]


#include <stdio.h>
#include <stdlib.h>

int main(int argc, char **argv)
{
long current = 0;
long previous = 0;
int numCases;

printf("Enter number of test cases for the fibonacci sequence: ");
scanf("%d", &numCases);

long *numbers = (long*)malloc(sizeof(long)*numCases);

int i;

for(i = 0; i < numCases; i++){
if(i == 0)
numbers[i] = current;
if(i == 1){
numbers[i] = 1;
current = 1;
}
else{
numbers[i] = current + previous;
previous = current;
current = numbers[i];
}
printf("\n");
printf("%d", numbers[i]);
}

free(numbers);
}

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3630

>>3629

>[object Object]

I just realized how much extraneous shit i put in there. Welp.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3635

>>3629

Rolling for another project.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3637

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3639

Rolling.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3656

Rawhide

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3669

Java rollin

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3680

Rollin'

Cobol

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3682

Roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3789

go up

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3800

rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3801

rerolling since i don't understand what a name generator does

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3851

>>3529

rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3857

>>3529

Fucking rollin

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3858

>>3529

nigger

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3859

they call me the sandman

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3860

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3861

rollin

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3862

>>3861

gotta reroll, actually just did this earlier

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3870

>>3529

rollando

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3871

>>3529

>No re-rolls

yeah, fuck 70 for right now.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3873

rh'llor

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3877

oh boy

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3878

>>3877

I don't know what this means

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3888

>>3529

fuck it let's go

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3889

>>3878

Brainfuck is an esoteric programming language.

An interpreter is a program which will take commands in a programming language and run them.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3890

File: 1449266512594.png (27.59 KB,577x771,577:771,a8708752493cdde2d512974fa7….png)

>>3888

solved it,

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3891

>>3890

used pastebin for syntax coloring, after mailing it to myself from another pc.

Kinda goofy.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3922

I'm rollllling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3923

>>3922

I pass. This list is shit.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3954

cocks

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3955

>>3529

Rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3959

>>3529

rolodobolo

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3964

Rollin

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3976

rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3982

I know I didn't roll it, but I'm new to Java and this thread inspired me to write a program that counts the number of letters, words, and sentences in your input.

Tell me if I'm doing something dumb or unneeded in doing this


package countwordsinastring;

import java.util.Scanner;

public class Main {

public static void main(String[] args) {
System.out.println("(Type 'EXIT' to exit)");
System.out.println("Enter complete sentences:");
boolean stillRunning = true;

while(stillRunning){
Scanner input = new Scanner(System.in);
String userInput = input.nextLine();

if(!userInput.equals("EXIT")){
int sentences = 0 ;
int words = 1 ;
int letters = 0;

System.out.println();

int i = 0;
char[] inputArr = new char[userInput.length() + 2];

for (i = 0; i < userInput.length(); i++) {
inputArr[i] = userInput.charAt(i);

if(!Character.isLetter(inputArr[i])){
switch (inputArr[i]) {
case ' ':
words++;
break;
case '.':
sentences++;
break;
case '!':
sentences++;
break;
default:
}
}else{
letters++;
}
}



if (sentences == 0) {
sentences = 1;
} else if(sentences > 0 && inputArr[userInput.length() - 1] != '.'
&& inputArr[userInput.length() - 1] != '!') {
sentences++;
}

System.out.println("Number of letters: " + letters);
System.out.println("Number of words: " + words);
System.out.println("Number of sentences: " + sentences);

System.out.println();

}else{
stillRunning = false;
}
}
}
}

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3983

>>3982

Focking shit

Ignore the fact that I initialize inputArr as having 2 more than userInput.length();

That was a mistake made in seeing if I could make it so that it doesn't add a sentence when it picks up on a "..." but that didn't work out so I removed it from the code

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3984

>>3982

Sorry to put so much on this thread but reading this after I posted it made me notice some formatting issues that were bugging me.

Made it more readable.


package countwordsinastring;

import java.util.Scanner;

public class Main {

public static void main(String[] args) {
System.out.println("(Type 'EXIT' to exit)");
System.out.println("Enter complete sentences:");
boolean stillRunning = true;

while (stillRunning) {
Scanner input = new Scanner(System.in);
String userInput = input.nextLine();

if (!userInput.equals("EXIT")) {
int sentences = 0;
int words = 1;
int letters = 0;
int i = 0;

System.out.println();

char[] inputArr = new char[userInput.length()];

for (i = 0; i < userInput.length(); i++) {
inputArr[i] = userInput.charAt(i);

if (!Character.isLetter(inputArr[i])) {
switch (inputArr[i]) {
case ' ':
words++;
break;
case '.':
sentences++;
break;
case '!':
sentences++;
break;
default:
}
} else {
letters++;
}
}



if (sentences == 0) {
sentences = 1;
} else if (sentences > 0 &&
inputArr[userInput.length() - 1] != '.' &&
inputArr[userInput.length() - 1] != '!') {
sentences++;
}

System.out.println("Number of letters: " + letters);
System.out.println("Number of words: " + words);
System.out.println("Number of sentences: " + sentences);

System.out.println();

} else {
stillRunning = false;
}
}
}
}

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3989

I'm gonna print this image out and use it as a means of inspiration for projects in Java and C++, seeing as I'm simultaneously learning those languages. I'll take these on (not necessarily in order) and learn whatever I don't know that I need to in order to complete them in my free time when I'm not learning by other means.

Wish me luck fam

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3996

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.3997

>>3801

Generates names?

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4042

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4043

Rolling bb

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4045

rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4047

File: 1451411307755.png (721 B,114x54,19:9,TicTacToe.png)

>>4045

done.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4049

im gonna have to do this in swift fuck me

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4057

rollan

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4070

>>4047

Nobody wins in TTT.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4087

LET'S DO IT

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4089

rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4091

rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4092

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4094

rollan

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4098

>>3529

rollan

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4100

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4110

rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4120

>>3529

Rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4123

roll.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4124

>>4123


require 'json'
require 'open-uri'

if ARGV.length != 2
puts "[-] Usage: 8chan-dl <board> <threadnum>"
end

board = ARGV[0]
threadnum = ARGV[1].to_i

threadurl = "http://8ch.net/#{board}/res/#{threadnum}.json"

thread = JSON.parse(open(threadurl).read)

title = thread['posts'][0]['sub'].gsub /[ |\/]/, '_'
puts "[+] Thread title: #{title}"

dir = "./#{title}/".gsub ' ', '_'
Dir.mkdir dir if not Dir.exists? dir

for post in thread['posts'].select{|p| p.has_key? 'ext'}
filename = "#{post['tim']}#{post['ext']}"
img_url = "http://media.8ch.net/#{board}/src/#{filename}"
puts "[+] Downloading #{img_url}"
File.open("#{dir}#{filename}", 'wb') do |file|
file.write(open(img_url).read)
end
end

Not the best. Has no error handling and shit but it seems to work. Also wrote a 4chan one that is very similar if you guys want that.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4129

File: 1453259215856.gif (48.27 KB,201x199,201:199,image.gif)

Yay, a rollotto that isn't a jizzfest!

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4130

Roooooooolll in the dungeon

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4131

rollan

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4140

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4144

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4222

Rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4223

>>4222

Rerolling for too easy

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4224

rawls

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4225

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4232

>>3529

Rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4233

i cant program but ill roll anyway

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4254

>tfw can't code for shit

>rolling anyway

Come on, FizzBuzz.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4258

File: 1455909954371.png (265.38 KB,500x417,500:417,Reaction (32).png)

ayyy

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4260

>>3529

rolling for easy task-

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4261

>>4260

what the hell is that ?

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4333

>>3529

balls

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4362

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4376

le rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4398

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4404

Rolling bb

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4409

>>3529

fucking roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4412

>>3529

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4416

>>3529

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4417

>>4416


public static String reverseString(String input)
{
char[] chars = input.toCharArray();
StringBuilder reversed = new StringBuilder();

for(int i=input.length()-1;i>=0;i--)
reversed.append(Character.toLowerCase(chars[i]));
return reversed.toString();

}

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4446

they see me rollin', they codin'

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4448

Try me.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4453

rollyo

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4464

rollan

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4465

>>4464

fuck your rules, rerollan

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4466

I terribly misunderstood the speed of this board...

I'll just look for something I know how to do...

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4471

>>3529

rolling will post later

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4472

>>3529

>>4471

#include <stdio.h>

unsigned triangularNumber(unsigned n);

const char *suffix[] = {" ","st","nd","rd"};

int main(int argc, char *argv[])

{

int n = 0,m;

unsigned t;

if ((argc < 2) ||

(sscanf(argv[1],"%d",&n) != 1) ||

(n <= 0))

{

printf("\nusage %s <n>\n",argv[0]);

printf(" where <n> is a positive integer\n");

return -1;

}

t = (int)(n * (((float)n + 1.0) / 2.0));

if (t == triangularNumber(n))

{

m = n % 10;

printf("\nThe %d%s triangular number is %d\n",

n,

((m > 0) && (m < 4)) ? suffix[m] : "th",

t);

}

else

{

printf("\nerror\n");

}

return 0;

}

unsigned triangularNumber(unsigned n)

{

if (n == 1) return 1;

return n + triangularNumber(n-1);

}

only works to around 65000 tho

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4479

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4481

>>4479

>Chip-8 emulator

>have to emulate an instruction set I'm completely unfamiliar with

fug

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4496

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4502

rolling bitcheS

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4503

>>4502

Welp that was easy. See you later bitcheS


> let celciusToFarenheit c = 32 + (c * 1.8)
> celciusToFarenheit 0
32.0
> celciusToFarenheit 100
212.0

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4510

Rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4512

Rollin'

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4529

rawlin

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4530

>>4529

(defun fact (n)
(if (= n 0)
1
(* n (fact (- n 1)))))

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4534

Dice rollRolled 61 (1d100)

rollin

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4538

they see me rollin'

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4539

rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4541

>>3529

Fuck my shit up, OP.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4582

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4585

idk how to dice so my last post numbers are my roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4586

how does one do code tags?

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4587

>>3529

r0lll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4588

>>3529

dubs.get()

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4589

>>4588


#include <stdio.h>
static const int ROWS = 67; //biggest that works
long double factorial(int argument){
if(argument>=0){
long double result=1;
for(;argument>1;argument--)
result = result*argument;
return result;
}else{
return -1; //out of range
}
}
long double choose(int n, int k){
return factorial(n) / ( factorial(k)*factorial(n-k) );
}
void pascal(unsigned long ptriangle[], int max_iter, int current_row){
if(current_row>=max_iter||current_row<0){ //done or out of range
return;
}else{
int i;
for(i=0;i<=current_row;i++) //compute row
ptriangle[(current_row*(current_row+1)/2)+i] = choose(current_row,i);
current_row++;
pascal(ptriangle,max_iter,current_row); //next row
}
}
void main(){
int iter = ROWS+1;
unsigned long triangle[(ROWS+1)*(ROWS+2)/2]; //n(n+1)/2
pascal(triangle, iter, 0); //do important thing
int i;
for(i=0;i<(iter*(iter+1)/2);i++){ //print triangle
if((triangle[i]==1)&&(triangle[i-1]==1)&&(i!=2)) //line breaks
printf("\n\n");
printf("%lu ",triangle[i]);
} return;
}

>>4586

Like this:

[code]code here
[/code]

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4599

Dice rollRolled 46 (1d100)

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4601

Rollan

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4607

Dice rollRolled 2 (1d100)

>>4599

le slightly obfuscated code. Tried to stay under 100 lines. Compile with


gcc -l allegro main.c



#include <allegro5/allegro.h>

float FPS = 5;
short t[300];
short gt[300] = { 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,2,2,1,2,2,
1,2,1,2,1,1,1,2,2,2,2,2,1,2,2,2,1,2,1,2,1,1,1,2,1,2,2,2,2,2,2,2,1,2,1,2,1,2,
1,2,1,2,1,2,1,1,2,2,2,2,2,2,1,2,1,2,1,1,1,2,1,2,1,2,1,2,2,2,2,2,2,2,1,1,1,2,
1,2,1,2,1,2,1,2,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,1,2,
1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2,2,2,1,2,1,2,1,2,2,2,1,2,2,2,1,1,1,1,1,2,1,2,1,2,1,2,1,2,1,1,1,2,1,2,1,1,1,
1,1,2,1,2,1,2,1,2,1,2,2,1,1,2,2,1,1,1,1,1,1,2,1,2,1,2,1,2,1,2,1,1,1,2,1,2,1,
1,1,1,1,2,2,2,1,1,2,1,1,2,2,2,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1};

int main(int argc, char **argv){
ALLEGRO_DISPLAY *display = NULL;
ALLEGRO_EVENT_QUEUE *event_queue = NULL;
ALLEGRO_TIMER *timer = NULL;
ALLEGRO_BITMAP *b[3];
t[rand()%300] = 2;
int redraw = true, dir = 2 | (1 << 3), del = 3, draw = 0;
al_init();
al_install_keyboard();
timer = al_create_timer(1.0 / FPS);
display = al_create_display(640, 480);
t[130] = 1, t[131] = 4, t[132] = 7;
for(int i = 0; i < 3; ++i){
b[i] = al_create_bitmap(32, 32);
al_set_target_bitmap(b[i]);
al_clear_to_color(al_map_rgb(255*(i>0), 255*(i%3 == 2), 255*(i%3 == 1)));
}
al_set_target_bitmap(al_get_backbuffer(display));
event_queue = al_create_event_queue();
al_register_event_source(event_queue, al_get_display_event_source(display));
al_register_event_source(event_queue, al_get_keyboard_event_source());
al_register_event_source(event_queue, al_get_timer_event_source(timer));
al_clear_to_color(al_map_rgb(0,0,0));
al_flip_display();
al_start_timer(timer);
while(draw != 300) {
ALLEGRO_EVENT ev;
al_wait_for_event(event_queue, &ev);
if(ev.type == ALLEGRO_EVENT_TIMER) {
if(dir != 9) {
int pos,npos, max = -32768;
for(int i = 0; i < 300;++i) {
if(t[i] % 3 == 1) {
t[i] -= del;
if(t[i] > max) {
max = t[i];
pos = i;
}
}
t[i] = t[i] < 0 ? 0 : t[i];
}
npos = (pos/20+((dir>>3)+14))%15 * 20 + (pos%20+(dir&0x7)+19)%20;
if(t[npos] % 3 == 1) {
dir = 1 | (1 << 3);
al_set_timer_speed(timer, 1.0/50.0);
} else if(t[npos] % 3 == 2) {
do pos = rand()%300;
while(t[pos] % 3 != 0);
del = (t[pos] = 2) - 2;
al_set_timer_speed(timer, 1/(FPS += 0.3));
} else
del = 3;
t[npos] = max + 3;
} else {
t[draw] = gt[draw];
++draw;
}
redraw = true;
} else if(ev.type == ALLEGRO_EVENT_DISPLAY_CLOSE) {
break;
} else if (ev.type == ALLEGRO_EVENT_KEY_DOWN) {
if (ev.keyboard.keycode == ALLEGRO_KEY_ESCAPE) {
break;
} else if(ev.keyboard.keycode == ALLEGRO_KEY_UP && dir != 17 && dir != 9) {
dir = 1 | (0 << 3);
} else if(ev.keyboard.keycode == ALLEGRO_KEY_DOWN && dir != 1 && dir != 9) {
dir = 1 | (2 << 3);
} else if(ev.keyboard.keycode == ALLEGRO_KEY_LEFT && dir != 10 && dir != 9) {
dir = 0 | (1 << 3);
} else if(ev.keyboard.keycode == ALLEGRO_KEY_RIGHT && dir != 8 && dir != 9) {
dir = 2 | (1 << 3);
}
}
if(redraw && al_is_event_queue_empty(event_queue)) {
redraw = false;
al_clear_to_color(al_map_rgb(0,0,0));
for(int i = 0; i < 300; ++i)
al_draw_bitmap(b[t[i]%3], (i%20) * 32, (i/20) * 32, 0);
al_flip_display();
}
}
return 0;
}

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4614

roll nigger

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4639

>>3529

Rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4646

>>3529

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4647

>>4646

WELL SHIT

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4661

>>4647

>>4646

Is it hard or have you already done it before?

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4662

>>3529

faas

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4667

Rolling because why not.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4668

Roll.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4676

Here we go

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4681

>>3529

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4713

rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4717

roll

>>3529

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4728

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4732

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4733

File: 1471107962504.gif (892.83 KB,500x271,500:271,sheesh.gif)

>>4732

>D&D

>Basic Rules: 114 pgs

Fuck it

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4770

>>4124

Let's see the 4chan one

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4776

rolie polie olie

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4778

gimme a good un

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4800

Dice rollRolled 53 (1d99)

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4802

>>3623

Yeah, that looks pretty damn great. Gonna roll something up for myself too

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4803

>>4802

Whew, writing in C gave me a real workout. Hope I can use C++ whatever I do later,

#include <stdio.h>

const float CONV_CONST = 5.0/9.0f;

int main()
{
float t;
char input;
float result;

printf("Celcius or Fahrenheit (c/f)?: ");
scanf("%c", &input);
printf("\nType in your temperature: ");
scanf("%f",&t);

if(tolower(input)=='c') {
result = t/CONV_CONST + 32.0;
} else {
result = (t - 32.0)*CONV_CONST;
}

printf("\nConverted temperature: %.2f", result);
return 0;
}

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4806

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4809

rollin along

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4823

File: 03e3985af791235⋯.jpg (117.56 KB,625x937,625:937,They_260b60_5456156.jpg)

rollin

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4824

>>4823

already exists

[code]

import sys

import os

import json

import requests

import shutil

import argparse

from blessings import Terminal

from multiprocessing import Value

from multiprocessing.pool import Pool

VERSION = "0.1"

NAME = "Infinity Grabber"

class Infinity:

Main class, does everything

def init(self):

parser = argparse.ArgumentParser()

parser.add_argument("thread", help="URL of thread to scrape")

parser.add_argument("--directory", "-d", help="Specify dir to save to (Default: ~/8chan)")

parser.add_argument("--name", "-n", help="Specify name of dir to download to (Default: Topic/OP Post number)")

parser.add_argument("--workers", type=int, help="Number of threads to run (Default: 10)")

parser.add_argument("--version", "-v", action="version", version=VERSION)

self.args = parser.parse_args()

save_path = self.args.directory or os.path.join(

os.path.expanduser('~'), "8chan")

self.header = {

'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11\

(KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',

'Accept': 'text/html,application/xhtml+xml,\

application/xml;q=0.9,*/*;q=0.8'}

self.thread_url = self.args.thread

self.board = self.thread_url.split('/')[3]

self.thread_name = ""

self.downloads = []

self.save_path = save_path

self.counter = Value('i', 0)

self.total_count = Value('i', 0)

self.workers = self.args.workers

self.down_dir = ""

def url_open(self):

""" Returns raw data from thread """

url = "{0}.json".format(os.path.splitext(self.thread_url)[0])

return requests.get(url, headers=self.header)

def jsonify(self):

""" Converts raw data to text to json object """

jsonable = self.url_open().text

return json.loads(jsonable)

def download_image(self, url, filename):

""" Creates new dir if doesn't exist, downloads image """

down_dir = os.path.join(self.save_path, self.thread_name)

img_dir = os.path.join(down_dir, filename)

if not os.path.exists(down_dir):

os.makedirs(down_dir)

image = requests.get(url, headers=self.header, stream=True)

with open(img_dir, 'wb') as location:

image.raw.decode_content = True

shutil.copyfileobj(image.raw, location)

self.down_dir = down_dir

def image_urls(self):

""" Iterates over json obj, gets image links

Creates pool of workers, creates new workers """

json_obj = self.jsonify()

for post in json_obj['posts']:

if 'ext' in post:

self.total_count.value += 1

try:

self.thread_name = self.args.name

except (KeyError, NameError):

self.thread_name = json_obj['posts'][0]['sub'].replace(' ', "_")

else:

self.thread_name = str(json_obj['posts'][0]['no'])

for post in json_obj['posts']:

if 'ext' in post:

filename = post['tim'] + post['ext']

image_url = 'https://8ch.net/{board}/src/{file}'.format(

board=self.board, file=filename)

self.downloads.append((image_url, filename))

self.download_image(image_url, filename)

with self.counter.get_lock():

self.counter.value += 1

update_progress(self.counter.value, self.total_count.value)

pool = Pool(self.workers)

pool_map = pool.map_async(self.download_image, self.downloads)

try:

pool_map.get(0xFFFF)

except KeyboardInterrupt:

print("Aborting")

pool.terminate()

pool.join()

else:

pool.close()

pool.join()

def main():

""" Creates instance of Infinity """

grabber = Infinity()

args = grabber.args

if len(args.thread) < 1:

sys.exit(1)

grabber = Infinity()

grabber.image_urls()

def update_progress(current, total):

""" Draws bar and updates it """

bar_length = 40

percent_finished = current/float(total)

percent = int(current/total*100)

fillers = int(percent_finished * bar_length)

empty_fillers = bar_length - fillers

progress_bar = "["

progress_bar += fillers * "="

progress_bar += ">"

progress_bar += empty_fillers * " "

progress_bar += "]"

term = Terminal()

with term.location(x=0):

sys.stdout.write("{} {}/{} [{}%]".format(progress_bar, current, total, percent))

sys.stdout.flush()

if name == "main":

main()

[/Code]

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4827

>>3529

Let's do this.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4828

>>4827

What the hell is a picross? Not a native speaker, so... Well, gonna post it when I solve it.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4836

Rollopo

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4844

k

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4845

>>4844

def alp(char):

alphabet={'a':'. -',

'b':'- . . .',

'c':'- . - .',

'd':'- . .',

'e':'.',

'f':'. . - .',

'g':'- - .',

'h':'. . . .',

'i':'. .',

'j':'. - - -',

'k':'- . -',

'l':'. - . .',

'm':'- -',

'n':'- .',

'o':'- - -',

'p':'. - - .',

'r':'. - .',

'q':'- - . -',

's':'. . .',

't':'-',

'u':'. . -',

'v':'. . . -',

'w':'. - -',

'x':'- . . -',

'y':'- . - -',

'z':'- - . .',

' ':' ',

'0':'- - - - -',

'1':'. - - - -',

'2':'. . - - -',

'3':'. . . - -',

'4':'. . . . -',

'5':'. . . . .',

'6':'- . . . .',

'7':'- - . . .',

'8':'- - - . .',

'9':'- - - - .',}

return str(alphabet[char])+" "

def translate(string):

original=string

original_lower = string.lower()

morse=""

for letter in original_lower:

try:

morse+=alp(letter)

except:

morse+=""

return morse+"\n"+original

print(translate("gas the kikes"))

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4846

redo

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4848

>>3529

boop

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4849

>>3530

>You can run function x inside function x

Speaking as a guy who's just started programming, I didn't think that you could do that. Thanks.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4850

>>3529

reply

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4851

>>3529

Rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4853

>>3529

The majority of those is wayy too much work for me to take seriously

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4949

>>3529

git is jewish mindtrick bullshit. version control is for faggots and niggers

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4952

>>3529

>>3529

probably something boring

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4956

roll'n

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4963

File: d4b4784ca0a578c⋯.jpg (55.78 KB,960x480,2:1,12696144_10204679692865804….jpg)

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.4979

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5039

Let's see how much I can do with Python without classes.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5040

>>5039

commands.py

def plus(arg1, arg2):

return arg1 + arg2

def minus(arg1, arg2):

return arg1 - arg2

def times(arg1, arg2):

return arg1 * arg2

def div(arg1, arg2):

return arg1 / arg2

def exponential(base, power):

return base ** power

def pi():

return 3.141592654

def euler():

return 2.718281828

def scientific_notation(number): # sig_figs is significant figures

# I just don't wanna write that shit down every single time, okay?

power = 0

if (abs(number) > 10):

while number > 10:

number /= 10

power += 1

elif (abs(number) < 1):

while number < 1:

number *= 10

power -= 1

# s.f. in scientific notation typically includes the base number

# i don't know how you learned it, but I learned it this way. Sorry.

print "%0.6fe%d" % (number, power)

main.py

http://pastebin.com/NBXkp0n6

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5041

>>5040

This is buggy as shit, never fucking mind ;-;

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5060

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5062

I roll it.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5066


public class Benis
{

public static String reverse( String s)
{
String ret="";
for(int i = s.length(); i>0;i--)
{
ret += s.charAt(i-1);
}
return ret;
}

public static void main(String [] args)
{
String s = "bujur";
System.out.println(reverse(s));
}
}

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5069

ROLL

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5070

>>4824

Your python code is surprisingly go-like in some ways, you use go anon?

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5094

Daily reminder to sage when you roll.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5096

>>3529

Rollin

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5097

>>5096


#include <iostream>

using namespace std;

struct vect{
int x;
int y;
int z;
};

int dotProduct(vect a, vect b){
return a.x*b.x + a.y*b.y + a.z*b.z;
}

vect crossProduct(vect a, vect b){
vect c;
c.z = a.x*b.y;
c.y = a.z*b.x;
c.x = a.y*b.z;
return c;
}

vect accept(){

int a,b,c;
cin>>a;
cin.get();//to ignore i+
cin.get();
cin>>b;
cin.get();//to ignore j+
cin.get();
cin>>c;
cin.get();//to ignore k

vect ans;
ans.x=a;
ans.y=b;
ans.z=c;

return ans;
}

void displayVect(vect a){
cout<<a.x<<"i+"<<a.y<<"j+"<<a.z<<"k"<<endl;
}

int main()
{
vect first,second;
cout<<"Insert vector in ai+bj+ck format"<<endl;

cout<<"First Vector :";
first=accept();

cout<<"Second Vector :";
second=accept();

cout<<"Dot Product : ";
cout<<dotProduct(first,second);

cout<<"Cross Product : ";
vect cross=crossProduct(first,second);
displayVect(cross);
return 0;
}

Done.

Only works for positive values though.

Will improve.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5098

>>5097

easy fix, just remove the extra cin.get() from the accept() function besides the //to ignore i+ comments

apologies for samefagging

The algo can be expounded to multi dimensions but I only used three.

Also rerolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5099

>>3529

090017090C0C00011414050D1014001408091300090E000300100C151300100C1513

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5102

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5103

Rollerino

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5142

>>3529

Rollcage.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5161

>>3529

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5169

rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5185

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5190

rolleroni

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5192

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5198

>>5192

Hi, I'm a bit new here so bear witrh me.

Does anyone know of a PGP solution that DOESN'T leave the unencrypted file? It's a pain. I can obviously erase the files but knowing they're u.nreadable if recovered would be peace of mind for me.

The way I see it my options are:

Encrypt the original file with truecrypt and then erase.

Or run everything in an encrypted volum on a VM - but are there any with a PGP standard? Most are things like trucrypt and I hear that has flaws.

What build would you suggest? What specific software? The goal is to leave no trace of the unencrypted file.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5202

rollin

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5203

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5204

>>5203

rerolling again

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5206

>>5204

using Vigenère cipher


letter = 'abcdefghijklmnopqrstuvwxyz '
def encrypt(key,string):
encrypt_string = []
string = string.lower()
key = key.lower()
for n in range(0,len(string)):
ind =(letter.index(key[n]) + letter.index(string[n]))%26
print ind
encrypt_string.append(letter[ind])

print encrypt_string

def decrypt(key,string):
decrypt_string = []
string = string.lower()
key = key.lower()
for n in range(0,len(string)):
ind =(letter.index(string[n]) - letter.index(key[n]))%26
decrypt_string.append(letter[ind])
print decrypt_string

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5213

rohl

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5233

>>3529

rawl

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5243

Guess I'll give it a roll. Trying to learn D cause I'm a dumb hipster yuppie.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5335

fred durst

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5337

>>3529

>difficulty ranges from easy as fuck to /just/ fuck my shit up

Maybe it would make sense to make perhaps 3 different images, for beginners, intermediate, and pros.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5339

Benford's law (aka boring gay shit)

#! python3

numberfilepath = "numbers.txt"
numberfile = open(numberfilepath, "r")
numberfiletext = str(numberfile.read()).split()
numberfile.close()

numbercount = {}

for x in range(1,10):
numbercount.update({x:0})

for x in range(0, len(numberfiletext)):
firstdigit = int(str(numberfiletext[x])[0])
numbercount[firstdigit] += 1

finallist = sorted(numbercount, key=lambda x: numbercount[x], reverse=True)

print("Descending list")
for x in finallist:
numberofhits = numbercount[x]
averagenumber = numbercount[x]/len(numberfiletext)
print("%s: count=%s, average=%s" % (x, numberofhits, averagenumber))

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5340

rollin'

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5343

rolling #gay

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5344


import unittest
from dijkstras import Graph

class Graph_Test(unittest.TestCase):

#Runs before each test
def setUp(self):
self.graph = Graph()

def test_add_vertex(self):
self.graph.add_vertex('A', {'B': 7, 'C': 8})
self.assertEqual(self.graph.vertices, {'A': {'C': 8, 'B': 7}})

def test_shortest_path(self, ):
self.graph.add_vertex('A', {'B': 7, 'C': 8})
self.graph.add_vertex('B', {'A': 7, 'F': 2})
self.graph.add_vertex('C', {'A': 8, 'F': 6, 'G': 4})
self.graph.add_vertex('D', {'F': 8})
self.graph.add_vertex('E', {'H': 1})
self.graph.add_vertex('F', {'B': 2, 'C': 6, 'D': 8, 'G': 9, 'H': 3})
self.graph.add_vertex('G', {'C': 4, 'F': 9})
self.graph.add_vertex('H', {'E': 1, 'F': 3})

self.assertEqual(self.graph.shortest_path('A', 'H'), ['H', 'F', 'B'])
self.assertEqual(self.graph.shortest_path('H', 'I'), {'A': 12, 'B': 5, 'C': 9, 'D': 11, 'E': 1, 'F': 3, 'G': 12, 'H': 0})

unittest.main()

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5356

>>3529

rooasdf

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5357

reply

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5365

File: 85bf10f0e3d2c09⋯.gif (1.1 MB,500x307,500:307,32156232.gif)

Roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5366

>>5365

reroll the ulam spiral is gay

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5381

Roll.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5393

rollarino

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5401

Rolling. Currently 4chan, 8ch and gelbooru downloaders

https://github.com/wewman

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5404

File: 121deb1045889c2⋯.gif (13.74 KB,125x125,1:1,1417737210276.gif)

>>3529

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5407

>>5404

I really didn't want to do encryption since that looks so boring, so I did fizzbuzz instead.

/* Fizz Buzz program
The terminal will print seven numbers at a time every time the user presses a key.
Any number divisible by 3 will be replaced with the string "Fizz", and any number
divisible by 5 will be replaced with the string "Buzz".
The user can terminate the program by typing 'x'.

Demonstrates basic bitch programming capacity.
Developed by anon, 11 7 2017.
*/

#include <iostream>

int main()
{
int n {0}; // This is the number the program will increment for printing.

std::cout << "FizzBuzz program.\n\n";
std::cout << "The integers will be printed until the user submits 'x'.\n";
std::cout << "Every number divisible by 3 will print \"Fizz\" instead.\n";
std::cout << "Every number divisible by 5 will print \"Buzz\" instead.\n\n";
std::cout << "Every number divisible by both 3 and 5 will print \"FizzBuzz\".\n\n";
std::cout << "Press any key to begin. Except x, which terminates the program.\n";

for(char c; std::cin>>c; ) //while the user gives input
{
if(c =='x') break; //excape on x

for(int i=0; i!=10; ++i)
{
++n;
bool fb {false}; //fizzbuzz detector

if(n%3 == 0) {
std::cout << "Fizz";
fb = true;
}
if(n%5 == 0) {
std::cout << "Buzz";
fb = true;
}
if (!fb) std::cout << n;
std::cout << ", ";
}

std::cout << std::endl;
}

std::cout << "bye nigga\n";
return 0;
}

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5416

>>3529

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5417

>>5416

fuck it, to tired, doing this tomorrow

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5420

ok

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5429

rawlz. will be back in couple hours most likely

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5430

>>5429

holy shizz ive had enough alcohol to choke a mouse


(define factorial
(lambda(n)
(if (= n 0)
1
(* n (factorial (- n 1))))))

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5431

>>5407

i doz it four youz with ez encypztions


def CaesarCypher(message,key,mode):
if (gcd(key,26)!=1):
print()
return
message=message.upper()
alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
translated=''
for each in message:
if each in alphabet:
out = alphabet.find(each)
if mode == 'encrypt':
out = (out+key)%26
elif mode == 'decrypt':
out = (out-key)%26
else:
print("invalid mode. exiting.")
return
translated+=alphabet[out]
else:
translated+=each
print(translated)

an nowz i stepz it up jusz a lil bit (iz crypto cuz toullz you what isz english


def isEnglish(message, wordPercentage=20, letterPercentage=85):
#these next two functions are only needed for isEnglish, so I encapsulated them within their parent function to limit their scope
def parseEnglish(message):
alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
lettersOnly = []
for each in message:
if each in (alphabet + alphabet.lower() + ' \t\n'):
lettersOnly.append(each)
return ''.join(lettersOnly)
def countEnglish(message):
#loads the dictionary file
def loadDict():
File = open('/usr/share/dict/linux.words')
words = {}
for each in File.read().split('\n'):
words[each] = None
File.close()
return words
message = parseEnglish(message)
possibleEnglish = message.split()
if possibleEnglish == []:
return 0.0
matches = 0
for word in possibleEnglish:
if word in loadDict():
matches += 1
return float(matches) / len(possibleEnglish)
#below is body of parent isEnglish() function...
matched = countEnglish(message) * 100 >= wordPercentage
numLetters = len(parseEnglish(message))
percentage = float(numLetters) / len(message) * 100
letters = percentage >= letterPercentage
return matched and letters

now iz do what isz ez in python


def generateRSAKey(keySize):
print("generating two Mersenne primes...")
p1 = generateMersennePrime(keySize)
p2 = generateMersennePrime(keySize)
print("generating n=prime1*prime2")
n = p1 * p2
print("determining a number coprime to n..")
e = randrange(2 ** (keySize - 1), 2 ** (keySize))
while gcd(e, (p1 - 1) * (p2 - 1)) != 1:
e = randrange(2 ** (keySize - 1), 2 ** (keySize))
print("generating modular inverse of number coprime to n...")
d = ModInverse(e, (p1 - 1) * (p2 - 1))

publicKey = (n, e)
privateKey = (n, d)

print('Public key:', publicKey)
print('Private key:', privateKey)
return (publicKey, privateKey)
def generateMersennePrime(keysize=1024):
# Return a random prime number of keysize bits in size.
while True:
num = randrange(2**(keysize-1), 2**(keysize))
if isPrime(num):
return num
def isPrime(num):
def rabinMillerPrimalityTest(num):
s = num - 1
t = 0
while s % 2 == 0:
s = s // 2
t += 1
for trials in range(5):
a = randrange(2, num - 1)
v = pow(a, s, num)
if v != 1:
i = 0
while v != (num - 1):
if i == t - 1:
return False
else:
i = i + 1
v = (v ** 2) % num
return True
if (num < 2):
return False
lowPrimes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]
if num in lowPrimes:
return True
for prime in lowPrimes:
if (num % prime == 0):
return False
return rabinMillerPrimalityTest(num)

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5432

>>5431

isz forgotz gcd funztions withch is curzial to crypti mats


def gcd(a, b):
while a != 0:
a, b = b % a, a
return b

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5433

ifz anyonez has cruptocuurenzies for beerz i m aczepting paiments naow

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5434

File: 718cd3087cb2dee⋯.gif (680.38 KB,500x334,250:167,already dead.gif)

>>5432

>>5431

Ha HAZ! I say, stupid is I to forgetz modular invertz funknkz! Bazisz of ayyy!simetric cryiptogriphy


def ModInverse(a, m):
# Returns the modular inverse of a % m
if gcd(a, m) != 1:
return
q1, q2, q3 = 1, 0, a
r1, r2, r3 = 0, 1, m
while r3 != 0:
q = q3 // r3 # // is the integer division operator
r1, r2, r3, q1, q2, q3 = (q1 - q * r1), (q2 - q * r2), (q3 - q * r3), r1, r2, r3
return q1 % m

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5436

>>5407

isz weakz and feabilminded only stronk can incript cripto

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5437

>>5407

>>5407

Litaraeeze ginerick fiszbusz

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5664

>>3529

rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5665

>>5664

Well that's boring, rolling again.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5686

Roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5687

>>5686

What is an incremental economy. Do I spawn the factors of production and let the system simulate a market.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5757

>>3529

>tfw I'm too inexperienced and helpless to be able to do any of these things

FML I need to get better.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5768

r

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5854

>>3529

Roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5868

rowling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5892

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5916

>>3529

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5922

Rolling...

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5929

>>3529

fuckin roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5958

>>3529

Roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5961

>>3530

how do you get the box?

#include <iostream>

using namespace std

int main()

{

cout << "test" << endl;

return 0;

}

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5962

rolling boys

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5969

Dice rollRolled 13 (1d100)

Rollan

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5974

>>3529

I'm not at this level. Is there a beginners version?

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5975

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5976

rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.5977

>>5975

w='w=%r;print w%%w';print w%w

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.6005

Rollerino

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.6030

File: 2ac0a5f59f92c00⋯.png (222.42 KB,640x500,32:25,caffeine2-640x500.png)

>>3529

BEGIN

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.6040

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.6106

>>3529

r0ll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.6108

roll it up

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.6270

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.6295

Rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.6353

Dice rollRolled 466, 302, 118, 471, 477, 312, 893, 384, 654, 603, 432, 10, 297, 120, 72, 926, 37, 322, 313, 493, 133, 263, 333, 839, 296, 65, 179, 393, 142, 1020, 151, 607, 298, 269, 54, 774, 580, 947, 133, 209, 525, 565, 219, 821, 684, 290, 723, 721, 611, 11, 189, 744, 274, 522, 559, 569, 587, 737, 962, 729, 732, 88, 312, 5, 356, 365, 778, 935, 288, 911, 120, 812, 452, 338, 609, 111, 627, 307, 832, 214, 318, 1021, 957, 591, 518, 491, 136, 80, 204, 73, 809, 935, 161, 96, 939, 517, 461, 693, 428, 748, 580, 547, 535, 7, 884, 120, 117, 487, 427, 949, 700, 744, 945, 633, 311, 438, 99, 447, 518, 302, 519, 302, 213, 679, 398, 127, 171, 858, 820, 598, 581, 375, 121, 92, 381, 1004, 211, 498, 467, 638, 422, 142, 357, 342, 775, 668, 780, 873, 90, 273, 151, 609, 575, 363, 264, 972, 490, 434, 805, 286, 8, 362, 660, 128, 453, 17, 108, 664, 514, 574, 278, 936, 716, 635, 253, 467, 278, 8, 316, 368, 281, 466, 976, 856, 829, 215, 803, 295, 649, 584, 581, 657, 946, 216, 785, 375, 233, 892, 15, 746 = 93454 (200d1024)

ok

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.6373

rollll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.6777

rollerino

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.6807

rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.6831

rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.6834

Roll.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.6836

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.6838

File: 58ff405909419ab⋯.png (245.95 KB,480x360,4:3,halp.png)

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.6852

Rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.6880

File: fcb8fde0f1c3145⋯.jpg (17.41 KB,474x476,237:238,1521866432077.jpg)

rollin

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.6917

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.6946

>>3529

Roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.6947

GOGO LETS CODE

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7009

>>3529

rollo

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7015

File: 4e405a4a627cc2d⋯.jpg (64.98 KB,1280x640,2:1,nightlight_by_reykat-d6qqh….jpg)

>>3529

Rollin my /g/ bois.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7053

Rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7061

File: c506bb8af2c2575⋯.mp4 (33.7 KB,480x270,16:9,VID-20180603-WA0004.mp4)

Rololo

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7062

Rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7063

ROLLING

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7064

rol

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7065

rolololol

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7067

rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7092

>>3529

Oh boy here we go.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7093

File: d2078077d917067⋯.jpg (121.04 KB,960x960,1:1,d2078077d917067f120b4d678a….jpg)

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7094

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7210

>>3529

Reverse a string pls

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7211

>>3529

Somebody write a program which randomly generates a possible title for a porn video.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7221

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7228

rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7229

>>7228

I'm a fucking genius.

import sys

def fib(n):
if n == 1:
return 1
if n == 2:
return 2
return fib(n - 1) + fib(n - 2)

print(fib(int(sys.argv[1])))

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7260

Rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7270

File: a9f1017418bcefc⋯.jpg (89.47 KB,960x960,1:1,fuckoff.jpg)

>>3529

Rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7278

>>3529

r-roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7279

>>7229

This is a joke, right?

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7288

File: 3adc881884145d9⋯.jpeg (75.09 KB,625x446,625:446,4567E618-041F-42C1-9C8F-C….jpeg)

>>7229

>I’m a genius

>writes basic fibonacci function

Okay

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7302

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7305

>>3529

woot woot

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7320

>>3529

Post the newest version nigger. Also rolling for easy shit.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7324

uuagh roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7348

>>7270

oh shit, it's cellino and barnes, representing buffalo new york for the last 79 years

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7489

>>3529

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7490

>>7489

fuck

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7491

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7492

>>7491

fuck that

re-roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7502

>>3529

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7511

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7934

>>3529

rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7991

>>3529

I love you OP

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7994

I don't do line numbers because who cares


'HighLow

[start]
i = INT(21*RND(1))
guess = i
cls

[input]
input "Enter your guess from 1 to 20. Type 0 to display the answer: ";answer

if answer = 0 then [print] else [first]

[first]
if answer = guess then [correct] else [check]

[check]
if answer > guess then
Print "Too high, try again: "
goto [input]
end if

if answer < guess then
Print "Too low, try again: "
goto [input]
end if

[correct]
Print "Nice job!"
goto [prompt]

[prompt]
input "Play again? [y/n] ";playagain$
if playagain$ = "y" then [start] else [exit]


[print]
print i
goto [prompt]

[exit]
print "Goodbye"

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.7996

File: cfd9250e3a43386⋯.gif (77.79 KB,794x880,397:440,September 20 Thursday-08:3….gif)

>>7994

A shitty gif of it in action, but considering that its the first one of these I've ever done, I think it looks ok. Not sure where I can cut anything out of it anyways.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8006

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8017

I'm functionally retarded and struggling to pull together a functioning excel-based ledger system using VBA

lets try this

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8025

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8044

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8046

>>3529

Roll roll roll roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8051

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8052

Dice rollRolled 19 (1d100)

Rollin'

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8068

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8072

>>3529

Let this be a good roll, I haven't programmed anything in a month and a half, I have no inspiration or motivation whatsoever...

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8073

>>8072

Uh huh, that's kind of easy, but to make it little more challaging, I'll reinvent the wheel...

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8087

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8123

>>3529

without deadline i'm not going to make it anyway

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8135

>>3529

I might regret this, but rolling.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8136

>>8135

[code]

#include <iostream>

#include <cmath>

using namespace std;

//Benfords Law

int main()

{

int digit;

double answer;

cin >> digit;

if (digit < 10 && digit > 0)

{

answer = log10(digit + 1) - log10(digit);

answer = answer * 100;

cout << answer;

}

else cout << "fuk off ya cheeky cunt";

}

[code/]

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8144

Rollypolly

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8266

>>3529

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8267

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8268

Dice rollRolled 85 - 1 (1d100)

aaa

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8269

>>8266

>fucking klingon translator

i was thinking about just sending input off to google translate and spitting out its output, but then i saw no "klingon" option anymore ;_;

i'm not about to spend time compiling a klingon dictionary just to create a map function. reroll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8272

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8283

File: 5dc98644c81ed39⋯.png (647.48 KB,3840x2160,16:9,clock.png)

>>8269

fuccin done finally lol

could have done this in a couple minutes in GameMaker, but i want to get into "real programming" so i used C++ and SDL2.

https://gitgud.io/cptchuckles/graphical-clock.git

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8285

Dice rollRolled 15 (1d99)

>>8283

Alright time to do some fuckin battleships in SFML. Rolling for next project as well.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8296

Rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8298

>>3529

rolling rolling rolling. Lets go c++

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8299

>>8298

this is what i got


#include <iostream>
#include <string>

int factorial(unsigned long number){ //yay recursion

if(!number)
return 1;
else
return number * factorial(number-1);
}

int main(int argc, char* argv[])
{
unsigned long factor;

std::cin >> factor;

if(factor < 0){
std::cout << "factor was smaller than 0 s" << factor << std::endl;
exit(2);
}

if(factor > 4294967294){
std::cout << "input over flow " << factor << std::endl;
exit(3);
}

std::cout << factorial(factor) << std::endl;

return 0;
}#include <iostream>
#include <string>

int factorial(unsigned long number){ //yay recursion

if(!number)
return 1;
else
return number * factorial(number-1);
}

int main(int argc, char* argv[])
{
unsigned long factor;

std::cin >> factor;

if(factor < 0){
std::cout << "factor was smaller than 0 s" << factor << std::endl;
exit(2);
}

if(factor > 4294967294){
std::cout << "input over flow " << factor << std::endl;
exit(3);
}

std::cout << factorial(factor) << std::endl;

return 0;
} //this took longer than needed to make cause i facking wanted command line input but i dropped it in the end

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8300

>>8299

fuck i double copied this shit. well ROLLL

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8301

>>3529

ROLL

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8302

ROLL

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8303

rolllllll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8310

rollin

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8311

Python is so useful

[

import random

subjects = {1:"Cats", 2:"Niggers", 3:"Chinks", 4:"Crackers", 5:"I"}

verbs = {1:" eat", 2:" hit", 3:" shot", 4:" raped", 5:" stabbed"}

second_noun = {1:" bongs.", 2:" pipes.", 3:" pussy.", 4:" that vidya."}

print(subjects[random.choice(list(subjects.keys()))] + verbs[random.choice(list(verbs.keys()))] + second_noun[random.choice(list(second_noun.keys()))])

]

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8312

File: 7f155cdba2e2cfa⋯.png (50.75 KB,512x512,1:1,pedo_bear.png)

>>3529

ROLL

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8313

roll forrest roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8340

rollin

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8381

>>3529

Rollin

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8385

Show me what you got

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8412

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8415

Roll.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8422

rollannn

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8423

>>8422

boring.

rolling again.


weight = float(input('weight: '))
height = float(input('height (inches): '))


bmi = float((weight / height**2) * 703)

if bmi < 19:
print("underweight")
elif bmi > 19 and bmi < 25:
print ("normal")
elif bmi > 25 and bmi < 30:
print("overweight")
elif bmi >= 30:
print("obese")

print("BMI: " + str(round(bmi,2)))

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8434

>>8423

ok, what's next


import re
import requests
from bs4 import BeautifulSoup

thread_id = 68523241
thread = str(thread_id)
r = requests.get('http://boards.4chan.org/g/thread/' + thread)
soup = BeautifulSoup(r.text, 'html.parser')

posts = soup.find_all('a', {"class": "fileThumb"})
for a in posts:
img_url = a['href'].replace('//', '')
f = re.search('\/(\d+.(jpg|png|gif|webm))', img_url)
filename = f.group(1)
img_data = requests.get('http://' + img_url).content
with open(filename, 'wb') as handler:
handler.write(img_data)
print('[+] Downloading image @ URL: ' + img_url)

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8436

>>8434

>34

too hard vro. will come back to it.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8439

>>3529

Rollerino

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8440

>>3529

Roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8441

>>8436

>34

>36

reroll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8448

>>3529

ROLL

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8468

File: 05107b5df1330b8⋯.png (94.56 KB,640x1508,160:377,ClipboardImage.png)

>>8285

Battleships is finally fuckin done.

- AI shoots randomly until it finds a cold hit.

- Then AI checks adjacent cells for the next hit.

- Then AI follows that direction until it finds a miss or the edge of the board.

- Then AI returns to the original cold hit and checks the rest of the adjacencies in case it had hit in the middle of the ship.

- Once all cells adjacent to the original cold hit have been checked, the AI resumes random strikes.

https://gitgud.io/cptchuckles/g-battleships.git

i'll paste main.cpp here for shits and giggles:

/**
* /g/ Coding challenge: Battleships with AI
*/

#include <SFML/Graphics.hpp>
#include "Board.h"
#include "AIController.h"
#include "InputPrompt.h"
#include "ShipBuilder.h"
#include "KeyInput.h"


const int WindowWidth = 640;
const int WindowHeight = 1508;

enum class GameState {
SETUP,
PLAY,
END
};

GameState state = GameState::SETUP;


sf::RenderWindow window = {
sf::VideoMode(WindowWidth, WindowHeight),
"/g/ battleships"
};


sf::Font arial;
sf::Text caption = {"aeiou", arial, 48U};
InputPrompt prompt = {"wew lads", caption, 0,1424};

sf::CircleShape open{32};
sf::CircleShape full{32};
sf::CircleShape miss{32};
sf::CircleShape hit{32};

Board board_1{64, 9,10, 64,64, open, full, miss, hit};
Board board_2{64, 9,10, 64,770, open, full, miss, hit};
AIController ai = {board_2, 2};

std::vector<IDrawable*> renderer;

bool init();
void gameReset();
void gameSetup();
void buildEnemyShips();
void inPlay();
void enemyTurn();
void atEndScreen();

int main()
{
if(! init()) return 1;


while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}

window.clear();
KeyInput::Get().Update();

switch(state)
{
case GameState::SETUP :
gameSetup();
break;
case GameState::PLAY :
inPlay();
break;
case GameState::END :
atEndScreen();
break;
}

for(auto item : renderer) item->Draw(window);


window.display();
}

return 0;
}


bool init()
{
window.setFramerateLimit(60);

if(! arial.loadFromFile("c:/windows/fonts/arial.ttf"))
return false;


open.setFillColor(sf::Color::Blue);
full.setFillColor(sf::Color{128,128,128,255});
miss.setFillColor(sf::Color::White);
hit.setFillColor(sf::Color::Red);

board_1.SetDisplayResource(&caption);
board_2.SetDisplayResource(&caption);

board_1.SetHidden(true);

renderer.push_back(&board_1);
renderer.push_back(&board_2);
renderer.push_back(&prompt);

return true;
}


void gameReset()
{
board_1.Clear();
board_1.SetHidden(true);
board_2.Clear();
prompt.ClearInput();
state = GameState::SETUP;
}


void gameSetup()
{
prompt.SetCaption("Arrows, space, & return");

static ShipBuilder* builder = nullptr;
static int ships = 4;
int shipSizes[] = {2,3,3,4,5};

if(! builder) builder = new ShipBuilder{board_2};

if(! builder->GetShip()) builder->ConstructShip(shipSizes[ships]);

builder->Update();
builder->DrawBoard(window);

if(KeyInput::Get().Return())
{
if(builder->FinalizeShip())
ships--;

if(ships < 0)
{
ships = 4;
delete builder;
builder = nullptr;
buildEnemyShips();
state = GameState::PLAY;
}
}
}


void buildEnemyShips()
{
int shipSizes[] = {2,3,3,4,5};
ShipBuilder builder = {board_1};

for(int i=0; i<5; i++)
builder.RandomShip(shipSizes[i]);
}


void inPlay()
{
if(ai.isMyTurn()) {
enemyTurn();
return;
}

prompt.SetCaption("Try cell: ");
prompt.Update();

if(KeyInput::Get().Return())
{
auto cell = board_1.GetCellFromString(prompt.GetContent());
prompt.ClearInput();

if(! cell) return;

board_1.Attack(cell.value());

if(board_1.CheckDefeated()) {
prompt.SetCaption("You Win! Again? (y/n): ");
state = GameState::END;
return;
}

ai.ActivateTurn();
}
}


void enemyTurn()
{
prompt.SetCaption("Enemy AI thinking...");

if(ai.Strike()) {
if(board_2.CheckDefeated()) {
prompt.SetCaption("You Lost! Again? (y/n): ");
state = GameState::END;
}
}
}


void atEndScreen()
{
board_1.SetHidden(false);
prompt.Update();

if(KeyInput::Get().Return())
{
auto answer = prompt.GetContent();

if(answer=="Y")
gameReset();
else if(answer=="N")
window.close();
}
}

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8477

>>3529

Rollll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8508

Rellel

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8510

>>8508

rerolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8511

Probs a good thing to do some C again, currently doing node at work, FML.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8512

>>3529

>>3530

>c++

horrible

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8523

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8633

>>8512

Don't talk shit about my waifu.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8644

>>3529

Rolling for fizzbuzz

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8646

>>8644

>>8645

Nevermind, I looked at the wrong numbers.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8651

>>3529

Rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8658

>>8644

uint64_t factorial(uint8_t ofNumber)
{
if (ofNumber <= 1)
{
return 1;
}

return ofNumber * factorial(ofNumber - 1);
}

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8883

>>3529

rollin'

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8884

>>8468

>>8285

Seriously, counting this as a re-roll for >>8883 as two other people have already done this...

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8887

<iframe width="560" height="315" src="https://www.youtube.com/embed/S-J1Pj8FC_A" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8903

>>3529

rng-sama give me a good one

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8904

>>8903

def age(years):

return(years*365.2422*24*60*60)

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8916

>>3529

Rollan

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8927

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8929

>>3529

Rollin cause I'm borred

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8951


test

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.8952

>>8951

Holy fuck I got game of life? That's a baby program. Fuck the rules. Reroll.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9080

File: 93c5c89c5f707cd⋯.png (959.76 KB,4800x4800,1:1,MEME.png)

Rollio for Polio

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9130

roll>>3529

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9141

Roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9144

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9148

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9178

>>3529

Spin that shit!

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9179

>>9178

Too tired to write a path finding system before bed.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9214

#Magic 8 ball (a bit lazy...)

import random

x = random.randint(0, 19)

Answers = ["It is certain.",

"It is decidedly so.",

"Without a doubt.",

"Yes - definitely.",

"You may rely on it.",

"As I see it, yes.",

"Most likely.",

"Outlook good.",

"Yes.",

"Signs point to yes.",

"Reply hazy, try again.",

"Ask again later.",

"Better not tell you now.",

"Cannot predict now.",

"Concentrate and ask again.",

"Don't count on it.",

"My reply is no.",

"My sources say no.",

"Outlook not so good.",

"Very doubtful."]

Question = input("Ask away! ")

print(Answers[x])

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9215

File: d9d496745f0c49b⋯.jpg (13.86 KB,269x287,269:287,8ball.JPG)

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9224

>>9215

t. redditor

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9240

rollus maximus

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9307

roll for larping

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9311

rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9312

>>9311

I did it in shell.

base64 < /dev/urandom | head -c 16

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9333

File: e477537d3e02bcb⋯.png (160 KB,480x270,16:9,desterminal2.png)

RORRU!!!

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9343

>>3529

great idea anon. rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9359

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9360

>>9359

>59

wtf is this

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9362

rolleroni

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9365

Pretty comprehensive BMI calculator I made. Both metric and inferior

http://youtuberips.tk/bmi/

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9367

>>9365

> .tk

Careful with those free domain names. They've been known to get hijacked after a while.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9368

>>7994

Nigga why the fuck you writing it in bash? That's gay af, like at least use python or don't be a deadass and use C

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9369

Holdup I already made rock paper scissors

http://youtuberips.tk/rps/

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9370

>>9367

They're a year for free so I can't decline. I'm not fucking paying for a joke website.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9697

Rollerino

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9714

>>3529

See me rollin'

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9715

>>9714


public static void Main(string[] args)
{
Console.WriteLine("Ask me a question.");
var rand = new Random();
var question = Console.ReadLine();
var answers = new List<string> {"Yes", "No", "You lost the game"};
Console.WriteLine($"Thinking about the answer to {question}...");
Thread.Sleep(1000);
Console.WriteLine(answers.OrderBy(item => rand.Next(answers.Count)).FirstOrDefault());
}

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9723

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9727

>>3529

rolling just because

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9740

>>3529

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9787

Roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9825

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9883

Rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9896

R

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9904

File: 5d7926ee5152e66⋯.gif (709.15 KB,500x537,500:537,1457733966525.gif)

rollan

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.9940

File: dd21babc5c097fb⋯.gif (1.78 MB,500x625,4:5,1532997991545.gif)

File: febda91dc00020b⋯.jpg (31.37 KB,319x478,319:478,IMG_20190423_090113_490.jpg)

Rollin. Have some pics; hope to write this in a few weeks' time

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.10014

Rollerinoo

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.10134

Ah?

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.10156

File: b1b2fb332280217⋯.jpg (37.95 KB,640x480,4:3,1556160452486.jpg)

>>3529

i will do it no matter what

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.10223

>>3529

relling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.10579

>>4849

It's called recursion and lots of good programmers do it. It's good practice for short (20-30 lines MAX) fucntions.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.10580

>>3529

Rol but also gite and gcc

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.10581

>>10580

Can't find list of codes, reroll.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.10596

lewkdsaf

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.10597

File: 5b1b7c4be0ee3ff⋯.jpg (1.4 MB,1944x2592,3:4,IMG_20190627_163712.jpg)

Fire up the stack after a full night's day of vodka, meth, and pcp? Haha, no. Rolling.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.10598

>>9715

is using Console.WriteLine and Console.ReadLine faster than just using a scanner?

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.10604

>>3530

Aw, lucky you! You got an easy one. My turn.

Roll, but since I am not a professional programmer, if it's too hard for me I won't to it or I'll do it after a lot of time. Here we go!

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.10605

>>10604

[code]/* I will use the one time pad encryption method. It's the most secure if you use it properly.*/

#include <stdio.h>

#include <stdlib.h>

void usage()

{

fprintf(stderr, "Usage: otp <key_file>\n");

exit(EXIT_FAILURE);

}

int main(int argc, char **argv)

{

int ch, ch2;

FILE *key;

if(argc != 2) usage();

key = fopen(argv[1], "r");

if(!key)

{

perror(argv[1]);

exit(EXIT_FAILURE);

}

while((ch = getchar()) != EOF)

{

ch2 = getc(key);

if(ch2 == EOF) break;

putchar(ch ^ ch2);

}

fclose(key);

exit(EXIT_SUCCESS);

}

/* Now you can use this program like this:

./otp key_file < plaintext.txt > cyphertext.enc

*/

[code]

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.10608

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.10625

rollin'

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.10692

Rollin rollin rollin, keep this shit on goin

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.10715

>>10692

I had no idea what 92 is so I made blackjack instead. Here it is please bully code as I want to get better.

https://pastebin.com/aRBJ7PbY

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.10739

>>3529

rolland

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.10756

>>3529

Roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.10846

>>10625

Well, shit. The board is back so I guess I better finally do this.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.10873

>>3529

let's rock n roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.10899

roll

>>3529

moderation should activate cycling mode on this thread btw

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.10915

rollan

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.10916

>>10915

https://bpaste.net/K5PA

Done (only works for ints and I don't sanitize input, but whatever)

Might do it in Haskell later, can't wait for my FP course.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.10974

>>3529

rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.10975

>>10974

[code]

factorial :: Int -> Int

factorial !n = foldl (\!x !y -> (*) x $! y) 1 [1..n]

[\code]

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.10976

>>10975

BO FAGGOT ENABLE [code] TAGS NOW

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.10978

>>10976

there's no option in board settings that'll fix you not knowing which slash to use.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.10982

>>10978


touche

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11010

>>3529

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11015

>>3529

rollan

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11019

File: 9458a76a9b815e5⋯.jpg (2.92 MB,3000x2500,6:5,flammarion_bw.jpg)

>>11015

No. 15, the Collatz conjecture. Not posted code on a []chan for a while, hope that simple markup tags work...


(defun collatz (n)
(if (= (mod n 2)
0)
(/ n 2)
(+ (* 3 n)
1)))

(defun collatz-recurs (n &optional (show nil))
(when show (format t "~A~%" n))
(let* ((next (collatz n)))
(if (eq next 1)
1
(collatz-recurs next show))))

I'm struck by how slowly the number of ops grows as you increase the size of the input.


CL-USER> (time (collatz-recurs 999))
Evaluation took:
0.000 seconds of real time
0.000010 seconds of total run time (0.000009 user, 0.000001 system)
100.00% CPU
18,176 processor cycles
0 bytes consed

1
CL-USER> (time (collatz-recurs (1- (expt 10 40))))
Evaluation took:
0.001 seconds of real time
0.000431 seconds of total run time (0.000400 user, 0.000031 system)
0.00% CPU
1,070,065 processor cycles
131,024 bytes consed

1
CL-USER>

40 orders of magnitude difference in input, 1 and a half orders of magnitude difference in processor cycles. Huh. Guess that's O(log(n)) for you... Or is it? That's the whole point of the conjecture, I suppose.

A fun little diversion. Thanks, /g/entooman!

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11020

>>4849

Yeah. There are a few conceptual leaps that really help when you're starting out. It's why people recommend reading books like SICP, and working in various paradigms. Broad knowledge gives you a solid foundation to work on-

....oh, and you wrote this in 2016. I didn't even look. Fuck, man. Hope you've gotten used to recursion since then

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11036

File: 1f8a851ec91b0fd⋯.jpeg (47.43 KB,1199x630,1199:630,swiftbitches.jpeg)

ROLLING

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11052

>>3530

>not dynamically programmed

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11118

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11155

roll uwu

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11156

>>11155

i don't know what RPN is and it's probably gay so I made heads/tails in the best language


function flip() {
var x = Math.round(Math.random())
if (x == 0) return 'heads'; else return 'tails';
}

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11159

>>11156

Your code is gay, here's a less gay version:


function flip() {
return ( Math.round(Math.random()) ) ? 'tails' : 'heads';
}

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11162

>>11159

> using bloated white spaces


function flip(){return Math.round(Math.random())?"tails":"heads"}

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11164

>>11162

What is this, 2019? No self respecting javaship programmer ever types the word "function" anymore.


let flip=()=>{return Math.round(Math.random())?"tails":"heads"}

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11178

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11273

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11274

>>3529

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11278

bepis.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11305

>>3529

Rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11308

bump

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11309

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11310

rolling

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11311

hehe

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11312

le roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11313

rolo

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11314

roller

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11315

rollerone

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11316

el rolo

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11317

XD

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11323

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11324

ROLL

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11325

roll;

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11347

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11401

>>3529

rollin rollin rollin

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11406

>>11401


#include <stdio.h>
#include <time.h>
#include <stdlib.h>

int main(void) {
int toss = 0;
int call = 0;
srand(time(NULL));

toss = rand() % 2;

printf("Say head or tail! press 0 for head and 1 for tail:");
scanf("%d", &call);
if(call==0 || call==1)
{
if(toss == call)
{
if(toss==1)
printf("You called it correctly ... it is tailn");
else
printf("You called it correctly ... it is headn");
}
else
{
if(toss==1)
printf("No way ...it is head !n");
else
printf("No way ... it is tail!n");
}
}

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11409

>>11406

>scanf

never ever.

#! /usr/bin/env ijconsole
9!:1 >.*:+/6!:0'' NB. seed from sub-second time
usage =: 3 : 0
stderr 'usage: ', (>1 } ARGV), ' <heads|tails>', LF
exit 1
)
toss =: ?2
ohno =: 'No way' ; 'You called it correctly'
itis =: '... it is heads' ; '... it is tails'
right =: toss = 'tails' -: >(2 } :: usage) ARGV
echo (> right { ohno), (> right { itis)
exit 0

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11410

>>11409

then what? first time using C

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11411

>>11410

getline()

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11425

>>11411

this is my first c program so bear with me...couldnt get a int value from newline or convert the string to int, kept getting seg faults

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11433

lord have mercy

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11440

ROLL

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11477

>>3529

rolling

no gay shit pls

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.11509

>>3529

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.12015

File: 663cde173c0f40d⋯.jpeg (40.13 KB,500x500,1:1,roll.jpeg)

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.12020

Guess I'll roll, depending on what I get I will post code.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.12044

>>3529

roal

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.12045

>>12020

>Guess I'll roll, depending on what I get I will post code.

I intended to post code, but ended up satisfied enough with it that I put it in my git repo instead.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.12070

>>3529

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.12334

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.12475

>>3529

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.13028

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.13029


local limit = ({...})[1]
assert(tonumber(limit), "Usage: fib (nth number)")
limit = tonumber(limit)
assert(limit > -1, "Only non negative numbers")
if limit == 0 or limit == 1 then
print "1"
return
end

local a = 1 --0th fib number
local b = 1 --1st fib number
local c

for i=1, limit-1 do
c = a+b
a = b
b = c
end

print(tostring(b))

Language: lua

Assumes 0th fib number is 1, 1st fib number is 1

I rolled 28, yes :/

can I help someone with their challenge?

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.13030

Roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.13040

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.13041

lemme roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.13046

>>13041

Python ez solution with sdl.

You will need:

pip install PySDL2

code:

https://pastebin.com/L1TEfWNU

use arrow keys to move

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.13047

>>11409

>scanf never ever

scanf is fine as long as you're aware of the trailing newline. And what is getline and why does it exist when we have fgets

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.13048

>>13047

may as well count that one as a roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.13075

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.13078

>>10605

Your code is vulnerable to stack buffer overflow.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.13081

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.13082

>>13081

already done, roll again

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.13083

>>13081

roll again

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.13098

>>13078

Not my code, but I don't see it. He doesn't buffer anything, and only processes input a single character at a time.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.13100

>>3529

Ready to get cucked by the programming god.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.13109

>89 Sine wave generator from pseudorandom numbers

Why in the fuck would you do that. Maybe this is poorly worded and they mean is make a prg with a sinusoidal output, but if you want to make a sine wave generator you sure as hell shouldn't be using random numbers.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.13110

>>13109

>if you want to make a sine wave generator you sure as hell shouldn't be using random numbers.

Nope. A white noise generator, perhaps.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.13111

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.13114

File: 22303adf59ec55b⋯.webm (632.97 KB,782x786,391:393,1585000053374.webm)

We rolling boys

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.13328

roll

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.13329

>>13328

//Fib Generator

//Generates 1st - ith fibonaci numbers

#include<stdlib.h>

#include<stdio.h>

int main(int argc, char **argv){

// printf("%d", argc);

//check for valid number of arguements

if(argc != 2)

{

printf("Error must specify exactly one interger argument\n");

return 1;

}

//convert str argument to int

//atoi() used here because 0 is not conidered a valid output

int numTerms = atoi(argv[1]);

//printf("%d\n", term);

//check if valid input

if(numTerms < 1)

{

printf("Error, input must be a valid positive interger.\n");

return 2;

}

long last = 0;

long current = 1;

long temp;

int i;

//iterative fibonacci addition

for(i=0; i<numTerms; i++)

{

printf("%d: %ld\n", (i+1), current);

temp = current;

current+=last;

last = temp;

if(current < 0)

{

//print message if addtion overflow

printf("Overflow has occured.\n");

break;

}

}

return 0;

}

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.13340

rollin'

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.14022

Thanks for the information.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.14025

Thank you for sharing these exercises and for the recommendations of the services. I am currently busy writing a letter of recommendation and I have had difficulties. I decided to buy a recommendation letter because I have to be sure that it will be written well.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.14026

Thank you for sharing these exercises and for the recommendations of the services. I am currently busy writing a letter of recommendation and I have had difficulties. I decided to buy a recommendation letter https://www.lorservice.com/ because I have to be sure that it will be written well.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

 No.14032

Some exercises are quite difficult to perform without qualified help. That's why I always have uk essay writing service https://www.brillassignment.co.uk/essay-writing-services/ handy where I can ask for help with any academic assignment. And I know that the work will be written qualitatively and in time convenient for me.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



[Return][Go to top][Catalog][Nerve Center][Random][Post a Reply]
Delete Post [ ]
[]
[ / / / / / / / / / / / / / ] [ dir / random / 93 / biohzrd / hkacade / hkpnd / tct / utd / uy / yebalnia ]