objective c - Assigning pattern information to pictures (iOS) -
I'm new to iOS development world and I'm making a small (potential addictive) game. I know Python and HTML / CSS, so I will be able to face computer terms, but if you are able to explain any answer, then it would be good.
For a short time, on a screen in my game, let's assume this is 'Arrow Left, Arrow Right, Arrow Left' (as a picture). Then the user will have to repeat the pattern (in the right order) to proceed. I'm going to use the UIGestureRecognizer to call the boost function with the 'right' pattern The next step in my programming tells the pictures 'path'. The identifier will check that the user input is equal to the given pattern, but I need to see for the computer whether the pattern shown is input by the user (sorry it is misleading). In essence, what is the most effective way of identifying a computer if the pattern given by the user is similar to the one on the screen.
Thank you in advance,
<< p>
OK, so I actually forgot for the first time and updated it. First I had indicated that what method would match a sequence, if any, you already know the sequence, which makes it easy!
Let's make some assumptions:
- We are using enum
enum PatternType Note: I know Radhawa Ibrahim An enum is mentioned and it is defined as the size type
. However, you are actually doing "pattern recognition" like the sound, so the shape type
does not clearly define what the enum is, it might actually be in the pattern direction
Or gesture direction
. - You already have the ability to read gestures in result array & lt; PatternType & gt;
.
- You have a fixed array that represents the pattern to match. It is the array & lt; Array & lt; PatternType & gt; & Gt;
. In other words, now you are trying to match up against whom.
- Now you already mapping your images in these guidelines.
- You know the sequences are matched against you.
So we look at the brute force view. Cruel force approach is to store such pattern sequences (only one example):
pattern vector: [[pattern type ]] = [[Lift, lift, lift], / this sequence is 0. [Okay, ok, .right], // This sequence is 1 [lift, .write,. Best, .upa] // This sequence is 2 / more of your sequences here, to match against each line There is a sequence / as well as the pattern shown on the screen [ Down, .up, lift, .down, .user] // can be sequenced later on 35]
will be loaded with more clever JSON or plist, but this exercise will Has been left above.
Assume that you have the result:
var results: [pattern type] = [. Lift, .Right, .ight, .up]
You can be matched with ==
(no overloading is required for this setup , Because we have an array of PatternType
, which is already equal, because there is no related data in enum)
something like
// When you retrieve the pattern, [current whiteness] == results {// indicate success} Other {// failure sign}}
Where Current Whiteness
Let Sfedta which comes from a user.
Comments
Post a Comment