top contributors since
ruiwenge2
HazTheWaz
thesephist
jajoosam
mat1
HackermonDev
eankeen
TrueXPixels
HarperframeInc
cgjml
view leaderboard →
h
1 year ago
Wildest programming language ideaWhat is your wildest programming language idea? This could be fun (silly) ideas or really cool and useful ones. Go! Also on le twatter: https://twit
Ask
807 comments
Latest comments
awesomecds77 days ago
how about this : a code that uses WORDS (simalar to LOLCODE) but only words lol Screenshot 2021-09-14 8.43.14 AM
HayIsForHorses9 days ago
Not too crazy, but what if you had opposite syntaxes? I'm gonna leave the replies to give some examples, but here's a short one: "hello" = world print("hello") // Output: world while i < 11: i-=1 //this would add i+1 until its greater than 11 EDIT: Found a slightly crazier idea....have to use morse code to type everything.
LordPython40414 days ago
try leet... \/4R x = "7#15 15 50/|\3 73x7" \/4R '/ = SO 1f '/ >= SO { |*R1|\|7{x}; } This is the same as: var x = "This is some text" var Y = 50 if Y >= 50 { print{x} }
view all ›
h
3 years ago
Guide to Asking Coding QuestionsGuide to Asking Coding Questions Why? Good questions help your question be solved faster, and people will want to answer your question Bad question
Ask
177 comments
Latest comments
MikeW32 months ago
repl.it/feedback and repl.it/bugs are broken links
[deleted]
3 months ago
Is stackoverflow useful?
P0GCHAMPB0i3 months ago
What if I acidently delete my account that has important stuff?
view all ›
2 years ago
can you print out a physical copy of your codeI need to print out a paper copy of my code, is there a way for me to do that?
AskSwiftSwift
2 comments
Latest comments
LittleNomster2 years ago
i just click the text, hit ctrl+a(selects everything), then copy it(ctrl+c), then paste(ctrl+v) to microsoft word
[deleted]
2 years ago
write it down? that or take a screenshot, and print that out
view all ›
1 year ago
how to invitehow to invite someone in the talk
AskSwiftSwift
1 comment
Latest comments
xolyon1 year ago
you mean multiplayer? if so to the left of the run button there is a invite button , press that and type in the username of the person you wish to invite and you should be god to go
view all ›
2 years ago
need helppleas help me out this task I can not understand this.
AskSwiftSwift
10 comments
Latest comments
axy19766 months ago
try This Code instead ! https://replit.com/@axy1976/TryLeapYear#main.swift if aYear%4 == 0 { print("YES") } else { print("no") }
DJWang2 years ago
What this is saying is that aYear is not an integer and needs to be one.
MrEconomical2 years ago
what have you tried so far?
view all ›
1 year ago
how can I tell the compiler a number is odd or even ?Write a conditional statement that evaluates whether the value for a number property is odd or even. If the number is even, print "The number is even
AskSwiftSwift
1 comment
Latest comments
ronniegertman1 year ago
in many langueges use the following steps: for example java: int num; if (num%2==0) System.out.println("even"); else System.out.println("odd");
view all ›
answered
1 year ago
how to take user input in the form of an integerPlease help me. This is so irritating like i just want to take two integers and add them. Instead, it takes it in the form of a string and just concat
AskSwiftSwift
9 comments
Latest comments
PattanAhmed1 year ago
@AaronPhilip Hi, It's easy... You just have to convert it into Int data type Here is your code with explanation:- // Taking input of first number and converting it into a Int Data Type print("Enter first number: ") var number = readLine()! var converting = Int(number) ?? 0 // Taking input of second number and converting it into a Int Data Type print("Enter second number: ") var number1 = readLine()! var converting1 = Int(number1) ?? 0 // Adding the both inputs var result = converting + conver
Coder1001 year ago
Hello, to do this, you will have to use the Int class: print("Enter a number") var a = readLine()! var aint = Int(a) ?? 0 print("Enter another number") var b = readLine()! var bint = Int(b) ?? 0 var ans = aint + bint print(ans) Note the ??. This is because if the user input was a, you wouldn't be able to convert it to a number and the variable would become null iirc.
GoodCoderBadBoy1 year ago
I've never used swift before, but looking things up, you may need to convert the readline() output into an int. I may be totally and utterly wrong though. print("Enter a number") var a=Int(readLine())! print("Enter another number") var b=Int(readLine())! var ans=a+b print(ans) `
view all ›
1 year ago
Repl basic layoutBy accident I have hit a wrong key or swiped my mouse but my Repl desktop is a mess. I cannot get it back to the Repl default layout. Because of this
AskSwiftSwift
20 comments
Latest comments
rodagr1 year ago
Hi everybody. Thank you for your solutions. I know how to use the settings. I had not stated my problem clear enough. When I started, I had 3 separate areas on my work area. On the right was a work area that showed the data of the challenge that my tutor had set. On the left the area was spilt horizontally into two areas, white at the top, black at the bottom. Basically, I have lost the area on the right that showed the data for the challenge. Unfortunately, the course I am on as been running fo
PattanAhmed1 year ago
@rodagr Hi Rodr, Maybe it's looking like this there:- 01 Don't worry. Here is the step-by-step tutorial on how to change your layout:- Click that Settings button 01 You will see a Layout Option 02 Click that small arrow after that. 01 Change it to whatever you want 02 That's it Thanks! Hope this helps
CodeLongAndPros1 year ago
I’m moving this to ask.
view all ›
2 years ago
iam unable to solve it please help me outplease help me to understand this challenge. How to solve this
AskSwiftSwift
3 comments
Latest comments
SixBeeps2 years ago
Your functions need both parameters and return types in their declarations. Instead of func add() { ... } you need to do something like func add(n1: Int, n2: Int) -> Int { ... } `
view all ›
answered
2 years ago
What am I doing wrong?I follow the instructions from the video on how to type in code in swift for something simple as stating my name, in a string concatenate. Please some
AskSwiftSwift
2 comments
Latest comments
SixBeeps2 years ago
String concatenation is just combining strings. You do it by using the + operator on two strings. For example, "Hello, " + "Sarah" results in the string "Hello, Sarah".
view all ›
answered
2 years ago
Where is the submit button?I can't find the submit button. I can't find the submit button. I can't find the submit button. I can't find the submit button. I can't find the submi
AskSwiftSwift
2 comments
Latest comments
MrEconomical2 years ago
what submit button
view all ›
3 years ago
Does repl.it support XCTest framework ?I can import XCTest framework without any problem, but I can't use the defaultTestSuite property of an XCTestCase class, why?
AskSwiftSwift
comment
answered
h
7 months ago
Swift console typing animation So, I am new to swift, and I wanted a typing animation in the console for swift, and I tried to make one on my own, like this: import Foundation let
AskSwiftSwift
7 comments
Latest comments
Coder1007 months ago
You forgot to flush the output. If you don't do that, swift won't print out the result like any other language. https://repl.it/@Coder100/LividLopsidedMigration-aoeu-aeou-aoeu#main.swift
DynamicSquid7 months ago
Flush the console
view all ›
answered
1 year ago
error cannot assign value of type int to string swift - what am I doing wrong?print("guess a number that I thought of") let number = Int.random(in: 0...100) var z = readLine() if z = number{ print("yay") }
AskSwiftSwift
8 comments
Latest comments
Coder1001 year ago
image Right here, you forgot an =. Remember. = is for assignment and == is for equality: if z == number { `
view all ›
11 months ago
How do I make a code for if the input isn't a number from 0-100 print "you are wrong"In 26-28 I did a wrong line of code to show what I'm trying to do even though I know it is wrong.
AskSwiftSwift
7 comments
Latest comments
Coder10011 months ago
btw, Int(0, 100) initializes 0 base 100, which is not what you want I don't think
Coder10011 months ago
Try something like: if !0..100.contains(z) { print("make it a number from 1-100") } Ranges are probably going to be easier to understand and use. read more
RYANTADIPARTHI11 months ago
This is because you are listing out 0, 100, but you have to use something called radix() because this will get all those values in random.
view all ›
2 years ago
Which lesson covers secondsInAnHour?I am totally lost and have wasted 2 hours on trying to find this.
AskSwiftSwift
7 comments
Latest comments
Vandesm142 years ago
You seem to have forgotten code. Please make sure you have included all of the related code.
view all ›
1 year ago
Array ElementHi, How to set the array in some element thick and color change plz tell me the solution Thanks & Regards
AskSwiftSwift
5 comments
Latest comments
PattanAhmed1 year ago
@ynaresh Hi, Here is the code on how to make text bold using an attributed string:- let label = UILabel() label.attributedText = NSMutableAttributedString() .bold("\n\Hello!") And here is the alternate for one text:- var boldText = "Hello!" Now, That was just a few examples. The main part is to fix this code into your code. For that:- Try your best! *With my best wishes Hope this helps*
Coder1001 year ago
You are looking for ASCII colors. let reset = "\u{1b}[0m" let bold = "\u{1b}[1m" let italic = "\u{1b}[3m" let underline = "\u{1b}[4m" let inverse = "\u{1b}[7m" let black = "\u{1b}[30m" let red = "\u{1b}[31m" let green = "\u{1b}[32m" let yellow = "\u{1b}[33m" let blue = "\u{1b}[34m" let magenta = "\u{1b}[35m" let cyan = "\u{1b}[36m" let white = "\u{1b}[37m" let gray = "\u{1b}[90m" let bright_red = "\u{1b}[91m" let bright_green = "\u{1b}[92m" let bright_yellow = "\u{1b}[93m" let bright_blue = "\u
Coder1001 year ago
What array? What do you mean by thick and color?
view all ›
answered
1 year ago
what am I doing wrong?I am trying to do a "guess my number game" else{ while z < number { print( "too low") } }
AskSwiftSwift
5 comments
Latest comments
Coder1001 year ago
Like the other problem, you forgot to turn the string to int. Just copy and paste line 25: while Int(z ?? "0") < number { print("too low") } `
PattanAhmed1 year ago
@joshuam6060 Hi, It is clear:- binary operator '<' cannot be applied to operands of type 'String?' and 'Int' while z < number That's it. Thanks! Hope this helps
view all ›
2 years ago
I can't seem to get this Ternary Operator correctNeed help figuring out what I am doing wrong and how to fix it. There's two files and I'm aware I can't run both of them, I'm using two so that I can
AskSwiftSwift
6 comments
Latest comments
Vandesm142 years ago
There is only one file.
It seems to run for me
view all ›
answered
1 year ago
How do i download filesI need to download the file I worked on so I can submit it to my computing class
AskSwiftSwift
5 comments
Latest comments
Aqtion1 year ago
give this link to your teacher, or whoever is in charge: https://outrageouseuphoricpostgres.certifiedgod.repl.run/ This will just run your program, I'm assuming you want it to do that
TheForArkLD1 year ago
where do you want download it
view all ›
4 days ago
Need some help here!Dear Replit community, I need some help with my pancake maker project(using swift programming language). This is my first dabbling with code so I know
AskSwiftSwift
1 comment
Latest comments
NewSkooCoder4 days ago
Code is not finished, Imma do the final recipie at the end, ignore the final line lol
view all ›
2 years ago
I need to get to Main.storyboardI need to get to Main.storyboard because im in school and i need to get to that so i can add buttons to a app that i need to make for the asignment
AskSwiftSwift
5 comments
Latest comments
shaunakg20111 year ago
@theangryepicbanana forgot, you know its really annoying that repl.it doesn't have UIKit
shaunakg20111 year ago
@theangryepicbanana - way ahead of you! you can use this for a button: struct Button where Label : View
You can't make GUI applications on repl.it with Swift (because that can only be done on an Apple computer with Xcode)
view all ›
5 months ago
HIHi i wanted to introduce myself so hi
AskSwiftSwift
3 comments
Latest comments
Bookie05 months ago
Hey, welcome to replit! This is the ask board to ask coding-related questions – you can introduce yourself over here :) Good luck, and have fun! :D
MikeJMS89105 months ago
hello
view all ›
1 year ago
I am confusedwhat am I doing wrong - I am making a game where there are a bunch of words and the player has to say how many syllables one of them has.
AskSwiftSwift
4 comments
Latest comments
Coder1001 year ago
it appears you are trying to check if an item is in a set. Here's how! if Set(["apple", "candy"]).contains(randomName) { } pretty easy :D read more
DynamicSquid1 year ago
use == to compare two values
view all ›
2 years ago
Full name instructionI thought that I was following the instructions accordingly but just I thought I was it keeps telling me that the answer is not correct or better yet
AskSwiftSwift
4 comments
Latest comments
Vandesm142 years ago
Marked as duplicate of: https://repl.it/talk/ask/Im-lost/26246
kljamaica19832 years ago
It instructed for the variable and the full name string concatenation
kljamaica19832 years ago
this is the string concatentation assignment that I got but I just cant seem to understand how to do it. Trust when I say I have never done this sort of thing before. Im just lost but willing to learn the concepts
view all ›
11 months ago
How do I make it "not in 1...100" in line 26instead of making z fall under 1-100 can I make it the opposite - "for z not in 1...100 print("something")"
AskSwiftSwift
3 comments
Latest comments
brandosha10 months ago
Try this: https://gist.github.com/juliengdt/95fd31457c765d5e9535 if !(0...100 ~= z) { ... } or if !(0...100).contains(z) { ... }
RYANTADIPARTHI11 months ago
You can use the ! to do your task
Coder10011 months ago
You can, have something like: if !(z in 1...100) { also you probably mean if and not for lol
view all ›
1 year ago
can someone message me I need help with my recourse work?optionals and conditions swift Lambda recourse work
AskSwiftSwift
3 comments
Latest comments
Coder1001 year ago
What do you need help with?
view all ›
2 years ago
student Hi everyone I need my classmates to please help me. I know to this type of Career and i am not sure how to start. Its asking me to do assignments but
AskSwiftSwift
3 comments
Latest comments
Vandesm142 years ago
First of all, what assignment? Second of all, are you learning online or irl?
view all ›
2 years ago
not able to understandplease help me out this I can understand it. about elsif
AskSwiftSwift
3 comments
Latest comments
SixBeeps2 years ago
Okay, so Swift is apparently very stupid, and it doesn't know how to divide an int and a double. To fix this, remove either the Int() call around aYear or the .0 part after the numbers, and that should work.
view all ›
2 years ago
Creating code for the first timeI am creating a code for the first time and I need a little direction. How do I add 6 buttons with different colors?
AskSwiftSwift
3 comments
Latest comments
You cannot use Swift's graphics on repl.it, as they are made for apple devices
view all ›
9 months ago
What am I doing wrong?I have been trying to figure this out for the longest time and I am honestly just stumped. The problem in question : Create a property called testSc
AskSwiftSwift
2 comments
Latest comments
RYANTADIPARTHI9 months ago
int doesn't seem to be the type to inherit from. Maybe something else.
JasonLiu199 months ago
Well, it seems to me you can't inherit from Int.
view all ›
1 year ago
Im looking for people to do a Swift languaje calculatorI am looking for people with very little experience or no wait a way in the Swift programing languaje i hope you do not pay a hard goodbye
AskSwiftSwift
2 comments
Latest comments