Skip to content

Count the occerances of every digit from zero to your chosen number. Plot results for cool fractal.

Notifications You must be signed in to change notification settings

johnsoupir/digits

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

image

Digits

A cool little C program to count the occerances of every digit from zero to your chosen number. This program was written with speed in mind. On my laptop it will run to 1 million in about 2 seconds. Graphing the results in GNUPlot produces an interesting pattern.

Usage

Complie with: gcc digits.c -o digits

Run with: ./digits <end-number>

Output is saved in a file, and is of the form:

<current number> <zeros in current> <zeros running total> <ones in current> <ones running total> ... <nines in current> <nines running total>

Cool video

A video of the results in an animated GNUPlot: https://youtu.be/xAPqNJ5Vm3Q

About

Count the occerances of every digit from zero to your chosen number. Plot results for cool fractal.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages