Programming Challenges Time!

No.

Left → Right
Parentheses → Exponents → Multiplication/Division → Addition/Subtraction

Multiplication has no order over Division, like Addition has no order over Subtraction.

3 Likes

This is too hard. I consider myself a decent developer but I could never have the patience to look at one line of code at a time, much less only do one real debugging test.

That’s why its called a challenge ;).

You should try it anyways!

I see that… but there is a difference between something that people look at and go “hrmm, I wonder if I could do that” and something people look at and go “oh… dear… god… no” Im afraid to admit that this is the latter, for me at least.

i gave up after an hour… this is too difficult (only see one line)

EDIT: I should say Annoying not difficult…

3 Likes

What theme is that o.O

Just the default dark theme with eclipse.

2 Likes

Updated post to make it easier.

1 Like

Right, I would have done this, but there is no way I’m going to follow those guidelines. There is no real life project that adheres to those guidelines, so no one programs under those conditions. “Oh yeah, we’ll hire you to make this GUI, but we’re gonna make it really hard to actually see your code as you do it, and if you fuck up at all being that you can’t conceptualize your own code, you have to start over.”

If the thing got updated to have realistic expectations, like some kind of time limit, potentially you record yourself doing it, I’d just make a quick app in kivy. Easiest thing I can think of to replicate a GUI.

5 Likes

@DotDash this would be a better challenge (just an example):

Calculator Challenge

Summary:

You must create a calculator that can follow the order of operations. Try to pack as many features as you can into the program while still making it easy to use/navigate. Get creative, design it however you wish! Your entry will be judged, so please make it as neat as possible!

Challenge ends 23:59 GMT -5:00, March 15, 2015

Rules:

  • Must have a GUI.
  • Must follow the order of operations.
  • Must accept mouse clicks and keyboard inputs.
  • Text area must show at least the current operation.
  • No external Libraries can be used.

Languages Allowed:

  • Java
  • C++

Extra Goals / Personal Goals:

  • Complete the project in less than 10 hours. (work time)
  • Add a scientific setting that will change the calculator. (see below)
  • Add Tangent, Sine, Cosine, operations.
  • Create a pi button, that calculates pi to the 10th number to use in calculations.
    • Do not save the pi number in a var, calculate it every time!
    • Allow users to calculate pi to the nth number.
  • Create a history log of past operations the user can revert back to.

Point Scale:

  • Code readability - 50%
  • How well your code is commented - 25%
  • OOP Conventions - 25%
  • Guidelines - 50%
  • Minimum requirements - 35%
  • Calculation accuracy - 15%
  • Extra credit - up to 25%
  • 5% for every extra feature you have that works.

Example of the scientific calculator:

8 Likes

You just placed another arbitrary restriction on the challenge. Unless the challenge is specifically designed to test a person’s skills in Java or C++, I don’t see why you would limit which languages a person could use. It’s like being a contractor, having a toolbox, but being limited to using a hammer and screwdriver to build a whole house. Yeah, you could do it, but you have other tools in your box too.

If C++, why not C or C#? Why not any other number of languages that can stand up to the task?

In your analogy it is clear that Brainf**k is a Hammer drill.

2 Likes

Replaced My challenge with @Kodfod’s , but removed Language Limitations (@DarkArcana).

2 Likes

Still a fairly complex and I would argue an arbitrary scoring system.
Perhaps something a little more similar to Code golf would be appropriate.

Code Golf provides no limitation on language but has a extremely unambiguous scoring system.

2 Likes

This feels subjective. What determines code readability? Should a person follow coding best practices for their specific language? Some people program with self-commenting code, or code that doesn’t need to be verbosely commented (commenting that may become obsolete or not get updated to reflect changes to code) by using naming styles and other good coding conventions.

What is this bit about not allowing external libraries. “KISS” “DRY” and “Don’t reinvent the wheel” come to mind when I see that. Sometimes it’s better to abstract certain bits of code out so that you can focus specifically on the functionality and not designing a framework to support it. Say you decide to use a language that doesn’t have a built in GUI handler (think swing, fx, tk, etc.), this rule would prevent you from importing what might be a standard in that language but isn’t explicitly a built in module.

I have to agree with @popeus about the scoring system and I need to add that some of the rules need to be adjusted to actually make sense.

It’s no hair off the programmers skin to calculate Pi (It’s easy, if we’re not attempting to get into ridiculous amounts of digits).

A good programmer would save a reasonable Pi length to save resources, not to make it more “challenging”.

If you’re worried about digits, use a print formatting tool. Then it wouldn’t matter if it was hundreds of digits because it’s only displaying what you want it to display. But yeah, it’s not really a challenge to calculate pi every time lol. Make a function :V.

2 Likes

It seems he used my example, and this was what was used in my school. It was specific to the language you wrote it in. The way my professor taught me to comment was this: “If you even doubt for a split second wither or not to comment, you better f*!^ing comment that code. […] Chances are you, will forget what you were doing, or how you did it!”

This was just an example I posted that came from my school experience. I just wanted to give him an IDEA of what a challenge could/should(?) look like. The language limitations was the ones that we were learning in class. Remember that post was:

Now this bit:

The whole point of this project is to challenge you. There’s some libraries out there that will do all the work for you; all you would have to do is create a few logic statements and boom you’re done. The challenge here is to get you to, learn and/or show off your knowledge of, the language you chose to write it in.

Agreed! Just to iterate again, the example I used was from school so a weird scoring system is the norm… I think?! (at least in my experiences)

1 Like