gonna try doing the c stuff in odin

This commit is contained in:
Emanuel Rodriguez 2023-08-16 23:22:36 -07:00
parent 08a4142b4a
commit bd0fc7054d
1 changed files with 20 additions and 0 deletions

20
odin/main.odin Normal file
View File

@ -0,0 +1,20 @@
package main
import "core:fmt"
linear_search :: proc(arr: []int, len: int, needle: int) -> bool {
for index, val in arr {
if val == needle {
return true;
}
}
return false;
}
main :: proc() {
fmt.println("hello there here is a for loop");
values: []int = {1, 2, 3, 4, 5};
res: bool = linear_search(values, 5, 2);
fmt.println(res);
}