Can half of Sup Forums even into programming?
If you roll and can't provide code for your number, you don't belong on Sup Forums.
Can half of Sup Forums even into programming?
Other urls found in this thread:
Roll
Rolling
>simple math is hard
rolling for pong
Rolling is half the battle!
>Rolling
lel
roll
Rollerino
why do I even bother replying I'm just gonna get one that takes a long ass time. eh roll
Challenge accepted.
>v2
get with the times, OP
penis
>doesn't specify board size
well 1x1 board for me it is
qass
>45 minutes since OP was posted
>nobody has posted any code yet
Jesus Christ, it's worse than I thought.
fuck it
>linked list
rr
Rolling to prove my education is worth a damn
Fuck you. Im nearly done with a four month project and the last thing i need is a faggot telling me whether I belong here. Fuck you. I knew what pointers were before strauss did.
Fuck fizzbuzz, I've already done that.
roll
rolling
Rolling
i actually did this a while ago with my own shitty algorithm
should probably finish my shunting-yard + RPN version
used javascript. i'm not sure if it's 100%, but it's okay-ish
function num2text(n) {
var ret = '';
var a = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen', 'twenty'];
a[30] = 'thirty';
a[40] = 'forty';
a[50] = 'fifty';
a[60] = 'sixty';
a[70] = 'seventy';
a[80] = 'eighty';
a[90] = 'ninety';
a[100] = 'hundred';
a[1000] = 'thousand';
if (isNaN(n)) {
console.log('fuck you');
return;
}
if (n < 0) {
ret += 'negative ';
n = n * -1;
}
if (n 0)
ret = a[n];
else if (n >= 100) {
ret += a[(n+'').charAt(0)] +' '+ a[(n>=1000?1000:100)];
n = n - (n+'').charAt(0) * (n>=1000?1000:100);
if (n > 99)
ret += ' '+ num2text(n);
else if (n > 0)
ret += ' and ' + num2text(n);
} else
ret += a[(n+'').charAt(0)*10] + ((n+'').charAt(1)==0?'':'-'+a[(n+'').charAt(1)]);
return ret;
}
*cums inside your waifu*
oh, and i couldn't be bothered to make it go higher than 9999.
I've never used pygame before so it works but it just jumps around because there isn't a delay.
kek
Malbolge
(=OMo^KJH#GE~%CB@RQa|^tyxwZHGV3kSRRm,,MLLg'&$coaCB|W@y=w
Rollan
rolling faggots, need some time away from my android trojan rat anyways.
rolando
what the fuck does 53 mean?
rolando again
>2 hours in
>33 replies
>1 shitty javascript solution
>1 unreadable garbage
Stay classy, Sup Forums.
I'm gonna get some bullshit red thing right?
// 086 Temperature converter
import java.util.Scanner;
import java.lang.Math;
public class TConverter
{
public static void main(String args[])
{
Scanner cIn = new Scanner(System.in);
String[] tempTypes = {"F", "C"};
System.out.print("Enter temperature (eg. 35C): ");
String inTempStr = cIn.nextLine();
cIn.close();
String inTempType = inTempStr.substring(inTempStr.length() - 1);
double inTempNum = Double.parseDouble(inTempStr.substring(0, inTempStr.length()-1));
String outTempStr = "[ERROR]";
if (inTempType.equalsIgnoreCase(tempTypes[0]))
{
outTempStr = String.format("%.1f%s", (inTempNum - 32) * 5/9, tempTypes[1]);
}
else if (inTempType.equalsIgnoreCase(tempTypes[1]))
{
outTempStr = String.format("%.1f%s", inTempNum * 9/5 + 32, tempTypes[0]);
}
System.out.println(inTempStr.toUpperCase() + " = " + outTempStr);
}
}
Great now post your Wolfenstein 3d-style ray caster
If I could do that, I wouldn't be unemployed shitposting on Sup Forums, faggot.
Kek, roll
hmm
Roll
Roll
I have nothing better to do
λ let binom n m = fromIntegral $ product [n-m+1..n] `div` product [1..m]
λ let triangle n = [ [binom m i | i
λ let isPalin (show -> n) = n == reverse n
λ isPalin 123
False
λ isPalin 12321
True
yawn again
Already did this one
import Control.Lens
import Control.Monad (( a
voronai points d = minimumBy (comparing $ distance d) points ^. _3
where distance (a,b) (c,d,_) = (a-c)^2 + (b-d)^2
render :: FilePath -> (Int, Int) -> ((Double, Double) -> Word8) -> IO ()
render p (w,h) f = runIL . writeImage p . Grey f (r/.w, i/.h))
main = render "voronai.png" (1920, 1280) . voronai = a -> b -> c
x /. y = fromIntegral x / fromIntegral y
Sup Forums is a general technology sub not a programming sub.
I'm new, is this ok?
public class Main
{
private static int state = 0;
private static double d;
public static void main(String[] args)
{
while (true)
makarovChain();
}
public static void makarovChain() {
d = Math.random();
if(state == 0) {
if(d
λ import Network.NTP.Control
λ res
There, I learned something new while looking up this one - now I can stop. (The code is simple enough that the implementation is pretty much just transcribing an example pseudo code into C or any other imperative language with arrays, so feel free to do it yourself)
99 pls I want to be punished
Roll
Ror
rolling cuz i should work
gimmme
roll
roll
roll
'use strict'
let palindrome = function(string) {
let halfway = string.length / 2;
let end = string.length - 1;
for (let i = 0; i < halfway; i++) {
if (string[i] !== string[end]) {
return false
}
end -= 1;
}
return true
}
palindrome('racecar')
>Reinventing the wheel: The Movie
I don't want to do any of these, because I feel I'd be wasting time.
fuck you
i'll be waiting for that wolfenstein 3d application user
rolllll
But I already do enough software development at work.
well shit
90% of these shouldn't take more than 10 minutes, pleb.
meant for
let's do this shit in ruby
R o l l
Wow that was so hard
from random import choice
name = raw_input("Enter your name : ")
print "Rock breaks Scissors, Scissors cuts Paper, Paper beats Rock"
rps = ['r','p','s']
u = 0
v = 0
#Here is the while loop, which will continue till break. The below text is intended to fit into the while loop.
while 1:
print "R: Rock, P: Paper, S: Scissor"
user = raw_input("Enter your choice among the three : ")
user = user.lower()
py = choice(rps)
if user == py:
print "You chose ",user
print "I chose ",py
print "Hence a Tie!"
elif user == 'r' and py == 's':
print 'You entered Rock. I had Scissor. You win!'
u+=1
elif user == 'r' and py == 'p':
print 'You entered Rock. I had Paper. You lose!'
v+=1
elif user == 's' and py == 'p':
print 'You entered Scissor. I had Paper. You win!'
u+=1
elif user == 's' and py == 'r':
print 'You entered Scissor. I had Rock. You lose!'
v+=1
elif user == 'p' and py == 's':
print 'You entered Paper. I had Scissor. You lose!'
v+=1
elif user == 'p' and py == 'r':
print 'You entered Paper. I had Rock. You win!'
u+=1
if v == 5:
#Print computer wins the game
print "Computer wins!"
break
#Provide proper conditions for elif in case user getting 5 points:
elif u == 5:
#Congratulate the user on winning along with their name
print name + " wins!"
break
roll
reroll
No rerolls, fucker. If you can't do the original challenge you shouldn't be on Sup Forums.
I don't code
Roll
challenge me neegus
i probably won't do it since i have the slows
Hail satan
I can do most of the green ones.
Here's the factorial:
#include
int fact (int n);
int main (void)
{
int n;
printf("Enter n: ");
scanf("%d", &n);
printf("fact(%d) = %d\n", n, fact(n));
return 0;
}
int fact (int n)
{
if (n
My code is missing a } at the end. Sorry for that.
The time has come.
Rolly
public class bmi
{
public static void main(String[] args)
{
Scanner scan= new Scanner (System.in);
System.out.println("Enter your weight (in pounds)");
double lbs=scan.nextInt();
System.out.println("Enter your height (in inches)");
double in=scan.nextInt();
double ans=((lbs*703)/(Math.pow(in, 2)));
System.out.println("Your BMI is "+ans);
}
}
I did it!
good job user! looks nice
It looks like it can be done without all the repetition, but I don't know how.
it should be
/* ... */
} else {
return (n * fact (n - 1)); /* not just fact(n - 1) */
}
/* ... */
The code for #64
a, b = 1, 1
fib = [a]
# get first 1000 fibonacci numbers
for i in range(1000):
a, b = b, a + b
fib.append(a)
# get first digit
digits = []
for num in fib:
while num / 10 != 0:
num = num / 10
digits.append(num)
# add numbers to a dictionary
count = {}
for num in digits:
count.setdefault(num, 0)
count[num] += 1
# print result
print count
The output:
{1: 301, 2: 177, 3: 125, 4: 96, 5: 80, 6: 67, 7: 57, 8: 53, 9: 45}
roll
Roll
>if (isNaN(n)) {
console.log('fuck you');
return;
}
kek
Rollo
rollinn
thank you, it was actually really fun to program
i just realise that
n.times{ a
now with emoji
that's pretty tight
Fuck you and your codemonkey elitism. Some of us like hardware more and all your bullshit pajeet code won't mean a fucking thing without working hardware to run it on.
Programmers always think they're the end-all be-all of computer knowledge. You are nothing. They can literally train retarded poo-in-loos to do it on paper. Fuck off, it's not impressive and it doesn't say shit about your skills as a person.
"Hurr durr, if you can't mill a tree down to lumber all by yourself then you don't belong on /DIY/"
Kill yourself.
/Salt
kys
>calling us codemonkeys
>clearly can't do any of these tasks