mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
examples: fix typos (#18229)
This commit is contained in:
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user