# Create a list
mylist = []
# Add an element to the front or back
mylist.append( "abc" )
mylist.insert(0, "def")
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::ops::*; | |
#[derive(Default, Clone, Copy, Debug)] | |
pub struct Point2 { | |
pub x: f64, | |
pub y: f64, | |
} | |
impl Point2 { | |
pub fn at( x : f64, y : f64 ) -> Self { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::ops::*; | |
#[derive(Default,Copy,Clone,Debug,PartialEq)] | |
pub struct IPoint2 { | |
pub x : i32, | |
pub y : i32, | |
} | |
impl IPoint2 { | |
pub fn at( x : i32, y : i32 ) -> Self { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use ipoint2::*; | |
#[derive(Clone,Debug)] | |
pub struct Matrix<T> { | |
cells : Box<[T]>, | |
pub width : i32, | |
pub height : i32, | |
} | |
impl<T : Copy + Default> Matrix<T> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
let mut i = "".into(); | |
std::io::stdin().read_line(&mut i); | |
let mut q:Vec<i8>= i.split(" ").map(|s|s.trim().parse().unwrap()).collect(); | |
loop { | |
if q[1]>q[3]{print!("S");q[3]+=1;} | |
let s = (q[0]-q[2]).signum(); | |
q[2] += s; | |
println!("{}", ["W","","E"][(s+1) as usize]); |
The desire of this proposal is to make a system that works with a minimal number of assets and a minimal syntax. It retains pixel crispness when possible, but still presents a usably sized display on all devices. It also optionally allows for using multiple images to get better clarity on multiple devices when a project can afford to produce multiple assets.
A user creates a single image.png
file and should be able to use this in the interface like this:
<Image ux:File="image.png"/>
This should work across all devices, that is ones with different screen densities. It won't be significantly larger or smaller if the target screen density differs. It produces a predictable UI layout.