Posts: 18510
Threads: 129
Joined: January 19, 2014
Reputation:
91
RE: Here's a simple programming problem for you to solve
April 27, 2016 at 12:53 am
(This post was last modified: April 27, 2016 at 12:55 am by Alex K.)
I'd still simulate a z digit number in an x-ary system, and the x different values for the digits correspond to the letters of the string S. In c++, I would write a small class with an increment operator which carries the 1 to the next digit when reaching x in one digit.
I do it for 250$/hr, and you get a free gourd!
The fool hath said in his heart, There is a God. They are corrupt, they have done abominable works, there is none that doeth good.
Psalm 14, KJV revised edition
Posts: 3290
Threads: 118
Joined: January 19, 2015
Reputation:
30
RE: Here's a simple programming problem for you to solve
April 27, 2016 at 1:13 am
I guess I'm a shameless slut because I'll do it for $100.00 US. I mean c'mon, it's a pretty easy problem.
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.
Albert Einstein
Posts: 5356
Threads: 178
Joined: June 28, 2015
Reputation:
35
RE: Here's a simple programming problem for you to solve
April 27, 2016 at 2:11 am
(This post was last modified: April 27, 2016 at 2:15 am by ErGingerbreadMandude.)
No guys! Not my homework!
I was just fascinated by the idea of inserting "abcdefghijklmnopqrstuvwxyz" as input- output all the result into a text file , then run my computer till I turn 40, and then I can open the text file and all the words in the dictionary and all the words that will be in the dictionary in the future will be in my text file. So technically, I'll have all the words anyone can ever make up -in my text file!!
@K, So when you look at it from the text files perspective, it's living in the past, present and the future simultaneously because all the words in the past, present and even the future is in the text file..
Posts: 5356
Threads: 178
Joined: June 28, 2015
Reputation:
35
RE: Here's a simple programming problem for you to solve
April 27, 2016 at 2:17 am
(April 26, 2016 at 12:40 pm)Tiberius Wrote: In python:
Code: import itertools
if __name__ == '__main__':
S = list(input('Input string: '))
z = int(input('Input integer: '))
for combo in itertools.product(S, repeat=z):
print(''.join(str(c) for c in combo))
I can't C your response,Tibby.
Posts: 5356
Threads: 178
Joined: June 28, 2015
Reputation:
35
RE: Here's a simple programming problem for you to solve
April 27, 2016 at 2:28 am
(April 26, 2016 at 9:41 pm)SteelCurtain Wrote: Lol this is totally your homework.
We're doing the same kind of degree right? I'll worship your feet for eternity if you solve this by yourself in c.
Posts: 15351
Threads: 118
Joined: January 13, 2014
Reputation:
117
RE: Here's a simple programming problem for you to solve
April 27, 2016 at 2:58 am
(This post was last modified: April 27, 2016 at 3:48 am by SteelCurtain.)
But it's not your homework, huh?
ETA: honestly, I'd help you, but it sounds like this thing is due tomorrow, and you've procrasturbated.
If it can wait, I'll give it a look after my exams tomorrow.
"There remain four irreducible objections to religious faith: that it wholly misrepresents the origins of man and the cosmos, that because of this original error it manages to combine the maximum servility with the maximum of solipsism, that it is both the result and the cause of dangerous sexual repression, and that it is ultimately grounded on wish-thinking." ~Christopher Hitchens, god is not Great
PM me your email address to join the Slack chat! I'll give you a taco(or five) if you join! --->There's an app and everything!<---
Posts: 5690
Threads: 8
Joined: April 3, 2014
Reputation:
68
RE: Here's a simple programming problem for you to solve
April 27, 2016 at 4:09 am
(April 27, 2016 at 2:11 am)pool the great Wrote: No guys! Not my homework!
I was just fascinated by the idea of inserting "abcdefghijklmnopqrstuvwxyz" as input- output all the result into a text file , then run my computer till I turn 40, and then I can open the text file and all the words in the dictionary and all the words that will be in the dictionary in the future will be in my text file. So technically, I'll have all the words anyone can ever make up -in my text file!!
@K, So when you look at it from the text files perspective, it's living in the past, present and the future simultaneously because all the words in the past, present and even the future is in the text file..
Have you looked up the Library of Babel yet?
It's pretty cool.
Posts: 5356
Threads: 178
Joined: June 28, 2015
Reputation:
35
RE: Here's a simple programming problem for you to solve
April 27, 2016 at 4:24 am
(April 27, 2016 at 2:58 am)SteelCurtain Wrote: But it's not your homework, huh?
ETA: honestly, I'd help you, but it sounds like this thing is due tomorrow, and you've procrasturbated.
If it can wait, I'll give it a look after my exams tomorrow.
Lol not my homework! So take your time,no probs.
Posts: 18510
Threads: 129
Joined: January 19, 2014
Reputation:
91
RE: Here's a simple programming problem for you to solve
April 27, 2016 at 4:35 am
(April 27, 2016 at 2:17 am)pool the great Wrote: (April 26, 2016 at 12:40 pm)Tiberius Wrote: In python:
Code: import itertools
if __name__ == '__main__':
S = list(input('Input string: '))
z = int(input('Input integer: '))
for combo in itertools.product(S, repeat=z):
print(''.join(str(c) for c in combo))
I can't C your response,Tibby.
Of course not, in Python it's basically
"
begin program
dothethingIwant();
end program
"
The fool hath said in his heart, There is a God. They are corrupt, they have done abominable works, there is none that doeth good.
Psalm 14, KJV revised edition
Posts: 5356
Threads: 178
Joined: June 28, 2015
Reputation:
35
RE: Here's a simple programming problem for you to solve
April 27, 2016 at 4:35 am
(This post was last modified: April 27, 2016 at 4:36 am by ErGingerbreadMandude.)
(April 27, 2016 at 4:09 am)Little lunch Wrote: (April 27, 2016 at 2:11 am)pool the great Wrote: No guys! Not my homework!
I was just fascinated by the idea of inserting "abcdefghijklmnopqrstuvwxyz" as input- output all the result into a text file , then run my computer till I turn 40, and then I can open the text file and all the words in the dictionary and all the words that will be in the dictionary in the future will be in my text file. So technically, I'll have all the words anyone can ever make up -in my text file!!
@K, So when you look at it from the text files perspective, it's living in the past, present and the future simultaneously because all the words in the past, present and even the future is in the text file..
Have you looked up the Library of Babel yet?
It's pretty cool.
Yes it's very cool! I actually made a program that does exactly that. If I run my program for a few minutes it'll contain names of everyone I know (not long names). It's just that my program create lots of duplications and isn't at the very least efficient,this means bigger text file size, longer time to open the file and even longer time to search inside the file for very little trade off.
I remember leaving my computer on without my mom knowing (a few years back when I first made this thing) and we went out. After some hours we returned and the text file size was some 6 GB, I was so glad but unfortunately I couldn't open a text file as big as that.
|