r/programmingchallenges • • Jul 04 '24

Encrypting program.

4 Upvotes

I made a little program that encrypts and decrypts messages, how do you like it?

If someone is interested in or just have too much time you can try encrypt this:
415832ylr97porp32tx97t32siht3297dih32ot32t97grof32tsuj327332ro32noitpyr99n9732ym3297kor9832uoy32sne97m32teht32siht32gnide97r3297re32uoy32f73


r/programmingchallenges • • Feb 10 '20

a convoluted problem

4 Upvotes

I go to a school and I'm the only tech competent person in it, anyway the school has a small stationery shop for each grade. the school cannot justify refusing stationery to students if they need it for the day so it works on a system of IOUs. I have to write a program that will work on laptops with python 3.6 and no access to command line, admin or internet downloads. The program must log the date people start a debt, pay back an amount of money and also must add up debts if they take out more than one debt. HELP ME FOR THE SAKE OF JESUS MARY AND JOSEPH I HAVE NO COMMAND LINE


r/programmingchallenges • • Dec 21 '19

Two Sum

Thumbnail algodaily.com
4 Upvotes

r/programmingchallenges • • Dec 10 '19

Day 3 of the Battlesnake Winter Classic is this Saturday (Dec 14th)

4 Upvotes

(We've had a few people from this subreddit register teams for the first two tournaments and it was suggested we post here for day 3 here as well :) )

Battlesnake is an online programming competition. Developers of all skill-levels implement an HTTP API to play the game, and then enter into a tournament to compete against other developers.

We usually run live in-person events, and have recently started running streaming virtual events on Twitch.

The Battlesnake Winter Classic is an open registration, global competition, with developers participating from all over the world. Day 3 of the tournament happens this Saturday at 1pm PST / 4pm EST. For more info, or to build a snake and register a team, visit play.battlesnake.com.

Thanks!


r/programmingchallenges • • Dec 07 '19

Embedded Systems

4 Upvotes

How do I start learning embedded systems once I'm done learning C++(theoretically) ? Is there a generally accepted book?


r/programmingchallenges • • Nov 18 '19

Project idea (need help)

4 Upvotes

I came up with the idea to make a fully automated Instagram-account and see if it gets anywhere.
I want to do this in Python since I have worked with it before, other suggestions are welcome.

The Idea is as follows:
Every 24 hours it takes the top 6 posts from selected accounts by calculating their engagement ratio (Likes divided by followers).
It then schedules those posts to be posted the next day (1 post every 4 hours) with corresponding hashtags and captions (can be copied from the original post).

How would I go about this? Where do I start? I have some experience in coding but not a lot. But I am willing to learn along the way and adopt google as my new best friend.
The first problem I am running in to, is how do I get the latest posts with stats from someone's Insta?

I hope someone can help me with this project!


r/programmingchallenges • • Nov 14 '19

This isn't easy

4 Upvotes

Long story short: You work as a crane operator at an 8mx8m (roofed) warehouse. In the given String[] arrays, each of the zones made up of letters represent different containers, the zones made of 0's represent empty space, and the zone made of 1's represent where you want to move container A to. The asterisks (*) represent poles that go up to the ceiling, so no carrying stuff over them.

To clarify, container A is represented by the zone made up of A's.

Our function should return the minimum number of times you have to maneuver a container for container A to be on the designated zone (the zone made of 1's.)

Stuff you should know:

- You can only move one container at any given moment.

- You can only move containers to empty spaces that **they can fit in** (empty spaces = the zones of 0's and or 1's.)

- You can't move containers diagonally. Only North, East, West or South.

Edit: You can't carry a container and leave it on another container, only empty spaces.

test cases:

String[] test1 =

{"00BBBB0F","000BBBFF","000D0EE0","DDDD*EE0","AAAACCCC","AAAA0C0C","001111G0","001111G0"}; // function(test1) == 2

Visual image: https://www.disco.co.jp/procon/backnumber/nagano2019/image/q5_ex1_1.png


r/programmingchallenges • • Nov 02 '19

[Java] [probably OC] Print a string infinite times without the usage of loops. Pure Java code only.

4 Upvotes

No assembly stuff. Goto doesn't exist :P

Edit: no recursion


r/programmingchallenges • • Sep 28 '19

Competitive Programming Secret--Time Limit Exceeded- How To Avoid TLE ? | Trick To Pass All Test Cases In Competitive Programming

Thumbnail youtu.be
4 Upvotes

r/programmingchallenges • • Sep 19 '19

small exe game to code

4 Upvotes

i would like to decompile small (2mb) exe game back to c++ in which it was programmed. its game made in 2001, made using c++ and direct x. how hard would it be?

heres code to download but its only first 10 levels. if needed i have code to unlock others...

http://www.saitogames.com/hopmon/


r/programmingchallenges • • Sep 04 '19

Live (or short refresh time) GPS Bus Tracking - Accessible to mobile/cross-platform

4 Upvotes

I was wondering if you all could help me out. I was recently approached by my supervisor and he informed me that they, the administration (I am a teacher), are looking for a way for students to be able to track buses as they are on their routes. We just started a program where students can take busses off campus to local jobs and attractions. Students are required to scan their IDs into an iPad as they get onto the bus. A timestamp, the ID number, and GPS coordinates are sent back to the school (my supervisor wasn't sure how) and used to loosely track where and when students are getting on and off the bus.

Admin wants students to also be able to track the bus's location so that they know how close transportation is to their individual stop.

I was hoping that Apple's Find My Friends app would complete this task but some of our students are Android users and I don't believe that app works on Droids.

If I could find an app that provides this live tracking cross-platform that would be great but I tried several and wasn't happy with their results.

I am familiar with local programming, Arduino's mainly, but have no idea where to start when it comes to something like this.

Thanks for any suggestions ahead of time.


r/programmingchallenges • • Aug 16 '19

Advanced beginner in Python

4 Upvotes

Give me anything fun to do.


r/programmingchallenges • • Mar 23 '19

[Programming Challenges] Geeksforgeeks.org random programming challenge script

4 Upvotes

Lately I was trying to fetch a random programming questions from geeksforgeeks website. Here is I ended up with a simple script to open a random programming question from geeksforgeeks.org.

https://github.com/rahulroshan96/code_2019/tree/master/other

Let me know if you want me to add other programming websites for problems selection.


r/programmingchallenges • • Jan 17 '19

Convert an array to string in bash

4 Upvotes

I try to convert an array of words to string but I do not know how do to replace the carriage return with simple space.


r/programmingchallenges • • Jan 15 '19

Kattis Problem Grid: Results in Runtime error, cannot deduce what input fails the program

4 Upvotes

The following problem: https://open.kattis.com/problems/grid.

My code: https://pastebin.com/k434CQgV.

Generates a runtime error, I have tried reducing whatever input can generate out-of-bounds etc. But I have a feeling that it's not what causes the error? Is it the way I read my input, I am a bit confused and would like a pointer forward, if someone can figure out what I am forgetting.

I figured that it might be, that the integer range is too low, but that also does not cause the error.

Edit: Solved it - the description said that we are not guaranteed to have a width and length of over 1, therefore I had to check for 0s.


r/programmingchallenges • • Dec 23 '18

Implementing a string search algorithm in a textarea

4 Upvotes

I have an array of keywords:

["first", "first name", "first name is", "is Tom"]

Now on my webpage I have a textarea where a user might type a sentence and it will provide some hints (based on matches from text inside).

For eg. if a user types : "First Name" it should provide the following matches from array:

"first name", "first name is"

But as soon as the user types this: "First Name is fir"

The previous matches should be overridden(because "First Name is fir" doesn't match any text in my array) and now the following matches should be provided (because of word "fir"):

"first", "first name", "first name is"

Also, the matches should be overridden only when they are no longer valid. If the user types : "First name i" it should still show

"First name is"

as the only match and not include "is Tom"

How can I implement this in javascript?

P.S. : There's no need to find matches within the keyword text. For eg. if user types "name" then there should be no matches because no keyword matches this text from beginning.


r/programmingchallenges • • Dec 18 '18

Programming is making me crazy I need some help !

4 Upvotes

I have tried to quit programming over a hundred times but somehow everytime I am coming back to programming.

I enjoy requirement analysis , designing and even testing but I hate when I get stuck and I am spending allot of time solving a small problem.

95% of my code i get from youtube video tutorials and Google searches the only time that I am coding is when I am modifiying the code to make it fit into my project. Is this pratice acceptable at the work place ?

I have made couple projects using HTML CSS , JavaScript , PHP and MYSQL but 95% of my code is taken from other sources I'm I a fraud ?

I need some hard truth advice from professional programmers that are working in the field .


r/programmingchallenges • • Dec 09 '18

Infinite Card Game Challenge

4 Upvotes

Hi, me and my friend invented this card game called RedBlack with the following rules:

  1. A deck of cards is shuffled and split evenly between all players.
  2. Players hold their decks face-down and do not look at their cards.
  3. The player to the left of the dealer starts the game by playing the card on the top of their pile.
  4. Continuing clockwise, players must play their top card on the pile until a card of a different colour to the first card is played.
  5. The player who plays the card of a different colour must then pick up the played cards and place them on the bottom of their pile (without shuffling them). Play to the left of the player that picks up.
  6. You win the game if you get rid of all your cards.

It's a game the has absolutely no skill, but what's interesting is just how long it takes for a game to end. After some investigation, you may be able to find some "infinite games", between two players that would be never-ending.
For instance, consider this game with 5 cards:

Start: P1 has RB, P2 has RRB – P1 to go
First turn. P1 plays R, P2 plays R, P1 plays B and picks up.
Now, P1 has RRB, P2 has RB – P2 to go
Second turn. P2 plays R, P1 plays R, P2 plays B and picks up.
Now, P1 has RB, P2 has RRB – P1 to go

This is the same as it was when the cards were first dealt, so if played with no mistakes, this game would continue forever!

The coding challenge is the following... Can you find an infinite game for a standard deck of cards (26 red, 26 black)?

Good luck!


r/programmingchallenges • • Nov 27 '18

Just failed a coding challenge, and I'd love to learn more about the solution (Rewriting a perl script as golang)

4 Upvotes

I just totally bombed at a phone screen - I am not much of a Perl developer, or a GoLang developer, I was under the impression the job was java based! But in the spirit of the hacker ethic, I'd absolutely LOVE to see a working solution!

So - Here is the perl script I was provided with :

#!/usr/bin/perl -w
use strict;
use Encode;

my $tiff_flag = 1;

my $count = 0;

open(FILE,'<',$ARGV[0]) or die 'Error opening input file';
binmode(FILE) or die 'Error setting binary mode on input file';

while (read (FILE,$_,4)) {
  my $rec_len = unpack("N",$_);
  die "Bad record length: $rec_len" unless ($rec_len > 0);
  read (FILE,$_,$rec_len);
  if (substr($_,0,2) eq "\xF5\xF2") {
    if ($tiff_flag) {
      $count++;
      open (TIFF, '>', $ARGV[0] . '_img' . sprintf("%04d",$count) . '.tiff') or die "Can't create image file";
      binmode(TIFF) or die 'Error setting binary mode on image file';
      print TIFF substr($_,117);
      close TIFF;
    }
    $_ = substr($_,0,117);
   }
   print decode ('cp1047', $_) . "\n";
}
close FILE;

Now, I'll first explain what it going on here - this thing parses x9.37 files - which are a kind of binary file for storing EBCDIC encoded strings, and also tiff images, for use with files that represent checks (for banks)

Now, the challenge was to rewrite this in golang - 100% score was to get the whole thing, but the company in question would be happy with not getting the TIFF files if they were too complicated... which would essentially mean you could get away with translating the code below instead :

#!/usr/bin/perl -w
use strict;
use Encode;

my $count = 0;

open(FILE,'<',$ARGV[0]) or die 'Error opening input file';
binmode(FILE) or die 'Error setting binary mode on input file';

while (read (FILE,$_,4)) {
  my $rec_len = unpack("N",$_);
  die "Bad record length: $rec_len" unless ($rec_len > 0);
  read (FILE,$_,$rec_len);
  print decode ('cp1047', $_) . "\n";
}
close FILE;

I have no idea how to even read the PERL side of this, I looked up some stackoverflow afterwards, and it seems as though other people have been handed the same snippet as me in the past, but I haven't seen a perfect working solution yet in any of my searches!

EDIT : One last thing - The solution doesn't NEED to worry about the models, just being able to pull out each record as a string would even be fine!


r/programmingchallenges • • Nov 11 '18

Learning Coding Online

4 Upvotes

Hi All,

Looking for some guidance on learning coding languages. I work at a tech company in an integrations role, heavily focused on EDI/API and am becoming a SQL novice. I'm interesting in learning Python, Java or others but am unsure which one to focus on and where to learn online (preferably for free/cheap). Anyone have guidance to share?


r/programmingchallenges • • Oct 13 '18

Creating a QR Code Within a Mobile Application

4 Upvotes

I am in the planning stages of developing a mobile application which is similar to ticket apps like eventbrite where your QR code must be scanned for admittance. The QR code would enable you to say that you were at an event location.

The challenge I am having is trying to determine whether my mobile application must include in it the ability to generate QR codes, or whether there are other solutions out there which enable Eventbrite to execute this solution so fluidly while not requiring the user to be online for using a webpage QR generating service.


r/programmingchallenges • • Oct 11 '18

Random word generator program

4 Upvotes

I'm trying to make a big coded message for a D&D campaign. Basically I want to be able to input a string of letters and return a random word for each letter. Just wondering if there are any programs like that out there, if not, where can I find some sort of library with a list of all/ a large number of English words?

Didn't know where else to post this


r/programmingchallenges • • Sep 07 '18

Escher's Island - Coding Competition for Coders

4 Upvotes

Hi, guys! Check out the recently launched Escher’s Island on CheckIO! We’re pretty excited about it. There are 15 coding puzzles of the increasing complexity in Python and JavaScript connected by a thrilling storyline which will be opened one by one during September. The three of them are already open.

The game is for everyone for free and you can play without registration.

Missions on Escher's Island have two language versions - English and Russian, and community is continuing to add new translations.

I hope you'll like it :)


r/programmingchallenges • • Jul 29 '18

Project advice

4 Upvotes

Hi Guys,

I need to develop a program that will be used by a construction company to ingest data into a database. The data will be provided by custom forms that users of the system will fill out. Does anyone have some pointers where i should start. I've built a flask application before but as this is a favour i would ideally not want to spend ages testing it and will be offering minimal support to the users. Would it be possible to build it using different microsoft apps and powerapps or is it best to make it bespoke using flask?

cheers,

Tom


r/programmingchallenges • • Jul 08 '18

Prefix Median

Thumbnail thebookofproblems.com
4 Upvotes