/brute_force_prime_search

A short exercise to introduce people to the Rust programming language

Primary LanguageRustMIT LicenseMIT

Searching primes by brute force

This code is ment to be an exercice to teach rust and give a first impression on how to work with the language during the training in Club Robot INSA Toulouse.

The objective is to make a bigger problem that the proposed exercices and teach a lot of the basic "wired" concepts of rust:

  • non mutable variables
  • what are macros (not how to use them)
  • type inference
  • variable shadowing
  • borrow-checker
  • modules
  • private modules by default
  • u32 vs i32
  • Option and Result
  • match
  • turbo-fish operator (parse::<u32>) (https://turbo.fish/)
  • iterators
  • terminal user input

This exercise lacks mostly async rust, multithreading and most importantly rust all powerful enums.

It is the continuation of the conference given as an introduction to the Rust language. You can find the presentation in my website: Presentation;

Contributing

If you have any more ideas of good exercises to practice basic rust concepts, or you find any way of making the code better just create an Issue se we can talk about it! Thanks 😊.

Licence

Even if it's under MIT licence if yo ever use this code as exercice every mention will be apreciated.