Search
From Hack Wars Wiki
Outdated, should be deleted. - aoi
| Challenge Information for Search | |
| Challenge | Search |
| Code | 11 |
| Input Example | Hello, Hi, Hack, n00b, Hello, What (String) |
| Output Example | 3 (Int) |
| Level | 0 |
| Profit | $0 |
| Experience | 0 to each stat |
| Description | Return the index of a given string. |
Solution
string searchFor = getInputString(); int i = 1; while(i < getInputStringCount()) { if(equal(getInputString(),searchFor)) { setOutputInt(i - 1); } i++; } |
