Author Topic: Tunnel Troubles  (Read 3057 times)

0 Members and 1 Guest are viewing this topic.

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Tunnel Troubles
« on: September 21, 2010, 02:05:51 am »
Yesterday, my time anyways, I got bored so I started working on a Tunnel game. I have an idea for how I'm going to do this all and everything but I can't get it to detect the edges correctly. I'm either detecting the row that hasn't been created yet or one row to far ahead. I can't figure out what I'm doing and I've been messing with this thing for like two hours just trying to get this to detect right.

Code: (Tunnel) [Select]
"**************→Str1 \\14 Asterisks
DelVar L116→dim(L1
6→S
5→A
8→X
10→W
1→L
For(F,0,6
Disp " \\Just a quote, no space.
End
Repeat 0
getKey→K
X+sum(⌂List(K={24,26→X
Disp sub(Str1,1,A)+sub("______",1,S)+sub(Str1,1,W-A \\6 Spaces
min(W-1,max(1,A+randInt(-1,1→A
A→L1(L
17-W+A→L1(L+1
Output(1,X,"V
If X=L1(L+2-14(L=13)) or X=L1(L+3-14(L=13
Stop
L+2
Ans-14(Ans=15→L
Pause \\This is just here to help testing/debugging.
End

This is not completed or optimized nor has all the things I want it to do. I just can't figure out what I'm doing wrong :(

So far I've tried modifying that check line to:

If X=L1(L+2-14(L=13)) or X=L1(L+3-14(L=13
If X=L1(L) or X=L1(L+1
If X=L1(L-2+14(L=1)) or X=L1(L-1+14(L=1

All to no avail. I thought that would check all the spots that it would be though because one would test one place ahead, one would test the uncreated line, and one tests some other line (either the last line created or two lines ahead, depending on the placement).

Anybody see where I am going wrong?

Thanks in advance.

Edit:
By the way, sorry that I keep coming to you guys lately to help me debug a few things.

Edit:
I think I might have just figured out what my problem was, and I feel like an idiot for not figuring it out sooner.

Edit:
Woo! Figured it out! Thanks anyone who tried to solve this mystery! Sorry for wasting your time though :(
« Last Edit: September 21, 2010, 03:17:50 am by meishe91 »
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

_player1537

  • Guest
Re: Tunnel Troubles
« Reply #1 on: September 21, 2010, 03:56:12 pm »
What was the incorrectness that was in your code?

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Tunnel Troubles
« Reply #2 on: September 21, 2010, 05:10:03 pm »
I realized that the elements that I needed to test were getting overwritten by the row that was yet to be created. So I just extended the list by two elements and that solved the problem.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Tunnel Troubles
« Reply #3 on: September 21, 2010, 11:03:07 pm »
Glad you got it fixed :)

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Tunnel Troubles
« Reply #4 on: September 21, 2010, 11:05:14 pm »
Ya, me too. I don't even remember how I thought of it :P Thing that sucks now is that there is a new bug that got produced from me fixing the other one. Which I can't think of how to fix it :(
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Tunnel Troubles
« Reply #5 on: September 21, 2010, 11:08:59 pm »
Sorry to hear x.x. I hate when that happens

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Tunnel Troubles
« Reply #6 on: September 21, 2010, 11:10:37 pm »
Good new though, fixed it :D Now should be completely bug free ;D
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Tunnel Troubles
« Reply #7 on: September 21, 2010, 11:18:47 pm »
Oh cool ;D

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Tunnel Troubles
« Reply #8 on: September 21, 2010, 11:21:42 pm »
Ya :) I just hope no more arise now :P
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)