Your code for a "swapAC" is exchanging the "childs" of A and C.
Isn't the OP's question to simply reorder the cards (while preserving the childs) according to a new sort order for the 'groups' A,B,C and D? At least his last example does that ...
How to change card order of cards (numbers)?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: How to change card order of cards (numbers)?
shiftLock happens
Re: How to change card order of cards (numbers)?
It is confusing because we are dealing with 2 different people.
If you look at the first post (samjith). A starts out with 3 cards and C has 5 cards. After the swap, A has 5 cards and C has 3 cards. So the cards are actually swapped from one letter to another.
He seems to verify that in his follow-up posts. If you look at the examples, C's 5 cards are now at the beginning and referred to as A's cards. So I assumed he wanted them renamed from "C-#" to "A-#" Sometimes it is confusing to figure out what a user is actually wanting to do. Languages and terminology get in the way.
I may be wrong. Hopefully Samjith will get back to us with confirmation or clarification. You did give a nice and complete answer to him. Good job. And thanks for bringing up the difference in our interpretations. Hopefully one of us answered his question and we can put this posting to rest.
If you look at the first post (samjith). A starts out with 3 cards and C has 5 cards. After the swap, A has 5 cards and C has 3 cards. So the cards are actually swapped from one letter to another.
He seems to verify that in his follow-up posts. If you look at the examples, C's 5 cards are now at the beginning and referred to as A's cards. So I assumed he wanted them renamed from "C-#" to "A-#" Sometimes it is confusing to figure out what a user is actually wanting to do. Languages and terminology get in the way.
I may be wrong. Hopefully Samjith will get back to us with confirmation or clarification. You did give a nice and complete answer to him. Good job. And thanks for bringing up the difference in our interpretations. Hopefully one of us answered his question and we can put this posting to rest.
Cyril Pruszko
https://sites.google.com/a/pgcps.org/livecode/
https://sites.google.com/a/setonhs.org/app-and-game-workshop/home
https://learntolivecode.com/
https://sites.google.com/a/pgcps.org/livecode/
https://sites.google.com/a/setonhs.org/app-and-game-workshop/home
https://learntolivecode.com/
Re: How to change card order of cards (numbers)?
It was the biggest and hardest part of this thread to clarify what the two OP's want.
Now, wouldn't it be a good idea (if you find some time) to complete your code, so that other beginners who read this thread have the solutions to both of the questions?
Now, wouldn't it be a good idea (if you find some time) to complete your code, so that other beginners who read this thread have the solutions to both of the questions?
shiftLock happens
Re: How to change card order of cards (numbers)?
It is a fine line between us writing the code for them and pointing them to the way to do it themselves. I prefer the second way so that they gain from the learning experience. From time to time, we get posts from students who just want the code written for them. Our job is not to do their homework for them but to help them learn.
Another reason not to be too specific with code is that we all have our own naming conventions and programming habits. What may seem simple and straight forward to you may be confusing to someone else. You might use a lot of functions while another prefers straight-line code. You might program a more general case with lots of variables and input fields while someone else just wants the code for their specific case.
Looking at his code from an earlier post, he/she knows how to use fields and pick off chars from input. What I left was certainly do-able by the author of this post.
Besides, we are still unclear about what he wants/needs. To write specific code may mislead him/her and lead to another volley of explanations and questions. If he/she still needs help with the code, we are here. Until then, there is enough here to get them further.
Another reason not to be too specific with code is that we all have our own naming conventions and programming habits. What may seem simple and straight forward to you may be confusing to someone else. You might use a lot of functions while another prefers straight-line code. You might program a more general case with lots of variables and input fields while someone else just wants the code for their specific case.
Looking at his code from an earlier post, he/she knows how to use fields and pick off chars from input. What I left was certainly do-able by the author of this post.
Besides, we are still unclear about what he wants/needs. To write specific code may mislead him/her and lead to another volley of explanations and questions. If he/she still needs help with the code, we are here. Until then, there is enough here to get them further.
Cyril Pruszko
https://sites.google.com/a/pgcps.org/livecode/
https://sites.google.com/a/setonhs.org/app-and-game-workshop/home
https://learntolivecode.com/
https://sites.google.com/a/pgcps.org/livecode/
https://sites.google.com/a/setonhs.org/app-and-game-workshop/home
https://learntolivecode.com/
Re: How to change card order of cards (numbers)?
Hi guys,
I am very happy, because i expect one answer, but i got more.
Actually i need
i made the code so much complicated by repeat loops, etc.
But now i got it. thanks for the job. I didn't think about the sort command.
Thanks
Samjith
I am very happy, because i expect one answer, but i got more.
Actually i need
this type. but Klaus suggest me to doA-1
A-2
A-3
B-4
B-5
C-6
C-7
C-8
etc.
like this, that's generates the confusion.Hint:
A clever naming scheme often make things easier to handle.
So can you please NAME your cards like:
A_1
A_2
A_3
B_1
B_2
etc.
And then explain again what you are trying to do with these NAMES in a little example?
Best
Klaus
i made the code so much complicated by repeat loops, etc.
But now i got it. thanks for the job. I didn't think about the sort command.
Thanks
Samjith