Skip to content

lexfrei/Find-Pi-by-random

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

NAME

Find-Pi-by-random - Find Pi by random shots

SYNOPSIS

main [options]

DESCRIPTION

The number π is a mathematical constant, the ratio of a circle's circumference to its diameter, commonly approximated as 3.14159.

This program makes the "shots" in the square and finds hits in relation to all the inscribed circle "shots".

This program was test from interview to Прогрэдис, Russian IT company. One my friend sends this to me: You have foursquare and inscribed circle, you have to do random shots to the foursquare and find Pi.

OPTIONS

-r=INT

Set circle size

-shots=INT

Set shots count

SAMPLE OUTPUT

Radius   = 10000000
Shots    = 10000000
Pi       = 3.141492
Accuracy = 0.999968
Time     = 779.1206ms

Releases

No releases published

Packages

No packages published

Languages