Skip to content

Commit 42905ce

Browse files
committed
feat: add hashtable example
1 parent ed6ee15 commit 42905ce

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<link rel="icon" type="image" href="https://avatars.githubusercontent.com/t/6609725?s=280&v=4" />
5+
<link rel="icon" type="image" href="src/assets/logo.png" />
66
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
77
<title>Pivot Lang</title>
88
</head>

src/constant/monacoCodes.ts

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,26 @@ pub fn count(mp: [[i64]]) i64 {
129129
}
130130
return res;
131131
}
132-
133-
134-
132+
135133
`,
136134
},
135+
{
136+
title:"hash table",
137+
code:`use std::cols::hashtable;
138+
use core::panic::assert;
139+
use core::hash::Hash;
140+
use core::eq::*;
141+
142+
fn main() i64 {
143+
let table = hashtable::new_hash_table<string|string>(10 as u64, 1 as u64);
144+
table.insert("hello","world");
145+
table.insert("bye","bye");
146+
assert(table.get("hello") is string);
147+
let v = table.get("hello") as string!;
148+
assert("world".eq(&v));
149+
return 0;
150+
}
151+
152+
`
153+
}
137154
];

0 commit comments

Comments
 (0)