Share your repls and programming experiences

← Back to all posts
Logarithms and Inverse Logarithms!
LizFoster (592)

Okay, time for something fun that , for once, ISN'T related to π! (Lol)

This program takes a user-inputted base and offset, and graphs the corresponding log and inverse log. This assumes the format:

log_base(x + o)

Please enjoy! #^__ ^#

Commentshotnewtop
LiamDonohue (279)

YYYYYYAAAYYY ur #1 on the leaderboard

Highwayman (1309)

@.lizzyFoster👏 :D

LizFoster (592)

@Highwayman Ha ha ha, do you like it? I'm starting work on a new big project, hopefully this one doesn't take like a year to complete wwwwwwwww

Highwayman (1309)

@LizFoster yeah! I like all your stuff, most ppl do lol. What’s the big proj?

LizFoster (592)

@Highwayman Recreating Pokemon Red completely, without any graphical modules, from scratch!

LizFoster (592)

@Highwayman I can tell this'll be fun! w-w

Highwayman (1309)

@LizFoster ngl, I’ve never actually heard of Pokémon Red (I kinda lived under a rock until like last year XD) what is it?

LizFoster (592)

@Highwayman Oh, wow! I thought Pokemon was a big thing in the U.S...

It was the very first Pokemon game, released in 1996 ^ ^

Highwayman (1309)

@LizFoster I mean it is but I literally have been living under a rock. Like no outside connections. Like a caveman.

...

Anyways. Cool! I think I’ve seen ppl play Pokémon before, and I’m excited to see what you will create :)

LizFoster (592)

@Highwayman Really! wwwwwwwwww

Yeah, I'm looking forward to getting into the thick of this one. I'm mostly looking forward to coding the overworld motion, and drawing up the maps 0~0

Highwayman (1309)

@LizFoster UwU overworld motion? What’s that?

LizFoster (592)

@Highwayman (Lol)

Oh, I mean, working on allowing the player to move around, and having the map move with the player

Highwayman (1309)

@LizFoster oh lol. Is this like 2d I’m guessing then?

Highwayman (1309)

@LizFoster XD how apre you gonna get the graphics to work without any libs? I can’t even image to be honest How does that work?

LizFoster (592)

@Highwayman Well, I'll make a section for all the textures I'll need to render for an area, assigning each of them a number. Then, I make a matrix using those numbers that, when printed properly, looks like the map.

LizFoster (592)

@Highwayman Think of it like a paint-by-numbers game.

CodingCactus (2467)

@LizFoster wow, that's a very big project. Pokemon's cool, although I've never played red, just like black2 onwards.

I feel like that will take quite a long time.

Good luck! :)

LizFoster (592)

@CodingCactus It probably will, yeah. I'm most worried about the map; how am I supposed to draw those textures on a reasonable scale?!

CodingCactus (2467)

@LizFoster I have no idea, but I bet you'll find a way

LizFoster (592)

@CodingCactus If only Python with Turtle allowed for multiple files and folders... T~T

CodingCactus (2467)

@LizFoster yea, why doesn't it? Maybe you could suggest it in feedback

LizFoster (592)

@CodingCactus Actually, yeah, I should do that! The process of getting keybinds set up is way easier with turtle anyways.. (Lol)

CodingCactus (2467)

@LiamDonohue Why weren't you happy with me being number 1 on the leaderboard? :(

CodingCactus (2467)

@LizFoster yeah, I was about to mention that :(

LizFoster (592)

@CodingCactus So it has something to do with hardware restraints, if I am following correctly?

CodingCactus (2467)

@LizFoster yeah, I think that maybe python with turtle as a language doesn't allow multiple files, so there isn't much that repl.it can do as an IDE to alter it to allow multiple files

maybe

CodingCactus (2467)

@LizFoster cool, i'm top of trending in feedback section
:)

LizFoster (592)

@CodingCactus Ooh, I like that idea. It would be quite cool to see how much traffic a post is getting!

Highwayman (1309)

@LizFoster sry bout the gap in time I had to go to bed apparently.

So it’s like

1 ——> textureA
2 ——> textureB
3 ——> textureC
4 ——> textureD

And the output is like

1 2
3 4

?? :/ my brain is slower than I’d like to admit :(
Or is it like

A B
C D

I think I’ve just confused myself even more on what your actually telling me XD hum time to look up paint-by-numbers.

I wonder if os.system() works on python with turtle repls... actually if you’re really gunning for it, then why not set up a remote dB to hold all that stuff you’d put in files like the textures and whatever?

LizFoster (592)

@Highwayman You're right, it's like

1 2
3 4

I don't know too much about the os module, unfortunately..

Highwayman (1309)

@LizFoster yay! I’m not dumb for once XD
yeah, I thought about it and decided it wouldn’t help anyways, not to worry. 🤷‍♂️

LizFoster (592)

@Highwayman wwwwwww

I'm excited to do this project ether way, though.

Highwayman (1309)

@LizFoster :P ye I’m very excited to see how that’ll turn out. I’ve tried making games before, but I just totally suck at it XD you look like you’ll get somewhere though and I think it’d be fool to play your game when you post or share.

LizFoster (592)

@Highwayman Also, I'm sure you don't suck that badly.

Highwayman (1309)

@LizFoster no no no I mean like it’s horrifying XD XD anyways.. uh.. something XD

AmazingMech2418 (658)

@LizFoster Though, do you think Turtle is fast enough to create a game? I haven't really messed with it much, but based on what I know, it is kind of slow... I think something like PyGame would be easier if you are doing it in Python. However, my go-to for that kind of stuff is HTML5. However, I'm not sure if Turtle allows image manipulation. I just know that drawing with Turtle would probably be too slow. I'm actually looking it up right now, because if Turtle can be used for image manipulation, I may just have to create a Python graphics library. However, I know that you could probably create a C library if needed (given that you know C (I only know command line C)). Anyways, good luck!

LizFoster (592)

@AmazingMech2418 I do not know C, sadly.

There are many ways to improve turtle's efficiency; win.tracer, t.speed(0), and most obviously, using multiple turtles to draw at once. I just don't know how to use PyGame, as I haven't taken the time to learn it..

Thank you!

AmazingMech2418 (658)

@LizFoster You're welcome! I honestly don't know enough C to create a graphics library either and haven't taken the time to learn PyGame. Also, you can use multiple turtles? As you can tell, I am pretty far behind in my Python knowledge, especially if you compare it to what I know about JavaScript which is my go-to language and which I have been programming in for years now (I only started Python maybe a year or two ago). JS was actually one of my first programming languages (my first was VB6, and my second was C# for ASP.NET, then I learned JS)

LizFoster (592)

@AmazingMech2418 I don't blame you for not knowing much about turtle; it's apparently quite outdated (I am surprised and glad that repl.it supports it!), I only know it because we had a brief lesson on it in class one day, and it was very cool to me ^ ^*

AmazingMech2418 (658)

@LizFoster Turtle is outdated? Honestly, I'm just behind in Python. I only really know how to do command line stuff. I've only really heard of things like PyGame honestly.

AmazingMech2418 (658)

@LizFoster By the way, is there a π project you forgot about? https://repl.it/@LizFoster/p It's empty...

JoeyRueff (19)

There's Pi inside! :O

Highwayman (1309)

UwU This is something I’m learning rn!

luffy223 (6)

wow and didn't understand how
how did you made a turtle to graph a function till me

LizFoster (592)

@luffy223 You basically just take the turtle's x or y value (scaled down however much you'd like), and plug it into an equation! Just look at lines 26 and 38 for even more clarity.

luffy223 (6)

mmmm could i input a function @LizFoster

LizFoster (592)

@luffy223 no, I don't think so, not on this program at least.

luffy223 (6)

not on yours or not on python [email protected]

luffy223 (6)

mmmm let's try making a python based desmos haha @LizFoster

KevinLu2 (0)

By inverse log do you just mean exponential

LizFoster (592)

@KevinLu2 No, I mean, the opposite of whatever logarithm you put in. I suppose in a way it is exponential, but that's not really the name that applies here.

SilentShadowBla (538)

Another awesome project! Nice job!!!!!
#πthon

[deleted]

WOW 60 LINES ONLY TO DO THAT!