Code Monkey home page Code Monkey logo

snake_rust's Introduction

1.介绍

使用 Rust 语言编写的贪吃蛇游戏,适合新手练手的小项目。

2.使用

# 1.clone 该项目
git clone [email protected]:d
dx533534/snake_rust.git
# 2.进入根目录
cd snake_rust
# 3.直接运行
cargo.run

运行后,会直接在命令行中生成简易地图,按"方向键+回车"即可按照指定方向移动!如下视频所述:

2024-02-27.23.13.51.mov

3.相关特性

运用了许多Rust的基础特性,便于新手加深理解:

  1. 基础数据类型
  2. struct: 结构体
  3. enum: 枚举
  4. Vec: 动态数组
  5. ownership: 所有权
  6. method/function: 方法和函数
  7. trait /trait object: 特征和特征对象
  8. Result: 错误处理和传播
  9. mod / module: 包和模块

snake_rust's People

Contributors

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