Jaymes Morris

@SagaciousPan (21)
Programming is just my hobby.
error
posted to Ask by abidahmed78692

You are missing the ")" on the end of your print statement.
It should loo like:
print("hello world")

Not:
print("hello world"

Comment if I helped or not, Good Luck.

new repl
posted to Ask by hyenial

Once you are logged-in to Repl.it you should be able to go to:
https://repl.it/repls
...and see all of your repls.
Then just click the "+ New Repl" button at the top right of the screen.
(It should be blue and not all the way on the right side, maybe more towards the middle.)

Reply if I helped, Good Luck.

What's this?
posted to Ask by mkhoi

The console is a place where you can run code.
You can use functions like print("my message") in the console.
Example (See Image):

Hope I could help you with understanding this!

new repl
posted to Ask by hyenial

@hyenial
Ohhh, your screen size is too small.
Are you on mobile right now?
If you can try to enlarge it.

If you are on a computer right now then you can hold Ctrl + Scroll (with your mouse) to change to your screens zoom level.

Number of Even Digits
posted to Ask by AlvinJohn1

So you want to know the number of even digits in a list, right?
You also want the user to enter the numbers?

Why is the system printing zero
posted to Ask by TasmiaChowdhury

I have never used Java before just now but I got it to work using floats:
https://repl.it/@SagaciousPan/YummyClassicCommands
Tell me if this helps.

Not sure what I am supposed to be returning here...
posted to Ask by OtakuMom

I don't know Java but, what seemed to fix the error form showing was changing:

#46      }
#47    }System.exit(0);
#48
#49  } return sum();
#50  

To:

#46      }
#47    }return "" + sum;
#48
#49  } 
#50  

The first thing is that the return is in the wrong place.

The next problem is that sum is a integer not an string or a function BUT the code expects you to return a string:
return sum(); => tries to return a non-existent function Gives Error
return sum; => tries to return it as an integer Gives Error
return ""+sum => returns sum as a string No Error!

Hope I could help a little or maybe solve your problem.
Like I said I don't use Java so I might not have told you anything you didn't know.
Please reply if I did or didn't help you fix your problem.

Good Luck with you future projects! 😊

Please mark this as answered if your problem has been solved.

Anyone Know Why This Isn't Working?
posted to Ask by etian

@etian Sorry I couldn't help sooner.
Glad you found a way to fix it though.
Keep up the good work! 😊

Anyone Know Why This Isn't Working?
posted to Ask by etian

@etian It seems to be working for me.

What's the problem with it?

saving
posted to Ask by demacedone

It should still save automatically without you doing anything.

Hope I helped!

Im stuck with programming in general
posted to Ask by JacksonAiken3

If your looking for a course to help you advance in coding then highly recommend FreeCodeCamp as it is free and teaches you thing you would need to become a professional back-end or front-end developer.
A lot of things also just come with practice and solving things yourself rather than just looking everything up (not saying that you are doing that).
Those people that are younger then you could have just been coding longer or are just naturally fast learners.
Doing different coding projects that you have never done before and experimenting with new functions will also effect the rate at which your learning and 'advancing'.

Just wondering but, mind listing so things/projects you have done?

Help me
posted to Ask by michael15935

Here is how you do it...

import java.util.Scanner;
class Main {
  public static void main(String[] args) {
        System.out.print("Enter a string : ");
        Scanner scanner = new Scanner(System. in);
        String inputString = scanner. nextLine();
        System.out.println("String read from console is : \n"+inputString);
  }
}

Example Repl:
https://repl.it/@SagaciousPan/Get-string-from-scanner

Hope I helped!

Please mark this as answered if your problem has been solved.

How do you generate random numbers in Python?
posted to Ask by BOIBOI1

@BOIBOI1
The below code will print a random number between 1 and 100 ten times.

# import the 'random' library and it's commands
import random

# do this 10 times
for x in range(10):
  #print a random number between 1 and 100
  print (random.randint(1,101))

Test at:
https://repl.it/@SagaciousPan/Random-Number-Python

Hope I could help!

Please mark this as answered if your problem has been solved.

hello
posted to Ask by robert5539

I think that the easiest inroduction game is a text adventure.
The game can be very simple or very advanced, it's up to you.
You can also always add on to it and give it more functions.

Hope I helped!

How can I stop repeating this code?
posted to Ask by SagaciousPan

@mwilki7 I found out the problem.
On top of putting sleep(text.length*mainController.speed); inside of the typeToConsole function, I also needed to add await to each mainController.typeToConsole("<input text here>"); inside of the main function.
Example:
await mainController.typeToConsole("Hello World!");
Thanks for your help.

How can I stop repeating this code?
posted to Ask by SagaciousPan

@mwilki7 I have just changed my code and put the sleep(text.length*mainController.speed); inside of the typeToConsole function.
Now you can see my next problem.

How can I stop repeating this code?
posted to Ask by SagaciousPan

@mwilki7 I tried doing that in different ways but every time it seemed to break the code by calling all of the typeToConsole methods at the same time making the console look like a jumbled mess.
I probably didn't explain that well but if you can try messing with it a bit to see if you can do what you suggested that would be great.

How can I stop repeating this code?
posted to Ask by SagaciousPan

@mwilki7 Thanks for the response but, if I change like you suggested:

text = "If I could find a way to not repeat so much code.";
mainController.typeToConsole(text);
await sleep(text.length*mainController.speed);

to:

mainController.typeToConsole("If I could find a way to not repeat so much code.");
await sleep(text.length*mainController.speed);

Then this part of it:

await sleep(text.length*mainController.speed);

Would no longer work and I would have to manually find out the number of characters in each string so that it pauses for the right time.
Example:

await sleep(49*mainController.speed);
How can I stop repeating this code?
posted to Ask by SagaciousPan

@theangryepicbanana Thanks for the quick response.
I can't believe I left var in there so many times.
I'll test using a loop and see how I like it.
Thanks again!

3rd Program (addition and multiplication)
posted to Share by mattflaherty

Are you learning programming.
Are new to programming/python?
This is a good start.
Keep up the good work.

My first Python project
posted to Share by Abdullah_099

Very nice!
A little Very repetitive but still fun.
I myself wouldn't play it again after winning though.
Keep up the good work and keep coding 🙂.

cauculator
posted to Share by JessiHudgins

It is broken, not printing anything on the screen and stops running about 1 second after pressing the run button.
(It's because you are currently working on it.)
(You have an open if statement.)

new repl
posted to Ask by hyenial

@hyenial
Glad I could help!

new repl
posted to Ask by hyenial

@hyenial
That's weird

, my screen looks like:

5day challenge
posted to Ask by UnnamedIam

um... what 5 day challenge?
Can you post a link?

Hi
posted to Ask by duckSuck

Since your new a good project in python would be a Text Adventure:
https://repl.it/@SagaciousPan/TextAdventureVersion05
Of course it wouldn't be as complex as that at first (as you ca see that is my 5th version),
but overtime you can expand it and add more features.

Reply if you think this idea is good, bad, or if your just not interested in doing it.
I would love to see your results and help you if needed.

Good Luck!

I did something cool on here!
posted to Share by JoeDew7

Very nice!
Not much to improve here but if you want to more practice you could make a text adventure.
I made one my self, though it took a couple of days.

My first one (using an old version of python):
https://repl.it/@SagaciousPan/TextAdventureVersion01

My second one (using the current version of python):
https://repl.it/@SagaciousPan/TextAdventureVersion05

I suggest the you move on to something like that.
Reply if my idea was good, bad, or something that you just don't feel like trying.
Good Luck.

Number of Even Digits
posted to Ask by AlvinJohn1

@AlvinJohn1
May be a little more advanced then what you are asking for but here you go:
https://repl.it/@SagaciousPan/Odd-and-Even-number-separator
(You may want to open it in a new tab to see everything it prints.)
Tell me how you like it or if you have any questions.
Good Luck.

infinite combat text game with character select(demo for the python text game i am working on)
posted to Share by INUMA666

My Personal Suggestions

I like the idea but there are a few changes that I would make to improve it:

  • The Ability to Type the Action
    • As of now you can only type the number (1, 2, 3, 4...).
    • Being able to type the action (attack, kit...) would be nice.
    • Or making it restrict you from typing anything but a number.
    • It lets you type words and accepts them but you don't know what there are going to do.
    • Example: Typed "attack" :: Action Taken "kit"
  • Typos
    • Mostly no capital letters or punctuation.
    • (Not much else to say here)
  • Bug: Holding Down [Enter]
    • If you press [Enter] it accepts it (nothing) as a response.
    • If you hold down [Enter] then it plays out the game until the amount of times nothing was entered is finished.