Updates from the Repl.it team about the product

← Back to all posts
Weekly Challenge #17
h
TheDrone7 (1654)

Hello again replers! We just finished our fourth series of weekly challenges and at the end of a month, @minx28 who was ranked 1st received 1 month of free hacker plan.

Today, we'll be starting another series of the weekly challenges and again, at the end of the month, whoever has the highest score, gets 1 month of free hacker plan!

That's it for the recap, moving forward, this week's challenge is given below!

WARNING : This is no longer beginner friendly!


Fibonacci Numbers

For those of you who don't know what it is, refer to this wikipedia page. The usual approach to calculating nth term of the series is either by using loops or recursion. For this week's challenge, you have to write a program that generates a user specified number of terms without using either of those 2 methods. No loops, no recursion.

The output only needs to have the Nth term.

Have fun with that one!

FAQ

  1. Are stdlib functions that might use looping or recursion behind the scenes allowed?
    A : Yes. But if you use them, you will lose 3 points from however much you get.

  2. Are external APIs or packages allowed?
    A : NO!

SUBMISSION

For submitting your codes for this challenge, you need to create a new post on repl talk share board and ensure that the post title contains #WEEKLY in it. The judging will go on throughout the week and as soon as the next post is made, the time window for submitting your code will end.


You can check out the last month's results here.

And that's it! Good luck with this week's weekly challenge and have fun!

Comments
hotnewtop
EpicGamer007 (1540)

Fibonacci numbers: me: This is gonna be easy! || Kalm
@TheDrone7: "Are external API's or packages allowed, NO!" : NUUUUUUUUUUUUU || PANIK

JosephSanthosh (1197)

I was confused for a second. Nice name though. @EpicGamer007

EpicGamer007 (1540)

@JosephSanthosh , its my name for multiple other accounts so i changed it.

AmazingMech2418 (1016)

Ah... Time for some metaprogramming. LOL!

HahaYes (1901)

@AmazingMech2418 haha metaprogramming. That should be intresting

AmazingMech2418 (1016)

@HahaYes Thank you! I already did mine though. LOL!

HahaYes (1901)

@AmazingMech2418 oh you did. I'm thinking of starting this... I still have time right?

AmazingMech2418 (1016)

@HahaYes I think so. You better go fast though!

Zavexeon (1180)

me resisting the temptation to delete all the comments and comment "first"

dabs364 (276)

Last week I made a post about the Fibonacci sequence... But, that used a for loop

RohilPatel (1519)

is there a first term? it doesnt seem very specific

TheDrone7 (1654)

@RohilPatel I mean, the series goes 0, 1, 1, 2, ... So 0 is the first term

minx28 (502)

@TheDrone7 thonk. I've usually seen 1 as the first term, 0 can be thought of as term number 0

AmazingMech2418 (1016)

@minx28 Same. I'm just going based on how Wolfram Alpha numbers everything. LOL!

xxpertHacker (785)

Wow I'm late, I already had Binet's formula pinned on my profile for almost a whole year. Oh, I guess I didn't... too late to submit but: https://repl.it/@xxpertHacker/Binets-Formula.

JosephSanthosh (1197)

Can I make a parody version of it? I made a non-parody version already!

HahaYes (1901)

Huh, this is getting intresting, I'll try to do it, but I guess I'll just wait until next month?

fuzzyastrocat (1505)

@HahaYes Or you could try speedcoding :D

mwilki7 (1130)

what about using event loops like in html5?

generationXcode (317)

Can I use a library like django to present it all?

DynamicSquid (4566)

ooh, we should have a code golf challenge!

fuzzyastrocat (1505)

@DynamicSquid I'm always up for code golf :D

SpicedSpices (296)

Do specific built-in array methods such as reduce and map count as iteration? As much as those methods would help, they feel too much like cheating.

Edit: nvm i saw the post edit

EpicGamer007 (1540)

You say we cannot use loops but can we use loops to set up an array? by doing that, we technically are not using loops to get the answer because we can just do: System.out.println(fibonacciNumbers[n]); to get the answer. Will this be ok?

TheDrone7 (1654)

@AbhayBhat nope, no loops whatsoever.

SpicedSpices (296)

@AbhayBhat you could use 10^n and then split it as a string to get an array of length n+1

EpicGamer007 (1540)

@SpicedSpices, can you explain a bit more?..

SpicedSpices (296)

@AbhayBhat if you take an integer n and set it to something like Int n = 6, you can raise 10 to the power of n Int o = Math.pow(10, n) (in Java), resulting in a number with n + 1 digits in it, because we use base 10 counting, and if you multiply something by 10, it adds a zero at the end. Now if you turn this into a string and split it between each character String[] p = o.toString().split(''); (in Java), it will create an array with n+1 items in it.

EpicGamer007 (1540)

Question: Can we look up stuff for help? I am still so noob, that I need loops & || recursion to get this...

TheDrone7 (1654)

@AbhayBhat of course, that's the point.

JosephSanthosh (1197)

Wait so the point is to look up for help? @TheDrone7

TheDrone7 (1654)

@JosephSanthosh the point is to be able to find a solution to something you can't solve already.

minx28 (502)

@DaLiteralPanda I am guessing that streamlit is fine, as long as you're not actually using it to calculate the numbers. If you're just using streamlit as an interface but calculating the numbers using pure python, I think that's ok.
Don't rely on me though, I could be wrong :/

HarperframeInc (439)

Just for clarification:

  • Absolutely no loops and recursion? Including list loops? (ex. [n - 1 for n in range(num)])
  • Python standard libraries such as math are allowed - correct?
dabs364 (276)

@HarperframeInc I already have a program for that but it uses loops...

HarperframeInc (439)

@dabs364 wha? I don't get how that relates to my comment?

HarperframeInc (439)

@dabs364 so why'd you comment that? (to flex on me?)

fuzzyastrocat (1505)

Hmm this looks fun... gonna try to do it without the direct math formula.
EDIT: I have done it without the math formula, that was fun. Try it!

minx28 (502)

Do exponentials use iteration?

AmazingMech2418 (1016)

@TheDrone7 How about repeat in strings? I think it is native Assembly, but the polyfill uses loops... Also, it's the same as multiplying a string by a number in Python...

CodingCactus (4117)

another maths one 🤔

TheDrone7 (1654)

@CodingCactus c'mon, everyone loves math.

CodingCactus (4117)

@TheDrone7 pretty sure the people that do these changes don't (except minx)

DynamicSquid (4566)

@TheDrone7

c'mon, everyone loves math.

what planet do you come from?

Codemonkey51 (1036)

c'mon, everyone loves math.

True dat @TheDrone7

AmazingMech2418 (1016)

@DynamicSquid What do you mean? Math is great!

CodeLongAndPros (1578)

@Coder100 rm -rf com.coder100.comments.weekly.17.first

CodeLongAndPros (1578)

@Coder100 Lemme guess, you didn't see my submission? It's more lamo that my comment.

slip1244 (255)

@CodeLongAndPros read faq
2. Are external APIs or packages allowed?
A : NO!

CodeLongAndPros (1578)

@nithilan4 Erm my title was “#WEEKLY I CHEATED BUT HERE IT IS ANYWAY”