Quellcode durchsuchen

Start adding Github links.

Herbert Wolverson vor 5 Jahren
Ursprung
Commit
8d5af0c294
5 geänderte Dateien mit 44 neuen und 1 gelöschten Zeilen
  1. 37 1
      book/src/chapter_1.md
  2. 1 0
      book/src/chapter_2.md
  3. 2 0
      book/src/chapter_3.md
  4. 2 0
      book/src/chapter_4.md
  5. 2 0
      book/src/chapter_5.md

+ 37 - 1
book/src/chapter_1.md

@@ -106,7 +106,43 @@ Save, and go back to the terminal. Type `cargo run`, and you will be greeted wit
 
 ## Playing with the tutorials
 
-TODO: Git glone, and how to build and use the tutorials in this package.
+You'd probably like to play with the tutorial code without having to type it all in! The good news is that it is up on GitHub for your perusal. You need to have `git` installed (RustUp should have helped you with that). Choose where you would like to have the tutorials, and open a terminal:
+
+```bash
+cd <path to tutorials>
+git clone https://github.com/thebracket/rustrogueliketutorial .
+```
+
+After a while, this will download the complete tutorial (including the source code for this book!). It is laid out as follows (this isn't complete!):
+
+```
+───book
+├───chapter-01-hellorust
+├───chapter-02-helloecs
+├───chapter-03-walkmap
+├───chapter-04-newmap
+├───chapter-05-fov
+├───resources
+├───src
+```
+
+What's here?
+
+* The `book` folder contains the source code for this book. You can ignore it, unless you feel like correcting my spelling!
+* Each chapter's example code is contained in `chapter-xy-name` folders; for example, `chapter-01-hellorust`.
+* The `src` folder contains a simple script to remind you to change to a chapter folder before running anything.
+* `resources` has the contents of the ZIP file you downloaded for this example. All the chapter folders are preconfigured to use this.
+* `Cargo.toml` is setup to include all of the tutorials as "workspace entries" - they share dependencies, so it won't eat your whole drive re-downloading everything each time you use it.
+
+To run an example, open your terminal and:
+
+```bash
+cd <where you put the tutorials>
+cd chapter-01-hellorust
+cargo run
+```
+
+If you are using *Visual Studio Code*, you can instead use *File -> Open Folder* to open the whole directory that you checked out. Using the inbuilt terminal, you can simply `cd` to each example and `cargo run` it.
 
 ---
 

+ 1 - 0
book/src/chapter_2.md

@@ -698,6 +698,7 @@ fn main() {
 ```
 This chapter was a lot to digest, but provides a really solid base on which to build. The great part is: you've now got further than many aspiring developers! You have entities on the screen, and can move around with the keyboard.
 
+**The source code for this chapter may be found [here](https://github.com/thebracket/rustrogueliketutorial/tree/master/chapter-02-helloecs)**
 
 ---
 

+ 2 - 0
book/src/chapter_3.md

@@ -324,6 +324,8 @@ fn main() {
 }
 ```
 
+**The source code for this chapter may be found [here](https://github.com/thebracket/rustrogueliketutorial/tree/master/chapter-03-walkmap)**
+
 ---
 
 Copyright (C) 2019, Herbert Wolverson.

+ 2 - 0
book/src/chapter_4.md

@@ -279,6 +279,8 @@ pub fn player_input(gs: &mut State, ctx: &mut Rltk) {
 }
 ```
 
+**The source code for this chapter may be found [here](https://github.com/thebracket/rustrogueliketutorial/tree/master/chapter-04-newmap)**
+
 ---
 
 Copyright (C) 2019, Herbert Wolverson.

+ 2 - 0
book/src/chapter_5.md

@@ -545,6 +545,8 @@ If you `cargo run` your project, you will now have visible tiles as slightly cya
 
 TODO: SCREENSHOT
 
+**The source code for this chapter may be found [here](https://github.com/thebracket/rustrogueliketutorial/tree/master/chapter-05-fov)**
+
 ---
 
 Copyright (C) 2019, Herbert Wolverson.