Coder Social home page Coder Social logo

snake's Introduction

贪吃蛇小游戏

最近在学习C,所以做一个纯C打造的贪吃蛇终端小游戏,由于MAC上windows的API都无法调用,所以寻找到了ncurses来实现控制终端.

使用的技术

  • C
  • Ncurses

实现效果(在src文件夹下)

  • 游戏准备界面:
    准备界面
  • 游戏中界面: 游戏中界面
  • 游戏结束界面: 游戏结束界面

运行方法

项目中的out文件即是我已编译过的程序,可直接在MAC终端运行,如修改可类似下方的指令编译运行

cd PieceOfCakeSnake
gcc Snake.c -o Snack.out -lncurses 
./Snack.out 

小结

在实现MAC上写终端贪吃蛇的时候遇到了很多问题,最重要的就是这个库的问题了,安装Ncurses一直报错,直到看到这篇文章才学会了在MAC上使用Ncurses.在此感谢这篇文章的作者. 也正是因此,我自己也写了一篇小博文来记录我的点滴:点我前往

声明: 用纯C写贪吃蛇只是为了学习交流,也让更多学C的新生能少走弯路,所以源代码大多打了注释,如有问题可以Issues交流.

snake's People

Contributors

shuwenhe avatar

Watchers

James Cloos avatar  avatar  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.