This commit is contained in:
Miloslav Ciz 2024-07-30 22:52:22 +02:00
parent 9005259ff3
commit df80221a15
29 changed files with 1864 additions and 1808 deletions

View file

@ -49,8 +49,9 @@ This place is for suggesting programming projects that will in first place serve
8. **[bytebeat](bytebeat.md)**: Make at least three cool sounding bytebeat songs.
9. **Lorem ipsum [markdown](md.md) generator**: Create a program that generates gibberish text in markdown format that looks like normal human text. Each time it is run, it will generate generally a different text that consists of 3 to 5 sections, each section starts with a heading which starts with `# ` after which 3 to 5 words follow, then there are two newlines and then 3 to 5 paragraphs follow; each paragraph ends with two newlines, except for the last one in the document which only ends with one newline. Paragraph consists of 5 to 10 sentences; each sentence consists of 3 to 10 words, starts with capital letter (other letters are lowercase) and ends with period. About 1 in 20 words in paragraphs are highlighted -- highlight is either italic (the word is between `*`s) or bold (the word is between `**`s). After period there is space except when it's the last period in a paragraph (then there is no space). Words are selected randomly from some set of words that you define (have at least 10 different words). Thumbs up for also generating lists etc.
10. **Caesar cipher**: Make a program that encrypts/decrypts text with the simple cipher known as Caesar cipher, i.e. by offsetting each letter by certain fixed number *N* (e.g. with *N = 2* the letter *A* will become *C*, *B* will become *D* etc.). Assume just ASCII characters on input (encrypted output can be non-ASCII). You can just choose and hardcode some specific *N* but thumbs up for allowing to set any *N*. You can input/output text from/to standard input/output or files -- it's up to you -- also you can either make one program that does both encoding and decoding (e.g. depending on CLI flag) or make two programs, one for each task.
11. **filetype guesser**: Create a program that reads a file and guesses its file type. You can NOT use the file name, only the file content. First look at the [magic number](magic_number.md) (file signature) -- check at least PDF, JPEG, PNG, MP3, GIF and TAR. If this doesn't succeed, then see if 90% of bytes are printable ASCII characters: if so, then guess the file to be TXT, otherwise you may report unknown type (or optionally you can try some extra checks if you want).
12. **[brainfuck](brainfuck.md) interpreter**: Make a program that interprets brainfuck. You may choose to read the input program either from standard input or from a file (the file may have some hardcoded name, e.g. your program will just look for a file named `program.bf` in the same directory). If the brainfuck program is invalid or runtime error occurs in it, you may just write out `error` and halt your interpreter. Thumbs up for making the interpreter nicer, e.g. allowing to pass input file name as a CLI argument, reporting more details about errors (e.g. its position in source code) and so on.
11. **simple website generator**: All static site generators suck ass, make your own. Make a simple markup language and a program that will turn this markup into [HTML](html.md) file -- this will allow you to write HTML websites very easily. The program will read the input file on standard input (i.e. NOT from a file, though you can optionally support this too) and output the HTML on standard output (again, output to file is optional), so that the program can be used like this: `cat myfile.mymarkup | ./mymarkupprocessor > mywebpage.html`. The markup language may be super simple: let's say `_` and `;_` could mark the start and end of bold text (translating to `<b>` and `</b>` respectively) , `#` and `;#` start and end of heading (translating to `<h1>` and `</h1>` respectively) and so on (you can make your own tags, this is just an example). Basically you'll be mostly just translating your tags into HTML tags. You don't have to implement escape sequences for special characters (i.e. it's fine if it's impossible to have let's say the `#` character in your output), but thumbs up if you do. You HAVE TO output a correct HTML, i.e. you have to output a prologue (something like `<html> <head> </head> <body> ...`) and epilogue (something like `</body> </html>`) and somehow deal with possible HTML special characters in the input text: for example if the input contains `<`, you have to translate it to `&lt;` etc., but it is allowed to handle non-trivial cases (like weird Unicode stuff or something) by e.g. just replacing problematic input with `???`. [Unicode](unicode.md) doesn't have to be supported on output, you can output plain [ASCII](ascii.md). You have to support at least normal text, 2 levels of headings and bold text, thumbs up for additional things like images, links, lists etc. Thumbs up for additional features like allowing to set website title with a CLI flag, choose from several hardcoded [CSS](css.md) styles or adding extra output formats like [Markdown](md.md), LaTeX and so on. Test that you generate correct HTML with some HTML validator.
12. **filetype guesser**: Create a program that reads a file and guesses its file type. You can NOT use the file name, only the file content. First look at the [magic number](magic_number.md) (file signature) -- check at least PDF, JPEG, PNG, MP3, GIF and TAR. If this doesn't succeed, then see if 90% of bytes are printable ASCII characters: if so, then guess the file to be TXT, otherwise you may report unknown type (or optionally you can try some extra checks if you want).
13. **[brainfuck](brainfuck.md) interpreter**: Make a program that interprets brainfuck. You may choose to read the input program either from standard input or from a file (the file may have some hardcoded name, e.g. your program will just look for a file named `program.bf` in the same directory). If the brainfuck program is invalid or runtime error occurs in it, you may just write out `error` and halt your interpreter. Thumbs up for making the interpreter nicer, e.g. allowing to pass input file name as a CLI argument, reporting more details about errors (e.g. its position in source code) and so on.
### Level 2: Mid, *Hurt Me Plenty*