<commit_before>#![Piston](./images/piston-logo.png)

[![Build Status](https://travis-ci.org/PistonDevelopers/piston.svg)](https://travis-ci.org/PistonDevelopers/piston) [![Crates.io](https://img.shields.io/crates/v/piston.svg?style=flat-square)](https://crates.io/crates/piston) [![Crates.io](https://img.shields.io/crates/l/piston.svg)](https://github.com/PistonDevelopers/piston/blob/master/LICENSE)

A modular game engine written in Rust

Maintainers of Piston core libraries: @bvssvni

[Examples](https://github.com/pistondevelopers/piston-examples)

[Overview](https://github.com/PistonDevelopers/piston/wiki/Piston-overview)

[List of features](https://github.com/PistonDevelopers/piston/issues/668)

[List of games made with Piston](https://github.com/PistonDevelopers/piston/wiki/Games-Made-With-Piston)

[Piston online docs](http://docs.piston.rs/piston/piston/)

[How to contribute](https://github.com/PistonDevelopers/piston/blob/master/CONTRIBUTING.md)

[Discussion forum](http://discourse.piston.rs/)

## Start new project with Piston

You should know how to build "hello world" with Rust, see http://www.rust-lang.org/.

[How to install FreeType](https://github.com/PistonDevelopers/piston/issues/912)
Piston uses FreeType for font rendering.

### Drawing a red rectangle

Add [piston_window](https://crates.io/crates/piston_window) to your Cargo.toml, for example:

```
[dependencies]
piston_window = "0.42.0"
```

In "src/main.rs", type the following code:

```Rust
extern crate piston_window;

use piston_window::*;

fn main() {
    let window: PistonWindow =
        WindowSettings::new("Hello Piston!", [640, 480])
        .exit_on_esc(true).build().unwrap();
    for e in window {
        e.draw_2d(|c, g| {
            clear([1.0; 4], g);
            rectangle([1.0, 0.0, 0.0, 1.0], // red
                      [0.0, 0.0, 100.0, 100.0],
                      c.transform, g);
        });
    }
}
```
<commit_msg>Update README.md to latest piston_window<commit_after>#![Piston](./images/piston-logo.png)

[![Build Status](https://travis-ci.org/PistonDevelopers/piston.svg)](https://travis-ci.org/PistonDevelopers/piston) [![Crates.io](https://img.shields.io/crates/v/piston.svg?style=flat-square)](https://crates.io/crates/piston) [![Crates.io](https://img.shields.io/crates/l/piston.svg)](https://github.com/PistonDevelopers/piston/blob/master/LICENSE)

A modular game engine written in Rust

Maintainers of Piston core libraries: @bvssvni

[Examples](https://github.com/pistondevelopers/piston-examples)

[Overview](https://github.com/PistonDevelopers/piston/wiki/Piston-overview)

[List of features](https://github.com/PistonDevelopers/piston/issues/668)

[List of games made with Piston](https://github.com/PistonDevelopers/piston/wiki/Games-Made-With-Piston)

[Piston online docs](http://docs.piston.rs/piston/piston/)

[How to contribute](https://github.com/PistonDevelopers/piston/blob/master/CONTRIBUTING.md)

[Discussion forum](http://discourse.piston.rs/)

## Start new project with Piston

You should know how to build "hello world" with Rust, see http://www.rust-lang.org/.

[How to install FreeType](https://github.com/PistonDevelopers/piston/issues/912)
Piston uses FreeType for font rendering.

### Drawing a red rectangle

Add [piston_window](https://crates.io/crates/piston_window) to your Cargo.toml, for example:

```
[dependencies]
piston_window = "0.44.0"
```

In "src/main.rs", type the following code:

```Rust
extern crate piston_window;

use piston_window::*;

fn main() {
    let mut window: PistonWindow =
        WindowSettings::new("Hello Piston!", [640, 480])
        .exit_on_esc(true).build().unwrap();
    while let Some(e) = window.next() {
        window.draw_2d(&e, |c, g| {
            clear([1.0; 4], g);
            rectangle([1.0, 0.0, 0.0, 1.0], // red
                      [0.0, 0.0, 100.0, 100.0],
                      c.transform, g);
        });
    }
}
```

{'fraction_non_alphanumeric': 0.16938359653591442, 'fraction_numerical': 0.020376974019358125, 'mean_word_length': 3.7427536231884058, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 26, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4344022', 'n_tokens_mistral': 1574, 'n_tokens_neox': 1374, 'n_words': 246}