Giter Club home page Giter Club logo

rust-exercises's Introduction

Rust exercises

Rustの基本的な文法と、考え方を学ぶためのエクササイズ集です。

番号 内容 フォルダ名
1 Hello world hello_world
2 所有権に関するもの ownership
3 参照に関するもの reference
4 変更可能な参照に関するもの mutable_reference
5 nullを返す可能性のある関数 option
6 エラーを起こす可能性のある関数 result
7 ライフタイムとスコープについて lifetime-and-scope
8 ライフタイムと関数について lifetime-and-function
9 動的計画法に関するもの fibonacci
10 ユーザ定義型に関するもの cart
11 イテレータとクロージャに関するもの iterator

楽しみ方

  1. exercisesフォルダを開く
  2. エクササイズを選ぶ
  3. そのエクササイズのフォルダをターミナルで開く
  4. src/main.rsをエディタ/IDEで開く
  5. Enjoy!

Cargoを使ったコンパイル

コンパイルはcargoコマンドを使って行います。 使い方は次をご覧ください。

$ cargo build # デバッグビルドの作成
$ cargo build --release # リリースビルドの作成
$ cargo run # ビルド後、コマンドライン引数なしで起動
$ cargo run -- -c -o foo.txt bar.txt 
# -c -o foo.txt bar.txt を引数に指定して、ビルドしたプログラムを起動

エクササイズの準備

  1. rustupを使ってRustの環境を整えてください。詳細はこちらをご覧ください
  2. 手に馴染んだエディタ / IDEを用意してください
  3. このレポジトリを手元に持って来てください

Acknowledgement

エクササイズ1, 2, 3, 4はintorustにあるものを参考にさせていただきました。

LISENCE

MIT

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.