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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:46:47+00:00 2026-05-16T00:46:47+00:00

I have read this implementation of glyphs in the Expert C Programming by Peter

  • 0

I have read this implementation of glyphs in the Expert C Programming by Peter Van Der Linden. He states this method to draw a glyph pattern. This question is strictly restricted to the context of C programming.

static unsigned short stopwatch[] = {
    0x07C6,
    0x1FF7,
    0x383B,
    0x600C,
    0x600C,
    0xC006,
    0xC006,
    0xDF06,
    0xC106,
    0xC106,
    0x610C,
    0x610C,
    0x3838,
    0x1FF0,
    0x07C0,
    0x0000
};

and then define

#define X )*2+1
#define _ )*2
#define s ((((((((((((((((0

for drawing glyphs 16-bits wide.

Then the above array is converted to a glyph pattern of a StopWatch.

How do we draw those glyphs on the screen without using the graphics? Is there any method to draw the glyph patterns of other objects like outline of maps, face of a person roughly without having to plot each of the pixels, and without using the regular C graphics?

Are there any algorithms that were followed?

  • 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-16T00:46:48+00:00Added an answer on May 16, 2026 at 12:46 am

    There is just a few lines of code missing:

    int main()
    {
        int i,j;
        for ( i=0;stopwatch[i];i++ )
        {
            for ( j=1<<16;j;j>>=1 ) printf("%c",stopwatch[i]&j?'o':' ');
            printf("\n");
        }
    }
    

    voila, stopwatch:

          ooooo   oo 
        ooooooooo ooo
       ooo     ooo oo
      oo         oo  
      oo         oo  
     oo           oo 
     oo           oo 
     oo ooooo     oo 
     oo     o     oo 
     oo     o     oo 
      oo    o    oo  
      oo    o    oo  
       ooo     ooo   
        ooooooooo    
          ooooo      
    

    The define statements are a shorthand to arrive at the magic values in that list:

    $ gcc -E -x c -
    #define X )*2+1
    #define _ )*2
    #define s ((((((((((((((((0 
    
    s _ _ _ _ _ _ X X X X _ _ _ _ _ _
    
    // will be preprocessed to:
    ^D
    
    ((((((((((((((((0 )*2 )*2 )*2 )*2 )*2 )*2 )*2+1 )*2+1 )*2+1 )*2+1 )*2 )*2 )*2 )*2 )*2 )*2
    

    That last blurb is an expression which leads to some value (in this case 960 or 0x03c0) you could use in that “stopwatch” list.

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

Sidebar

Related Questions

I have just read this interesting article about the implementation details for various languages
I have read this post about how to test private methods. I usually do
I have read the documentation on this and I think I understand. An AutoResetEvent
I have to read a txt file with lines formated like this: 1: (G,
I have quickly read over the Microsoft Lambda Expression documentation. This kind of example
I just started to read about this new technology... Does someone have some knowledge
I usually do not have difficulty to read JavaScript code but for this one
I have this function to read in all ints from the file. The problem
well i have this messages table with sample values like these: msg_id recipient_id read
I am sure I have read this somewhere, Can anyone tell me what the

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.