parent
580cb74047
commit
339d7edc3c
|
@ -4,8 +4,8 @@ fn main() {
|
||||||
html := http.get('https://news.ycombinator.com')
|
html := http.get('https://news.ycombinator.com')
|
||||||
mut pos := 0
|
mut pos := 0
|
||||||
for {
|
for {
|
||||||
pos := html.index_after('https://', pos + 1)
|
pos = html.index_after('https://', pos + 1)
|
||||||
if pos == - 1 {
|
if pos == -1 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
end := html.index_after('"', pos)
|
end := html.index_after('"', pos)
|
||||||
|
|
|
@ -9,12 +9,14 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
struct User {
|
struct User {
|
||||||
|
mut:
|
||||||
first_name string
|
first_name string
|
||||||
last_name string
|
last_name string
|
||||||
age int
|
age int
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Context {
|
struct Context {
|
||||||
|
mut:
|
||||||
first_name ui.TextBox
|
first_name ui.TextBox
|
||||||
last_name ui.TextBox
|
last_name ui.TextBox
|
||||||
age ui.TextBox
|
age ui.TextBox
|
||||||
|
@ -26,6 +28,7 @@ struct Context {
|
||||||
fn main() {
|
fn main() {
|
||||||
mut ctx := &Context {
|
mut ctx := &Context {
|
||||||
txt_pos: 10
|
txt_pos: 10
|
||||||
|
window: 0// TODO
|
||||||
}
|
}
|
||||||
ctx.window = ui.new_window(ui.WinCfg {
|
ctx.window = ui.new_window(ui.WinCfg {
|
||||||
width: 500
|
width: 500
|
||||||
|
|
|
@ -18,7 +18,7 @@ fn main() {
|
||||||
if key == '' {
|
if key == '' {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
m[key] = m[key] + 1 // TODO m[key]++
|
m[key] = m[key] + 1// TODO m[key]++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Sort the keys
|
// Sort the keys
|
||||||
|
|
Loading…
Reference in New Issue