GithubHelp home page GithubHelp logo

ella-emc / lottery_craze Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 36 KB

This repository contains an implementation in C and Python of a lottery machine. The program reads entries from a file and writes the winning entries to a separate file.

C 76.73% Python 23.27%

lottery_craze's Introduction

lottery_craze

This repository contains an implementation in C and Python of a lottery machine. The program reads entries from a file and writes the winning entries to a separate file.

There are two C source files in this repository. The first one is the initial version instructed to us in our Programming I class. It doesn't use arrays to read the integers in the input file.

Originally, the C source file reads a .in file and not a CSV file. However, to accommodate to both the C and Python implementations of this program, I decided to tweak the original C source file to be capable of reading and writing CSV values. The principles and algorithm used in the C implementation are fundamentally similar to the ones used in the Python implementation.

The dataset used as input to the program was sourced from Sohier Dane on Kaggle. This link leads to the Kaggle dataset. All the numbers in the dataset are winning lottery numbers in the state of New York since 2001.

Some remarks on the C implementation:

  • Upon execution, the user is asked for a lottery six-number combination.
  • The program checks if each number is within the range of 1 to 59. If false, program terminates.
  • If the input is valid, the program will now read through the lines in the dataset, looking for six-number, five-number, four-number, and three-number matches.
  • Each number of matched combination in the dataset is written in another CSV file containing the information from the dataset. In other words, when there are three matched numbers between the input and the data from the file, the number from the dataset will be written in another file containing three-number winning combinations. And so on.
  • This program assumes that each number is unique. (There is no repeating number in each line.)

Remark on the Python implementation:

  • Only the combinations with winners will have a file written specifically for it, unlike in the C implementation where every number of combination yielded a file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.