# Exercises

For the exercises on this page, you will need to use the NaNoPy package.

Each exercise carries the difficulty level indication:
- [*] Easy
- [**] Moderate
- 🖌️ Uses the NaNoPy graphical environment

```{important}
Do **all** NaNoPy exercises (🖌️), whatever their difficulty level. They build on each other, so skipping one makes the next ones harder.
```

`````{exercise} [**] Moving particles 🖌️
:class: dropdown

{download}`Download this exercise.<../coding-exercises/chapter-14-biomolecular/01_Moving_particles.py>`

```{include} ../coding-exercises/chapter-14-biomolecular/01_Moving_particles_rendered.md
```

`````

`````{exercise} [**] Simulation of moving objects 🖌️
:class: dropdown

{download}`Download this exercise.<../coding-exercises/chapter-14-biomolecular/02_Moving_objects.py>`

```{include} ../coding-exercises/chapter-14-biomolecular/02_Moving_objects_rendered.md
```

`````

`````{exercise} [**] Keeping an object within the screen 🖌️
:class: dropdown

{download}`Download this exercise.<../coding-exercises/chapter-14-biomolecular/03_Object_within_screen.py>`

```{include} ../coding-exercises/chapter-14-biomolecular/03_Object_within_screen_rendered.md
```

`````

`````{exercise} [**] Random particle diffusion 🖌️
:class: dropdown

{download}`Download this exercise.<../coding-exercises/chapter-14-biomolecular/04_Particle_diffusion.py>`

```{include} ../coding-exercises/chapter-14-biomolecular/04_Particle_diffusion_rendered.md
```

`````

`````{exercise} [**] Particle collision 🖌️
:class: dropdown

```{figure} images/exercise-collision.svg
---
height: 400px
name: collision
---
```

{download}`Download this exercise.<../coding-exercises/chapter-14-biomolecular/05_Collision.py>`

```{include} ../coding-exercises/chapter-14-biomolecular/05_Collision_rendered.md
```

`````

`````{exercise} [**] Escape the container and monitor the situation 🖌️
:class: dropdown

{download}`Download this exercise.<../coding-exercises/chapter-14-biomolecular/06_Escape.py>`

```{include} ../coding-exercises/chapter-14-biomolecular/06_Escape_rendered.md
```

`````

`````{exercise} [**] Collisions between many particles 🖌️
:class: dropdown

```{figure} images/many-particle-collisions.svg
:alt: Particles of two colors are connected with arrows to indicate interactions. If every pair is connected (left) there are many operations. If only spatially close pairs are connected, there are fewer operations.
:name: many-particle-collisions

The `get_close_pairs` and `apply_to_close_pairs` functions select particles that are spatially close for further computation.
```

{download}`Download this exercise.<../coding-exercises/chapter-14-biomolecular/07_Many_particle_collisions.py>`

```{include} ../coding-exercises/chapter-14-biomolecular/07_Many_particle_collisions_rendered.md
```

`````
