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

Programming challenges

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

Thread replies: 18
Thread images: 2

>challenge
>Produce this programatically
>http://sprunge.us/OWBI
>>
int i = 2;
while (1) {
printf("%d\n", i);
i *= 2;
}

what's the challenge? buffer overflow?
>>
>>57690884
that and you have to separate every 68 digits of larger numbers with \ and a new line
>>
>>57690938
you do it
>>
>>57690805
Do your own homework.
>>
>>57691209
I produced this in my machine using concatenative bash
>>
do your own homework you fucking autistic retard. If you can't even solve this then you have no hope when the >pajeet's come to take your CS job, after they've taken all the monkey jobs.
>>
>>57691279
dipshit read the thread before you speak
>>
if you want a hint, start here with pseudo-code dumbfuck:

set i = 2
set is = ""
set a = 0 //counter var
set b = 0 //char selector var

loop forever {

a = convert_to_int_by_flooring(i / 68) //count # of times to newline
is = convert_to_string(i) //make editable

for each 1 in a {

b = a*68-1 //get position, starting from reverse

string_function_add_text_at_position(is, b, "/\n") //place the "/\n" string in the b position in the string is

a--

}

i--

}
>>
trivial for a code artisan™ such as myself

require 'net/http'
require 'uri'

Net::HTTP.get_print URI('http://sprunge.us/OWBI')
>>
>>57691371

whoops, i-- should be i=i*2, durr lol
>>
>>57691377
 wget http://sprunge.us/OWBI 


Mine's shorter
>>
>>57691252
then post your code
>>
>>57691419
http://sprunge.us/ZKFE

Now I bet you feel real goofed huh
>>
>>57691419
now show us your version @;)
>>
def okay(n):
for i in range(1000):
os.chdir('/home/fgtkekekek/')
txt = open('numbers.txt', 'a')
n = n * 2
txt.write(str(n) + '\n')
okay(2)


that is it?
>>
File: 1480135508740.png (677KB, 1920x1080px) Image search: [Google]
1480135508740.png
677KB, 1920x1080px
start = 2
while len(str(start)) < 199:
for i in range(1673):
if len(str(start)) >= 68:
for i in range(0,len(str(start)),68):
print(str(start)[i-68:i] + '\\')
else:
print(start)

start = start * 2

I wrote this one in python. Just started learning python this semester mostly a java guy

lmk! keyboard unrelated
>>
>>57690805
(1..Float::Infinity).each do |i|
puts 2**i
end
Thread posts: 18
Thread images: 2


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

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


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