Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7615097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:34:16+00:00 2026-05-31T02:34:16+00:00

I am currently building a card game and everything works fine when I write

  • 0

I am currently building a card game and everything works fine when I write output to the console.
However, when I write to a file, the suit associated with each card becomes a strange set of 4 different characters. Instead of printing the Heart, Diamond, Club and Spade symbols as defined in an ASCII table, the file produces 4 different characters that include – and |. The other two characters look like tiny super-scripted L’s.

public enum SUIT { HEART = 0, DIAMOND = 1, CLUB = 2, SPADE = 3 };
public enum VALUE { NINE = 0, JACK = 1, QUEEN = 2, KING = 3, TEN = 4, ACE = 5 };
public static string printCard(PinochleCard theCard)  
//This card game uses a set of 5 card denominations
    {
        string cardS = "";

        switch (theCard.cardValue)
        {
            case VALUE.ACE:
                cardS += 'A';
                break;
            case VALUE.TEN:
                cardS += "10";
                break;
            case VALUE.KING:
                cardS += 'K';
                break;
            case VALUE.QUEEN:
                cardS += 'Q';
                break;
            case VALUE.JACK:
                cardS += 'J';
                break;
            case VALUE.NINE:
                cardS += '9';
                break;
        }
        cardS += (char)(theCard.suit + 3);   // +3 converts to heart, diamond, club, spade in
        return cardS.PadRight(4);            //   the console but not for files
    }

Next I call this function in a loop to print a users hand.

Thanks for all the help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T02:34:17+00:00Added an answer on May 31, 2026 at 2:34 am

    ASCII doesn’t include hearts, diamonds, clubs and spades. Any “ASCII table” which includes them is talking about a specific encoding which is possibly compatible with ASCII for the first 127 values (which are all that ASCII defines) but then goes its own way.

    .NET uses Unicode for everything text-related; you should consult the Unicode code charts to find the characters you want – but then consider how you’re going to write them to a file (which encoding you’ll use, etc). Often console fonts don’t support everything within Unicode.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently building an application that consists of several components, each of which
I'm currently building a Java app that could end up being run on many
I am currently building in Version 3.5 of the .Net framework and I have
I am currently building an internal web application used in a factory/warehouse type location.
We're currently building an application that executes a number of external tools. We often
I'm currently building a small web application that includes a fair amount of JavaScript.
I am currently building an Excel 2007 Add-in using VSTO (latest version + sp1)
I am currently building a web site and I just implemented SqlCacheDependency using LinqToSQL
I am currently building a small website where the content of the main div
I'm currently building a project and I would like to make use of some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.