[ / / / / / / / / / / / / / ] [ 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 [View All]

>you roll it

>you code it

>you post it

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

457 postsand34 image repliesomitted. Click reply to view. ____________________________
Disclaimer: 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 ]