Skip to content
Sign UpLog In
Profile icon

Hjonkiues The Second

@FriendlyGooseMan
I am FriendlyGooseMan. just a programming goose. I do optimizations for stuff nobody asked for discord: FriendlyGooseMan#0371
Repls
Community
FriendlyGooseMan
FriendlyGooseMan
shared a Post
1 year ago
Help required.
Hey so I have an issue with my saving system. Not really the saving system but the loading system it says that it cannot convert my string-list (as in
mfffff
Python
InvisibleOne
InvisibleOne
You can convert a string list to a list like this: mystrlist = "['banana','apple','orange']" mylist = eval(mystr_list) print(my_list) print(type(my_list)) Output: ['banana', 'apple', 'orange'] Just be careful using eval() because it will execute any command given. And if someone managed to put something like import os;os.system('rm -rf') into it, it would delete your files. If you are controlling the input however it should be fine. Other then this there are a few other techniques you can 1 year ago
MrVoo
MrVoo
Since a string is always made into a list the same way no matter what, you can't do it like that :( You have to find a way to change it back yourself1 year ago
FriendlyGooseMan
FriendlyGooseMan
shared a Post
1 year ago
I have optimized random number generation to be about 0.00001260415 per number (abt 6 seconds for 500K) but I think the reply community can take this
RandomNumberOptimizing
Python
Spacecraft
Spacecraft
~3 seconds for 500k import random import time mylist = [] i = 500000 print("Starting") start=time.time() for x in range(i): mylist.append(random.randint(0,10000)) end=time.time() print("%s ms Elapsed 500K numbers generated" %(end-start)) `1 year ago
FriendlyGooseMan
FriendlyGooseMan
shared a Post
2 years ago
Very Simple Slot machine that is going into a much bigger project of mine. click run and it will go fast (yes its laggy cuz repl.it and no I'm not buy
Slot Machine 01
Python
FriendlyGooseMan
FriendlyGooseMan
shared a Post
2 years ago
So I still need root.mainloop() And I need an event to happen every second. How would you do this, thanks in advance
IveBeenWorkingOnAProjectToLongINeedABreak.
Python
IMayBeMe
IMayBeMe
For this to happen you want a regular python while loop which calls a function that will update the Tkinter interface. I also can give more specific help if you can tell me exactly what you are trying to achieve.2 years ago
FriendlyGooseMan
FriendlyGooseMan
shared a Post
2 years ago
ok so basically I made tic tac toe using a numpy matrix. I really just did this for learning. but I wanted to share anyways. You play by inputting a n
TicTacToeAtHome
Python
FriendlyGooseMan
FriendlyGooseMan
shared a Post
2 years ago
Wanna make a team because Im bored. and like make a game or something. Also I can only use python because I am sad boi but like just say if you wanna
littlepenguin
littlepenguin
I can join!2 years ago
FriendlyGooseMan
FriendlyGooseMan
shared a Post
3 years ago
Some things you should do to write code is to plan it out, plan what you want to do, I'm working on AI and I just planed it out and it helped a lot. S
matrixmike
matrixmike
'your' should be 'you are'3 years ago
Jakman
Jakman
this is a great post. What other things programmers would want to do is see how everything comes together such as the structure of a building.3 years ago
DynamicSquid
DynamicSquid
Why does your post have so many upvotes from 0-cycle accounts? It looks like most of them are bots3 years ago
FriendlyGooseMan
FriendlyGooseMan
shared a Post
3 years ago
So Dumb Idea, That imma do, I want to make an Auto clicker in repl, how would I do that
SixBeeps
SixBeeps
Can't really do it unless you make a VM repl. Even then, the clicks won't go outside of the VM.3 years ago
FriendlyGooseMan
FriendlyGooseMan
shared a Post
3 years ago
I haz epic music need put in I need 50 charcters XD
ALPHAMONV
Pygame
Dart
Dart
i know python in repl does not have a way to play sound but im not too sure about pygame3 years ago
Vandesm14
Vandesm14
Did you mean to post this in Share? If so, I can move the post for you.3 years ago
FriendlyGooseMan
FriendlyGooseMan
shared a Post
3 years ago
So We can do dumber things ;-; I need 50 charcters
YeetW
Bash
RomeroSchwarz
RomeroSchwarz
Take input in the console, then write it to the chromium browser. > If this post helped, mark it as the answer3 years ago
SixBeeps
SixBeeps
The only way is to google "at symbol" and copy-paste. It doesn't look like the shift key works.3 years ago
mwilki7
mwilki7
using @ in what context3 years ago
FriendlyGooseMan
FriendlyGooseMan
shared a Post
3 years ago
chromuim --allow-no-sandbox-job is weird and I dont know how to use it.
YeetW
Bash
RomeroSchwarz
RomeroSchwarz
Based on what I found, > If this post helped, mark it as the answer3 years ago
FriendlyGooseMan
FriendlyGooseMan
shared a Post
3 years ago
SyntaxError: name 'x' is assigned to before global...
The Quest For Cheese
Pygame
AlexanderTarn
AlexanderTarn
You only use global when you use a global variable in a function not a loop.3 years ago
FriendlyGooseMan
FriendlyGooseMan
shared a Post
3 years ago
I made a simple snake game (well followed a tutorial) because I was bored. Hope you like '_' Edit Controls are WASD
Snake
Pygame
StephenHradnans
StephenHradnans
nice profile picture3 years ago
Axrevyn
Axrevyn
Great game, it does lag though. And lag isn't ideal for a reflex-reliant game.3 years ago
FriendlyGooseMan
FriendlyGooseMan
shared a Post
3 years ago
Why isn't local storage working? I really don't know how it works soo yeah
LlamaClick
HTML, CSS, JS
Vandesm14
Vandesm14
Your load function is not being run at all. Make sure you execute the load function in the first line of the cps function.3 years ago
FriendlyGooseMan
FriendlyGooseMan
shared a Post
3 years ago
This is confuse. and I have smol brain Water is not working and I am mad
Duncqun I @LukeShomper
Python
FriendlyGooseMan
FriendlyGooseMan
@Nemoiscool Did Have the answer that helped more but @maazzubair99 Helped a lot too!3 years ago
Nemoiscool
Nemoiscool
I have discovered a few issues. The first is on line 12: 'Water =- (Humans*2)' should be: 'Water -= (Humans*2)' (note the switch of the '-' and '=') Next, variables declared outside of functions cannot be used inside functions unless you do one of a couple things: At the beginning of every function you declare the variable to be global by typing this line: 'global Water.' Another way would be to use parameters. to declare a parameter, simply put the parameter name inside the parenthesis when3 years ago
FriendlyGooseMan
FriendlyGooseMan
shared a Post
3 years ago
I really dont know how to use text wrap, I just wanna print some ascii text that I made and I want to print it so I went on google and it said text wr
Duncqun I
Python
sylashur
sylashur
I don't think you have to use textwrap, this is what I have, you just have to maximize the output window before running the code. https://repl.it/@sylashur/Duncqun-I-LukeShomper3 years ago
eco27
eco27
you need parentheses around print print(textwrap.dedent(... ... ...) `3 years ago
FriendlyGooseMan
FriendlyGooseMan
shared a Post
3 years ago
I need this because It's a clicker and It's no fun having to restart so I'm just asking. Thanks!
LlamaClick
HTML, CSS, JS
Vandesm14
Vandesm14
You can use local storage for that: Set an item: localStorage.setItem('score', 300); Get an item: localStorage.getItem('score');3 years ago
mwilki7
mwilki7
Not the best idea, but way I did something like this is to turn your game state into text and copy paste that manually into a file somewhere.3 years ago
FriendlyGooseMan
FriendlyGooseMan
shared a Post
3 years ago
How would I make it so that Buteen moves down a line so that it looks a lot better.
LlamaClick
HTML, CSS, JS
Vandesm14
Vandesm14
You can use `` to add a newline, if that's what you need.3 years ago
FriendlyGooseMan
FriendlyGooseMan
shared a Post
3 years ago
Press enter to goto the next screen after the title. The Save screen is so glitchy and I dont know how to fix it.
ALPHAMONV
Pygame
Vandesm14
Vandesm14
Repl.it is just glitchy overall. The only way to avoid/fix this is to run it on your local machine.3 years ago
FriendlyGooseMan
FriendlyGooseMan
shared a Post
3 years ago
So im using a function to display the text if that helps Im Trying to figure out why its blinking white on the second screen (Press enter to goto next
ALPHAMONV
Pygame
Vandesm14
Vandesm14
Your repl does not seem to work so I'm not able to test the screen bug.3 years ago