| Off Topic > Off Topic |
| Programming Megathread |
| << < (37/241) > >> |
| Bow:
I "know" (dependent on how much of a butt you are) 4 coding languages (listed on how much I know them) Torque: --- Code: ---function whatever(%stupid) { %stupid = 5; if (%stupid == 5) { echo("im good at coding"); } } whatever(); --- End code --- --- Code: ---LUA local a = 10 if a == 10 then print('I suck at coding') --- End code --- specifically roblox lua. --- Code: --- while true do game.Workspace.base.BrickColor = BrickColor.Red() wait(0.1) game.Workspace.base.BrickColor = BrickColor.Blue() wait(0.1) game.Workspace.base.BrickColor = BrickColor.Green() wait(0.1) game.Workspace.base.BrickColor = BrickColor.Black() wait(0.1) game.Workspace.base.BrickColor = BrickColor.Yellow() end --- End code --- python: --- Code: ---print('butts are' %s) % stupid poopiscrap = 5 print('i like' poopiscrap) --- End code --- I haven't really done python in a while, so.... Java: --- Code: ---int x = 10 int y = 10 System.out.printIn(x "is also" y) --- End code --- Again, I haven't done Java in a LONG time. |
| Foxscotch:
--- Quote from: Bow on December 13, 2015, 04:32:17 PM ---python: --- Code: ---print('butts are' %s) % stupid poopiscrap = 5 print('i like' poopiscrap) --- End code --- I haven't really done python in a while, so.... Java: --- Code: ---int x = 10 int y = 10 System.out.printIn(x "is also" y) --- End code --- Again, I haven't done Java in a LONG time. --- End quote --- neither of these will work in python, string interpolation like that, with a %, isn't really used. even if it was, that's still not a valid way to do it instead, you'd need to write print('butts are {0}'.format(stupid)) and that of course assumes that stupid is a real variable the java one won't work because java requires a class with a main method. you'd have to write this instead: public class Whatever { static void main(String[] args) { int x = 10; int y = 10; System.out.println(x + " is also " + y); } } I don't think the stuff you had in the println call would work either, but I don't have compiler on hand to check. it probably wouldn't though also you have to have semicolons |
| Otis Da HousKat:
I think programming is lame unless it is interacting with something in the physical world. I get ads sometimes on Facebook to apply to become an advertisement software engineer for AOL accompanied by a video with employees talking about how great it is to work there. It annoys me because I wonder what kind of tool aspires to use their skills to support a machine to bother end users and stuff executive pockets, especially for an "off brand" company like AOL. I just looked it up and apparently AOL was bought by Verizion this past summer. That reminds me of how one of my friends from university got an engineering job with Verizon when he graduated and immediately started guzzling that corporate kool aid. Sharing stories about captains of industry, how poor people suck, defending anti-net neutrality laws, and other similar things. |
| Flame:
--- Quote from: Foxscotch on December 13, 2015, 05:36:50 PM ---public class Whatever { static void main(String[] args) { int x = 10; int y = 10; System.out.println(x + ' is also ' + y); } } --- End quote --- java string literals are surrounded in ", not '. character literals are surrounded with ', but otherwise yeah this is right |
| otto-san:
i've never really worked extensively with java, but will that code not throw an error because you're trying to concatenate an int with a string? or is that just implied in java? |
| Navigation |
| Message Index |
| Next page |
| Previous page |