Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

War

CindexCindex Member Posts: 27
This is a game, but very basic so I put in the basic questions section.

I'm trying to make a game of War like you play with cards. It shows you the cards and then you can draw again. The problem is things aren't showing up right. Numbers and letters will show up wrong. For example, sometimes when I'm supposed to get a number I'll get a heart or club.

I think the problem may be that I'm trying to change an int value into a string. Such as:
[code]card = show;[/code]
and
[code]ocard = show2;[/code]

Is there a better way to do this? Here is the full code:
[code]#include
#include
#include

Comments

  • IDKIDK Member Posts: 1,784
    : This is a game, but very basic so I put in the basic questions
    : section.
    :
    : I'm trying to make a game of War like you play with cards. It shows
    : you the cards and then you can draw again. The problem is things
    : aren't showing up right. Numbers and letters will show up wrong.
    : For example, sometimes when I'm supposed to get a number I'll get a
    : heart or club.
    :
    : I think the problem may be that I'm trying to change an int value
    : into a string. Such as:
    : [code]: card = show;[/code]:
    : and
    : [code]: ocard = show2;[/code]:
    :

    Yepp, thats the prob.

    You could do like this: show = card+'0';

    Look at the ascii table to find out why and how this works.
  • CindexCindex Member Posts: 27
    Thank you! It works exactly the way I want it to now!
    =======================================
    Noob programmer at Actionscript and C++.

    . ~Always needing help~ .
Sign In or Register to comment.