Code Monkey home page Code Monkey logo

code-rain's Introduction

Code-rain

使用linux C语言实现数字雨,类似于《黑客帝国》屏幕上显示流动的数字;

本项目所使用的linux系统版本为:Linux version 3.13.0-24-generic,32位;

编程时需要ncurses.h 头文件,打开usr/include,若没有则打开终端输入命令来安装ncurses:sudo apt-get install libncurses5-dev libncursesw5-dev

使用gcc编译;

运行结果仅为个人学习展示,实际效果可能并不理想。

编程思路:

1.确定屏幕的长宽xy,坐标轴顶点在左上角;

2.将代码雨分解成一个一个队列,每个队列包含n个节点,队列起始位置在x轴上,每个队列起始位置不重叠,队列依次在y轴加1,形成“下雨”效果;

3.当队列到达y轴最大值后,丢弃队列头节点 ,然后在尾节点插入新节点 ,循环往复。

原理示意图:

https://img-blog.csdnimg.cn/20190912162701315.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dhbmdxaW5nY2h1YW45Mg==,size_16,color_FFFFFF,t_70

运行效果:

https://img-blog.csdnimg.cn/2019091216243850.gif

版本记录:

2019.9.12 初次提交 V1.0

标星次数:

Stargazers over time

code-rain's People

Contributors

fyw4 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.