- Joined
- Jan 27, 2015
- Messages
- 4,997
- Reaction score
- 5,909
- Trophies
- 1
- Location
- Behind a screen reading news
- XP
- 4,982
- Country

I don't really like to indent lua. Looks prettier non indentedINDENT YOUR CODE PLS![]()

I don't really like to indent lua. Looks prettier non indentedINDENT YOUR CODE PLS![]()
Please right your code inI got images to show doing this. I I hope it helps!
![]()
--------------------- MERGED ---------------------------
.png's will also work
here

Please right your code inCode:Code:here
Background = Screen.loadImage(System.currentDirectory().."/img/bg.bmp")
red = Color.new(255,0,0)
-- Setting up stuff
while true do
Screen.waitVblankStart()
Screen.refresh()
pad = Controls.read()
if (Controls.check(pad,KEY_START)) then
System.exit()
end
-- Adding the images/text
Screen.drawImage(0,0,Background,TOP_SCREEN)
Screen.drawImage(0,0,Background,BOTTOM_SCREEN)
Screen.flip()
end
-- Making the story
Screen.debugPrint(40,155,"Press A to start",red,BOTTOM_SCREEN)
Screen.flip()
end
sorry by indent I thought you meant tabbingPlease right your code inCode:Code:here
If you meant me, yes, I did mean tabbing. I'm fairly sure no language looks "prettier" non-indented (uhh assembler maybe?). It helps with readability and understanding where everything begins and ends.Code:Background = Screen.loadImage(System.currentDirectory().."/img/bg.bmp") red = Color.new(255,0,0) -- Setting up stuff while true do Screen.waitVblankStart() Screen.refresh() pad = Controls.read() if (Controls.check(pad,KEY_START)) then System.exit() end -- Adding the images/text Screen.drawImage(0,0,Background,TOP_SCREEN) Screen.drawImage(0,0,Background,BOTTOM_SCREEN) Screen.flip() end -- Making the story Screen.debugPrint(40,155,"Press A to start",red,BOTTOM_SCREEN) Screen.flip() end
--------------------- MERGED ---------------------------
sorry by indent I thought you meant tabbing

I know- I have fixed it now. I'll clean it up later. I still think it looks better like this.If you meant me, yes, I did mean tabbing. I'm fairly sure no language looks "prettier" non-indented (uhh assembler maybe?). It helps with readability and understanding where everything begins and ends.
BTW there's a loose "end" in the code you posted.

I know- I have fixed it now. I'll clean it up later. I still think it looks better like this.

Challenge accepted! This homebrew will be released within the coming months - it is a port of Oregon trail.Do you know that if you write something like 1k lines of code in LUA without identing it, your code will be completely ununderstandable?
For example take CHMM2 source ( https://github.com/Rinnegatamante/CHMM2/blob/master/source/index.lua ) and make the code like no identation.
I challenge you to understand how it works and where loops, if clauses and functions ends.

Challenge accepted! This homebrew will be released within the coming months - it is a port of Oregon trail.

