Skip to main content

Posts

Showing posts from February, 2018

Featured Post

Your First Programming Language

What programming language you start with really all depends on where you want to go with programming/coding. The great thing about this field is that there are an absolute abundance of smaller fields that you can go into, all using programming in their own unique ways. For web applications, a good start would be with HTML and later moving your way through CSS, JavaScript, JQuery, PHP, SQL, and any of the JavaScript libraries. Ruby is also a popular choice, so I would recommend checking that out too. For more scientific fields or areas with more machine learning and A.I., Python is generally a great place to start as it is widely used in that field of study. C++ is also a very useful language to know for that, but it can be a little more challenging for beginners. For game and application design, languages such as C#, C, Swift, Kotlin, and Java are most often used for that.

A Guy Teaching IT In A Village In Ghana

Happiness

Search Google From Google

Well, Well, Well

Description A square well is dug with a peculiar shape: each 1x1 section has varying heights above some floor. You wish to fill the well with water, filling from a hose above the square marked 1. Square 1 is the lowest (think of this as a heightmap in units from the bottom). Water flows at 1 cubic unit per unit time (e.g. 1 liter per minute if you want specific units). You wish to know when you fill a specific square. You can assume water behaves like it does in the real world - it immediately disperses, evenly, to all accessible regions, and it cannot spontaneously leak from one square to another if there is no path. Assume a constant flow rate for the water. Today's question is - writing a program, can you tell at what time the well's target square is under a cubic unit of water? Input Description You'll be given a row with two numbers, N and N, telling you the dimensions of the well. Then you'll be given N rows of N colums of unique numbers. Then you'l

Love Story Of Computer Geeks

Google Knows Everything About You!!!!!

Wonders Resource Allocation

Description In the board game 7 Wonders, there are four basic resources, which we'll abbreviate with letters: W for wood, B for brick, S for stone, and O for ore. Resource cards let you produce one of your choice of resources. We'll use W/B to represent a resource card that can give you either 1 wood or 1 brick, but not both. Given the resource cards W/B/S/O, W, S/B, and S, it is possible for you to produce 2 wood and 2 stone: use the first two cards to get wood, and the last two to get stone. However, with that same set of cards, it is impossible for you to produce 2 wood and 2 brick. Input You'll be given a comma-separated sequence of cards inside of square brackets, with the features separated by a slash. Your target will be given as "Can you make ____?" with the list of resources to target, one per card. Note: in the game 7 Wonders, every card produces either 1, 2, or all 4 of the resources. But if you want a challenge, make your program support any

Star Battle solver

Background Star Battle is a grid-based logic puzzle. You are given a SxS square grid divided into S connected regions, and a number N. You must find the unique way to place N*S stars into the grid such that: Every row has exactly N stars. Every column has exactly N stars. Every region has exactly N stars. No two stars are horizontally, vertically, or diagonally adjacent. If you would like more information: Star Battle rules and info YouTube tutorial and written tutorial of solving Star Battle puzzles by hand There are many Star Battle puzzles available on Grandmaster Puzzles. Just be aware that some are variants that follow different rules. Challenge Write a program to solve a Star Battle puzzle in a reasonable amount of time. There's no strict time requirement, but you should run your program through to completion for at least one (N, S) = (2, 10) puzzle for it to count as a solution. Feel free to use whatever input/output format is most convenient for you. In the

Hacking a search engine

Problem description Let's consider a simple search engine: one that searches over a large list of short, pithy sayings. It can take a 5+ letter string as an input, and it returns any sayings that contain that sequence (ignoring whitespace and punctuation). For example:  Search: jacka Matches: Jack and Jill went up the hill to fetch a pail of water.         All work and no play makes Jack a dull boy.         The Manchester United Junior Athletic Club (MUJAC) karate team was super good at kicking.  Search: layma Matches: All work and no play makes Jack a dull boy.         The MUJAC playmaker actually kinda sucked at karate. Typically, a search engine does not provide an easy way to simply search "everything", especially if it is a private service. Having people get access to all your data generally devalues the usefulness of only showing small bits of it (as a search engine does). We are going to force this (hypothetical) search engine to give us all of its re

Permutation Madness

Description Permutation madness A group of programs has gotten together in a line and have started dancing They appear to have 3 dance moves. Try Spin that's a good trick, the right end swaps up most left keeing their order Exchange Two programs appear to swap depending on the numbers given Partner Two programs that know eachother swaps Input description a list of programs in their initial order First you will be given a string of characters, each character is an individual program On the next line you will get a list of moves split by , The moves work as following: Spin is given as SN where N is a positive integer. This moves N programs from the right up front, keeping their order Exchange is given as xA/B where A and B are the positions of two programs that will swap positions Partner is given as pA/B where A and B refer to the original positions of the programs and swaps them whereever they currently are Output description The output is the final or

Minesweeper

Description In this challenge you will come up with an algorithm to solve the classic game of Minesweeper. The brute force approach is impractical since the search space size is anywhere around 1020 to 10100 depending on the situation, you'll have to come up with something clever. Formal Inputs & Outputs Input description The current field state where each character represents one field. Flags will not be used. Hidden/unknown fields are denoted with a '?'. 'Zero-fields' with no mines around are denoted with a space. Example for a 9x9 board:     1????     1????     111??       1?? 1211  1?? ???21 1?? ????211?? ????????? ????????? Output description A list of zero-based row and column coordinates for the fields that you have determined to be SAFE. For the above input example this would be: 0 5 1 6 1 7 2 7 3 7 5 1 5 7 6 2 6 7 The list does not need to be ordered. Challenge input As suggested by /u/wutaki, this input is a greater c

Cricket Scoring

Description Cricket is a bat-and-ball game played between two teams of 11 players each on a field at the centre of which is a rectangular pitch. The game is played by 120 million players in many countries, making it the world's second most popular sport! There are 2 batsmen standing on two bases and the ball is played to the strike base. Batsmen run between their bases to increases their 'runs'. If a batsman gets out, a new batsman arrives to their base. This is only a simplified version of the rules Let's look at a typical score: 1.2wW6.2b34 There are 5 types of characters: (number) - The player on strike acquires this many runs to his name. '.' - A dot ball. No runs. 'b' - A bye, 1 run to the team but not to any particular batsman. 'w' - A wide, 1 run to the team but not to any particular batsman. The difference between 'w' and 'b' is that a 'b' counts as a ball but 'w' is not a legal ball. 'W

Advanced pacman

Description This challenge takes its roots from the world-famous game Pacman. To finish the game, pacman needs to gather all pacgum on the map. The goal of this chalenge is to have a time-limited pacman. Pacman must gather as much pacgum as possible in the given time. To simplify, we will say that 1 move (no diagonals) = 1 unit of time. Formal Inputs & Outputs Input description You will be given a number, the time pacman has to gather as much pacgum as possible, and a table, being the map pacman has to explore. Every square of this map can be one of those things : A number N between (1 and 9) of pacgums that pacman can gather in one unit of time. "X" squares cannot be gone through. "C" will be where pacman starts. "O" (the letter, not zero ) will be a warp to another "O". There can be only 2 "O" on one map; Output description Your program should output the maximum number of pacgums pacman can gather in the given t

Which Number Recurs First

Description Working with very large data sets is an increasingly common activity in efforts such as web analytics and Internet advertising. Efficiently keeping track of values when you have around 264 possible values is the challenge. Today's challenge is to read a steady stream of distinct values and report on the first one that recurs. Your program should be able to run an arbitrary number of times with distinct, infinite sequences of input and yield the probabilisticly correct value. Data source I spent a good chunk of my morning trying to find a stream of random values for you to consume. I could not find one (e.g. a PRNG as a service) so I decided to use a local PRNG implementation. For this challenge, please use the following random number generator based on the Isaac design. https://github.com/dkull/Isaac-CSPRNG/blob/master/Isaac.py The above code expects a maximum integer passed to the rand() method, and for the purposes of this challenge set it to sys.maxsize.

Repetitive Rubik's Cube

Description The Rubik's Cube is a pleasant and challenging pastime. In this exercise however, we don't want to solve the cube. We want to (mindlessly) execute the same sequence over and over again. We would like to know how long it will take us to go back to the original starting position. Write a program which, given a series of moves, outputs the number of times that sequence must be executed to reach the original state again. Input Description A space separated series of movies in the official WCA Notation will be given. There are 6 faces. U (up, the top face). D (down, the bottom face). L (left). R (right). F (front). B (back). * Each face is turned like you were looking at it from the front. * A notation such as X means you turn the X face clockwise 90'. So R L means turn the right face clockwise 90' (from its perspective), then the left face clockwise 90' (from its perspective). * A notation such as X' (pronounced prime) means you turn the X face

Text Summarizer

Description Automatic summarization is the process of reducing a text document with a computer program in order to create a summary that retains the most important points of the original document. A number of algorithms have been developed, with the simplest being one that parses the text, finds the most unique (or important) words, and then finds a sentence or two that contains the most number of the most important words discovered. This is sometimes called "extraction-based summarization" because you are extracting a sentence that conveys the summary of the text. For your challenge, you should write an implementation of a text summarizer that can take a block of text (e.g. a paragraph) and emit a one or two sentence summarization of it. You can use a stop word list (words that appear in English that don't add any value) from here. You may want to review this brief overview of the algorithms and approaches in text summarization from Fast Forward labs. This is ess

Mozart's Musical Dice

Description In 1787 the famous composer Wolfgang Amadeus Mozart devised a Musikalisches Würfelspiel (musical dice game) that lets you "compose without the least knowledge of music". Obviously, this is a very loose definition of "compose", but it does produce pieces of music that have probably never been written down or played before. We'll be playing his game today (with some simplifications so you don't need to know musical notation). Today's challenge may seem a little harder than typical at first, but it's actually not bad once you get the idea. I've tried to make the instructions as clear and complete as possible, but please ask for help if you have any trouble understanding them. The starting composition Start by downloading the starting composition here. Each line in this file gives the note name, starting time, and duration for one note in the starting composition, e.g.: D3 281.5 0.5 "D3" is the name of the note, which

Cryptarithmetic Solver

Description Cryptarithms are a kind of mathematical puzzle. Each puzzle consists of a basic equation of arithmetic (involving addition, subtraction, division, etc.) with words, where each letter represents a different digit. The goal of the puzzle is to find the correct number substitution for each letter in order to make a valid equation. This classic example (taken from the wikipedia page) was first published in 1924:     S E N D +   M O R E _______________   M O N E Y The solution to this puzzle is: O = 0, M = 1, Y = 2, E = 5, N = 6, D = 7, R = 8, and S = 9. (i.e. 9567 + 1085 = 10652) Note: Leading zeroes are not allowed in a valid solution. Task You will be given a cryptarithm in string form. Your task is to output the letters and corresponding numbers which make up a valid solution to the puzzle. For the purposes of this challenge, all equations will consist only of addition. Leading zeroes (in a multi-digit number) are not allowed in a valid solution