Repl Talk
A friendly platform to share and discuss all things repl.it
Announcements
Updates from the Repl.it team about the product
Pinned
DEVELOPER SPOTLIGHT #05: Forget school, just teach yourself.
Aloha, friends! Today, I’m writing from the beautiful island of Oahu and I am very pleased to welcome you all to another edition of our **Developer Spotlight** series! ![tumblr_inline_mlud44tb6c1roozkr](https://storage.googleapis.com/replit/images/1560189460829_1a36e0a95df6ff771065becc95a04552.gi) *image compliments of Tumblr* We sat down with one of my favorite community members, @superwhiskers. Some of you might already know @superwhiskers as the golang teacher of our [Discord](https://repl.it/discord) server’s Language Learning Club—but she *originally* got on my radar because of her [Undertale-themed tet chat](https://repl.it/@superwhiskers/undertale-textchat-thing). @katyadee: Hey there! Happy to have you here. I know you pretty well, but let’s start off with an introduction for the folks at home.
 @superwhiskers: Hello! I’m just a 16 year old programmer who lives in the U.S. There's not much else to it. @katyadee: I’ve wondered this for a long time… What’s the story behind your username? 
 @superwhiskers: It's just a tweaked version of an older username I had. I've used it for so long and it kinda just stuck.
 @katyadee: 😭 and here I thought it had some cool meaning behind it! Are you in school? 
 @superwhiskers: Yes. I take slightly more advanced-ish classes like (e.g. calculus), but I find it boring so anything that I really want to study I do on my own time. For example, I've been looking into studying something called category theory outside of school because it's more college level stuff. ![cat](https://storage.googleapis.com/replit/images/1560189510639_d7c03eef95699f27c68d2ba8cb71e4ee.jpe) @katyadee: What do you find boring about school? Also… what’s [category theory](https://en.wikipedia.org/wiki/Category_theory)? @superwhiskers: IDK, I just prefer learning things on my own, so I don't really bother paying too much attention and instead listen enough to learn the basis of what I need to learn and figure out the rest of my own. And I can't really explain category theory entirely, as I don't understand it entirely myself, and it also encompasses a bit that would be too much to explain here. I'd recommend doing a bit of your own research to explain it rather than having me do so. @katyadee: LOL, ok. Let’s talk programming. How’d you get into coding? How long have you been coding? @superwhiskers: I’ve been programming seriously for over a year now, but I’ve been doing programming longer than that (around 5 or so years) but nothing notable really came from that. @katyadee: What do you mean that you've been 'programming seriously' for over a year? What changed? @superwhiskers: I begun to understand the basics much better, and got really, really good at programming in golang. It was a substantial improvement from where I was a year ago. @katyadee: You are pretty good at golang. You actually lead the golang LLC group. You just self-taught? @superwhiskers: I just learned. I tend to read documentation and other things when I'm bored at school, so i guess I just passively absorb the information and put it to use. Go is also just a really simple language. There isn't much to learn about it so when you learn the base concepts you almost know the entire language. ![golang](https://storage.googleapis.com/replit/images/1560189523818_6e9ebed105948245147f0e5372551e4f.gi) @katyadee: What can I say, I’m still impressed. How’d you find Repl.it? @superwhiskers: I guess I was just looking for something to write code online with and I found it ¯\_(ツ)_/¯ @katyadee: Aw. No story, you really don't remember? @superwhiskers: There isn't really much that was really interesting, I just found it and decided to use it :) @katyadee: Ok. Ok. I guess I always expect people to have these cool stories. But usually, we were just the best IDE for their needs, haha. What’s your favorite language to code in and why? @superwhiskers: I don't really have "one favorite language" but I kinda like C for the amount of control it gives you while still being practical-ish to use for large things (unlike Assembly). @katyadee: C is pretty hard, isn't it? I don't know much about it, actually. What kind of things have you created in C? @superwhiskers: It isn't very hard (at least for me). It's just really verbose. I haven't done much, but I did meme and port crunch over to it and write a question function in it as part of a project to port one function to every language possible. (Seen [here](https://github.com/superwhiskers/question)) @katyadee: Based on what I know about you and your projects, you strike me as super capable and proactive. What’s one time you felt really challenged by something while programming and how’d you overcome it? @superwhiskers: I feel really challenged at finding the motivation to actually work on things. There aren't really many things I’ve found challenging while programming, but I absolutely suck at getting motivated to do something in the first place. I usually overcome it by just finding something else enjoyable to do and then come back instead of constantly working on project after project without doing something else to keep myself from getting fatigued. @katyadee: What do you think could help motivate you? @superwhiskers: Other people wanting to use what I make does a good job. @katyadee: I like that. I think I’m the same way with things I create. What are your plans for the future? Do you want to go into tech? If so, what kind? @superwhiskers: I plan to get some programming-related job, but I don't really know where :/ @katyadee: Hard to tell with that kind of thing, I think. You never know where you’ll end up! What would your dream job be, though? @superwhiskers: I don't really have one, I just want to be able to enjoy what I do @katyadee: You’re a lot more practical than I was at your age. I think my answer was something like, “Be a cartoonist,” and I had a really narrow idea of what that meant and where I wanted to work. Fulfilment as a goal… It’s like you’re 30, not 16! What’s your favorite thing that you’ve built, on or off Repl.it? @superwhiskers: Well, I have this kinda nice buffer library I've been working on recently that used a bunch of optimization techniques called crunch. It’s probably my best done library, but i think it can be better. [Here] (http://github.com/superwhiskers/crunch) it is. @katyadee: Can you explain what a buffer library is, for people who might not know? @superwhiskers: It's basically a region of data stored in memory. crunch actually uses an array under the hood, (an array can be thought of as a buffer, as it's just data) and edits it when you perform actions on it. @katyadee: What’s your favorite thing you’ve built on Repl.it? @superwhiskers: I tend to use Repl.it for smaller snippets of code when I'm away from my development setup, but I do have that [sanschat](https://repl.it/@superwhiskers/undertale-textchat-thing) thing that people seemed to enjoy. @katyadee: I really liked that one, too. What’s the story behind it? @superwhiskers: it was just a simple chat application I wrote when I was bored in school. There isn't much story behind it besides "it's a chat where all of the text boxes look like Sans Undertale.” ![sans undertale](https://storage.googleapis.com/replit/images/1560189569172_acabb24229dcaf9488f9eed8a51c46a8.jpe) @katyadee: What’s one piece of advice you’d give someone new to code? @superwhiskers: Learning at your own pace gives better results than having others dictate how you learn. Or at least that's how I've found it to work for me. @katyadee: You’re like a walking advertisement for why kids should drop out of school and become autodidacts. I hope you know that! Do you have any tech heroes? Who are they? Why? @superwhiskers: Not really. I see the point in having someone you look up to for inspiration, but I just don't really find anyone inspiring to me. Idolizing someone only sets you up for disappointment when you realize that nobody is perfect. @katyadee: That's a really interesting answer to this question... I kind of love it. What inspires you, if not a person in particular? @superwhiskers: I'm inspired by looking at things other people make and seeing how I can improve upon them.
7
posted by katyadee (597) 6 days ago
Pinned
✨✨Introduce Yourself! 👋 ✨✨
Hi everyone! Use this space to share anything you want to share with our community - your name, where you're from, what you program in, what brought you here... whatever you're comfortable with! Can't wait to get to know y'all. 💖 Katya
132
posted by katyadee (597) 1 month ago
Pinned
2
Weekly Repls #36
Welcome back everyone! Sorry it took so long, we'll be back to a normal schedule in no time. Let's checkout the amazing posts I've been missing out on. We have a new challenge, and will require a lot of creativity. Keep in mind, we won't be posting your challenge submissions here, just posts in Learn and Share. Now let's see this repls! @timmy_i_chen [Created an awesome demo of python, and library that makes game development incredibly easy!](https://repl.it/talk/share/Physics-Fun-with-Python-Play/15481) @wayanjimmy [Created a linked-list model in typescript!](https://repl.it/talk/share/Linked-List-in-Typescript-using-Closure/15437) @malvoliothegood [Created a tutorial to help teach people PHP, a language repl.it just added!](https://repl.it/talk/learn/PHP-tutorial-No-1-Introduction/15442) @enigma_dev [Is showing people how to use R to train your computer!](https://repl.it/talk/learn/Machine-learning-for-beginners-in-R-1Introduction-to-KNNand-Reading-data-from-a-dataset/15323) That's all folks, see you guys next week!
5
posted by 21natzil (625) 7 days ago
14
Repl Stats 📊 (beta!)
So many of us make websites on repl.it - and share them all over the internet. However, to know how many people visited your website and to learn about your traffic, you have to add heavy, sometimes privacy invasive scripts to your website 😞 ## Introducing Repl Stats 📊 (beta!) Learn about how many hits your web app got - without needing to add any scripts. If it's on repl.it - It'll just work (works for repl.run too!) 😉 To try it out just go to https://stats.repl.co/# {repl.hostname} You don't want to include the protocol (`https` or `http`) - so an example would look like this: https://stats.repl.co/#www.lyrics.rip It's not too much right now, just a graph of all hits like this one 👇 ![Screen Shot 2019-06-05 at 5.19.48 PM](https://storage.googleapis.com/replit/images/1559780427595_b7aaa4351154336e2a15778dd44a94a0.pn) But, I wanted to share this to see if y'all would want this, and if you would, what more features would you like to see? ✨ *(note: right now, that stats update daily - not in realtime)*
10
posted by jajoosam (523) 11 days ago
45
Repl.it Mobile App MVP
**We did it!** [10 days ago](https://repl.it/talk/ask/Replit-Mobile-App/13853) I created a post asking if people were interested in a mobile app for Repl.it. The answer in general was yes, and I set out to build the best possible thing I could. And I just released the MVP of the app. Here are some supported features: - Creating and deleting repls and files 📂 - Both dark mode and light mode 🌚 - Integrated code editor with syntax highlighting 💻 - Rich editor preferences ⚙ - Works on both Android and iOS 📱 And I'm planning on adding much more, including Repl Talk support. I couldn't have done this without the help of all the amazing testers on our Discord server as well as support from Repl.it team members. This was also a fun experience learning React Native. ![Screenshots](https://storage.googleapis.com/replit/images/1557505257614_3675e7514d3ef4c35bd5da45cff18b87.pn) **Q: Where can I download it?** A: You can download the Android app [here](https://exp-shell-app-assets.s3.us-west-1.amazonaws.com/android/%40kognise/replit-mobile-fedb162be7844a9a97edd7dd4bed7c82-signed.apk). iOS is supported but I don't currently have a release. **Q: What about running repls?** A: Although you can view web repls, other types of repls are not currently supported. Repl.it recently moved to an API based on [protocol buffers](https://developers.google.com/protocol-buffers/) and due to several concerns of theirs we may have to wait until June. **Q: What the heck is an MVP?** A: MVP stands for "minimum viable product." According to [Wikipedia](https://en.wikipedia.org/wiki/Minimum_viable_product), it is "a product with just enough features to satisfy early customers, and to provide feedback for future product development." **Q: What did you build it with?** A: I used [React Native](https://facebook.github.io/react-native/) as well as many other open-source projects including [React Native Paper](https://reactnativepaper.com/). I really appreciate all the work the maintainers of these projects put in that helped make Repl.it Mobile so much better. If you're interested and want to learn more or get early access to features, make sure to [join the Discord community](https://discord.gg/sVxJJZA)! *Disclaimer: Repl.it Mobile is currently a community-run project. You can view the source code [here](https://github.com/kognise/repl.it-mobile).*
40
posted by Kognise (180) 1 month ago
See more posts
Ask
Ask coding questions
Pinned
27
What should we code?
I've seen a couple of posts around here where people are asking what they should work on next. Let's use this space to brainstorm some cool projects.
96
posted by katyadee (597) 17 days ago
Pinned
62
Guide to Asking Coding Questions
# **Guide to Asking Coding Questions** ## **Why?** Good questions help your question be solved faster, and people will want to answer your question Bad questions waste time, you will often not get answers that you asked for, and people will often ignore your questions ## **Quick Questions Guide** ### Do This - Always ask your questions in English - Explain what you want the code to do - Explain what the code does - Include error messages - Share the repl with the line numbers - When you figure out the answer, update your post - Put the repl link, instead of pasting code ### Don't Do This - Don't post homework questions - Don't use caps in the title - Don't use words like 'HELP' or 'PLEASE' in the title - Don't post questions that already have an answer (Search Box) - Don't post feedback or bugs on Talk, use [repl.it/feedback](https://repl.it/feedback) for feedback, or [repl.it/bugs](https://repl.it/bugs) for bugs ## **Steps For Better Questions** 1. Understand the code - Read your code and figure out what each line does - If a concept is unfamiliar, Google it - You can also use a debugger to help you 2. Describe the problem - Explain what you want the code to do - Explain what the code does (error messages) 3. Provide the code - Share a repl that has your code - Share the line number(s) of your code issue - Make sure that the code you shared has the issue 4. Format code consistently - Make sure your code is easy to read 5. Check for typos - Make sure the code does not have any typos that would cause the problem 6. Explain what you did to troubleshoot the problem - Make a list of what you think the problem is and try to fix your problem by going through the list 7. Make a guess on what you think the problem might be - Use the list from the previous step 8. Proofread the question - Make sure you provided everything - Clear all confusions that you think there might be 9. Update people on the question - If you figured out the answer, edit the post to tell people - When you get an answer, fully understand it - Be nice to people who answer your question - Remember that the people wanted to answer your question, but didn't have to 10. Things to NOT do - Don't post homework questions - Only post questions in English - Do not use caps in the title - Do not use "HELP" or "PLEASE" in the title - Don't post questions that have already been answered (Use search box) - Don't post feedback or bugs on Talk, use [repl.it/feedback](https://repl.it/feedback) for feedback, or [repl.it/bugs](https://repl.it/bugs) for bugs ## **Example:** ### **Question** We have some Python code with an error: [repl](https://repl.it/@Mosrod/Question-Tutorial) ```python rannumexe = int(input()) if rannumexe = 1: print('hi' + rannumexe) ``` ### Step 1 We show what each line does using comments. ```python rannumexe = int(input()) # Asks the user to input a rannumexe if rannumexe = 1: # If the rannumexe equals 1 print('hi' + rannumexe) # Print hi and the rannumexe ``` ### Step 2 We want the code to input a number, and if the number is one, print "hi" and the number. Our problem is that we have an invalid syntax error on line 2 in the main.py file. ``` File "main.py", line 2 if rannumexe = 1: ^ SyntaxError: invalid syntax ``` ### Step 3 Our repl with the issue is located [here](https://repl.it/@Mosrod/Question-Tutorial). We have an issue on line 2 ### Step 4 We can change "rannumexe" to "number" to clear confusion ```python number = int(input()) # Asks the user to input a number if number = 1: # If the number equals 1 print('hi' + number) # Print hi and the number ``` ### Step 5 We don't have any typos ### Step 6 Our problem could be that we improperly used the if statement ### Step 7 The problem could be about using the if statement incorrectly ### Step 8 Our final question: Title: Invalid syntax error about equal signs Content: I have an invalid syntax error on line 2 in the main.py file of this [repl](https://repl.it/@Mosrod/Question-Tutorial). The program should take a number as an input, check if the number is equal to one, and if so, print "hi" and the number. The error point to the equal signs and I think this issue is with the incorrect syntax of the if statement. Help is appreciated :). ```python number = int(input()) # Asks the user to input a number if number = 1: # If the number equals 1 print('hi' + number) # Print hi and the number ``` ``` File "main.py", line 2 if rannumexe = 1: ^ SyntaxError: invalid syntax ``` Steps based on Gordon Zhu's [post](https://medium.com/@gordon_zhu/how-to-be-great-at-asking-questions-e37be04d0603). If you have any suggestions or feedback, post it in the comments below.
31
posted by Mosrod (242) 9 months ago
8
If you could ask the Repl.it team anything, what would you ask?
It could be about the product, a coding question, or even something personal (within reason)! I'll see if I can wrangle answers for ya.
25
posted by katyadee (597) 3 days ago
14
SCHOOL'S OUT! IT'S SUMMER!!! 🌞 What are your summer coding plans?
SCHOOL'S OUT FOR BASICALLY EVERYONE, finally! Do you have any summer coding goals? What are they? Mine are... * get really good at HTML & CSS * learn JS
77
posted by katyadee (597) 9 days ago
8
Game Brainstorm
In the "what should I make" thread @amasad expressed his wish for another multiplayer game. He wanted it to be more community focused than some of the multiplayer shooters. I decided to act on it and am planning to make a multiplayer faction-based game. I currently envision four factions starting in the center of a large map and having the opportunity to explore/battle each other. I also would love to have the in-game accounts linked to repl.it accounts. However this would require some input from repl.it themselves. I imagine the character just being a profile pic with a circle around it indicating a faction color. I would also, however like your input on this. If you think that factions would just split the community then explain why here. I want to hear your thoughts in the comments. Also, if you know HTML and Javascript you are welcome to offer your help. If you are good at making art I would be thankful for your help as well. Regards, @kaldisberzins
48
posted by kaldisberzins (253) 10 days ago
See more posts
Challenge
Submit your website!
Pinned
Announcing contest SPACE 🏆
It's time for another contest! We're not gonna make this one super huge, but promise that it is going to be real good fun to build entries for this one! So what do you have build? **Web Repls**! But, not just plain old web repls - this contest needs you to make webapps in a certain format! Let's start by taking a look at an example: [https://dadjokes--jajoosam.repl.co](https://dadjokes--jajoosam.repl.co/) ![](https://i.imgur.com/mqqkBvs.gif) Every time you hit space, the app loads a new dad joke, and a new image 👴 🖼️ That's why the contest is named `<SPACE>` - you gotta make a repl which when the user hits space! This could be updating an image, text (even both!) - or anything that feels like the main content of the repl. We also recommend that you update the app automatically every so often (you'll see why soon!) You can use any APIs you want, try [Web Scraping](https://repl.it/talk/learn/Get-started-with-Web-Scraping/8930), or just make a list of your own! ## Get started with examples You can check out the source for any of these and fork them to get started 👇 - [Dad Jokes - Node.js + Express](https://repl.it/@jajoosam/dadjokes) - [One more Shibe - HTML](https://repl.it/@jajoosam/shibes) - [Inspiring Kotes - Python + Flask](https://repl.it/@jajoosam/Inspiring-Kotes) ## Okay, but what do we get? The winning entry gets a $50 Amazon giftcard + 3 free months of Hacker Plan 💥 Along with that, we're also gonna put up a big screen at Repl.it HQ - and put up some of the coolest entries there! We recommend you to update the app every 5s so that our screen keeps showing new things ✨ As we're working on making repl.it - we'll also have fun when we see the creations y'all have made! Get going - you have a week from now - until *June 12th*! **Update - the deadline is now extended to June 20th, 00:00 PST** 😄
25
posted by jajoosam (523) 12 days ago
13
FontKey
Hi! I've spent the past few days working on my submission, FontKey. I aimed to create something that both satisfies the requirements and is a useful tool people might use day-to-day. **Let's get to the meat.** What does it do? Simple, FontKey helps you find new fonts. If you've heard of Roboto, Open Sans, Lato, and Montserrat, you'll know that these fonts are at the top. And the sad thing is, most websites keep using them. When you press space, FontKey will pick a new font for you. You can try out font pairs and if you like one side of a pair you can lock it in place. But it does much more than that! You can **preview your fonts in realistic layouts,** and if you want to collaborate with someone else just **click a button to get a sharing link.** For example, [here's one](https://s.fontkey.design/KCgQ1wZaC1)! You can also **get code for your site** in a click. What else? Well, I made a cheesy promo video. You know - bouncy background music, lots of editing. Click [here](https://vimeo.com/342162889) or watch it on the site. Finally, there's auto mode. It'll automatically switch fonts in a fullscreen page every 5 seconds. It's there because it looks cool - and would make a nice screensaver. ## Closing First and foremost, [here's a link to FontKey](https://www.fontkey.design/). It's probably at the bottom too. I'd appreciate any feedback! I'm thinking I might eventually launch this on Product Hunt as well. ![FontKey: A modern way of finding fonts.](https://www.fontkey.design/static/media.png)
12
posted by Kognise (180) 3 days ago
10
Press Space for FREE 👏 MEMES 👏
# [FREE 👏 MEMES 👏!](https://press-space-for-free-memes--liltaco.repl.co/) How can you say no to that? 😊 It has a nice style (I made the CSS, it's not gonna blow your mind), a bunch of content from Reddit, and you can even see how many upvotes a submission has and who uploaded it. It takes a random submission from a given subreddit (defaults to r/memes) with the reddit API when you press space. I am not responsible for any weird things you see there. [Have fun](https://press-space-for-free-memes--liltaco.repl.co/)! Some recommendations: + memes - get free memes! + dankmemes - a more abstract alternative. + me_irl - selfies of the soul + unixporn - woah those are some epic Unix setups! + programmerHumor - some programmer jokes + dadJokes - sorry for that one + programmerDadJokes - same but for programmers + anything else on Reddit... ![freememes](https://storage.googleapis.com/replit/images/1560357867088_2360153f15dc90d4b13a45172f5cfd8d.pn)
26
posted by liltaco (43) 5 days ago
20
MEME Website
I have made a website on my own, and I have decided to share it to you guys on replit. Enjoy and don't forget to open it in a new tab with the symbol (" little square with a diagonal arrow ") because it's way better that way. Also don't forget to put a comment like a suggestion or an appreciation or something like that, and it will be very nice it you could vote for me on the top left. ** I am working very hard on this project and updates will come every week!** _____________________________________________________________________________________ **For the challenge :** 1 - Hit, press or smash the **space bar** on your keyboard while you are on the main page and it will show you this : ![image](https://storage.googleapis.com/replit/images/1560181800501_3ceecf1717bd528b657be12c4bc00e1c.pn) - Keep pressing the **space bar** until you get to the end of the "story". 2 - Again, for the challenge i have made a page where you will need to press the **space bar** to get some photos memes, press this : ![image](https://storage.googleapis.com/replit/images/1560181658131_397843d8bcc5a2dcf1d9f80a1913abde.pn) ** I hope you will enjoy and if you do, don't forget to up vote! It will make me happy**
20
posted by lsambrook (195) 8 days ago
11
📰 XKCD Comic Viewer 📝
😌 So I made a viewer for the [xkcd comics](https://xkcd.com) ![gif](https://i.imgur.com/CQQAe6g.gif) Features - Automatically switch through comics every ~10 seconds - *<space>* to manually switch comics. "Manual mode" stops after ~15 seconds - Loading indicator at top of screen - Dynamic shadow below comic - Hovering over comic gives special 3D effects - If the comics are to small, just zoom in (although images will pixelate) It definitely could be better, in terms of quality and consistency, but it's fine now. Works best in Chrome, mostly in Firefox, and not really in Edge. [Click to see it in action!](https://contest-space-entry-final.eankeen.repl.co)
5
posted by eankeen (493) 6 days ago
See more posts
Learn
Learn to Code via Tutorials on Repl.it
Pinned
5
LLC GOLANG: Web apps & structs (Videos 5+6)
## Hi everyone! This week, we'll focus on: * [Creating a simple web app](https://www.youtube.com/watch?v=-QmdZ7821wA) * [Structs](https://www.youtube.com/watch?v=3fsvqo9pQyg) **Weekly Quiz:** Quiz yourself on last week's concepts [here](https://forms.gle/CAn1mx8j4R5j74y39 ). This week's quiz is self-grading, so there's... 🥁🥁🥁 no due date! If you completed last week's quiz, you should have received your scores tonight, Tuesday, May 14th. **Next week's quiz** By Sunday, 5/19, please make sure you post your new quiz questions below. Please only include items covered in videos 1-6. 'Til next week, friends!
4
posted by katyadee (597) 1 month ago
26
🌚🕶 How to Enable Repl.it Site-Wide Dark Theme 🕶🌚
# Repl.it Site-Wide Dark Theme Do you like not being blinded while browsing Repl.it? Well me neither! ![Repl talk on dark theme](https://storage.googleapis.com/replit/images/1557091294976_160fda0e32057fb2f3a93d971d4a4203.pn) *** First, you might not have the editor dark theme enabled, so make sure you enable that. 1. Click the settings button at the left of the editor screen. ![Settings Button](https://storage.googleapis.com/replit/images/1557091461609_7a585f76190494f3bc741389062781a0.pn) 2. Find the theme dropdown, and select *dark* ![theme dark](https://storage.googleapis.com/replit/images/1557091792258_8f89ba2a4630090419013d3220ddbd0d.pn) *** Now that you have the editor dark theme enabled, we will enable the site-wide dark theme. 1. Download Tampermonkey for [Chrome](https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo) or [Firefox](https://addons.mozilla.org/en-US/firefox/addon/tampermonkey/) 2. Choose a theme from [the list of themes](https://www.darktheme.tk/themes) or [create your own](https://www.darktheme.tk/custom) 3. Click the `install` button. 4. Upvote and post a comment on this tutorial. 5. Profit!
20
posted by mat1 (2152) 1 month ago
64
🚀 A Starter Guide to Pygame 📀
# 🚀 A Starter Guide to Pygame 📀 Pygame is an open-source library for making graphical applications with Python. Learn more about it on the official [website](https://pygame.org). This tutorial is intended to help you setup a very basic Pygame interface. It's for Python beginners or people who want to quickly bootstrap a Pygame project. Find more about Repl.it's GFX public beta announcement [here](https://repl.it/talk/announcements/Replit-GFX-Public-Beta-Build-Games-and-GUI-Apps/11545). So let's get started! We're going to be building a simple screen saver. The final result will look like the following ![programProgress4](https://i.imgur.com/dEileMP.gif) ## Starting out When creating a new project, be sure to select "PyGame" when creating a project. ![image](https://storage.googleapis.com/replit/images/1552705106070_4aa0e807cd3fb5197a7251222d74d724.pn) Now we're ready to start writing some code! ## Painting the Screen Red 🎨 First, we're importing Pygame and initializing all the imported pygame modules with [`pygame.init()`](https://www.pygame.org/docs/ref/pygame.html#pygame.init). Second, we're declaring `width` and `height` variables that represent the size of the screen. Third, we're setting `backgroundColor` to a tuple of 3 elements that represent the RGB numbers. Fourth, `screen` is a display Surface, or an initialized window or screen for display with the [`set_mode()`](https://www.pygame.org/docs/ref/display.html#pygame.display.set_mode) method. Lastly, in the infinite loop, we're filling the screen to the `backGroundColor` and updatiang the display Surface to the screen. In other words [`pygame.display.flip()`](https://www.pygame.org/docs/ref/display.html#pygame.display.flip) "refreshes" the screen with changes you made to the grahpics. ```python import pygame pygame.init() width, height = 800, 600 backgroundColor = 255, 0, 0 screen = pygame.display.set_mode((width, height)) while True: screen.fill(backgroundColor) pygame.display.flip() ``` So, we get a red background! ![programProgress1](https://storage.googleapis.com/replit/images/1552448696584_73e029d5335f2d2a06c92a180e7103be.pn) ## Adding the DVD Right before you while loop, import an image of your DVD. Feel free to use the same image I used, in the repl below. ```python dvdLogo = pygame.image.load("dvd-logo-white.png") ``` Then, create a rectangle from the Surface, or from the image you just loaded with [`get_rect()`](https://www.pygame.org/docs/ref/surface.html?highlight=get_rect#pygame.Surface.get_rect) ```python dvdLogoRect = dvdLogo.get_rect() ``` Now, inside of the `while` loop (after filling the background color), "map" the imported image to the `dvdLogoRect` rectangle using the [`blit()`](https://www.pygame.org/docs/ref/surface.html?highlight=blit#pygame.Surface.blit) method. That way, the image stays inside of the invisible `dvdLogoRect` rectangle. ```python screen.blit(dvdLogo, dvdLogoRect) ``` Now, we get a DVD! ![programProgress2](https://storage.googleapis.com/replit/images/1552449702561_27872d2c7a30d4d9dbb53d3c908851d9.pn) ## Moving the DVD Logo To move the DVD logo, simply use `move()` by a speed: ```python dvdLogoRect = dvdLogoRect.move(dvdLogoSpeed) ``` Make sure you also declare and initialie dvdLogoSpeed at the top of the file. `dvdLogoSpeed[0]` represents the speed in the `x` direction. ```python dvdLogoSpeed = [1, 1] ``` Finally, I added a `time.sleep(10 / 1000)` so the logo moves slower. So my code ended up looking like ![programProgress3](https://i.imgur.com/dsh8TYo.gif) The DVD logo *will* move off the screen because there is no bouncing. To implement a check for bouncing, add the following: ```python if dvdLogoRect.left < 0 or dvdLogoRect.right > width: dvdLogoSpeed[0] = -dvdLogoSpeed[0] if dvdLogoRect.top < 0 or dvdLogoRect.bottom > height: dvdLogoSpeed[1] = -dvdLogoSpeed[1] ``` The `.left` and `.right` properties don't seem to be [documented](https://www.pygame.org/docs/ref/rect.html?highlight=rect%20left), but it's implied that `.left` measures the distance from the left part of the `dvdLogoRect` Rect (rectangle) to the left part of the `screen.` And so on and so fourth for `.right`, `.top`, and `.bottom`. Here is the final result ![programProgress4](https://i.imgur.com/dEileMP.gif) Now let me know when the logo hits the corner!
31
posted by eankeen (493) 3 months ago
11
BOOKMARKLETS!
# What is a bookmarklet? A bookmarklet is similar to an extension, but is used by clicking a bookmark. According to wikipedia: > A bookmarklet is a bookmark stored in a web browser that contains JavaScript commands that add new features to the browser. Bookmarklets are unobtrusive JavaScripts stored as the URL of a bookmark in a web browser or as a hyperlink on a web page. Bookmarklets are usually JavaScript programs. Regardless of whether bookmarklet utilities are stored as bookmarks or hyperlinks, they add one-click functions to a browser or web page. When clicked, a bookmarklet performs one of a wide variety of operations, such as running a search query or extracting data from a table. For example, clicking on a bookmarklet after selecting text on a webpage could run an Internet search on the selected text and display a search engine results page. # Create a bookmarklet Creating a bookmarklet is easy. (If you do know how to create a bookmark. If not read [Creating A Bookmark](https://www.computerhope.com/issues/ch000858.htm) ) Let's create a simple example: First, create a bookmark. As for the title of the bookmark, name it “Hello World”. Instead of keeping the url of the page as the bookmark type `javascript:alert(‘Hello World!’)`. There! Click save or whatever it is in your search engine. And click the bookmark. You should have an alert message saying “Hello World!” appear! To run js in a bookmark, you need to have the `javascript:` prefix before it. You can only type one line so make sure to use your semicolons! In addition, you **can not use double quotes**. The search engine saves the bookmark in code that looks something like this: ```html <a href="javascript:alert(‘Hello World!’)">Hello World</a> ``` If you use double quotes it looks like: ```html <a href="javascript:alert(“Hello World!”)”>Hello World</a> ``` And causes an error. If you have multiple lines, create an anonymous function: `javascript:(function(){ var x=prompt(‘Hi say something:’); alert(‘You said: ’ + x); })()` Notice there are NO double quotes. Let's go over some examples: Google Search: `javascript:(function(){window.open('https://www.google.com/search?q='+prompt('Google Search:', '').split(' ').join('+'), '', 'width=800,height=500,left=10,top=10,scrollbar=yes');})();` The above example opens up a new window with a search query of your input! Feel free to copy any of these or the ones listed below. Calculator: `javascript:(function(){var evl,expr=prompt('Formula...','');with(Math)try{evl=parseFloat(eval(expr));if(isNaN(evl)){throw Error('Not a number!');}prompt('Result of '+expr+':',evl)}catch(evl){alert(evl);}})();` @JSer ‘s Rolling Sky: (Thanks for creating such an awesome game!) `javascript:window.open('https://Rolling-Sky--jser.repl.co', '', 'top=15,left=15,scrollbar=yes,width=500,height=600')` # Community Creations @Zavexeon **Faces Generator** > uhm... it works.... and is also useless... ```js javascript: const faces = ['OwO ', 'UwU', 'TwT', '>w<', '^w^']; let face = faces[Math.floor(Math.random()*faces.length)]; document.write('<body style=\'background-color: black;\'></body><title>' + face + '</title><p style=\'text-align: center; font-size: 500px; font-family: Arial; color: white;\'>' + face + '</p>'); ``` ** Thank you for reading! Please upvote and comment your own bookmarklets, to be added to the community creations section! I hope I get a content creator tag for this 😀 **
27
posted by PYer (2042) 1 month ago
35
How I solved the Secret Announcement
# A Detailed Solution to Secret Announcement ### Background: You are most likely busy creating a game for the game jam and you probably know that an announcement came 2 weeks before the jam as a secret message using [steganography](https://en.wikipedia.org/wiki/Steganography) I was one of those chaps who actually solved the secret, but didn't do anything. The challenge can be found [here](https://repl.it/@timmy_i_chen/secret-announcement?ref=newsletter). There was a solution, but that was not very explanatory.This post will explain how ~I~ solved the announcement. This post assumes basic knowledge of the binary system. *** The first thing I did after seeing the newsletter was to read up on steganography.I found this on wikipedia: >Concealing messages within the lowest bits of noisy images or sound files Interesting... ## Reverse Engineering: Then, I looked at the code.Apart from imports and loops to go through all pixels,this was the crux of the code: ```py secret_red = secret_pix[0] >> shift_amt secret_green = secret_pix[1] >> shift_amt secret_blue = secret_pix[2] >> shift_amt public_red = public_pix[0] & all_except_LSB_mask public_green = public_pix[1] & all_except_LSB_mask public_blue = public_pix[2] & all_except_LSB_mask final = ( secret_red + public_red, secret_green + public_green, secret_blue + public_blue ) ``` `>>` and `&` are [binary operators](https://en.wikipedia.org/wiki/Bitwise_operation).shift_amt was 7 and all_except_LSB_mask was 254 What does the >> operator do? It shifts the bits towards towards right.For example: `11100010101 >> 6` outputs `11100` i.e. the last 6 bits are removed. In our case, all the 8 bit data(because 255 is the maximum in RGB color format and 255 is 8 bits) is shifted by 7 bits so that would leave only the highest bit as one or zero. This would also imply that anything greater than 127.5 (255 / 2) would leave 1 while anything lesser would leave zero. `10101010 >> 7 == 1` `01010000 >> 7 == 0` So that's our secret pixel Then, we see the `&` operator with all_except_LSB_mask as 254.The & operator is called bitwise and. Basically, it returns one only if both expressions are one.Like `1&1 == 1` `1&0 == 0` `0&0 == 0` An important property of the & operator is that `something & all 1s = something` another one is that `something & 0 = 0` `10100100`&`11111111`==`10100100` 254 in binary is `11111110` So,all the bits except the last one would remain intact `10011011 & 11111110 ==10011010` So,this would turn all public pixels into even numbers as the last bit is 2**0=1 and if it is absent, the number must be even. The final pixel is secret_pix + public_pix.We know that public pix is either 0 or 1.Since the last bit of public pix is always zero,The last bit of final pixel must reflect the secret image. So here's my code: ```py from PIL import Image public=Image.open('out.png').convert('RGB') secret=Image.new('RGB',(600,600)) for x in range(600): for y in range(600): secret.putpixel((x,y),tuple((i%2)*255 for i in public.getpixel((x,y)))) secret.save('secret.png') ``` All the juicy stuff is in one line:`(i%2)*255 for i in public.getpixel((x,y)` What this does is: + take the public pixel + compute modulo two (returns 1 if odd and 0 if even) + multiply that by 255 because 00000001 or 00000000 show no visible difference but 11111111 and 00000000 do + put this in the secret image, pixel by pixel And Heres my output: ![secret](https://storage.googleapis.com/replit/images/1553919764220_1470a455120ad93feec70c9423124f04.pn) waow indeed
12
posted by Lord_Poseidon (108) 3 months ago
See more posts
Share
Share your repls and programming experiences
Pinned
Rules for Posting - Read me!
Some rules and guidelines to keep in mind as you share your great work on our boards: 1 - Be kind and courteous to others 2 - Make sure that any feedback you provide is constructive. 3 - Outside links are allowed, but you must provide the source. Ideally, things that you post will have been created on Repl.it. 4 - Avoid posting overly promotional material - the focus is, and always will be, a programming, learning, and collaborative community. :) 5 - Don't spam! Keep things SFW (Safe For Work). We may revoke your access to these boards if you are found to be in violation of any of these rules. Feel free to ask clarifying questions. Last updated 7/10/18 12:09 PST
63
posted by timmy_i_chen (917) 12 months ago
4
👀 Domain Hack Finder 👀
# Domain Hack Finder Ever want to make a website, but you haven't been sure what you should name it? According to Wikipedia, a domain hack is a domain name that suggests a word, phrase, or name when concatenating two or more adjacent levels of that domain. For example, "bir.ds" and "examp.le", using the fictitious country-code domains .ds and .le, suggest the words birds and example respectively. In this context, the word hack denotes a clever trick (as in programming), not an exploit or break-in (as in security). ![Domain Hack Finder](https://storage.googleapis.com/replit/images/1560713948448_70de33f52af24ebcae9e109e2fd5828f.pn) [Try it out now! 😎](https://domain-hack-finder.mat1.repl.run) (Upvote this post for free Robux or MineCoins or whatever!)
5
posted by mat1 (2152) 10 hours ago
7
my plane game
this is a fun turn based game your main goal is to get away from the German planes
15
posted by ethanheys (33) 5 days ago
17
Rings
Ring, my entry for the repl.it <space> competition, is a simple web app that adds a spinning ring with random properties (e.g. color, thickness, size) to the screen. Here are some pictures I took of what this can look like: ![img1](https://storage.googleapis.com/replit/images/1559841813027_ad1580cced82a398bf1c782b874f41b0.pn) ![img2](https://storage.googleapis.com/replit/images/1559841813575_7db6388a71fcf6bf0936e514eb9373b9.pn) ![img3](https://storage.googleapis.com/replit/images/1559841813728_8856d1f2161ba1479ee9a8377272fec1.pn) remember to upvote if you like this!
4
posted by theangryepicbanana (612) 11 days ago
39
WebCraft - A Online Minecraft!
MINECRAFT! IN A WEB BROWSER! AWESOME!!! It's a fun, simple game that you can do many things in! Just try to explore!
41
posted by HENRYMARTIN4 (51) 27 days ago
See more posts