Skip to content

Latest commit

 

History

History
279 lines (221 loc) · 19.4 KB

Codewars-Problems-By-Stephen-Prata-Chapter.md

File metadata and controls

279 lines (221 loc) · 19.4 KB

Codewars 8kyu Problems by Stephen Prata's "C Primer Plus" Chapter

Purpose

Codewars sorts problems by difficulty. 8kyu problems are the easiest. But this sorting is not specific to the programming language. In particular, C students learn dynamic memory allocation late in their first semester. Assigning introductory C students to to "easy 8kyu Codewars problems" is problematic.

This document sorts all 180 8kyu Codewars problems by chapter in Stephen Prata's "C Primer Plus" book. I roughly sort problems by difficulty within each chapter list (easiest first).

If you are using this list to assign problems to students, I recommend giving the students the goal of solving a subset of the problems they can theoretically solve. For example, I believe seven problems are solvable by students after reading chapter 2 of the Stephen Prata book. Your assignment could be for the students to solve any three of them before moving onto chapter 3.

A huge number of problems become available once the students learn arrays, strings, and dynamic memory allocation (chapters 10-12)

This sorting is error-prone. As of December 2022 this list should be considered draft. I welcome pull requests to refine the list. I intend to create Codewars collections for each of these, but want to refine the list before doing that work.

Chapter 2: Introducing C

Topics covered: assignment, main(), printf(), integers, comments

Chapter 3: Data and C

Topics covered: int, short, long, unsigned, char, float, double, _Bool, _Complex, _Imaginary

Chapter 4: Character strings and formatted input/output

Topics covered: strlen(), const, strings (intro), scanf, printf, #define

Chapter 5: Operators, expressions, and statements

Topics covered: while, typedef, math operators (including modulus), compound statements, automatic type conversions, typecasts, functions that use arguments

Chapter 6: Control statements, looping

Topics covered: For, while, do, inequality operators, do/while, arrays (introduction), writing functions that return values

Chapter 7: C Control statements, branching, and jumps

Topics covered: If-else, switch, continue, break, case, default, goto, logical and, logical or, conditional operator, putchar(), getchar(), <type.h>, nesting if-else, character analysis (islower() etc).

Chapter 8: Character input/output and input validation

Topics covered: input, output, buffered vs unbuffered input, simulating end-of-file from the keyboard, pipes and redirection, user interface

Chapter 9: Functions

Topics covered: Return, address, * indirection operator, functions, arguments, return values, function types, ANSI C prototypes, recursion

Chapter 10: Arrays and pointers

Topics covered: static, &, * indirection operator, arrays, pointers and arrays, writing functions that process arrays, two-dimensional arrays

Chapter 11: Character strings and string functions

Topics covered: gets(), gets_s(), fgets(), puts(), fputs(), strcat(), strncat(), strcmp(), strncmp(), strcpy(), strncpy(), sprintf(), strchr(), creating and using strings, <string.h>, using command-line arguments

Chapter 12: Storage classes, linkage, and memory management

Topics covered: Auto, extern, static, register, const, volatile, restricted, _Thread_local, _Atomic, rand(), srand(), time(), malloc(), calloc(), free(), determining scope and lifetime of a variable, designing more complex programs

Chapter 13: File input/output

Topics covered: fopen(), getc(), putc(), exit(), fclose(), fprintf(), fscanf(), fgets(), fputs(), rewind(), fseek(), ftell(), flush(), fgetpos(), fsetpos(), feof(), ferror(), ungetc(), setvbuf(), fread(), fwrite()

No 8kyu Codewars problems cover file input/output.

Chapter 14: Structures and other data forms

Topics covered: struct, union, typdef, ->, . (accessing member of a struct), structure templates, typedef, unions, pointers to functions, enum

Chapter 15: Bit fiddling

Topics covered: ~, &, |^, <<, >>, &=, |=, bitwise operators, bit fields, _Alignas, _Alignof

No 8kyu Codewars problems cover bit fiddling

Chapter 16: C preprocessor and the C library

Topics covered: #define, #include, #ifdef, #else, #endif, #ifndef, #if, #elif, #line, #error, #pragma, _Generic, _Noreturn, _Static_assert, function-like macros, conditional compilation, generic selection expression, C library and handy functions

No 8kyu Codewars problems cover the C preprocessor

Chapter 17: Advanced data representation

Topics covered: Malloc, using C to represent a variety of data types, new algorithms, developing programs conceptually, abstract data types

No 8kyu Codewars problems cover advanced data representation

8kyu problems deemed inappropriate for an entry-level C class (for various reasons)