First Last

@a5rocks (787)
Motivation... Please give...
What do YOU think of repl.it's new homepage?
posted to Announcements by 21natzil

I like it personally, though I do agree with people's criticisms that it has a little too much white space. At the same time, I have not really spent much time looking at it, so take what I say with a grain of salt.

(somewhat) dead simple multiple dispatch
posted to Share by a5rocks

@Warhawk947 this is supposed to allow you to specify which functions get called on special types, so for example you could make a function foo that raises an error except when the type of the argument is list, in which case it would call a different function.

Shiritori Word Game (v1.0.0)!!!
posted to Share by IreoluwaRaufu

Errored when pressing enter on difficulty selection... maybe it should default to medium?

Also, I'm of the opinion the game shouldn't exit at the end, so you can see all the stats over time, which is pretty cool :D

help in indentation
posted to Ask by onkarbangar

The error means that you mixed spaces with tabs: don't do that. In this case, line 62 that you added uses spaces instead of the tabs used everywhere else. Go into your settings, switch your indentation style to tabs, then delete the spaces and replace them with tabs.

How to create a auto clicker?
posted to Ask by FilipH

I would look into AutoHotKey.

It's not on repl, but it should do exactly what you want it to.

What is the language you recommend the most? Why do you recommend it??
posted to Ask by enigma_dev

I personally really really recommend python. But then of course, python is also the only lang I know (other than a little js), so that doesn't say much.

As for why, it's because:
a) you have packages for many, many things
b) it's easy enough to pick up, and "pythonic" code is easy to read.

How to add beautifulsoup package
posted to Ask by anilreddy864

Make a requirements.txt file with beautifulsoup4 as the first line. Now at the top of your code write from bs4 import BeautifulSoup.

https://repl.it/site/docs/repls/packages#python

How do you host a server on replit?
posted to Ask by nt998302

@nt998302 Well, you use socket.io in node, or even websockets in python should set the server up. Though if you want to be able to look at the pages in python I would recommend "Flask" (there's a couple tutorials in the Learn board)

Default name challenge
posted to Ask by mkhoi

BitesizedMindlessComputationalscience ohhhhhhhhh boy here we go again

You know? I'm happy python has a NotImplementedError!

https://repl.it/@a5rocks/BitesizedMindlessComputationalscience lol

Kicking
posted to Ask by vuona4730

Fork the repl, and delete the original.

██ Empty ██
posted to Share by mat1

10/10 best game. This rating is completely unbiased.

This game made me reflect on my past, something not many games have done.

My repl stopped running randomly.
posted to Ask by NoelB33

It's because of this:

  applebefore = si.get_live_price("aapl")
  appleafter = si.get_live_price("aapl")
  if(applebefore == appleafter):
    pass

Try moving applebefore = ... to before the while loop, and update it whenever the stocks grow using applebefore = appleafter

Please help me figure out how to do this.
posted to Ask by ArtemPionov

Use elif instead of else. else is a blanket statement, it doesn't check a condition, while elif does.

[LUA] Is there a way to use lua for databases
posted to Ask by Altarias

https://github.com/pllua/pllua One of the first few results for Postgres integration with Lua.

But what exactly are you looking for?

Sorry that I didn't really notice what you were looking for on first glance...

How do I use for-each loops to print out only the books with a capital C in them?
posted to Ask by AshtonToland
for (String C: books)
{
 System.out.println(C);
 
}

This loop needs to have an if condition to check if C has a "C" in it. Maybe use something like string.indexOf and compare the result to -1?

✨HERE'S WHO WON OUR MUSIC HACKATHON!
posted to Announcements by katyadee

Nice job everyone!

Artificial Intelligence Competition
posted to Share by lydiahallie

@SPQR Seeing so little replies makes me sad. I'm going to share two of my impossible ideas for people to continue this chain. Here:

  • A random number generator, but AI
  • An 8-ball, but with infinite answers
    Please note I'm working on a more plausible idea related to an 8-ball.
Anything else to make it more simple? Or is it the Most simplest program?
posted to Ask by Bookie0

A couple nitpicks (my personal style here, don't mind me):

1) please no space between functions and arguments
2) single quotes look pretty nice vs double quotes.

If you wanted to make it maybe more understandable, I would do something like this:

HELLO_TEXT = 'Hello, dear fellow being!'

print(HELLO_TEXT)

That allows for easy edits without someone having to know what print does.

JS Assignment 13: Intro to Classes in Javascript
posted to Ask by maximussallam

Your checkPassword function needs to accept a string as an input, and compare it to the password. It would look something like so:

checkPassword = function(stringInput){return stringInput == this.password}

Any questions about the code?

ENOENT: no such file or directory, open '.env'
posted to Ask by lungera

That may not be possible for all I know. However, you can just use process.env.<VARIABLE NAME>

How do you save it to your computer
posted to Ask by MenaalH

left files menu -> three dots at top right -> download as zip -> extract -> put on usb

can I get help with this question please
posted to Ask by ayaanHasan

This is just a bunch of ifs. I'm sure you can do it.

LOGIN PAGE
posted to Ask by K1NGBOSS

The html should look something like this:

<form action="/login">
  <input type="text" placeholder="username">
  <input type="password" placeholder="password">
  <input type="submit">
</form>

which will send a GET request to YOUR_URL/login?username=USERNAME&password=PASSWORD

Can I change compiler switches?
posted to Ask by Jack_AdrianAdr1

Yes! right-click repl, click "open command palette", type "shell", press enter, type "clang++ main.cpp -compiler_options_here -o main", press enter, then type "./main".

UPDATE: It works for me :) (though I don't actually know if the compiler options actually change anything, but they should)

Also, you can upvote this feature request so maybe repl will add a more intuitive way : https://repl.it/feedback/p/visually-change-compiler-switches

Default name challenge
posted to Ask by mkhoi

@mkhoi Nope, still too scared.

the bitesized part is going to be the real challenge

Why are we here ?
posted to Share by DamianPieczykol

Sounds like a existential crisis to me... I recommend watching Kurzgesagt's existential crisis playlist to be even more existentially crisised.

But in all seriousness, please post this in share

What language?
posted to Ask by mkhoi

Python has all the features I need (thus far).

And this might be cheating, but Cython allows you to use C in Python too (if i remember correctly).

Python update??
posted to Ask by Kioriin

If you are unable to do something in Python 3.6.3, tell me (I can get you a Python 3.7 repl), but you should be able to do most things.

Software Design
posted to Tutorials by LeonDoesCode

And what would any tutorial be without mentioning the vast store of patterns http://wiki.c2.com/?PatternsForBeginners has. (Pretty obscure wiki though, very cool nevertheless)

Artificial Intelligence Competition
posted to Share by lydiahallie

@Stanlyhalo Wait are AIs von Neumann machines?