r/programmingrequests • • Aug 07 '17

Practice Challenges

Hi,

Im a novice coder with not very much experience.

I'm currently in a position where I want to expand my capabilities, so that I can put my ability to more use. I want to find more challenges to teach myself how to become a better programmer, but with my current skills, Im not sure what a proper "step up" would be.

Currently, my abilities mostly amount to HTML scrubbing and file manipulation in python. I also know very very basic bash scripting for linux shell. My longest python file was 150 lines of code that simply tracks users posts and downloads media to a respective folder.

Ive skimmed over other languages such as html and SQL, but Im mostly using python.

If anyone has a good idea for a challenge to help me build my skills, Id appreciate it.

Some areas of interest are, Object Oriented Programming, Artificial Inteligence, Networking, Peripheral interaction, and Gaming

Thanks for reading!

3 Upvotes

7 comments sorted by

2

u/RANDOM_TEXT_PHRASE Aug 07 '17

Got a tip: focus the shit out of one language to the point you know it inside and out, and THEN move onto another language. You mention both HTML and Python, work on Python alone first, then learn web languages (please learn all the web languages not just html)

1

u/[deleted] Aug 07 '17

Thanks. Ill keep focusing on python then.

1

u/SamSlate Aug 08 '17

JavaScript would be a language associated with HTML, if you want to head in a web development direction. linux and PHP would also be great, if not must know language/os for that field/career.

for ai, tensor flow is a library for python and very accessable approach to ai.

for networking linux is a must. just generally it's good to understand linux and c/c++. idk if i would bother to learn c++ if i had learned JavaScript first (because it's hard) but I'd be a lesser programmer had i not.

2

u/serg06 Aug 07 '17

I'll give you a very hard challenge:

2 players, Dan and Larry, play on a grid board of size N by N. They both start on random spots on the board.

Dan moves first: For each move, Dan can only move diagonally up and right. If he's up against then right wall, then he can only move up. If Dan reaches the top of the board, he wins.

Larry moves second: For each move, he moves like a knight in chess: 1 square in one (non-diagonal) direction, and 2 squares in a different (non-diagonal) direction. If Larry lands on Dan, Larry wins.

You must create a function in your program that figures out who will win the game, and in how many moves. Assume that Larry is a robot that plays perfectly every time and, if he can win from his starting position, he will win.

GIVEN PARAMETERS:

  1. The size of the board (A single number N, meaning the board will be an N by N board.)

  2. The starting horizontal coordinate of Dan (The left-most position is 0, and the most right-most position is N-1).

  3. The starting vertical coordinate of Dan (The bottom-most position is 0, and the top-most position is N-1).

  4. The starting horizontal coordinate of Larry

  5. The starting vertical coordinate of Larry

OUTPUT:

The function must return a string as follows: "<Name> wins in <number> moves."

RUNTIME:

If the board is of size N, the function must have no more than a c*N2 runtime. For example, if a board of size 2 takes no more than 5*22 seconds to calculate, then a board of size 100 should take no more than 5*1002 seconds to calculate.

2

u/[deleted] Aug 08 '17

I think Ill give that a shot. Trying to conceptualize that would be interesting

1

u/diebolo Aug 10 '17

Did you make up this challenge or did you get it from a book/website? If so, how is the book/website called?

1

u/serg06 Aug 10 '17

I got it as homework in Data Structures course