Hello all! I just wanted to rekindle the who wants a challenge? topic without bumping it after seven months. I think it’s really cool to pass on challenges to other users, even if they’re newer and just want to participate. I really like codewars, but the katas can really kick your butt, and I like the community aspect of this forum. Anyways, challenge away. I don’t know exactly how to go about this, but anybody who wants a challenge can ask for the difficulty level and language like: “Gimme a easy/mediumish challenge for Ruby, m8.”
Hopefully this picks up. @stetim94 gave me a good challenge I’ll be working more on when I have time.
Ok well lets get this started. I think I want a medium Javascript challenge. Not sure what that challenge will encompass but if possible I like games
Can you write a function, that when passed a string of words, you can print the length of the SHORTEST word?
Does this make sense?
Yeah, Basically, if I type a string like this “brad ate pizza tonight” I want ate to return because it is the shortest word
You want to return 3, because [quote=“kyleaw, post:3, topic:65935”]
print the length
[/quote]
Sigh yeah yeah just testing ya ok sounds interesting enough thank you! let the fun begin
i already provided a good challenge for kyleaw:
build a program which build a pyramid, first prompt the user for how high the pyramid should be, lets say the user enters 5, the pyramid should be printed like this:
#
##
###
####
#####
if you want to make it yourself more difficult:
#
##
###
####
#####
or even more difficult:
#
# #
# # #
# # # #
# # # # #
you can pick the programming language, good luck!
does someone have a good challenge for me?
what you want a challenge in oh master of coding?
of course, even for me there can be challenges. I am still struggling on codewars on a regular basis
me too, I just started yesterday and those katas kill me
I’ve got one!
Can you write a program that generates a guessing game? Make it end when the user guesses the correct answer. If the user guess is too low, tell them, also tell them if it’s too high. I’ve done this in Java using scanner.
Bonus points: ask the user to determine what the range should be!
This sounds hard but it’s really more time consuming than difficult.
is this you? https://www.codewars.com/users/kyleaw
the challenges in codewar get more difficult if you progress through the ranks
That is in fact me!
No, the guessing game is something I wrote in Java a couple months ago.
No I meant mine xD you give me link to your profile and the first challenge I see is “Shortest Word” and I be like this girl is trying to get me to cheat haha
I did mine in python haha, I’ve already seen the solutions for JavaScript, it was just something I did yesterday and I was trying to think of something pretty easy.
[details=Mine in python.]```
def find_short(s):
# your code here
l = 100
words = s.split(" ")
for word in words:
if len(word) < l:
l = len(word)
return l
hm… i build the number guesses game:
from random import randint
print("welcome to the number guess game")
invalid = True
while invalid:
try:
print("enter the range of guess game")
minimum = int(input("enter minimum value: "))
maximum = int(input("enter maximum value: "))
guesses = int(input("nuber of guesses: "))
if minimum + 5 > maximum:
raise ValueError
except ValueError:
print("invalid input or to small range")
else:
invalid = False
number = randint(minimum,maximum)
def guess():
for i in range(0,guesses):
try:
temp = int(input("guess the number: "))
except ValueError:
print("invalid input, you wasted a guess")
else:
if temp == number:
return "you won!"
print("not the right number")
print("guesses remaining:", guesses - i - 1 )
return "You lost"
print(guess())
still has some sharp edges, but how did i do? (this is python3 code)
function find_shortest_word(str)
{
var array1 = str.match(/\w[a-z]{0,}/gi);
var result = array1[0];
for(var x = 1 ; x < array1.length ; x++)
{
if(result.length > array1[x].length)
{
result = array1[x];
}
}
return result;
}
console.log(find_shortest_word('brad ate pizza tonight'));
Ok, I will admit, I did cheat slightly with var array1 = str.match(/\w[a-z]{0,}/gi); found it on another forum post xD However, fondly enough, other javascript lessons pretty much provided everything else