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 7600319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:52:55+00:00 2026-05-30T22:52:55+00:00

I am just asking a quick simple question here. I’m trying to code poker

  • 0

I am just asking a quick simple question here. I’m trying to code poker card rankings into 4 digit binary code (exp. 2 is 0010, 7 is 0111)(ignoring the suits for now). Then decoding and print it out.

To my knowledge the best way of changing a Int into a String is by using the function show. However, using it on this situation it drops all the zeros that is in front of the 1 (exp. show 0011 returns “11”, show 0001 returns “1”). How do I keep the zeros?

Thanks

  • 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-30T22:52:56+00:00Added an answer on May 30, 2026 at 10:52 pm

    Because 0001 is a number, and not a character string. The 0001 read syntax is converted into an integer object, and when you print that integer object, it prints in decimal as 1.

    1 is the successor to 0. There are no zeros in 1. 🙂

    To print 1 as 0001, try the prelude that provides printf:

    E.g

    http://hackage.haskell.org/packages/archive/base/latest/doc/html/Text-Printf.html

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

Sidebar

Related Questions

Just a quick simple question that I can not seem to find an answer
I hope this question is not 'controversial' - I'm just basically asking - has
I'm perhaps being a bit lazy asking this here, but I'm just getting started
just a quick question: I am a CS undergrad and have only had experience
Just a quick question to confirm the documentation: The getY(int) function from MotionEvent in
I'm just asking theoretical question. I' have an operation which takes some period of
Just a quick question for people who know the inner workings of .Net better
So I've just got a quick question on padding with 0's. The examples I
I'm just asking whether there is a simple way to extract a string out
Just a really quick question about something small. The following is part of a

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.