examples: fix typos (#18229)

This commit is contained in:
Turiiya 2023-05-25 15:54:46 +02:00 committed by GitHub
parent caee3935a5
commit 993546a0a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 89 additions and 89 deletions

View file

@ -9,7 +9,7 @@ pub mut:
valid bool
}
pub struct ImageWritter {
pub struct ImageWriter {
settings ImageSettings
pub mut:
writer PPMWriter
@ -17,19 +17,19 @@ pub mut:
buffer []ValidColor
}
pub fn new_image_writer(mut writer PPMWriter, settings ImageSettings) &ImageWritter {
pub fn new_image_writer(mut writer PPMWriter, settings ImageSettings) &ImageWriter {
total_pixels := settings.width * settings.height
mut buffer := []ValidColor{len: total_pixels, init: ValidColor{
valid: false
}}
return &ImageWritter{
return &ImageWriter{
writer: writer
settings: settings
buffer: buffer
}
}
pub fn (mut iw ImageWritter) handle(result sim.SimResult) !int {
pub fn (mut iw ImageWriter) handle(result sim.SimResult) !int {
total_pixels := iw.settings.width * iw.settings.height
// find the closest magnet

View file

@ -21,7 +21,7 @@ pub fn (mut state SimState) satisfy_rope_constraint(params SimParams) {
pub fn (mut state SimState) increment(delta_t f64, params SimParams) {
// 1. add up all forces
// 2. get an accelleration
// 2. get an acceleration
// 3. add to velocity
// 4. ensure rope constraint is satisfied

View file

@ -9,7 +9,7 @@ pub struct Vector3D {
z f64
}
// vector creates a Vector3D passing x,y,z as parameteres
// vector creates a Vector3D passing x,y,z as parameters
pub fn vector(data Vector3D) Vector3D {
return Vector3D{
...data