top contributors since
theangryepicbanana
HazTheWaz
thesephist
Bookie0
eankeen
mat1
jajoosam
HackermonDev
ChaseLean
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
833 comments
Latest comments
DaxCodes3 days ago
RTexter can make movie scripts/other fun things with text
JonDoeBeep5 days ago
A lanuguage where you can use only the word: I. For example this program in binary from bloomu 111000101101101011101110111000010110101111101101101011011110111011101100111010110001000000001100111111101010101010100010010101101011111011101110111000100001101011011110101011011101111011111110101011101101101010011010100110111111110000000010000111001010110111101100111011010000000011011100110110100010101000101100101010101100111010111111110000000010000111001010110111101100111011010000000010101111110110100
SebastjanTekavc7 days ago
hi
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
179 comments
Latest comments
KS-11ZZ-94397119 days ago
how to ask how many courses you're taking
EthanRachall23 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 ›
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 ›
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 ›
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 ›
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
need helppleas help me out this task I can not understand this.
AskSwiftSwift
10 comments
Latest comments
axy19767 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 ›
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
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
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
13 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
VulcanWM13 days ago
Swift is mostly for Mac users so I recommend you use XCode
view all ›
19 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
bloodball19 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.
SomeBoyPlayz19 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 ›
2 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
8 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
Coder1008 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
DynamicSquid8 months ago
Flush the console
view all ›
10 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
RYANTADIPARTHI10 months ago
int doesn't seem to be the type to inherit from. Maybe something else.
JasonLiu1910 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
brandosha11 months 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
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
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
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 ›