Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
yith
  • Loading branch information
MJUIUC committed Jan 7, 2017
2 parents aca94be + 0693c1b commit 1d2f1df
Show file tree
Hide file tree
Showing 144 changed files with 2,753 additions and 28 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,18 @@ we will be posting ~~daily~~ periodic challenges for the community to complete.
8. [Submission Review](#submission-review)

## The Administration Team
- [slandau](https://github.com/slandau3 "slandau3")
- [okraarmband](https://github.com/OkraArmband "OkraArmband")
- [erocs](https://github.com/erocs "erocs")
- [myrrlyn](https://github.com/myrrlyn "myrrlyn")
- [jremillard](https://github.com/jarydremillard "jaryd remillard")
- [sten](https://github.com/dashsten "dashten")
- [manuel](https://github.com/ManuelMeraz "ManuelMeraz")
- [marcus](https://github.com/MJUIUC "MJUIUC")
- [ae1vtas](https://github.com/aev1tas "aev1tas")
- [aakash](https://github.com/asethi77 "asethi77")
- [flickdm](https://github.com/flickdm "flickdm")


## About Year of Programming

Expand Down
21 changes: 20 additions & 1 deletion _bin/cpr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

# Checkout Pull Request
#
Expand Down Expand Up @@ -26,9 +26,28 @@ function merge_pr () {
git merge "${1}/${2}"
}

if [[ "$#" == "0" ]]; then
cat <<-EOS
Usage:
_bin/cpr get <username> <branch>, as seen when looking at a Pull Request on the
web (see https://help.github.com/articles/checking-out-pull-requests-locally/)
_bin/cpr merge <username> <branch> will merge the PR into master and open up
your editor for a commit message.
This function is only useful for admins, as we are the only ones with write
access to the central repository. Don't bother running this in a fork of the
central repo unless you *yourself* have incoming pull requests.
EOS
exit 0
fi

if [[ "$1" == "" ]]; then
echo "You must specify an action"
exit 1
elif [[ "$1" != "get" && "$1" != "merge" ]]; then
echo "The subcommands are 'get' and 'merge'. They require a username and a branch as second and third arguments."
fi
if [[ "$2" == "" ]]; then
echo "You must specify a GitHub username"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log "hello world"
16 changes: 16 additions & 0 deletions challenge_0/coffeescript/kedarbramhe/coffeescripts/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
##Install
To install, first make sure you have a working copy of the latest stable version of Node.js. You can then install CoffeeScript globally with npm:

`npm install -g coffee-script`

##Usage
To compile this file command used is

`coffee -o javascripts/ -c coffeescripts/`

Option -c means to compile and -o means the output folder.The ordering should always be output then compile.

To run the compiled file simply run the compiled .js file with node
for example

`node hello_world.js`

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions challenge_0/csharp/bdoner/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Hello

To compile run `csc.exe hello.cs` and run the resulting file `hello.exe`.
7 changes: 7 additions & 0 deletions challenge_0/csharp/bdoner/hello.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using System;

public class Hello {
static void Main() {
Console.WriteLine("Hello, world!");
}
}
8 changes: 8 additions & 0 deletions challenge_0/go/makernaren/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Hello world!
#### To run the code :
* Install [golgang](https://golang.org/doc/install)
* Open this directory in terminal and run `go run helloworld.go` to compile and run the code.
```
$ go run helloworld.go
Hello World!
```
9 changes: 9 additions & 0 deletions challenge_0/go/makernaren/helloworld.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package main

import (
"fmt"
)

func main() {
fmt.Println("Hello World!")
}
9 changes: 9 additions & 0 deletions challenge_0/go/natdm/app.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package main

import (
"log"
)

func main() {
log.Println("hello world")
}
10 changes: 10 additions & 0 deletions challenge_0/julia/DTCitron/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#Hello World

##Premise

- Hello and welcome to our little community! We're glad to have you!
- Your first task is to implement a simple Hello World program in the language of your choice. Happy coding!

##Implementation

- Call `julia helloworld.jl' in the `src' directory
1 change: 1 addition & 0 deletions challenge_0/julia/DTCitron/src/helloworld.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
println("Hello World!")
10 changes: 10 additions & 0 deletions challenge_0/python/DTCitron/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#Hello World

##Premise

- Hello and welcome to our little community! We're glad to have you!
- Your first task is to implement a simple Hello World program in the language of your choice. Happy coding!

##Implementation

- Call `python main.py' from the `src' directory
5 changes: 5 additions & 0 deletions challenge_0/python/DTCitron/src/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
def main():
print 'Hello World!'

if __name__=='__main__':
main()
4 changes: 4 additions & 0 deletions challenge_0/python/bryantpq/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Challenge 0
FILES:
1 . hello.py
Prints hello world to the console
1 change: 1 addition & 0 deletions challenge_0/python/bryantpq/hello.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print('Hello World!')
1 change: 1 addition & 0 deletions challenge_0/python/tavery321/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A program written in python which prints "Hello World"
2 changes: 2 additions & 0 deletions challenge_0/python/tavery321/src/c0.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
print("Hello World")

3 changes: 3 additions & 0 deletions challenge_0/python/walkingluo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Challenge_0

- Print Hello World
11 changes: 11 additions & 0 deletions challenge_0/python/walkingluo/src/hello_world.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#
# Print Hello World
#


def print_hello_world():
print("Hello World")


if __name__ == '__main__':
print_hello_world()
4 changes: 4 additions & 0 deletions challenge_0/rust/makernaren/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions challenge_0/rust/makernaren/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[package]

name = "hello_world"
version = "0.0.1"
authors = [ "naren <makernaren@gmail.com>" ]
8 changes: 8 additions & 0 deletions challenge_0/rust/makernaren/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Hello world!
#### To run the code :
* Install [rustlang](https://www.rust-lang.org/en-US/install.html)
* Open this directory in terminal and run `cargo run` to compile and run the code.
```
$ cargo run
Hello, world!
```
3 changes: 3 additions & 0 deletions challenge_0/rust/makernaren/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}
1 change: 0 additions & 1 deletion challenge_1/c/scottsquatch/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Reverse a String
Application which reverses a string.

## Building
``` bash
make
Expand Down
60 changes: 34 additions & 26 deletions challenge_1/c/scottsquatch/src/main.c
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>

/* Constants */
#define RETURN_SUCCESS 0
#define MAX_SIZE 256
#define TRUE 0
#define FALSE -1

/* Function Declarations */
char* reverse(char* originalString);
bool shouldContinue(char contineChar);
void reverse(char* originalString);
int should_continue(char contineChar);
void swap(char*, int, int);

int main()
{
char stringToReverse[MAX_SIZE];
char continueResult;
char* reversedString = NULL;

do
{
Expand All @@ -24,48 +25,55 @@ int main()
scanf("%s", stringToReverse);

// Print result
reversedString = reverse(stringToReverse);
printf("Reversed String: %s\n", reversedString);
reverse(stringToReverse);
printf("Reversed String: %s\n", stringToReverse);

// See if we should continue
printf("Would you like to continue (y to continue): ");
scanf(" %c", &continueResult);

} while(shouldContinue(continueResult));

// free up memory
free(reversedString);
} while(should_continue(continueResult) == TRUE);

return RETURN_SUCCESS;
}

// Reverse a given string.
char* reverse(char* originalString)
void reverse(char* originalString)
{
// Variables
int length;
char* reversedString = NULL;
int i;
int reversedIndex;

if (originalString != NULL)
{
length = strlen(originalString);
reversedString = calloc(length, sizeof(char));
reversedIndex = 0;
int length = strlen(originalString);
int backIdx = length - 1;
// Calculate number of loops here so that we don't have to keep recomputing.
// swapping front and back pointers so only iterate over half of length
int numLoops = length / 2;

// Iterate over Original String in Reverse
for (i = length - 1; i >= 0; i--)
// iterate over half of the string, swapping front and back pointers
for (int frontIdx = 0; frontIdx < numLoops; frontIdx++)
{
reversedString[reversedIndex++] = originalString[i];
// Swap back and front to reverse string.
swap(originalString, frontIdx, backIdx--);
}
}
}

return reversedString;
// Swap characters of a character array
void swap(char* string, int firstIndex, int secondIndex)
{
char temp = string[firstIndex];
string[firstIndex] = string[secondIndex];
string[secondIndex] = temp;
}

// Return true if we are to continue loop
bool shouldContinue(char contineChar)
int should_continue(char contineChar)
{
return contineChar == 'y' || contineChar == 'Y';
if (contineChar == 'y' || contineChar == 'Y')
{
return TRUE;
}
else
{
return FALSE;
}
}
8 changes: 8 additions & 0 deletions challenge_1/c/woser/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Reverse a string
Application for string reversal.

## Compile and Run
$gcc string_reverse.c -o 'output.exe' && ./'outputfile'

## Explanation
Takes string as in-code input and reverses it using two pointers, printing reversed string on console.
24 changes: 24 additions & 0 deletions challenge_1/c/woser/src/string_reverse.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include <stdio.h>
#include <string.h>

void string_reverse(char* string){
char* start = string;
char* end = start + strlen(string) - 1;
char tmp;

while (end > start){
tmp = *start;
*start = *end;
*end = tmp;

++start;
--end;
}
}

int main(void){
char string[] = "Hello!";
string_reverse(string);
printf("%s\n", string);
return 0;
}
16 changes: 16 additions & 0 deletions challenge_1/coffeescript/kedarbramhe/coffeescripts/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
##Install
To install, first make sure you have a working copy of the latest stable version of Node.js. You can then install CoffeeScript globally with npm:

`npm install -g coffee-script`

##Usage
To compile this file command used is

`coffee -o javascripts/ -c coffeescripts/`

Option -c means to compile and -o means the output folder.The ordering should always be output then compile.

To run the compiled file simply run the compiled .js file with node
for example

`node hello_world.js`
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
reverse = (s) ->
if s.length < 2 then s else reverse(s[1..-1]) + s[0]

s = "HelloWorld"
console.log "s=#{s}, s.reverse=#{reverse(s)}"
17 changes: 17 additions & 0 deletions challenge_1/cpp/chowey/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <iostream>
#include <string>

int main() {
std::string input;
std::cout << "Enter a string to be reversed:" << std::endl;
std::getline(std::cin,input);

int length = input.length();

for(int i = 1; i <= length; i++) {
std::cout << input[length-i];
}
std::cout << std::endl;

return 0;
}
Loading

0 comments on commit 1d2f1df

Please sign in to comment.