| Off Topic > Off Topic |
| Programming Megathread |
| << < (163/241) > >> |
| Foxscotch:
--- Quote from: TristanLuigi on August 11, 2016, 11:38:55 PM ---My problem is that my attention span is only a few days so I can never get big projects done. Does anyone have any advice to stay motivated? --- End quote --- make it something that you care about |
| Maxwell.:
i just coded a command into my discord bot, which i recoded all by myself in javascript --- Code: ---bot.on("message", function(message) { if(message.content.search("!mcalc") > -1) { var ans = math.eval(message.content.substring(7, 70)); bot.reply(message, ans); } } --- End code --- it uses the mathjs library and it basically does all your math problems like !mcalc sqrt(2) or a lot more, and I'm so proud of it because it has a ton of uses and it's my first time using a library |
| Foxscotch:
I love seeing people using node because I love node |
| ZSNO:
I edited my Discord bot library to use VLC for media playback instead of ffmpeg so that it doesn't have to download the entire source before playing. Also plays more formats. It was painful. Also added an animu op trivia from openings.moe because it seemed like a fun idea. --- Quote from: Glass Joe on August 11, 2016, 03:31:34 PM ----snip- --- End quote --- For emplace, you'll probably want to use push_back instead. If you're adamant on using emplace, you should be able to get it to work by using files.emplace(files.begin() + static_cast<int>(SPRITE_RING1),"bkahajsds"); files.begin() returns an Iterator at the beginning of the files vector, then you add the numeric value of SPRITE_RING1 to it to get to your desired position. Your last two errors are because you're switching based on a defined data structure instead of a variable. It's like trying to use switch(int). You need a "sprite_file usedSprite;" variable in your class that actually holds a value. Then you could use switch(usedSprite) |
| TristanLuigi:
--- Quote from: Foxscotch on August 11, 2016, 11:40:36 PM ---make it something that you care about --- End quote --- It's usually something that I care about at the time but not after a few days. Maybe it's just a perspective thing? I don't usually find the actual programming to be fun, but I like making things. Any tips for actually enjoying the grunt work? |
| Navigation |
| Message Index |
| Next page |
| Previous page |