Giter Site home page Giter Site logo

wu_algorithm's Introduction

WU Algorithm

made by tmaluh (_ipal)

Testing Xiaolin Wu's line algorithm on C using SDL2.

screenshot

Randomized start and end lines positions on each ./wu_algo startup. If you wants to change randomatic lines counter - use flag --linesCounter(described below), default is: 10.

Requirements pre-installations:

Fedora:

$> sudo dnf install SDL2-devel-2.0.9-3.fc30.x86_64

MacOS:

$> brew install sdl2

Compiling

Use make for compiling all files.

When you have already installed SDL2 library you can use this simple rules:

  • make: Compile all. (On Fedora can require password if SDL2 libraries not installed)
  • make clean: Delete all ./wu_algo temporary(*.o) files.
  • make del: In this project equals to make fclean.
  • make fclean: Expands make clean to delete also executable ./wu_algo.
  • make re: It's rules - make fclean & make in one.
  • make pre: It's rules - make del & make in one.
  • make debug: Re-compile ./wu_algo without optimization flags but with -g3 for debug.

Keybinds:

Description Key
Re-random all line positions R
Exit. ESC

Flags:

Flag Description Shortcut Default value Param type
--maxLineLength Set max randomize line length. -mll equals to WIN_X Unsigned integer. (Min: 25; Max: equals to Default Value;)
--linesCounter Set how much lines radnomize, calculate and draw. -lc 10 Unsigned Integer. (Min: 1; Max: 1500000)
--foregroundColor Change foreground(lines) color. -fgc 0xffffff HEX string, starts with '0x'.
--backgroundColor Change background color. -bgc 0x0 HEX string, starts with '0x'.

Example:

$> ./wu_algo -lc 1000 -bgc 0xaa00ff -fgc 0x1ffff

screenshot2

wu_algorithm's People

Contributors

iipal avatar

Watchers

 avatar

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.