ID:2158633
 
(See the best response by Ter13.)
Code:Please help me bro


Problem description:http://prntscr.com/cspi3y

I tried helping but my comment was deleted, good luck.
)::
i cant delete comments so it must of been you http://prntscr.com/cspmbq
Best response
Your indentation is inconsistent.

Make it consistent.

Use tabs. Don't mix tabs and spaces.
i tried -_-
Do you know what indentation is? Do you know what inconsistent means?

One of these two, you don't know. So let's address that knowledge gap.
When you copy+paste code instead of typing your own code, you'll occasionally run into situations where spaces are meant to be tabs.


Also, you didn't tryed. You tried. Well, that's arguable anyways.

Inconsistent indentation. The indentation is not consistent. Meaning your code doesn't line up. See how lines 10-12 don't match with lines 13-20? Inconsistent indentation. Although, to be honest, this shouldn't be your primary concern and it should just be deleted altogether as you're going about a very flawed way to accomplish whatever you're trying to attempt.
Although, to be honest, this shouldn't be your primary concern and it should just be deleted altogether as you're going about a very flawed way to accomplish whatever you're trying to attempt.

We probably ought to focus on the compiler errors first before we get started on the guy for inefficient code. Struggling with syntax isn't quite the time for that. It'll come. Give the man time to get his feet wet.

Also, I'm not trying to be rude asking whether you know what the two words mean.

Hit CTRL+T in Dream Maker. The problem will become apparent very quickly.


click here to view full size image.


See those >> symbols? Those markers appear when you press Ctrl+T. Ctrl+T shows your tabs with those little characters.

They show up to show your indentation. Indentation is used in programming to mark the control path that code follows. In order for the computer to know what to do with your code, you have to use not only the correct words, numbers, but they must also be put in the correct places according to what you want the computer to do. Indentation is the WHERE code goes. We use the tab key to put code in the proper control path.

Inconsistent means that you aren't using a regular pattern. This means that your indentation pattern is confusing the compiler because you are mixing spaces and tabs.

Look at the screenshot of my code. See how the indentation is all consistent? The functions in that screenshot all have very different control paths, and as such the indentation pattern is different from function to function because of the placement of block-level statements like keywords, proc labels, while loops, if statements, and switch statements.

Your indentation is inconsistent. You need to fix it by making it consistent. You make the indentation consistent by removing the spaces and setting the lines to the proper level of indentation based on the control path of the function you are writing.

Just fixing it for you like I did last time is going to make the problem worse if you don't understand that copy/pasting code from the forums uses four spaces instead of one tab. You need to be able to do this. You've been given enough information to fix the problem. You don't need our help from here. We've given you all the information that we can at this point to help you help yourself.

In response to Ter13
OK I fixed it a little but these two lines of code I still need help on. I did not copy and paste, also I am Very new to coding and I know you guys are experienced and Experts at coding I appreciate the help and thankful for the support.


http://prntscr.com/csr8us
Examples for you.

mob/verb/Example1()
world << "1 tab needed"
if(1 == 1)
// 1 = 1 so it's TRUE
world << "2 tabs needed"
else
world << "2 tabs needed"

mob
verb/Example2()
world << "2 tabs needed"
if(1 == 1)
// 1 = 1 so it's TRUE
world << "3 tabs needed"
else
world << "3 tabs needed"

mob/verb
Example3()
world << "2 tabs needed"
if(1 == 1)
// 1 = 1 so it's TRUE
world << "3 tabs needed"
else
world << "3 tabs needed"
mob
verb
Example4()
world << "3 tabs needed"
if(1 == 1)
// 1 = 1 so it's TRUE
world << "4 tabs needed"
else
world << "4 tabs needed"
On a related note, I really wish I could simply use tab characters instead of non-breaking spaces in the code blocks. Unfortunately, not all browsers are down yet with the option to change the number of spaces per tab, and I won't allow an 8-space tab on principle.
I'd be happy if pressing the tab button in the input box would put in a tab. It's really simple javascript, but like you said, freakin' 8-space tabs ruining everything.
Why can't you just intercept a copy event that begins and ends inside of the code element using javascript? Then you can just perform a quick regex to swap the characters with tabs out.

The clipboard API is pretty robustly supported by modern browsers now.