Git Product home page Git Product logo

dojo3's Introduction

Coding Dojo #3

A rust exercise to be done in a coding dojo.

The goal is to create a small intro.

Expectations

Give participants some Rust insight that will give them motivations to learn more. This is also an experimentation to know if this approach could help people to start and learn Rust.

Instruction

Part 1

  • Create a starfield.
    • โš ๏ธ (0,0) is not the screen center.
    • Stars are darker and smaller in the center of the screen.
    • Advice refactor to use modules.

Part 2

  • Create a sinus, rainbow scrolling text.
    • Advice refactor to use a builder pattern.

Build and run instructions

Run Locally (mainly for development purposes)

  1. Clone the project
  git clone https://github.com/uggla/dojo3
  1. Go to the project directory
  cd dojo3

Native

  1. Install Rust following the instructions here.

    Tips: the rustup method is the simplest one.

  2. Install required library for macroquad

  • Ubuntu system dependencies
apt install pkg-config libx11-dev libxi-dev libgl1-mesa-dev libasound2-dev
  • Fedora system dependencies
dnf install libX11-devel libXi-devel mesa-libGL-devel alsa-lib-devel
  • Windows and MacOS system
No dependencies are required for Windows or MacOS
  1. Run
cargo run --release

Wasm32 client

  1. Follow the above instruction of the native build.

  2. Install basic-http-server

cargo install basic-http-server
  1. Add the wasm32 compilation target
rustup target add wasm32-unknown-unknown
  1. Run
cargo build --target wasm32-unknown-unknown --release
  1. Serve the files and open the browser
basic-http-server
xdg-open http://127.0.0.1:4000

dojo3's People

Contributors

uggla avatar

Watchers

 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.