├── 001
├── NameGenerator.py
└── README.md
├── 015
├── CollatzConjecture.py
└── README.md
├── README.md
└── TODO
/001/NameGenerator.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 |
3 | import multiprocessing # TODO: Multithreading
4 | import random
5 | import re
6 | import sys
7 | import urllib.request
8 |
9 | regex = r'^[A-Za-z_.]+$'
10 |
11 | countFore = 1
12 | countLast = 1
13 |
14 | cleanForeList = []
15 | cleanLastList = []
16 |
17 | try:
18 | uncleanLastList = urllib.request.urlopen(
19 | "http://www.census.gov/genealogy/www/data/1990surnames/dist.all.last"
20 | ).read().split()
21 |
22 | uncleanForeList = urllib.request.urlopen(
23 | "http://deron.meranda.us/data/census-derived-all-first.txt"
24 | ).read().split()
25 | except MemoryError:
26 | print("Out of memory error.")
27 | sys.exit(0)
28 |
29 |
30 | # The following takes a long time. TODO: Write names to Database
31 | for i in range(0, len(uncleanForeList)):
32 | x = uncleanForeList[i].decode('utf-8')
33 | if re.match(regex, x):
34 | cleanForeList.append(x)
35 | print("Storing First Name:", x + ",",
36 | "Number:", countFore
37 | )
38 | countFore += 1
39 |
40 | for i in range(0, len(uncleanLastList)):
41 | x = uncleanLastList[i].decode('utf-8')
42 | if re.match(regex, x):
43 | cleanLastList.append(x)
44 | print("Storing Last Name:", x + ",",
45 | "Number:", countLast
46 | )
47 | countLast += 1
48 | print("\n")
49 |
50 | for i in range(0, 10): # Second number is amount of names to generate.
51 | print(
52 | cleanForeList[random.randint(0, len(cleanForeList) - 1)].lower().title(),
53 | cleanLastList[random.randint(0, len(cleanLastList) - 1)].lower().title(),
54 | )
55 |
--------------------------------------------------------------------------------
/001/README.md:
--------------------------------------------------------------------------------
1 | Name Generator
2 | ============================
3 |
4 | A name generator that fetches and validates names from the census, and uses a PRNG to sort through them and generate Pseudorandom names.
5 |
6 |
7 | TODO:
8 | ----------------------------
9 |
10 | NameGenerator.py
11 | ----------------------------
12 |
13 | - Multithreading
14 |
- Database
15 |
16 |
17 | Other
18 | ----------------------------
19 |
20 | - Implement in C
21 |
- Implement in C++
22 |
- Implement in C#
23 |
- Implement in Java
24 |
Implement in Python
25 | - Implement in Ruby
26 |
- Implement in Haskell
27 |
- Implement in LISP
28 |
29 |
--------------------------------------------------------------------------------
/015/CollatzConjecture.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | #
3 | # If odd: 3n +1
4 | # If even: n / 2
5 | # It always finds 1.
6 |
7 | while True:
8 | try:
9 | natNum = int(input("Starting number: "))
10 | break
11 | except ValueError:
12 | print("Please enter a whole integer.")
13 |
14 | while True:
15 | if natNum % 2 == 0:
16 | natNum = natNum / 2
17 | elif natNum == 1:
18 | break
19 | else:
20 | natNum = (natNum * 3) + 1
21 | print(natNum)
22 |
--------------------------------------------------------------------------------
/015/README.md:
--------------------------------------------------------------------------------
1 | Collatz Conjecture
2 | ============================
3 |
4 | The 3n+1 Conjecture. You will always reach one.
5 |
6 |
7 | TODO:
8 | ----------------------------
9 |
10 | Other
11 | ----------------------------
12 |
13 | - Implement in C
14 |
- Implement in C++
15 |
- Implement in C#
16 |
- Implement in Java
17 |
Implement in Python
18 | - Implement in Ruby
19 |
- Implement in Haskell
20 |
- Implement in LISP
21 |
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | programming-projects-for-n00bz
2 | ==============================
3 |
4 | /g/'s Programming Projects for n00bz. Courtesy of anon from 4chan.
5 |
6 | These are in random difficulty order.
7 |
8 | How to Play
9 | -----------------------------
10 | Last three digits of your post decide.
11 |
12 | Happy Rolling!
13 |
14 |
15 |
16 |
17 | - Name Generator
18 |
- Higher or Lower / Heads or tails
19 |
- Temperature Converter
20 |
- Calculate your Age in Seconds
21 |
- Simple Encryption / Decryption
22 |
- FizzBuzz
23 |
- Rock Paper Scissors and/or Rock Paper Scissors Lizard Spock
24 |
- Hangman
25 |
- Love Calculator
26 |
- Pseudorandom Quote Generator
27 |
- Password Generator
28 |
- Atomically Correct Time from an internet clock
29 |
- Haiku Generator
30 |
- Magic Eight Ball
31 |
- Collatz Conjecture
32 |
- Reverse a string
33 |
- Count the Vowels in a string
34 |
- Count the words in a string
35 |
- Minesweeper
36 |
- Connect Four
37 |
- BMI Calculator
38 |
- 4chan Thread Downloader (Images)
39 |
- Sodoku Generator / Solver
40 |
- Maze Game and Solution Algorithm
41 |
- Decimal to Binary
42 |
- Picross Solver
43 |
- Eulerian Path
44 |
- Fibonnaci Sequence Algorithm
45 |
- Calculate and Print the Factorial of 100
46 |
- Encryption Collection. Implement all of the tools in the Rumkin Collection: http://rumkin.com/tools/cipher/
47 |
- Blackjack
48 |
- Text Adventure Game
49 |
- Generate an ASCII image of a Christmas tree to a user given height.
50 |
- Area Calculator
51 |
- Benfords Law
52 |
- Hunt the Wumpus
53 |
- Static Website Generator
54 |
- Crossword Game
55 |
- NTP Server
56 |
- Stronger Password Generator (With less chance of predicting an outcome)
57 |
- Find the largest number in an array, and print its position
58 |
- ASCII Analogue Clock
59 |
- Dijkstra's Algorithm
60 |
- Text to Morse translator. Bonus points for generating the sound.
61 |
- Noughts and Crosses / Tic Tac Toe / X and O
62 |
- Snake Game
63 |
- FTP Client (TCP or UDP with ACK)
64 |
- Telnet Server
65 |
- IMP Interpreter
66 |
- Tetris
67 |
- Conway's Game of Life
68 |
- Web Crawler
69 |
- Text Editor
70 |
- RSS Feed Creator
71 |
- Evaluate Binomial Coefficients
72 |
- Reverse Polish Notation (RPN) Calculator
73 |
- Output the Mandlebrot Set in ASCII
74 |
- Sorting Algorithm
75 |
- Convert Markup to HTML
76 |
- The N Queens Problem
77 |
- Details Validatior using Regular Expressions. Validate Phone numbers, emails, names etc.
78 |
- Linked List
79 |
- Mastermind
80 |
- Random Image Generator
81 |
- last.FM Scrobbler
82 |
- Klingon Translator
83 |
- Prime Number generator using a Sieve
84 |
- Markov Chain
85 |
- Graphical Digital Clock (GUI)
86 |
- Oil Spill Game
87 |
- Algorithm to calculate Triangle Numbers
88 |
- Calculate a users typing speed
89 |
- Name Art in ASCII
90 |
- Towers of Hanoi
91 |
- Quine
92 |
- IRC Bot
93 |
- Brainfuck Interpreter
94 |
- Sorting Algorithm Audibilization and/or Visualisation
95 |
- Chip-8 Emulator
96 |
- Geekcode Generator (3.12)
97 |
- Define, translate and rotate a shape with an arbitrary amount of vertices
98 |
- Pong with Variable Vectors
99 |
- Battleships with an Artificial Intelligence (NPC) opponent. Make sure they're beatable.
100 |
- Simple Rougelike. Mega chapeau for multiplayer over LAN.
101 |
- TCP chat program with basic encryption (XOR)
102 |
- Incremental Economy Simulator (Look up Time of Exploration)
103 |
- Encryption / Decryption Hiding text in an image
104 |
- Calculate Pascals Triangle
105 |
- Sine Wave Generator from Pseudorandom Numbers
106 |
- Pacman Clone with Ghost AI
107 |
- Flappy Birds Clone
108 |
- Fast Fourier Transform
109 |
- Graphical Digital Clock (GUI) that allows the user to set alarms and change colors
110 |
- Binary Search / Binary Search Tree
111 |
- Nintendo Oil Panic
112 |
- Generate the Sierpinski Triangle
113 |
- Calculate the Dot and Cross of two Vectors
114 |
- Little Man Computer Simulator
115 |
- Basic LISP Interpreter
116 |
- Hailstone Sequence
117 |
118 |
119 | Challenge Tier
120 | ------------------------------
121 |
122 | - Conways Game of Life with an Improvement Algorithm.
123 | -It should be given a starting pattern, and alter the starting pattern when a generation dies or stops significant movement (repeats itself indefinately.)
124 | - Scan the entire IPv4 range, from 0.0.0.0 to 255.255.255.255 and log IP's that host webservers in a database.
125 | -I take no responsibility if anybody comes knocking on your door.
126 |
127 |
128 | Also check out:
129 |
130 | https://projecteuler.net/
131 | https://github.com/WoutervdBrink/Programming-Challenges
132 | https://github.com/karan/Projects
133 | http://www.dreamincode.net/forums/topic/78802-martyr2s-mega-project-ideas-list/
134 | http://rosettacode.org/wiki/Category:Programming_Tasks
135 | http://www.cs.manchester.ac.uk/study/postgraduate-research/projects/
136 | https://www.google.com/?q=Programming+Projects
137 |
138 | For more ideas.
139 |
--------------------------------------------------------------------------------
/TODO:
--------------------------------------------------------------------------------
1 | 001:
2 | Implement in C
3 | Implement in C++
4 | Implement in C#
5 | Implement in Java
6 | Implement in Ruby
7 | Implement in Haskell
8 | Implement in LISP
9 | Python:
10 | Multithreading
11 | Database
12 |
--------------------------------------------------------------------------------