title: What algorithm can I use to turn a drunkards walk into a correlated RNG?
body: <p>I'm a novice programmer (the only reason I say this is because I'm not super familiar with all the terms yet) and I'm trying to make walls generate in respect to the wall before it. I've posted a question about it on here before </p>
  
  <p><a href="https://stackoverflow.com/questions/23301197/randomly-generated-tunnel-walls-that-dont-jump-around-from-one-to-the-next">Randomly generated tunnel walls that don&#39;t jump around from one to the next</a></p>
  
  <p>and sort of got the answer. What I was mainly looking for was the for loop that was used (I think). Th problem is I didn't know how to implement it properly without getting errors.</p>
  
  <p>My problem ended up being "I couldn't figure out how to inc. this in to it. I have 41 walls altogether that i'm using and the walls are named Left1 and Right1. i had something like this</p>
  
  <pre><code>CGFloat Left1 = 14; for( int i = 0; i &lt; 41; i++ ){ 
  CGFloat offset = (CGFloat)arc4random_uniform(2*100) - 100; 
  Left1 += offset; 
  Right1 = Left1 + 100;
  </code></pre>
  
  <p>but it was telling me as a yellow text that Local declaration of  "Left1" hides instance variable and then in a red text it says "Assigning to 'UIImageView *__strong' from incompatible type 'float'. i'm not sure how to fix this"</p>
  
  <p>and I wasn't sure how to fix it. I realize (I think) that arc4random and arc4random_uniform are pretty much the same thing, as far as i know, with slight differences, but not the difference i'm looking for. </p>
  
  <p>As I said before, i'm pretty novice so any example would really be helpful, especially with the variables i'm trying to use. Thank you.</p>