Using Operators in a selection

Get help using Construct 2

Post » Thu Apr 03, 2014 12:41 am

Image

Hello, I have a quick question on my code, mostly on operators. My current exercise is further learning and this current project is to make a Tarot Reading web app. As to why, why not? I needed a project and seen one online and felt I could make a better one. Currently I am dealing the cards from the deck and with a deck of ten cards but will expand to the full 78 card set.

Dealing the first two are easy. First chose a num from 1-10 and pickNth instance that match's a family var for each card and position that card on the table. Here is where I am having trouble, For the next 9 cards how do you deal them form the deck and only select the cards that have not all ready been selected.

Right now my attempt is to use a while loop to say during this step (Action = 2) if Card Var Card 2 (ThatWhichCross) is equal to Var Card 1 (HeartOfMatter) set Var Card 2 to new value between 1 and 10; else if they are not equal than place card and stop loop, also set Var Card 3 (TopOfMind)

That part works just fine however it is when I move to dealing with more than one var that I am running into trouble.

While (Action = 3) if Var Card 3 is equal to Var Card 1 OR Card 2 than chose another value between 1-10. else if the inverse than place the card and stop loop.

The issue I am thinking is in the Operators “TopOfMind = ThatWhichCross | HeartOfMatter” the OR expression just dose not seem to be working as I think it should be working.

I also may be approaching this wrong, total possibility any help offered will be welcomed.
You do not have the required permissions to view the files attached to this post.
"Were all mad here. I'm mad, your mad." "How do you know I'm mad?" Asked Alice. "You must be" Said the Cheshire Cat. "Or you wouldn't have come here"-Lewis Carroll: Adventures In Wonderland
B
7
S
3
Posts: 113
Reputation: 1,295

Post » Thu Apr 03, 2014 1:25 am

Im not really 100% sure how those cards work, but from what I recall its something about drawing some cards and based on those and some hokus pokus its possible to tell the future or something about a person?

Anyway back to reality.... :D
Think you might be overcomplicating things a bit, try to look at it this way.

"You have 10 cards and you want to draw a random card and no more than once."

1. First of all you need something that can pick a random card. So as you have already done "Pick random Card".
2. To make sure that the card doesn't get picked more than once. You need to mark a card as being "played" or "Used". This can be done with a simple Boolean, lets call it "Used".

This is pretty much what you need to make it work, if you add them together.

Card.Used = False : So only cards that are not used already are picked.
Pick random Card ; Will pick a random card of those not in use.

So after you play a card you mark "Used = true" and reset it to false when you want to reset the game.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848

Post » Thu Apr 03, 2014 3:15 am

Oooh, that is much more Practical than the way I was going about it. I got caught up in loops that I over looked booleans. Thank you kindly.

And I am trying to leave as much "Hocos Pokus" out as I can. Each card has a meaning depending on where it is placed in the order on the table and they cross reference each other. I think it to be a good logic exercise believe me or not lol. And I even have a idea to expand it to make it a educational venture into Tarot, things that are not very well understood. "The cards only have the power that you yourself give. More importantly is understanding that the same is true for your life" © 2014
"Were all mad here. I'm mad, your mad." "How do you know I'm mad?" Asked Alice. "You must be" Said the Cheshire Cat. "Or you wouldn't have come here"-Lewis Carroll: Adventures In Wonderland
B
7
S
3
Posts: 113
Reputation: 1,295

Post » Thu Apr 03, 2014 3:25 am

"The cards only have the power that you yourself give. More importantly is understanding that the same is true for your life" © 2014

In other words hokus pokus :P

Well I don't think you have to leave it out, im pretty sure that you can make it just as accurate as the real thing :D
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848

Post » Thu Apr 03, 2014 4:13 am

nimos100 wrote:
"The cards only have the power that you yourself give. More importantly is understanding that the same is true for your life" © 2014

In other words hokus pokus :P

Well I don't think you have to leave it out, im pretty sure that you can make it just as accurate as the real thing :D


Time will tell my friend :D

MUCH better, now comes the fun part of padding it with all the text box content. This also allowed me to remove 10 Global Variables so again thank you. In a few days I will probably make a new thread showing my progress, in the appropriate section.

But now I will probably call it a night.
You do not have the required permissions to view the files attached to this post.
"Were all mad here. I'm mad, your mad." "How do you know I'm mad?" Asked Alice. "You must be" Said the Cheshire Cat. "Or you wouldn't have come here"-Lewis Carroll: Adventures In Wonderland
B
7
S
3
Posts: 113
Reputation: 1,295


Return to How do I....?

Who is online

Users browsing this forum: ounound and 17 guests