very tricky or am i just stupid?

Started by
22 comments, last by kSquared 18 years ago
Quote:Original post by Anonymous Poster
You're just stupid.

You're just nobody.
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other player's eyes with his King.
Advertisement
Quote:Original post by smart_idiot
You're just nobody.


O RLY?
Quote:Original post by Anonymous Poster
Quote:Original post by smart_idiot
You're just nobody.


O RLY?


YA RLY!
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other player's eyes with his King.
Quote:Original post by smart_idiot
Quote:Original post by Anonymous Poster
Quote:Original post by smart_idiot
You're just nobody.


O RLY?


YA RLY!


I couldn't find Wikimedia's hotlinking policy or this would've been in an <img> tag.

AP: Grow up. Posting kindergarden insults, behind a viel of anonymity, against a self admitted programming novice, trying to learn how to program, is what's stupid. And by "stupid" I mean disgusting and ill mannered. You were born allready knowing how to program in scheme? I think not.

vioxx_1: Homework help is mostly a no no around here, to prevent this forum being cluttered up by people who would use this forum as their own personal cheat sheet. On an online forum, it can be impossible to distinguish between someone wanting someone else to do their homework, and someone wanting to actually learn.

For the later, I suggest turning to your professor, your TAs, or your classmates. Given that all of the above will be focusing on your specific topic, they have the best chance of helping you. They're in a better position to gauge if you're cheating (and in a better position to report you if you are), or if you're trying to learn - in which case they'll be more able to cover in depth and detail what your class is focusing on, as it will be the same that they're focusing on.

That said, we can post nudges in the right direction if you explain your stumbling block. I don't know lisp, nevermind scheme (a dialect of lisp), but from what I can recall, the way to deal with your situation is to not modify the original list. You have a situation akin to:

inputa = (1 2 3)
inputb = (1 2)

And then creating combinations, by using car/cdr on those lists, loosing the original in the process. The key to going back to the origin (restarting) lies in not destroying the original.

[Edited by - MaulingMonkey on April 8, 2006 1:05:06 AM]
The thing is is that I made up the list of numbers.
I just want to learn the process of recursion for another problem.
I'm actually converting characters into numbers and things like that.
So I need this process in order to be able to do it.
Is there any examples of this process using a different question?

Because all i want to know is how it works.
Quote:Original post by vioxx_1
The thing is is that I made up the list of numbers.
I just want to learn the process of recursion for another problem.
I'm actually converting characters into numbers and things like that.
So I need this process in order to be able to do it.
Is there any examples of this process using a different question?

Because all i want to know is how it works.


The "process of recursion" is very general, but usually it will look like this one of these two:

Tail call recursion:
(define (f ...)  (if ...      ... ; Base case      (f ...))) ; Recursive case


Non-tail call recursion:
(define (f ...)  (if ...      ... ; Base case      (g ... (f ...) ...))) ; Recursive case


Is this what you were asking for, or did you want a concrete example (really, pretty much all of the concrete examples will follow that pattern)?

Hi,

You could do this quite easily using the modulus operator.

GCS584
Quote:Original post by gcs584

Hi,

You could do this quite easily using the modulus operator.

GCS584


What does modulus have to do with this? I don't see how using modulo will help iterate over a two lists and add each element.
Quote:Original post by Roboguy
Quote:Original post by gcs584

Hi,

You could do this quite easily using the modulus operator.

GCS584


What does modulus have to do with this? I don't see how using modulo will help iterate over a two lists and add each element.


Well since I don't know Scheme, I made an assumption that an index for the retrieval of a value from the list could be specified.

GCS584
Quote:Original post by gcs584
Quote:Original post by Roboguy
Quote:Original post by gcs584

Hi,

You could do this quite easily using the modulus operator.

GCS584


What does modulus have to do with this? I don't see how using modulo will help iterate over a two lists and add each element.


Well since I don't know Scheme, I made an assumption that an index for the retrieval of a value from the list could be specified.

GCS584


Lists in Scheme are singly linked lists. The easiest (and most efficient) way to do this would be recursion over the linked lists, passing the tail of them to the recursive call.

This topic is closed to new replies.

Advertisement