diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/adarsh1498/even.cpp b/adarsh1498/even.cpp new file mode 100644 index 0000000..423f3e2 --- /dev/null +++ b/adarsh1498/even.cpp @@ -0,0 +1,17 @@ +#include +using namespace std; + +int main() +{ + int n; + + cout << "Enter an integer: "; + cin >> n; + + if ( n % 2 == 0) + cout << n << " is even"; + else + cout << n << " is odd"; + + return 0; +} diff --git a/adarsh1498/sum.cpp b/adarsh1498/sum.cpp new file mode 100644 index 0000000..18a02b9 --- /dev/null +++ b/adarsh1498/sum.cpp @@ -0,0 +1,16 @@ +#include +using namespace std; + +int main() +{ + int N1,N2,result; + + cout << "Enter two integers: "; + cin >> N1 >> N2; + + result = N1 + N2; + + cout << N1 << " + " << N2 << " = " << result; + + return 0; +} diff --git a/araanbranco/helloberfun.js b/araanbranco/helloberfun.js new file mode 100644 index 0000000..a32b6e7 --- /dev/null +++ b/araanbranco/helloberfun.js @@ -0,0 +1 @@ +console.log('Hello Hacktoberfun') \ No newline at end of file diff --git a/araanbranco/sum.js b/araanbranco/sum.js new file mode 100644 index 0000000..3ab8ed6 --- /dev/null +++ b/araanbranco/sum.js @@ -0,0 +1,5 @@ +function sum (a, b) { + return a + b +} + +console.log(sum(5,4)) \ No newline at end of file diff --git a/bgail/sum.py b/bgail/sum.py new file mode 100644 index 0000000..3545568 --- /dev/null +++ b/bgail/sum.py @@ -0,0 +1,9 @@ +def sum(x,y): + return x+y; +def main(): + x = int(input('Enter first num: ')) + y = int(input('Enter second num: ')) + print(sum(x,y)) + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/captainswain/helloberfun.php b/captainswain/helloberfun.php index ae2d639..1d52e56 100644 --- a/captainswain/helloberfun.php +++ b/captainswain/helloberfun.php @@ -1,3 +1,4 @@ +#include + +int sum(int a ,int b){ + + return a+b; +} + +int main(){ + int a,b,c; + printf("Enter 2 numbers\n"); + scanf("%d%d",&a,&b); + printf("\nSum is %d",sum(a,b)); + return 0; + } diff --git a/casper/sum.py b/casper/sum.py new file mode 100644 index 0000000..a8a1b47 --- /dev/null +++ b/casper/sum.py @@ -0,0 +1,10 @@ +#! /usr/bin/env python + +def sum(x, y): + return x + y + +if __name__ == "__main__": + a = float(input("First number : ")) + b = float(input("Second number : ")) + + print(sum(a,b)) \ No newline at end of file diff --git a/emmandev/hacktoberfun.php b/emmandev/hacktoberfun.php new file mode 100644 index 0000000..01c9f63 --- /dev/null +++ b/emmandev/hacktoberfun.php @@ -0,0 +1,3 @@ + + +using namespace std; +int main() { + int num1, num2; + cin >> num1; + cin >> num2; + cout << (num1 + num2); +} diff --git a/gmrsagar/helloberfun.js b/gmrsagar/helloberfun.js new file mode 100644 index 0000000..6367f15 --- /dev/null +++ b/gmrsagar/helloberfun.js @@ -0,0 +1 @@ +console.log('Hello Hacktoberfun') diff --git a/hacktoberfun b/hacktoberfun new file mode 160000 index 0000000..824bece --- /dev/null +++ b/hacktoberfun @@ -0,0 +1 @@ +Subproject commit 824bece0bb0c61829cfe8eb31eb49706d7e9bec2 diff --git a/indobits /sum.py b/indobits /sum.py new file mode 100644 index 0000000..4bfb58b --- /dev/null +++ b/indobits /sum.py @@ -0,0 +1,4 @@ +def sum(a,b): + print(a+b) + +sum(1,2) diff --git a/kbc/sum.cpp b/kbc/sum.cpp new file mode 100644 index 0000000..a0e2794 --- /dev/null +++ b/kbc/sum.cpp @@ -0,0 +1,12 @@ +#include +using namepsace std; + +int main(){ + int a,b; + cout<<"Enter a number: "; + cin>>a; + cout<<"Enter another number: "; + cin>>b; + cout<<"sum is "< +int main() +{ + printf("Hello Hacktoberfun"); + return 0; +} \ No newline at end of file diff --git a/nghminh163/even_odd.go b/nghminh163/even_odd.go new file mode 100644 index 0000000..1a910d8 --- /dev/null +++ b/nghminh163/even_odd.go @@ -0,0 +1,13 @@ +package main + +import "fmt" + +func main() { + var a int + fmt.Scan(&a) + if a%2 == 0 { + fmt.Print("The number you entered is even") + } else { + fmt.Print("The number you entered is odd") + } +} diff --git a/nghminh163/odd-even.cpp b/nghminh163/odd-even.cpp new file mode 100644 index 0000000..b7a7bdc --- /dev/null +++ b/nghminh163/odd-even.cpp @@ -0,0 +1,14 @@ +#include +int main() { + + int n; + printf("Enter a number: "); + scanf("%d",&n); + if(1&n) + printf("%d is an odd number\n",n); + else + printf("%d is an even number\n",n); + + return 0; + +} diff --git a/nghminh163/return-odd-even.go b/nghminh163/return-odd-even.go new file mode 100644 index 0000000..dcb96ca --- /dev/null +++ b/nghminh163/return-odd-even.go @@ -0,0 +1,17 @@ +package main + +import "fmt" + +func main(){ + + fmt.Print("Input number- ") + var number int + fmt.Scanln(&number) + + + if(number%2!=0){ + fmt.Println(number,"is odd number") + }else{ + fmt.Println(number,"is even number") + } +} \ No newline at end of file diff --git a/nghminh163/sum.go b/nghminh163/sum.go new file mode 100644 index 0000000..480eed1 --- /dev/null +++ b/nghminh163/sum.go @@ -0,0 +1,11 @@ +package main + +import "fmt" + +func sum(a, b int) int{ + return a+b +} + +func main() { + fmt.Print(sum(1,2)) +} diff --git a/robot/helloberfun.py b/robot/helloberfun.py new file mode 100644 index 0000000..078eb57 --- /dev/null +++ b/robot/helloberfun.py @@ -0,0 +1,70 @@ +import curses +from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN +from random import randint + + +curses.initscr() +win = curses.newwin(20, 60, 0, 0) +win.keypad(1) +curses.noecho() +curses.curs_set(0) +win.border(0) +win.nodelay(1) + +key = KEY_RIGHT +score = 0 + +snake = [[4,10], [4,9], [4,8]] +food = [10,20] + +win.addch(food[0], food[1], '*') + +while key != 27: + win.border(0) + win.addstr(0, 2, 'Score : ' + str(score) + ' ') + win.addstr(0, 27, ' SNAKE ') + win.timeout(150 - (len(snake)/5 + len(snake)/10)%120) + + prevKey = key + event = win.getch() + key = key if event == -1 else event + + + if key == ord(' '): + key = -1 + while key != ord(' '): + key = win.getch() + key = prevKey + continue + + if key not in [KEY_LEFT, KEY_RIGHT, KEY_UP, KEY_DOWN, 27]: + key = prevKey + + + snake.insert(0, [snake[0][0] + (key == KEY_DOWN and 1) + (key == KEY_UP and -1), snake[0][1] + (key == KEY_LEFT and -1) + (key == KEY_RIGHT and 1)]) + + + if snake[0][0] == 0: snake[0][0] = 18 + if snake[0][1] == 0: snake[0][1] = 58 + if snake[0][0] == 19: snake[0][0] = 1 + if snake[0][1] == 59: snake[0][1] = 1 + + + if snake[0] in snake[1:]: break + + + if snake[0] == food: + food = [] + score += 1 + while food == []: + food = [randint(1, 18), randint(1, 58)] + if food in snake: food = [] + win.addch(food[0], food[1], '*') + else: + last = snake.pop() + win.addch(last[0], last[1], ' ') + win.addch(snake[0][0], snake[0][1], '#') + +curses.endwin() +print("\nScore - " + str(score)) +print("http://bitemelater.in\n") diff --git a/shashi/sort.py b/shashi/sort.py new file mode 100644 index 0000000..df84ec2 --- /dev/null +++ b/shashi/sort.py @@ -0,0 +1,7 @@ +#call this function with a list and it will return a sorted list + +def sort(a): + return sorted(a) + +# testing +print(sort([4,5,8,5,2,2,3])) \ No newline at end of file diff --git a/shuvikash/helloberfun.java b/shuvikash/helloberfun.java new file mode 100644 index 0000000..3baa48a --- /dev/null +++ b/shuvikash/helloberfun.java @@ -0,0 +1,10 @@ +import java.io.*; +import java.util.*; + +class hactoberfun +{ + public static void main (String[] args) + { + System.out.println("Hello Hacktoberfun"); + } +} diff --git a/sort.cpp/a.out b/sort.cpp/a.out new file mode 100755 index 0000000..b05122e Binary files /dev/null and b/sort.cpp/a.out differ diff --git a/sort.cpp/sort.cpp b/sort.cpp/sort.cpp new file mode 100644 index 0000000..1f42225 --- /dev/null +++ b/sort.cpp/sort.cpp @@ -0,0 +1,24 @@ +#include +using namespace std; +int main() +{ + long long int size; + vector v; + cout<<"Please enter the size of the array:- "<>size; + cout<<"Please enter the numbers one by one:-"<>value; + v.push_back(value); + } + sort(v.begin(),v.end()); + cout<<"Array in sorted order is:- "; + for(long long int i=0;i +using namespace std; + +int main() +{ + int N1,N2,result; + + cout << "Enter two integers: "; + cin >> N1 >> N2; + + result = N1 + N2; + + cout << N1 << " + " << N2 << " = " << result; + + return 0; +} diff --git a/sum__two__numbers/sum.cpp b/sum__two__numbers/sum.cpp new file mode 100644 index 0000000..5057bfc --- /dev/null +++ b/sum__two__numbers/sum.cpp @@ -0,0 +1,12 @@ +#include +using namespace std; +int main() +{ + long long int first,second; + cout<<"Please enter the first number:- "<>first; + cout<<"Please enter the second number:- "<>second; + cout<<"The sum of the two number is:- "< + +void main(){ + printf("\n*****Check wether a number is even or odd*****\n\n\n"); + + int a; + + printf("Enter a number:\n"); + scanf("%d", &a); + + if (a % 2 == 0) + printf("--->The number you entered is even\n"); + else + printf("--->The number you entered is odd\n"); +} diff --git a/vmsantos/helloberfun.c b/vmsantos/helloberfun.c new file mode 100644 index 0000000..769888e --- /dev/null +++ b/vmsantos/helloberfun.c @@ -0,0 +1,6 @@ +#include + +int main (){ + printf("Hello Hacktoberfun\n"); + return 0; +} diff --git a/vmsantos/sum.c b/vmsantos/sum.c new file mode 100644 index 0000000..cb82929 --- /dev/null +++ b/vmsantos/sum.c @@ -0,0 +1,17 @@ +#include + +int sum(int int1, int int2){ + return int1 + int2; +} + +int main(){ + int int1, int2; + int1 = 0; + int2 = 0; + printf("Type the first integer you want to sum:\n"); + scanf("%d", &int1); + printf("Type the second integer you want to sum:\n"); + scanf("%d", &int2); + printf("%d + %d = %d\n", int1, int2, sum(int1, int2)); + return 0; +}