Skip to main content
25 events
when toggle format what by license comment
Aug 31, 2017 at 6:02 comment added Alexei Levenkov You can't delete that question (it has more than one answer) and it not going to be "transferred to CS"... You can consider asking it on CS, also you should spend some extra time learning what is expected of questions on that site. Side note: I feel that for some strange reason CS courses/books you took did not cover converting iterative code to recursive... make sure to brush up on at least terminology before posting to cs.stackexchange.com
Aug 31, 2017 at 4:34 comment added user8157871 @tima I know. I am telling you it was horrible. Should I wait for a moderator to transfer it to CS or should I just delete it?
Aug 31, 2017 at 4:31 comment added tima @ArmandoH. you added the code after it was already closed as too broad
Aug 31, 2017 at 4:29 comment added user8157871 @tima I did post a code in one of the edits, but it was removed because I put it there after receiving a pseudo-code answer. Also, the way I phrased the question was horrible. I thought that function invoking was implied when I said that the language could define functions.
Aug 31, 2017 at 4:25 comment added tima Maybe the user is mistaken that this is homework but what is the point of this thread? You asked a question without writing any code yourself. Did you expect users to write all of the variations of how it can be done for you? These types of questions will always get downvoted and closed.
Aug 31, 2017 at 4:08 history edited BoltClockMod CC BY-SA 3.0
edited body
Aug 31, 2017 at 3:26 comment added Alexei Levenkov @ArmandoH. The way main question is phrased currently excludes recursion. This is perfectly valid assignment for beginning of "compilers 101" course. You'd expected to find that you need more than just functions and conditional statements (recursive functions are much harder to implement than non-recursive once as you can't make all variables global hence will likely show up later in the course). Post still looks like homework assignment with no effort to solve anything (and edit in "answer" does not show research effort).
Aug 31, 2017 at 3:15 comment added user8157871 It was just a horrible question. It was supposed to be a challenge using only definition of variables, functions and if statements. Recursion worked under those circumstances.
Aug 31, 2017 at 3:12 comment added user8157871 I never said recursion was not allowed. In fact, I did not know it was used and that is why I did not mention it.
Aug 31, 2017 at 3:08 comment added Gabe Sechan @AlexeiLevenkov Then fix the language. Its broken. Anything relying on recursion for iteration is horribly inefficient. And take it to cs.stackexchange.com which is where questions like this belong.
Aug 31, 2017 at 3:06 comment added Alexei Levenkov @GabeSechan I'll iterate comments from post here: neither recursion nor jumps are allowed according to question as asked. So there is no way to implement while with constraints in the question. The fact that "use recursion" helped Armando and they accepted the answer does not mean that it is possible to implement iteration without jumps and recursion.
Aug 31, 2017 at 2:55 comment added Gabe Sechan @ArmandoH. Wrong answer. The correct answer is goto, which is how it works on an assembly level while(cond) {do_loop} is translated to loop: if(cond) { do_loop; goto loop}
Aug 31, 2017 at 2:54 comment added user8157871 @GabeSechan I think I already discussed that point quite a bit. I'll just post the small prototype in a few minutes. By the way, recursion was the answer.
Aug 31, 2017 at 2:51 comment added Gabe Sechan Because what you want to do is a classic homework question, and there's no practical reason to ever do things that way other than as a homework assignment. There's no problem with asking for help on your hoemwork when you've done some leg work yourself first, but if you ask an obvious homework question without showing some effort I'm downvoting and voting to close instantly.
Aug 31, 2017 at 2:50 comment added user8157871 @AlexeiLevenkov that answer actually helped me a bit. I am writing a prototype in Python right now. Should I post it as an answer when I finish it so that future visitors have an actual code instead of pseudo-code?
Aug 31, 2017 at 2:44 comment added Alexei Levenkov Note that accepted answer to your main question does not actually answer the question as it is asked now. If your goal is to confuse future potential visitors that have the same question it is perfectly fine (as acceptance only means "helped the most"), otherwise you may want to actually make sure answer actually answer what is asked in the post and not what you are interested to know.
Aug 31, 2017 at 2:25 comment added user2066936 Lol. I feel for you man. The problem with volunteers is that you can't fire them. All you can do is hope you don't cross paths with them.
Aug 31, 2017 at 2:06 vote accept CommunityBot
Aug 31, 2017 at 2:01 answer added user3956566 timeline score: 1
Aug 31, 2017 at 1:58 answer added Makoto timeline score: 4
Aug 31, 2017 at 1:57 comment added user8157871 @yannis I just saw your edit. Yes, that is why. I am definetely going to show that I am putting some effort next time.
Aug 31, 2017 at 1:51 comment added user8157871 @yannis You are right... I did forget to do that. So that is what caused this whole situation?
Aug 31, 2017 at 1:47 comment added yannis "I did some research and I did not find the specific answer I needed." How are we supposed to know that? Why didn't you give any indication of this research in your question? No one cares if the question is homework or not. What people do care about is you putting some effort into it, before you turn to Stack Overflow for help.
Aug 31, 2017 at 1:46 history edited yannis CC BY-SA 3.0
deleted 2 characters in body
Aug 31, 2017 at 1:43 history asked user8157871 CC BY-SA 3.0