okay so I'm building a fishing script and need a little help.
right now the problem is comparing 2 arrays.
basically i have @bait_info which holds a list of fish that the bait attracts, and @local_info which has a list of the fish at the location. What I need is for both arrays to be checked and if a fish is in both arrays to be put into a new one @possible_catch.
not sure how to do this without 300 lines of code....any suggestions?
EDIT: Never mind, i found how to do it. it was pretty simple. @pc = @bait & @local. what ever is common in both arrays is put into the new array. Hurray learning!
okay so I'm building a fishing script and need a little help.
right now the problem is comparing 2 arrays.
basically i have @bait_info which holds a list of fish that the bait attracts, and @local_info which has a list of the fish at the location. What I need is for both arrays to be checked and if a fish is in both arrays to be put into a new one @possible_catch.
not sure how to do this without 300 lines of code....any suggestions?
EDIT: Never mind, i found how to do it. it was pretty simple. @pc = @bait & @local. what ever is common in both arrays is put into the new array. Hurray learning!
Edited by dolarmakShare this post
Link to post
Share on other sites