top contributors since
Prankster
theangryepicbanana
HazTheWaz
thesephist
SuigamiMitsokeL
eankeen
mat1
HackermonDev
HarperframeInc
cgjml
view leaderboard →
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
179 comments
Latest comments
KS-11ZZ-94397126 days ago
how to ask how many courses you're taking
EthanRachall30 days ago
Hi can someone help me fix my code? The background color won't work on my Python Turtle code, Link is here: https://replit.com/@EthanRachall/mountain-range-1#main.py
MikeW33 months ago
repl.it/feedback and repl.it/bugs are broken links
view all ›
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
835 comments
Latest comments
DaxCodes10 days ago
RTexter can make movie scripts/other fun things with text
JonDoeBeep12 days ago
A lanuguage where you can use only the word: I. For example this program in binary from bloomu 111000101101101011101110111000010110101111101101101011011110111011101100111010110001000000001100111111101010101010100010010101101011111011101110111000100001101011011110101011011101111011111110101011101101101010011010100110111111110000000010000111001010110111101100111011010000000011011100110110100010101000101100101010101100111010111111110000000010000111001010110111101100111011010000000010101111110110100
SebastjanTekavc14 days ago
hi
view all ›
20 days ago
How can I run XCTestCases in Repl.it?In XCode there's a very nice 'play' button beside each test case function, which is obviously not present in Repl.it. I'm curious is it even possible
AskSwiftSwift
1 comment
Latest comments
VulcanWM20 days ago
Swift is mostly for Mac users so I recommend you use XCode
view all ›
26 days ago
Is Replit having difficulty with Swift code right now?Even with the most simple print statement, I get no output when I run a Swift program in Replit. If I run the same print statement in a Python program
AskSwiftSwift
4 comments
Latest comments
bloodball26 days ago
I do not see any code in your main file but I assume you aren't getting any output because repl.it is having issues with execution. Give it a few hours and it should work.
SomeBoyPlayz26 days ago
@kquick8 more detail? I dont see any code and this is working normally image
view all ›
1 month 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
NewSkooCoder1 month ago
Code is not finished, Imma do the final recipie at the end, ignore the final line lol
view all ›
3 months ago
Database for swiftHey, how can i use the replit database for my nonclient swift language. i have already seen the replit document but i cant get any idea. anyone help m
AskSwiftSwift
comment
6 months ago
HIHi i wanted to introduce myself so hi
AskSwiftSwift
3 comments
Latest comments
Bookie06 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
MikeJMS89106 months ago
hello
view all ›
answered
9 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
Coder1009 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
DynamicSquid9 months ago
Flush the console
view all ›
11 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
RYANTADIPARTHI11 months ago
int doesn't seem to be the type to inherit from. Maybe something else.
JasonLiu1911 months ago
Well, it seems to me you can't inherit from Int.
view all ›
1 year 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
brandosha1 year ago
Try this: https://gist.github.com/juliengdt/95fd31457c765d5e9535 if !(0...100 ~= z) { ... } or if !(0...100).contains(z) { ... }
RYANTADIPARTHI1 year ago
You can use the ! to do your task
Coder1001 year 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
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
Coder1001 year ago
btw, Int(0, 100) initializes 0 base 100, which is not what you want I don't think
Coder1001 year 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
RYANTADIPARTHI1 year 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 ›
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 ›
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 ›
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
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
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 ›
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 ›
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 ›
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
PattanAhmed1 year ago
@URItechnollogy Hi, You can check the following websites that guide you to how to build a calculator in Swift:- **Click here This too Check this website also** And you can find more online tutorials on YouTube, web browser, etc *Hope this helps Please mark my answer if this helps*
[deleted]
1 year ago
Hey! I moved the board your post is in from templates to the ask board. Make sure you put posts in the correct board! Thanks!
view all ›
1 year ago
Help please! I need help understanding how to use the max (by: ) method on swift to find the key with the maximum value in a dictionary. thanks!
AskSwiftSwift
1 comment
Latest comments
estenoesmiputon1 year ago
This is the documentation of the function map(by:). Apart from that, I will try to explain what I understand of this function. The core of the function is func max(by areInIncreasingOrder: ( (key: Key, value: Value), (key: Key, value: Value) ) throws -> Bool) rethrows -> (key: Key, value: Value)? As you can see, you have to pass a function inline to compare the pair of values. The code that you are using, is a shortcut. If you want the full code, it would be: let fu
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 ›
2 years ago
Help with conditionals and options with swiftWhat am I doing wrong. Please explain any answers you have....TIA any help is greatly appreciated!
AskSwiftSwift
1 comment
Latest comments
elonmaks2 years ago
Hi, @HilareeSchultz . I hope it will help you to understand. Swift 4 also introduces Optionals type, which handles the absence of a value. Optionals say either "there is a value, and it equals x" or "there isn't a value at all". An Optional is a type on its own, actually one of Swift 4’s new super-powered enums. It has two possible values, None and Some(T), where T is an associated value of the correct data type available in Swift 4. So this documentation says about: If you declaring variabl
view all ›
2 years ago
Unwrapping an integerCan someone please explain to me what I am doing wrong here. I am on the last step and, not only just plain want it to work, I also want to fully unde
AskSwiftSwift
comment
2 years ago
how to invitehow to invite someone in the talk
AskSwiftSwift
1 comment
Latest comments
xolyon2 years 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
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
ronniegertman2 years 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 ›
2 years ago
I can't get past the second question here on arrays can anyone help mehere is my code var numbers = [45, 73, 195, 53] //Write your code here var computedNumbers = 1 numbers = computedNumbers + 1 print(computedNumbers
AskSwiftSwift
2 comments
Latest comments
ash15khng2 years ago
What is the question? You gave us the code but we need to know what you want to with it.
What are you trying to do?
view all ›
2 years ago
Why do I get these two errors?exit status 1 main.swift:6:1: error: expected expression else ^ main.swift:4:5: warning: initialization of variable 'isOn' was never used; consider re
AskSwiftSwift
comment
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 ›
2 years ago
I want to learn how to code in swift, can you teach me some basic lessons?I want to learn some basic tips and tricks for Swift as I want to advance in my app development. I'm quite experienced in Python so I have a basic und
AskSwiftSwift
2 comments
Latest comments
The official Swift website is a good place to start: https://docs.swift.org/swift-book/GuidedTour/GuidedTour.html
RomeroSchwarz2 years ago
Please, don't ask for tutorials on the Ask board, as this isn't a board made for lessons. Go to the learn board if you want to find tutorials. But, here is what you need: this tutorial will teach you all of the basics of swift. > If this post helped, mark it as the answer.
view all ›
2 years ago
stuckWrite 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
SixBeeps2 years ago
The remainder operator (a % b) works out how many multiples of b will fit inside a and returns the value that is left over (known as the remainder). The remainder of x and 2 can tell you if a number is even or odd.
view all ›
2 years ago
how to debug my code how can i correct my code and i will i know if my code is good or not
AskSwiftSwift
1 comment
Latest comments
a5rocks2 years ago
I would recommend going through the errors raised one by one, almost like a todo list. For example, the first one: Firstprogram.swift:1:1: error: expressions are not allowed at the top level print("Hello, My name is Olasunkanmi, I love ios development.") This is telling you that you need to have a function (main probably, I don't use Swift) around all of this. This is pretty easy to do in fact, just ctrl+a, ctrl+tab, then at the top and bottom add the necessary function seperators.
view all ›
2 years ago
Printing Output TextsHey there learners, Im just starting out on my precourse and Im on the section where i have to print output texts. I do the procedure correctly to out
AskSwiftSwift
2 comments
Latest comments
SixBeeps2 years ago
Try putting your code in Main.swift
mwilki72 years ago
I don't see any code.
view all ›