Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --------------------------------------------------------------------------------------------------------------------------------
- Author 0xNOP
- 1ST Version:
- --------------------------------------------------------------------------------------------------------------------------------
- "STRING""STR"#"Found!":A "Woops! Nothing Found!":B;;-1>AB? e# Try it out at: https://is.gd/q4527m
- --------------------------------------------------------------------------------------------------------------------------------
- "STRING" # Pushes String Literal onto the Stack | String to Search
- "STR" # Pushes String Literal onto the Stack | String to Find
- # # Find Index (returns [index] if found, else returns [-1])
- "Found!":A # Store String literal in variable [A]
- "Woops! Nothing Found!":B # Store String literal in variable [B]
- ;; # Removes Two Top Most items from Stack
- -1> # Verifies if the top element from Stack is [-1]
- AB # If [-1] then [A] is pushed next, else [B] is pushed instead.
- ? # Performs [IF]
- --------------------------------------------------------------------------------------------------------------------------------
- 2ND Version:
- --------------------------------------------------------------------------------------------------------------------------------
- "STRING""STR"#-1>"Found!""Woops! Nothing Found!"? e# Try it out at: https://is.gd/IyhuX4
- --------------------------------------------------------------------------------------------------------------------------------
- Code Explanation is basically the same thing as Version 1, the only thing that changes is that variables are not used anymore.
- --------------------------------------------------------------------------------------------------------------------------------
- 3RD Version:
- --------------------------------------------------------------------------------------------------------------------------------
- l:Al:B;;AB#-1>"Found!""Woops! Nothing Found!"? e# Try it out at: https://is.gd/K8WFVE
- --------------------------------------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement