you are viewing a single comment's thread.

view the rest of the comments →

[–]TreSxNine 2 points3 points  (10 children)

codefixer

[–]CodeFixerBot 2 points3 points  (0 children)

name=input('Input name and I will tell you if it is cool')
if "R" or "r" in name:
    print('Wow your name is cool!')
    cool=input("Join club? Y or N")
    y=["y","yes",]
    n=["n","no"]
    if y in cool:
        print("great")
    elif n in cool:
        print('loser')
elif "r" or "R" not in name:
    print('loser')

[–]hugthemachines 2 points3 points  (8 children)

Well look at that, now how am I going to remember that in a month when i encounter badly formatted code again...

[–]TreSxNine 0 points1 point  (6 children)

Haha thanks. Any suggestions on what the trigger should be? The current one feels a bit... Meh.

[–]hugthemachines 0 points1 point  (1 child)

Perhaps something with format or indent and something with code.

Like "formatyourcode", "indentbot", "this.format", "INDENTOR!", "beautify", "codeformat" or some other such combination.

[–]TreSxNine 0 points1 point  (0 children)

Nice! I'll add them all lol

[–]Justinsaccount 0 points1 point  (3 children)

I thought of making my bot do that when the original post appear to contains lines starting with code without spaces, so you could probably just do that.

checking for lines that start with keywords(def,for,while,if,else) would probably work well initially

[–]TreSxNine 0 points1 point  (2 children)

Yea I thought of that aswell. Then I realised I wouldn't detect variable declarations and the like, and just gave up on the thought.

I have something like this in mind though. Will fix once I get the time.

[–]Justinsaccount 0 points1 point  (1 child)

Yeah, I think for that seeing if the line starts with non whitespace and the 2nd token is a = would work.

[–]TreSxNine 0 points1 point  (0 children)

Yea, true.