Compare commits
3 Commits
a39e4a780d
...
ee80b05d10
Author | SHA1 | Date | |
---|---|---|---|
ee80b05d10 | |||
2fab31d822 | |||
a7e050c351 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
IronGolem.asm
|
IronGolem.asm
|
||||||
IronGolem.🗿
|
IronGolem.🗿
|
||||||
|
tmp.*
|
||||||
|
14
src/contain_only.🗿
Normal file
14
src/contain_only.🗿
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
contain_only(to_big, to_find)
|
||||||
|
{
|
||||||
|
local tmp;
|
||||||
|
|
||||||
|
tmp = to_big;
|
||||||
|
loop
|
||||||
|
{
|
||||||
|
if ([tmp] == 0)
|
||||||
|
return 1;
|
||||||
|
if (strchr(to_find, [tmp]) == 0)
|
||||||
|
return 0;
|
||||||
|
tmp++;
|
||||||
|
}
|
||||||
|
}
|
10
src/strchr.🗿
10
src/strchr.🗿
@ -1,12 +1,12 @@
|
|||||||
strchr(str, c)
|
strchr(str, c)
|
||||||
{
|
{
|
||||||
local i = 0;
|
local start = str;
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
if ([str + i] == c)
|
if ([start] == c)
|
||||||
return (str + i);
|
return (start);
|
||||||
if ([str + i] == 0)
|
if ([start] == 0)
|
||||||
return (0);
|
return (0);
|
||||||
i++;
|
start++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
7
tests/contain_only.🗿
Normal file
7
tests/contain_only.🗿
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
main()
|
||||||
|
{
|
||||||
|
name = "contain_only";
|
||||||
|
|
||||||
|
test_num(contain_only("17", "0123456789"), 1, "");
|
||||||
|
test_num(contain_only("17a", "0123456789"), 0, "");
|
||||||
|
}
|
Reference in New Issue
Block a user