First Last

@a5rocks (812)
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.

how do I add another page on my website that I am making?
posted to Ask by nianp

Go to the files (the top button in the left sidebar), click the one that has a page with a plus. Then name it what you want the page to be + .html, and then you can navigate to <url>/<name>.html!

For example, if you name it example.html, you can go to <url>/example.html.

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

(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

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

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

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.

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

██ 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.

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.
✨HERE'S WHO WON OUR MUSIC HACKATHON!
posted to Announcements by katyadee

Nice job everyone!

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.

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?

Online Remote Desktop
posted to Ask by Masy

TeamViewer, or some VNC thing.

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).

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

@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)

Kicking
posted to Ask by vuona4730

Fork the repl, and delete the original.

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.

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.

How can I make a discord bot stay online even after I close the page?
posted to Ask by hillsam001

https://www.codementor.io/garethdwyer/building-a-discord-bot-with-python-and-repl-it-miblcwejz#keeping-our-bot-alive

Follow the steps here to keep it alive.

EDIT: Please make sure your token is secure. Regenerate it, and then use a .env file to keep it secure. If people get your token, they can, for example, delete all the channels in every server it has access to. (if you don't want to secure your bot, just make sure it doesn't have the permissions to do anything disastrous)

[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?

Artificial Intelligence Competition
posted to Share by lydiahallie

@Stanlyhalo Wait are AIs von Neumann machines?