Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Sandbox

Post History

50%
+0 −0
Sandbox Circle of text characters [FINALIZED]

posted 1y ago by trichoplax‭  ·  edited 1y ago by trichoplax‭

#15: Post edited by user avatar trichoplax‭ · 2022-10-28T14:23:32Z (over 1 year ago)
Mark as finalized
  • Circle of text characters
  • Circle of text characters [FINALIZED]
  • Given a radius R, output a text representation of a circle.
  • ## Input
  • - A positive integer R (strictly greater than zero)
  • - You do not need to handle values of R greater than 32
  • ## Output
  • - A square grid of characters of side length 2R + 1
  • - You may choose any 2 distinct characters to represent the foreground (depicting the circle) and the background
  • - The centre of the circle is the centre of the square. That is, the location (R, R) if using zero indexed coordinates
  • - Each foreground character must have a distance from the centre that has either a floor or a ceiling of R. That is, R-1 < distance < R+1. Within a single output, some foreground characters may have a floor of R and some may have a ceiling of R - you do not need to choose one or other consistently
  • - The circle must not have gaps. Specifically, there must be no connected path of horizontally or vertically adjacent background characters joining the centre to any edge of the square. Equivalently, a flood fill from the centre will not reach any of the edges
  • ## Examples
  • Here `.` represents the background and `#` represents the foreground.
  • Using these characters, the rules are equivalent to:
  • - Every `.` must be included in the background
  • - Any `#` may be included in the foreground, but not all of them need to be - some may be left as background provided there are no gaps between the foreground characters
  • This is intended to give the flexibility to allow various different circle drawing approaches to compete.
  • The potential character placements for radius 1 to 10:
  • ```text
  • R = 1
  • ###
  • #.#
  • ###
  • R = 2
  • #####
  • ##.##
  • #...#
  • ##.##
  • #####
  • R = 3
  • .#####.
  • ###.###
  • ##...##
  • #.....#
  • ##...##
  • ###.###
  • .#####.
  • R = 4
  • ..#####..
  • .###.###.
  • ##.....##
  • ##.....##
  • #.......#
  • ##.....##
  • ##.....##
  • .###.###.
  • ..#####..
  • R = 5
  • ..#######..
  • .####.####.
  • ###.....###
  • ##.......##
  • ##.......##
  • #.........#
  • ##.......##
  • ##.......##
  • ###.....###
  • .####.####.
  • ..#######..
  • R = 6
  • ...#######...
  • ..####.####..
  • .##.......##.
  • ##.........##
  • ##.........##
  • ##.........##
  • #...........#
  • ##.........##
  • ##.........##
  • ##.........##
  • .##.......##.
  • ..####.####..
  • ...#######...
  • R = 7
  • ....#######....
  • ..#####.#####..
  • .###.......###.
  • .##.........##.
  • ##...........##
  • ##...........##
  • ##...........##
  • #.............#
  • ##...........##
  • ##...........##
  • ##...........##
  • .##.........##.
  • .###.......###.
  • ..#####.#####..
  • ....#######....
  • R = 8
  • ....#########....
  • ...#####.#####...
  • ..###.......###..
  • .###.........###.
  • ###...........###
  • ##.............##
  • ##.............##
  • ##.............##
  • #...............#
  • ##.............##
  • ##.............##
  • ##.............##
  • ###...........###
  • .###.........###.
  • ..###.......###..
  • ...#####.#####...
  • ....#########....
  • R = 9
  • .....#########.....
  • ....#####.#####....
  • ..####.......####..
  • ..##...........##..
  • .##.............##.
  • ###.............###
  • ##...............##
  • ##...............##
  • ##...............##
  • #.................#
  • ##...............##
  • ##...............##
  • ##...............##
  • ###.............###
  • .##.............##.
  • ..##...........##..
  • ..####.......####..
  • ....#####.#####....
  • .....#########.....
  • R = 10
  • ......#########......
  • ....######.######....
  • ...###.........###...
  • ..###...........###..
  • .###.............###.
  • .##...............##.
  • ##.................##
  • ##.................##
  • ##.................##
  • ##.................##
  • #...................#
  • ##.................##
  • ##.................##
  • ##.................##
  • ##.................##
  • .##...............##.
  • .###.............###.
  • ..###...........###..
  • ...###.........###...
  • ....######.######....
  • ......#########......
  • ```
  • ## Validator
  • You can validate specific outputs with this [text circle validator], which will give an explanation for any failed validations.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [text circle validator]: https://trichoplax.github.io/text-circle-validator/ "Online validator for outputs from this challenge"
  • # Now posted: [Circle of text characters](https://codegolf.codidact.com/posts/287319)
  • ---
  • Given a radius R, output a text representation of a circle.
  • ## Input
  • - A positive integer R (strictly greater than zero)
  • - You do not need to handle values of R greater than 32
  • ## Output
  • - A square grid of characters of side length 2R + 1
  • - You may choose any 2 distinct characters to represent the foreground (depicting the circle) and the background
  • - The centre of the circle is the centre of the square. That is, the location (R, R) if using zero indexed coordinates
  • - Each foreground character must have a distance from the centre that has either a floor or a ceiling of R. That is, R-1 < distance < R+1. Within a single output, some foreground characters may have a floor of R and some may have a ceiling of R - you do not need to choose one or other consistently
  • - The circle must not have gaps. Specifically, there must be no connected path of horizontally or vertically adjacent background characters joining the centre to any edge of the square. Equivalently, a flood fill from the centre will not reach any of the edges
  • ## Examples
  • Here `.` represents the background and `#` represents the foreground.
  • Using these characters, the rules are equivalent to:
  • - Every `.` must be included in the background
  • - Any `#` may be included in the foreground, but not all of them need to be - some may be left as background provided there are no gaps between the foreground characters
  • This is intended to give the flexibility to allow various different circle drawing approaches to compete.
  • The potential character placements for radius 1 to 10:
  • ```text
  • R = 1
  • ###
  • #.#
  • ###
  • R = 2
  • #####
  • ##.##
  • #...#
  • ##.##
  • #####
  • R = 3
  • .#####.
  • ###.###
  • ##...##
  • #.....#
  • ##...##
  • ###.###
  • .#####.
  • R = 4
  • ..#####..
  • .###.###.
  • ##.....##
  • ##.....##
  • #.......#
  • ##.....##
  • ##.....##
  • .###.###.
  • ..#####..
  • R = 5
  • ..#######..
  • .####.####.
  • ###.....###
  • ##.......##
  • ##.......##
  • #.........#
  • ##.......##
  • ##.......##
  • ###.....###
  • .####.####.
  • ..#######..
  • R = 6
  • ...#######...
  • ..####.####..
  • .##.......##.
  • ##.........##
  • ##.........##
  • ##.........##
  • #...........#
  • ##.........##
  • ##.........##
  • ##.........##
  • .##.......##.
  • ..####.####..
  • ...#######...
  • R = 7
  • ....#######....
  • ..#####.#####..
  • .###.......###.
  • .##.........##.
  • ##...........##
  • ##...........##
  • ##...........##
  • #.............#
  • ##...........##
  • ##...........##
  • ##...........##
  • .##.........##.
  • .###.......###.
  • ..#####.#####..
  • ....#######....
  • R = 8
  • ....#########....
  • ...#####.#####...
  • ..###.......###..
  • .###.........###.
  • ###...........###
  • ##.............##
  • ##.............##
  • ##.............##
  • #...............#
  • ##.............##
  • ##.............##
  • ##.............##
  • ###...........###
  • .###.........###.
  • ..###.......###..
  • ...#####.#####...
  • ....#########....
  • R = 9
  • .....#########.....
  • ....#####.#####....
  • ..####.......####..
  • ..##...........##..
  • .##.............##.
  • ###.............###
  • ##...............##
  • ##...............##
  • ##...............##
  • #.................#
  • ##...............##
  • ##...............##
  • ##...............##
  • ###.............###
  • .##.............##.
  • ..##...........##..
  • ..####.......####..
  • ....#####.#####....
  • .....#########.....
  • R = 10
  • ......#########......
  • ....######.######....
  • ...###.........###...
  • ..###...........###..
  • .###.............###.
  • .##...............##.
  • ##.................##
  • ##.................##
  • ##.................##
  • ##.................##
  • #...................#
  • ##.................##
  • ##.................##
  • ##.................##
  • ##.................##
  • .##...............##.
  • .###.............###.
  • ..###...........###..
  • ...###.........###...
  • ....######.######....
  • ......#########......
  • ```
  • ## Validator
  • You can validate specific outputs with this [text circle validator], which will give an explanation for any failed validations.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [text circle validator]: https://trichoplax.github.io/text-circle-validator/ "Online validator for outputs from this challenge"
#14: Post edited by user avatar trichoplax‭ · 2022-10-28T14:20:06Z (over 1 year ago)
Add link to validator
  • Given a radius R, output a text representation of a circle.
  • ## Input
  • - A positive integer R (strictly greater than zero)
  • - You do not need to handle values of R greater than 32
  • ## Output
  • - A square grid of characters of side length 2R + 1
  • - You may choose any 2 distinct characters to represent the foreground (depicting the circle) and the background
  • - The centre of the circle is the centre of the square. That is, the location (R, R) if using zero indexed coordinates
  • - Each foreground character must have a distance from the centre that has either a floor or a ceiling of R. That is, R-1 < distance < R+1. Within a single output, some foreground characters may have a floor of R and some may have a ceiling of R - you do not need to choose one or other consistently
  • - The circle must not have gaps. Specifically, there must be no connected path of horizontally or vertically adjacent background characters joining the centre to any edge of the square. Equivalently, a flood fill from the centre will not reach any of the edges
  • ## Examples
  • Here `.` represents the background and `#` represents the foreground.
  • Using these characters, the rules are equivalent to:
  • - Every `.` must be included in the background
  • - Any `#` may be included in the foreground, but not all of them need to be - some may be left as background provided there are no gaps between the foreground characters
  • This is intended to give the flexibility to allow various different circle drawing approaches to compete.
  • The potential character placements for radius 1 to 10:
  • ```text
  • R = 1
  • ###
  • #.#
  • ###
  • R = 2
  • #####
  • ##.##
  • #...#
  • ##.##
  • #####
  • R = 3
  • .#####.
  • ###.###
  • ##...##
  • #.....#
  • ##...##
  • ###.###
  • .#####.
  • R = 4
  • ..#####..
  • .###.###.
  • ##.....##
  • ##.....##
  • #.......#
  • ##.....##
  • ##.....##
  • .###.###.
  • ..#####..
  • R = 5
  • ..#######..
  • .####.####.
  • ###.....###
  • ##.......##
  • ##.......##
  • #.........#
  • ##.......##
  • ##.......##
  • ###.....###
  • .####.####.
  • ..#######..
  • R = 6
  • ...#######...
  • ..####.####..
  • .##.......##.
  • ##.........##
  • ##.........##
  • ##.........##
  • #...........#
  • ##.........##
  • ##.........##
  • ##.........##
  • .##.......##.
  • ..####.####..
  • ...#######...
  • R = 7
  • ....#######....
  • ..#####.#####..
  • .###.......###.
  • .##.........##.
  • ##...........##
  • ##...........##
  • ##...........##
  • #.............#
  • ##...........##
  • ##...........##
  • ##...........##
  • .##.........##.
  • .###.......###.
  • ..#####.#####..
  • ....#######....
  • R = 8
  • ....#########....
  • ...#####.#####...
  • ..###.......###..
  • .###.........###.
  • ###...........###
  • ##.............##
  • ##.............##
  • ##.............##
  • #...............#
  • ##.............##
  • ##.............##
  • ##.............##
  • ###...........###
  • .###.........###.
  • ..###.......###..
  • ...#####.#####...
  • ....#########....
  • R = 9
  • .....#########.....
  • ....#####.#####....
  • ..####.......####..
  • ..##...........##..
  • .##.............##.
  • ###.............###
  • ##...............##
  • ##...............##
  • ##...............##
  • #.................#
  • ##...............##
  • ##...............##
  • ##...............##
  • ###.............###
  • .##.............##.
  • ..##...........##..
  • ..####.......####..
  • ....#####.#####....
  • .....#########.....
  • R = 10
  • ......#########......
  • ....######.######....
  • ...###.........###...
  • ..###...........###..
  • .###.............###.
  • .##...............##.
  • ##.................##
  • ##.................##
  • ##.................##
  • ##.................##
  • #...................#
  • ##.................##
  • ##.................##
  • ##.................##
  • ##.................##
  • .##...............##.
  • .###.............###.
  • ..###...........###..
  • ...###.........###...
  • ....######.######....
  • ......#########......
  • ```
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • Given a radius R, output a text representation of a circle.
  • ## Input
  • - A positive integer R (strictly greater than zero)
  • - You do not need to handle values of R greater than 32
  • ## Output
  • - A square grid of characters of side length 2R + 1
  • - You may choose any 2 distinct characters to represent the foreground (depicting the circle) and the background
  • - The centre of the circle is the centre of the square. That is, the location (R, R) if using zero indexed coordinates
  • - Each foreground character must have a distance from the centre that has either a floor or a ceiling of R. That is, R-1 < distance < R+1. Within a single output, some foreground characters may have a floor of R and some may have a ceiling of R - you do not need to choose one or other consistently
  • - The circle must not have gaps. Specifically, there must be no connected path of horizontally or vertically adjacent background characters joining the centre to any edge of the square. Equivalently, a flood fill from the centre will not reach any of the edges
  • ## Examples
  • Here `.` represents the background and `#` represents the foreground.
  • Using these characters, the rules are equivalent to:
  • - Every `.` must be included in the background
  • - Any `#` may be included in the foreground, but not all of them need to be - some may be left as background provided there are no gaps between the foreground characters
  • This is intended to give the flexibility to allow various different circle drawing approaches to compete.
  • The potential character placements for radius 1 to 10:
  • ```text
  • R = 1
  • ###
  • #.#
  • ###
  • R = 2
  • #####
  • ##.##
  • #...#
  • ##.##
  • #####
  • R = 3
  • .#####.
  • ###.###
  • ##...##
  • #.....#
  • ##...##
  • ###.###
  • .#####.
  • R = 4
  • ..#####..
  • .###.###.
  • ##.....##
  • ##.....##
  • #.......#
  • ##.....##
  • ##.....##
  • .###.###.
  • ..#####..
  • R = 5
  • ..#######..
  • .####.####.
  • ###.....###
  • ##.......##
  • ##.......##
  • #.........#
  • ##.......##
  • ##.......##
  • ###.....###
  • .####.####.
  • ..#######..
  • R = 6
  • ...#######...
  • ..####.####..
  • .##.......##.
  • ##.........##
  • ##.........##
  • ##.........##
  • #...........#
  • ##.........##
  • ##.........##
  • ##.........##
  • .##.......##.
  • ..####.####..
  • ...#######...
  • R = 7
  • ....#######....
  • ..#####.#####..
  • .###.......###.
  • .##.........##.
  • ##...........##
  • ##...........##
  • ##...........##
  • #.............#
  • ##...........##
  • ##...........##
  • ##...........##
  • .##.........##.
  • .###.......###.
  • ..#####.#####..
  • ....#######....
  • R = 8
  • ....#########....
  • ...#####.#####...
  • ..###.......###..
  • .###.........###.
  • ###...........###
  • ##.............##
  • ##.............##
  • ##.............##
  • #...............#
  • ##.............##
  • ##.............##
  • ##.............##
  • ###...........###
  • .###.........###.
  • ..###.......###..
  • ...#####.#####...
  • ....#########....
  • R = 9
  • .....#########.....
  • ....#####.#####....
  • ..####.......####..
  • ..##...........##..
  • .##.............##.
  • ###.............###
  • ##...............##
  • ##...............##
  • ##...............##
  • #.................#
  • ##...............##
  • ##...............##
  • ##...............##
  • ###.............###
  • .##.............##.
  • ..##...........##..
  • ..####.......####..
  • ....#####.#####....
  • .....#########.....
  • R = 10
  • ......#########......
  • ....######.######....
  • ...###.........###...
  • ..###...........###..
  • .###.............###.
  • .##...............##.
  • ##.................##
  • ##.................##
  • ##.................##
  • ##.................##
  • #...................#
  • ##.................##
  • ##.................##
  • ##.................##
  • ##.................##
  • .##...............##.
  • .###.............###.
  • ..###...........###..
  • ...###.........###...
  • ....######.######....
  • ......#########......
  • ```
  • ## Validator
  • You can validate specific outputs with this [text circle validator], which will give an explanation for any failed validations.
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • [text circle validator]: https://trichoplax.github.io/text-circle-validator/ "Online validator for outputs from this challenge"
#13: Post edited by user avatar trichoplax‭ · 2022-10-28T00:55:27Z (over 1 year ago)
Make clear input will never be zero
  • Given a radius R, output a text representation of a circle.
  • ## Input
  • - A positive integer R
  • - You do not need to handle values of R greater than 32
  • ## Output
  • - A square grid of characters of side length 2R + 1
  • - You may choose any 2 distinct characters to represent the foreground (depicting the circle) and the background
  • - The centre of the circle is the centre of the square. That is, the location (R, R) if using zero indexed coordinates
  • - Each foreground character must have a distance from the centre that has either a floor or a ceiling of R. That is, R-1 < distance < R+1. Within a single output, some foreground characters may have a floor of R and some may have a ceiling of R - you do not need to choose one or other consistently
  • - The circle must not have gaps. Specifically, there must be no connected path of horizontally or vertically adjacent background characters joining the centre to any edge of the square. Equivalently, a flood fill from the centre will not reach any of the edges
  • ## Examples
  • Here `.` represents the background and `#` represents the foreground.
  • Using these characters, the rules are equivalent to:
  • - Every `.` must be included in the background
  • - Any `#` may be included in the foreground, but not all of them need to be - some may be left as background provided there are no gaps between the foreground characters
  • This is intended to give the flexibility to allow various different circle drawing approaches to compete.
  • The potential character placements for radius 1 to 10:
  • ```text
  • R = 1
  • ###
  • #.#
  • ###
  • R = 2
  • #####
  • ##.##
  • #...#
  • ##.##
  • #####
  • R = 3
  • .#####.
  • ###.###
  • ##...##
  • #.....#
  • ##...##
  • ###.###
  • .#####.
  • R = 4
  • ..#####..
  • .###.###.
  • ##.....##
  • ##.....##
  • #.......#
  • ##.....##
  • ##.....##
  • .###.###.
  • ..#####..
  • R = 5
  • ..#######..
  • .####.####.
  • ###.....###
  • ##.......##
  • ##.......##
  • #.........#
  • ##.......##
  • ##.......##
  • ###.....###
  • .####.####.
  • ..#######..
  • R = 6
  • ...#######...
  • ..####.####..
  • .##.......##.
  • ##.........##
  • ##.........##
  • ##.........##
  • #...........#
  • ##.........##
  • ##.........##
  • ##.........##
  • .##.......##.
  • ..####.####..
  • ...#######...
  • R = 7
  • ....#######....
  • ..#####.#####..
  • .###.......###.
  • .##.........##.
  • ##...........##
  • ##...........##
  • ##...........##
  • #.............#
  • ##...........##
  • ##...........##
  • ##...........##
  • .##.........##.
  • .###.......###.
  • ..#####.#####..
  • ....#######....
  • R = 8
  • ....#########....
  • ...#####.#####...
  • ..###.......###..
  • .###.........###.
  • ###...........###
  • ##.............##
  • ##.............##
  • ##.............##
  • #...............#
  • ##.............##
  • ##.............##
  • ##.............##
  • ###...........###
  • .###.........###.
  • ..###.......###..
  • ...#####.#####...
  • ....#########....
  • R = 9
  • .....#########.....
  • ....#####.#####....
  • ..####.......####..
  • ..##...........##..
  • .##.............##.
  • ###.............###
  • ##...............##
  • ##...............##
  • ##...............##
  • #.................#
  • ##...............##
  • ##...............##
  • ##...............##
  • ###.............###
  • .##.............##.
  • ..##...........##..
  • ..####.......####..
  • ....#####.#####....
  • .....#########.....
  • R = 10
  • ......#########......
  • ....######.######....
  • ...###.........###...
  • ..###...........###..
  • .###.............###.
  • .##...............##.
  • ##.................##
  • ##.................##
  • ##.................##
  • ##.................##
  • #...................#
  • ##.................##
  • ##.................##
  • ##.................##
  • ##.................##
  • .##...............##.
  • .###.............###.
  • ..###...........###..
  • ...###.........###...
  • ....######.######....
  • ......#########......
  • ```
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • Given a radius R, output a text representation of a circle.
  • ## Input
  • - A positive integer R (strictly greater than zero)
  • - You do not need to handle values of R greater than 32
  • ## Output
  • - A square grid of characters of side length 2R + 1
  • - You may choose any 2 distinct characters to represent the foreground (depicting the circle) and the background
  • - The centre of the circle is the centre of the square. That is, the location (R, R) if using zero indexed coordinates
  • - Each foreground character must have a distance from the centre that has either a floor or a ceiling of R. That is, R-1 < distance < R+1. Within a single output, some foreground characters may have a floor of R and some may have a ceiling of R - you do not need to choose one or other consistently
  • - The circle must not have gaps. Specifically, there must be no connected path of horizontally or vertically adjacent background characters joining the centre to any edge of the square. Equivalently, a flood fill from the centre will not reach any of the edges
  • ## Examples
  • Here `.` represents the background and `#` represents the foreground.
  • Using these characters, the rules are equivalent to:
  • - Every `.` must be included in the background
  • - Any `#` may be included in the foreground, but not all of them need to be - some may be left as background provided there are no gaps between the foreground characters
  • This is intended to give the flexibility to allow various different circle drawing approaches to compete.
  • The potential character placements for radius 1 to 10:
  • ```text
  • R = 1
  • ###
  • #.#
  • ###
  • R = 2
  • #####
  • ##.##
  • #...#
  • ##.##
  • #####
  • R = 3
  • .#####.
  • ###.###
  • ##...##
  • #.....#
  • ##...##
  • ###.###
  • .#####.
  • R = 4
  • ..#####..
  • .###.###.
  • ##.....##
  • ##.....##
  • #.......#
  • ##.....##
  • ##.....##
  • .###.###.
  • ..#####..
  • R = 5
  • ..#######..
  • .####.####.
  • ###.....###
  • ##.......##
  • ##.......##
  • #.........#
  • ##.......##
  • ##.......##
  • ###.....###
  • .####.####.
  • ..#######..
  • R = 6
  • ...#######...
  • ..####.####..
  • .##.......##.
  • ##.........##
  • ##.........##
  • ##.........##
  • #...........#
  • ##.........##
  • ##.........##
  • ##.........##
  • .##.......##.
  • ..####.####..
  • ...#######...
  • R = 7
  • ....#######....
  • ..#####.#####..
  • .###.......###.
  • .##.........##.
  • ##...........##
  • ##...........##
  • ##...........##
  • #.............#
  • ##...........##
  • ##...........##
  • ##...........##
  • .##.........##.
  • .###.......###.
  • ..#####.#####..
  • ....#######....
  • R = 8
  • ....#########....
  • ...#####.#####...
  • ..###.......###..
  • .###.........###.
  • ###...........###
  • ##.............##
  • ##.............##
  • ##.............##
  • #...............#
  • ##.............##
  • ##.............##
  • ##.............##
  • ###...........###
  • .###.........###.
  • ..###.......###..
  • ...#####.#####...
  • ....#########....
  • R = 9
  • .....#########.....
  • ....#####.#####....
  • ..####.......####..
  • ..##...........##..
  • .##.............##.
  • ###.............###
  • ##...............##
  • ##...............##
  • ##...............##
  • #.................#
  • ##...............##
  • ##...............##
  • ##...............##
  • ###.............###
  • .##.............##.
  • ..##...........##..
  • ..####.......####..
  • ....#####.#####....
  • .....#########.....
  • R = 10
  • ......#########......
  • ....######.######....
  • ...###.........###...
  • ..###...........###..
  • .###.............###.
  • .##...............##.
  • ##.................##
  • ##.................##
  • ##.................##
  • ##.................##
  • #...................#
  • ##.................##
  • ##.................##
  • ##.................##
  • ##.................##
  • .##...............##.
  • .###.............###.
  • ..###...........###..
  • ...###.........###...
  • ....######.######....
  • ......#########......
  • ```
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
#12: Post edited by user avatar trichoplax‭ · 2022-10-26T14:36:17Z (over 1 year ago)
Remove ambiguity from output section
  • Given a radius R, output a text representation of a circle.
  • ## Input
  • - A positive integer R
  • - You do not need to handle values of R greater than 32
  • ## Output
  • - A square grid of characters of side length 2R + 1
  • - You may choose any 2 distinct characters to represent the foreground (depicting the circle) and the background
  • - The centre of the circle is the centre of the square. That is, the location (R, R) if using zero indexed coordinates
  • - Each foreground character must have a distance from the centre that has either a floor or a ceiling of R. That is, R-1 < distance < R+1. Within a single output, some characters may have a floor of R and some may have a ceiling of R - you do not need to choose one or other consistently
  • - The circle must not have gaps. Specifically, there must be no connected path of horizontally or vertically adjacent background characters joining the centre to any edge of the square. Equivalently, a flood fill from the centre will not reach any of the edges
  • ## Examples
  • Here `.` represents the background and `#` represents the foreground.
  • Using these characters, the rules are equivalent to:
  • - Every `.` must be included in the background
  • - Any `#` may be included in the foreground, but not all of them need to be - some may be left as background provided there are no gaps between the foreground characters
  • This is intended to give the flexibility to allow various different circle drawing approaches to compete.
  • The potential character placements for radius 1 to 10:
  • ```text
  • R = 1
  • ###
  • #.#
  • ###
  • R = 2
  • #####
  • ##.##
  • #...#
  • ##.##
  • #####
  • R = 3
  • .#####.
  • ###.###
  • ##...##
  • #.....#
  • ##...##
  • ###.###
  • .#####.
  • R = 4
  • ..#####..
  • .###.###.
  • ##.....##
  • ##.....##
  • #.......#
  • ##.....##
  • ##.....##
  • .###.###.
  • ..#####..
  • R = 5
  • ..#######..
  • .####.####.
  • ###.....###
  • ##.......##
  • ##.......##
  • #.........#
  • ##.......##
  • ##.......##
  • ###.....###
  • .####.####.
  • ..#######..
  • R = 6
  • ...#######...
  • ..####.####..
  • .##.......##.
  • ##.........##
  • ##.........##
  • ##.........##
  • #...........#
  • ##.........##
  • ##.........##
  • ##.........##
  • .##.......##.
  • ..####.####..
  • ...#######...
  • R = 7
  • ....#######....
  • ..#####.#####..
  • .###.......###.
  • .##.........##.
  • ##...........##
  • ##...........##
  • ##...........##
  • #.............#
  • ##...........##
  • ##...........##
  • ##...........##
  • .##.........##.
  • .###.......###.
  • ..#####.#####..
  • ....#######....
  • R = 8
  • ....#########....
  • ...#####.#####...
  • ..###.......###..
  • .###.........###.
  • ###...........###
  • ##.............##
  • ##.............##
  • ##.............##
  • #...............#
  • ##.............##
  • ##.............##
  • ##.............##
  • ###...........###
  • .###.........###.
  • ..###.......###..
  • ...#####.#####...
  • ....#########....
  • R = 9
  • .....#########.....
  • ....#####.#####....
  • ..####.......####..
  • ..##...........##..
  • .##.............##.
  • ###.............###
  • ##...............##
  • ##...............##
  • ##...............##
  • #.................#
  • ##...............##
  • ##...............##
  • ##...............##
  • ###.............###
  • .##.............##.
  • ..##...........##..
  • ..####.......####..
  • ....#####.#####....
  • .....#########.....
  • R = 10
  • ......#########......
  • ....######.######....
  • ...###.........###...
  • ..###...........###..
  • .###.............###.
  • .##...............##.
  • ##.................##
  • ##.................##
  • ##.................##
  • ##.................##
  • #...................#
  • ##.................##
  • ##.................##
  • ##.................##
  • ##.................##
  • .##...............##.
  • .###.............###.
  • ..###...........###..
  • ...###.........###...
  • ....######.######....
  • ......#########......
  • ```
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • Given a radius R, output a text representation of a circle.
  • ## Input
  • - A positive integer R
  • - You do not need to handle values of R greater than 32
  • ## Output
  • - A square grid of characters of side length 2R + 1
  • - You may choose any 2 distinct characters to represent the foreground (depicting the circle) and the background
  • - The centre of the circle is the centre of the square. That is, the location (R, R) if using zero indexed coordinates
  • - Each foreground character must have a distance from the centre that has either a floor or a ceiling of R. That is, R-1 < distance < R+1. Within a single output, some foreground characters may have a floor of R and some may have a ceiling of R - you do not need to choose one or other consistently
  • - The circle must not have gaps. Specifically, there must be no connected path of horizontally or vertically adjacent background characters joining the centre to any edge of the square. Equivalently, a flood fill from the centre will not reach any of the edges
  • ## Examples
  • Here `.` represents the background and `#` represents the foreground.
  • Using these characters, the rules are equivalent to:
  • - Every `.` must be included in the background
  • - Any `#` may be included in the foreground, but not all of them need to be - some may be left as background provided there are no gaps between the foreground characters
  • This is intended to give the flexibility to allow various different circle drawing approaches to compete.
  • The potential character placements for radius 1 to 10:
  • ```text
  • R = 1
  • ###
  • #.#
  • ###
  • R = 2
  • #####
  • ##.##
  • #...#
  • ##.##
  • #####
  • R = 3
  • .#####.
  • ###.###
  • ##...##
  • #.....#
  • ##...##
  • ###.###
  • .#####.
  • R = 4
  • ..#####..
  • .###.###.
  • ##.....##
  • ##.....##
  • #.......#
  • ##.....##
  • ##.....##
  • .###.###.
  • ..#####..
  • R = 5
  • ..#######..
  • .####.####.
  • ###.....###
  • ##.......##
  • ##.......##
  • #.........#
  • ##.......##
  • ##.......##
  • ###.....###
  • .####.####.
  • ..#######..
  • R = 6
  • ...#######...
  • ..####.####..
  • .##.......##.
  • ##.........##
  • ##.........##
  • ##.........##
  • #...........#
  • ##.........##
  • ##.........##
  • ##.........##
  • .##.......##.
  • ..####.####..
  • ...#######...
  • R = 7
  • ....#######....
  • ..#####.#####..
  • .###.......###.
  • .##.........##.
  • ##...........##
  • ##...........##
  • ##...........##
  • #.............#
  • ##...........##
  • ##...........##
  • ##...........##
  • .##.........##.
  • .###.......###.
  • ..#####.#####..
  • ....#######....
  • R = 8
  • ....#########....
  • ...#####.#####...
  • ..###.......###..
  • .###.........###.
  • ###...........###
  • ##.............##
  • ##.............##
  • ##.............##
  • #...............#
  • ##.............##
  • ##.............##
  • ##.............##
  • ###...........###
  • .###.........###.
  • ..###.......###..
  • ...#####.#####...
  • ....#########....
  • R = 9
  • .....#########.....
  • ....#####.#####....
  • ..####.......####..
  • ..##...........##..
  • .##.............##.
  • ###.............###
  • ##...............##
  • ##...............##
  • ##...............##
  • #.................#
  • ##...............##
  • ##...............##
  • ##...............##
  • ###.............###
  • .##.............##.
  • ..##...........##..
  • ..####.......####..
  • ....#####.#####....
  • .....#########.....
  • R = 10
  • ......#########......
  • ....######.######....
  • ...###.........###...
  • ..###...........###..
  • .###.............###.
  • .##...............##.
  • ##.................##
  • ##.................##
  • ##.................##
  • ##.................##
  • #...................#
  • ##.................##
  • ##.................##
  • ##.................##
  • ##.................##
  • .##...............##.
  • .###.............###.
  • ..###...........###..
  • ...###.........###...
  • ....######.######....
  • ......#########......
  • ```
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
#11: Post edited by user avatar trichoplax‭ · 2022-10-25T13:06:34Z (over 1 year ago)
Simplify example format
  • Given a radius R, output a text representation of a circle.
  • ## Input
  • - A positive integer R
  • - You do not need to handle values of R greater than 32
  • ## Output
  • - A square of characters of side length 2R + 1
  • - You may choose any 2 distinct characters to represent the foreground (depicting the circle) and the background
  • - The centre of the circle is the centre of the square. That is, the location (R, R) if using zero indexed coordinates
  • - Each foreground character must have a distance from the centre that has either a floor or a ceiling of R. That is, R-1 < distance < R+1. Within a single output, some characters may have a floor of R and some may have a ceiling of R - you do not need to choose one or other consistently
  • - The circle must not have gaps. Specifically, there must be no connected path of horizontally or vertically adjacent background characters joining the centre to any edge of the square. Equivalently, a flood fill from the centre will not reach any of the edges
  • ## Examples
  • These examples use the following characters to indicate the distance from the centre:
  • - `#` means the character is a distance of exactly R from the centre
  • - `.` means the distance is less than or equal to R-1 or greater than or equal to R+1
  • - `f` or `F` means the floor of the distance is R
  • - `c` or `C` means the ceiling of the distance is R
  • - upper case (`F` or `C`) means the distance rounded to the nearest integer is R
  • Using these characters, the rules are equivalent to:
  • - Every `#` must be included in the foreground
  • - Every `.` must be included in the background
  • - All other characters can be either foreground or background, provided there are no gaps between the foreground characters
  • This is intended to give the flexibility to allow various different circle drawing approaches to compete.
  • Examples of valid circles include:
  • - Every `#`, `f`, and `F` is foreground (every character with a floor of R is foreground)
  • - Every `#`, `c`, and `C` is foreground (every character with a ceiling of R is foreground)
  • - Every `#`, `F`, and `C` is foreground (every character that rounds to R is foreground)
  • - Every `#`, `f`, `F`, `c`, and `C` is foreground (every character with a floor or ceiling of R is foreground)
  • The potential character placements for radius 1 to 10:
  • ```text
  • R=1:
  • F#F
  • #.#
  • F#F
  • R=2:
  • fF#Ff
  • Fc.cF
  • #...#
  • Fc.cF
  • fF#Ff
  • R=3:
  • .fF#Ff.
  • fCc.cCf
  • Fc...cF
  • #.....#
  • Fc...cF
  • fCc.cCf
  • .fF#Ff.
  • R=4:
  • ..FF#FF..
  • .FCc.cCF.
  • FC.....CF
  • Fc.....cF
  • #.......#
  • Fc.....cF
  • FC.....CF
  • .FCc.cCF.
  • ..FF#FF..
  • R=5:
  • ..fFF#FFf..
  • .f#cc.cc#f.
  • f#c.....c#f
  • Fc.......cF
  • Fc.......cF
  • #.........#
  • Fc.......cF
  • Fc.......cF
  • f#c.....c#f
  • .f#cc.cc#f.
  • ..fFF#FFf..
  • R=6:
  • ...fFF#FFf...
  • ..FCcc.ccCF..
  • .FC.......CF.
  • fC.........Cf
  • Fc.........cF
  • Fc.........cF
  • #...........#
  • Fc.........cF
  • Fc.........cF
  • fC.........Cf
  • .FC.......CF.
  • ..FCcc.ccCF..
  • ...fFF#FFf...
  • R=7:
  • ....fFF#FFf....
  • ..fFCcc.ccCFf..
  • .fFc.......cFf.
  • .Fc.........cF.
  • fC...........Cf
  • Fc...........cF
  • Fc...........cF
  • #.............#
  • Fc...........cF
  • Fc...........cF
  • fC...........Cf
  • .Fc.........cF.
  • .fFc.......cFf.
  • ..fFCcc.ccCFf..
  • ....fFF#FFf....
  • R=8:
  • ....ffFF#FFff....
  • ...fFCcc.ccCFf...
  • ..FCc.......cCF..
  • .fCc.........cCf.
  • fFc...........cFf
  • fC.............Cf
  • Fc.............cF
  • Fc.............cF
  • #...............#
  • Fc.............cF
  • Fc.............cF
  • fC.............Cf
  • fFc...........cFf
  • .fCc.........cCf.
  • ..FCc.......cCF..
  • ...fFCcc.ccCFf...
  • ....ffFF#FFff....
  • R=9:
  • .....fFFF#FFFf.....
  • ....FCCcc.ccCCF....
  • ..fFCc.......cCFf..
  • ..Fc...........cF..
  • .FC.............CF.
  • fCc.............cCf
  • FC...............CF
  • Fc...............cF
  • Fc...............cF
  • #.................#
  • Fc...............cF
  • Fc...............cF
  • FC...............CF
  • fCc.............cCf
  • .FC.............CF.
  • ..Fc...........cF..
  • ..fFCc.......cCFf..
  • ....FCCcc.ccCCF....
  • .....fFFF#FFFf.....
  • R=10:
  • ......fFFF#FFFf......
  • ....fFCccc.cccCFf....
  • ...f#c.........c#f...
  • ..fCc...........cCf..
  • .f#c.............c#f.
  • .Fc...............cF.
  • fC.................Cf
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • #...................#
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • fC.................Cf
  • .Fc...............cF.
  • .f#c.............c#f.
  • ..fCc...........cCf..
  • ...f#c.........c#f...
  • ....fFCccc.cccCFf....
  • ......fFFF#FFFf......
  • ```
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • Given a radius R, output a text representation of a circle.
  • ## Input
  • - A positive integer R
  • - You do not need to handle values of R greater than 32
  • ## Output
  • - A square grid of characters of side length 2R + 1
  • - You may choose any 2 distinct characters to represent the foreground (depicting the circle) and the background
  • - The centre of the circle is the centre of the square. That is, the location (R, R) if using zero indexed coordinates
  • - Each foreground character must have a distance from the centre that has either a floor or a ceiling of R. That is, R-1 < distance < R+1. Within a single output, some characters may have a floor of R and some may have a ceiling of R - you do not need to choose one or other consistently
  • - The circle must not have gaps. Specifically, there must be no connected path of horizontally or vertically adjacent background characters joining the centre to any edge of the square. Equivalently, a flood fill from the centre will not reach any of the edges
  • ## Examples
  • Here `.` represents the background and `#` represents the foreground.
  • Using these characters, the rules are equivalent to:
  • - Every `.` must be included in the background
  • - Any `#` may be included in the foreground, but not all of them need to be - some may be left as background provided there are no gaps between the foreground characters
  • This is intended to give the flexibility to allow various different circle drawing approaches to compete.
  • The potential character placements for radius 1 to 10:
  • ```text
  • R = 1
  • ###
  • #.#
  • ###
  • R = 2
  • #####
  • ##.##
  • #...#
  • ##.##
  • #####
  • R = 3
  • .#####.
  • ###.###
  • ##...##
  • #.....#
  • ##...##
  • ###.###
  • .#####.
  • R = 4
  • ..#####..
  • .###.###.
  • ##.....##
  • ##.....##
  • #.......#
  • ##.....##
  • ##.....##
  • .###.###.
  • ..#####..
  • R = 5
  • ..#######..
  • .####.####.
  • ###.....###
  • ##.......##
  • ##.......##
  • #.........#
  • ##.......##
  • ##.......##
  • ###.....###
  • .####.####.
  • ..#######..
  • R = 6
  • ...#######...
  • ..####.####..
  • .##.......##.
  • ##.........##
  • ##.........##
  • ##.........##
  • #...........#
  • ##.........##
  • ##.........##
  • ##.........##
  • .##.......##.
  • ..####.####..
  • ...#######...
  • R = 7
  • ....#######....
  • ..#####.#####..
  • .###.......###.
  • .##.........##.
  • ##...........##
  • ##...........##
  • ##...........##
  • #.............#
  • ##...........##
  • ##...........##
  • ##...........##
  • .##.........##.
  • .###.......###.
  • ..#####.#####..
  • ....#######....
  • R = 8
  • ....#########....
  • ...#####.#####...
  • ..###.......###..
  • .###.........###.
  • ###...........###
  • ##.............##
  • ##.............##
  • ##.............##
  • #...............#
  • ##.............##
  • ##.............##
  • ##.............##
  • ###...........###
  • .###.........###.
  • ..###.......###..
  • ...#####.#####...
  • ....#########....
  • R = 9
  • .....#########.....
  • ....#####.#####....
  • ..####.......####..
  • ..##...........##..
  • .##.............##.
  • ###.............###
  • ##...............##
  • ##...............##
  • ##...............##
  • #.................#
  • ##...............##
  • ##...............##
  • ##...............##
  • ###.............###
  • .##.............##.
  • ..##...........##..
  • ..####.......####..
  • ....#####.#####....
  • .....#########.....
  • R = 10
  • ......#########......
  • ....######.######....
  • ...###.........###...
  • ..###...........###..
  • .###.............###.
  • .##...............##.
  • ##.................##
  • ##.................##
  • ##.................##
  • ##.................##
  • #...................#
  • ##.................##
  • ##.................##
  • ##.................##
  • ##.................##
  • .##...............##.
  • .###.............###.
  • ..###...........###..
  • ...###.........###...
  • ....######.######....
  • ......#########......
  • ```
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
#10: Post edited by user avatar trichoplax‭ · 2022-10-25T10:55:04Z (over 1 year ago)
Improve output section
  • Given a radius R, output a text representation of a circle.
  • ## Input
  • - A positive integer R
  • - You do not need to handle values of R greater than 32
  • ## Output
  • - A square of characters of side length 2R + 1
  • - You may choose any 2 distinct characters to represent the foreground (depicting the circle) and the background
  • - The centre of the circle is the centre of the square. That is, the location (R, R) if using zero indexed coordinates
  • - Each foreground character must have a distance from the centre that has either a floor or a ceiling of R. That is, R-1 < distance < R+1. You may use some of each
  • - The circle must not have gaps. Specifically, there must be no connected path of horizontally or vertically adjacent background characters joining the centre to any edge of the square. Equivalently, a flood fill from the centre will not reach any of the corners
  • ## Examples
  • These examples use the following characters to indicate the distance from the centre:
  • - `#` means the character is a distance of exactly R from the centre
  • - `.` means the distance is less than or equal to R-1 or greater than or equal to R+1
  • - `f` or `F` means the floor of the distance is R
  • - `c` or `C` means the ceiling of the distance is R
  • - upper case (`F` or `C`) means the distance rounded to the nearest integer is R
  • Using these characters, the rules are equivalent to:
  • - Every `#` must be included in the foreground
  • - Every `.` must be included in the background
  • - All other characters can be either foreground or background, provided there are no gaps between the foreground characters
  • This is intended to give the flexibility to allow various different circle drawing approaches to compete.
  • Examples of valid circles include:
  • - Every `#`, `f`, and `F` is foreground (every character with a floor of R is foreground)
  • - Every `#`, `c`, and `C` is foreground (every character with a ceiling of R is foreground)
  • - Every `#`, `F`, and `C` is foreground (every character that rounds to R is foreground)
  • - Every `#`, `f`, `F`, `c`, and `C` is foreground (every character with a floor or ceiling of R is foreground)
  • The potential character placements for radius 1 to 10:
  • ```text
  • R=1:
  • F#F
  • #.#
  • F#F
  • R=2:
  • fF#Ff
  • Fc.cF
  • #...#
  • Fc.cF
  • fF#Ff
  • R=3:
  • .fF#Ff.
  • fCc.cCf
  • Fc...cF
  • #.....#
  • Fc...cF
  • fCc.cCf
  • .fF#Ff.
  • R=4:
  • ..FF#FF..
  • .FCc.cCF.
  • FC.....CF
  • Fc.....cF
  • #.......#
  • Fc.....cF
  • FC.....CF
  • .FCc.cCF.
  • ..FF#FF..
  • R=5:
  • ..fFF#FFf..
  • .f#cc.cc#f.
  • f#c.....c#f
  • Fc.......cF
  • Fc.......cF
  • #.........#
  • Fc.......cF
  • Fc.......cF
  • f#c.....c#f
  • .f#cc.cc#f.
  • ..fFF#FFf..
  • R=6:
  • ...fFF#FFf...
  • ..FCcc.ccCF..
  • .FC.......CF.
  • fC.........Cf
  • Fc.........cF
  • Fc.........cF
  • #...........#
  • Fc.........cF
  • Fc.........cF
  • fC.........Cf
  • .FC.......CF.
  • ..FCcc.ccCF..
  • ...fFF#FFf...
  • R=7:
  • ....fFF#FFf....
  • ..fFCcc.ccCFf..
  • .fFc.......cFf.
  • .Fc.........cF.
  • fC...........Cf
  • Fc...........cF
  • Fc...........cF
  • #.............#
  • Fc...........cF
  • Fc...........cF
  • fC...........Cf
  • .Fc.........cF.
  • .fFc.......cFf.
  • ..fFCcc.ccCFf..
  • ....fFF#FFf....
  • R=8:
  • ....ffFF#FFff....
  • ...fFCcc.ccCFf...
  • ..FCc.......cCF..
  • .fCc.........cCf.
  • fFc...........cFf
  • fC.............Cf
  • Fc.............cF
  • Fc.............cF
  • #...............#
  • Fc.............cF
  • Fc.............cF
  • fC.............Cf
  • fFc...........cFf
  • .fCc.........cCf.
  • ..FCc.......cCF..
  • ...fFCcc.ccCFf...
  • ....ffFF#FFff....
  • R=9:
  • .....fFFF#FFFf.....
  • ....FCCcc.ccCCF....
  • ..fFCc.......cCFf..
  • ..Fc...........cF..
  • .FC.............CF.
  • fCc.............cCf
  • FC...............CF
  • Fc...............cF
  • Fc...............cF
  • #.................#
  • Fc...............cF
  • Fc...............cF
  • FC...............CF
  • fCc.............cCf
  • .FC.............CF.
  • ..Fc...........cF..
  • ..fFCc.......cCFf..
  • ....FCCcc.ccCCF....
  • .....fFFF#FFFf.....
  • R=10:
  • ......fFFF#FFFf......
  • ....fFCccc.cccCFf....
  • ...f#c.........c#f...
  • ..fCc...........cCf..
  • .f#c.............c#f.
  • .Fc...............cF.
  • fC.................Cf
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • #...................#
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • fC.................Cf
  • .Fc...............cF.
  • .f#c.............c#f.
  • ..fCc...........cCf..
  • ...f#c.........c#f...
  • ....fFCccc.cccCFf....
  • ......fFFF#FFFf......
  • ```
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • Given a radius R, output a text representation of a circle.
  • ## Input
  • - A positive integer R
  • - You do not need to handle values of R greater than 32
  • ## Output
  • - A square of characters of side length 2R + 1
  • - You may choose any 2 distinct characters to represent the foreground (depicting the circle) and the background
  • - The centre of the circle is the centre of the square. That is, the location (R, R) if using zero indexed coordinates
  • - Each foreground character must have a distance from the centre that has either a floor or a ceiling of R. That is, R-1 < distance < R+1. Within a single output, some characters may have a floor of R and some may have a ceiling of R - you do not need to choose one or other consistently
  • - The circle must not have gaps. Specifically, there must be no connected path of horizontally or vertically adjacent background characters joining the centre to any edge of the square. Equivalently, a flood fill from the centre will not reach any of the edges
  • ## Examples
  • These examples use the following characters to indicate the distance from the centre:
  • - `#` means the character is a distance of exactly R from the centre
  • - `.` means the distance is less than or equal to R-1 or greater than or equal to R+1
  • - `f` or `F` means the floor of the distance is R
  • - `c` or `C` means the ceiling of the distance is R
  • - upper case (`F` or `C`) means the distance rounded to the nearest integer is R
  • Using these characters, the rules are equivalent to:
  • - Every `#` must be included in the foreground
  • - Every `.` must be included in the background
  • - All other characters can be either foreground or background, provided there are no gaps between the foreground characters
  • This is intended to give the flexibility to allow various different circle drawing approaches to compete.
  • Examples of valid circles include:
  • - Every `#`, `f`, and `F` is foreground (every character with a floor of R is foreground)
  • - Every `#`, `c`, and `C` is foreground (every character with a ceiling of R is foreground)
  • - Every `#`, `F`, and `C` is foreground (every character that rounds to R is foreground)
  • - Every `#`, `f`, `F`, `c`, and `C` is foreground (every character with a floor or ceiling of R is foreground)
  • The potential character placements for radius 1 to 10:
  • ```text
  • R=1:
  • F#F
  • #.#
  • F#F
  • R=2:
  • fF#Ff
  • Fc.cF
  • #...#
  • Fc.cF
  • fF#Ff
  • R=3:
  • .fF#Ff.
  • fCc.cCf
  • Fc...cF
  • #.....#
  • Fc...cF
  • fCc.cCf
  • .fF#Ff.
  • R=4:
  • ..FF#FF..
  • .FCc.cCF.
  • FC.....CF
  • Fc.....cF
  • #.......#
  • Fc.....cF
  • FC.....CF
  • .FCc.cCF.
  • ..FF#FF..
  • R=5:
  • ..fFF#FFf..
  • .f#cc.cc#f.
  • f#c.....c#f
  • Fc.......cF
  • Fc.......cF
  • #.........#
  • Fc.......cF
  • Fc.......cF
  • f#c.....c#f
  • .f#cc.cc#f.
  • ..fFF#FFf..
  • R=6:
  • ...fFF#FFf...
  • ..FCcc.ccCF..
  • .FC.......CF.
  • fC.........Cf
  • Fc.........cF
  • Fc.........cF
  • #...........#
  • Fc.........cF
  • Fc.........cF
  • fC.........Cf
  • .FC.......CF.
  • ..FCcc.ccCF..
  • ...fFF#FFf...
  • R=7:
  • ....fFF#FFf....
  • ..fFCcc.ccCFf..
  • .fFc.......cFf.
  • .Fc.........cF.
  • fC...........Cf
  • Fc...........cF
  • Fc...........cF
  • #.............#
  • Fc...........cF
  • Fc...........cF
  • fC...........Cf
  • .Fc.........cF.
  • .fFc.......cFf.
  • ..fFCcc.ccCFf..
  • ....fFF#FFf....
  • R=8:
  • ....ffFF#FFff....
  • ...fFCcc.ccCFf...
  • ..FCc.......cCF..
  • .fCc.........cCf.
  • fFc...........cFf
  • fC.............Cf
  • Fc.............cF
  • Fc.............cF
  • #...............#
  • Fc.............cF
  • Fc.............cF
  • fC.............Cf
  • fFc...........cFf
  • .fCc.........cCf.
  • ..FCc.......cCF..
  • ...fFCcc.ccCFf...
  • ....ffFF#FFff....
  • R=9:
  • .....fFFF#FFFf.....
  • ....FCCcc.ccCCF....
  • ..fFCc.......cCFf..
  • ..Fc...........cF..
  • .FC.............CF.
  • fCc.............cCf
  • FC...............CF
  • Fc...............cF
  • Fc...............cF
  • #.................#
  • Fc...............cF
  • Fc...............cF
  • FC...............CF
  • fCc.............cCf
  • .FC.............CF.
  • ..Fc...........cF..
  • ..fFCc.......cCFf..
  • ....FCCcc.ccCCF....
  • .....fFFF#FFFf.....
  • R=10:
  • ......fFFF#FFFf......
  • ....fFCccc.cccCFf....
  • ...f#c.........c#f...
  • ..fCc...........cCf..
  • .f#c.............c#f.
  • .Fc...............cF.
  • fC.................Cf
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • #...................#
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • fC.................Cf
  • .Fc...............cF.
  • .f#c.............c#f.
  • ..fCc...........cCf..
  • ...f#c.........c#f...
  • ....fFCccc.cccCFf....
  • ......fFFF#FFFf......
  • ```
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
#9: Post edited by user avatar trichoplax‭ · 2022-10-25T10:34:27Z (over 1 year ago)
Clarify output section
  • Given a radius R, output a text representation of a circle.
  • ## Input
  • - A positive integer R
  • - You do not need to handle values of R greater than 32
  • ## Output
  • - A square of characters of side length 2R + 1
  • - You may choose any 2 distinct characters to represent the foreground (depicting the circle) and the background
  • - The centre of the circle is the centre of the square. That is, the location (R, R) if using zero indexed coordinates
  • - Each foreground character must have a distance from the centre that has either a floor or a ceiling of R. That is, R-1 < distance < R+1
  • - The circle must not have gaps. Specifically, there must be no connected path of horizontally or vertically adjacent background characters joining the centre to any edge of the square. Equivalently, a flood fill from the centre will not reach any of the corners
  • ## Examples
  • These examples use the following characters to indicate the distance from the centre:
  • - `#` means the character is a distance of exactly R from the centre
  • - `.` means the distance is less than or equal to R-1 or greater than or equal to R+1
  • - `f` or `F` means the floor of the distance is R
  • - `c` or `C` means the ceiling of the distance is R
  • - upper case (`F` or `C`) means the distance rounded to the nearest integer is R
  • Using these characters, the rules are equivalent to:
  • - Every `#` must be included in the foreground
  • - Every `.` must be included in the background
  • - All other characters can be either foreground or background, provided there are no gaps between the foreground characters
  • This is intended to give the flexibility to allow various different circle drawing approaches to compete.
  • Examples of valid circles include:
  • - Every `#`, `f`, and `F` is foreground (every character with a floor of R is foreground)
  • - Every `#`, `c`, and `C` is foreground (every character with a ceiling of R is foreground)
  • - Every `#`, `F`, and `C` is foreground (every character that rounds to R is foreground)
  • - Every `#`, `f`, `F`, `c`, and `C` is foreground (every character with a floor or ceiling of R is foreground)
  • The potential character placements for radius 1 to 10:
  • ```text
  • R=1:
  • F#F
  • #.#
  • F#F
  • R=2:
  • fF#Ff
  • Fc.cF
  • #...#
  • Fc.cF
  • fF#Ff
  • R=3:
  • .fF#Ff.
  • fCc.cCf
  • Fc...cF
  • #.....#
  • Fc...cF
  • fCc.cCf
  • .fF#Ff.
  • R=4:
  • ..FF#FF..
  • .FCc.cCF.
  • FC.....CF
  • Fc.....cF
  • #.......#
  • Fc.....cF
  • FC.....CF
  • .FCc.cCF.
  • ..FF#FF..
  • R=5:
  • ..fFF#FFf..
  • .f#cc.cc#f.
  • f#c.....c#f
  • Fc.......cF
  • Fc.......cF
  • #.........#
  • Fc.......cF
  • Fc.......cF
  • f#c.....c#f
  • .f#cc.cc#f.
  • ..fFF#FFf..
  • R=6:
  • ...fFF#FFf...
  • ..FCcc.ccCF..
  • .FC.......CF.
  • fC.........Cf
  • Fc.........cF
  • Fc.........cF
  • #...........#
  • Fc.........cF
  • Fc.........cF
  • fC.........Cf
  • .FC.......CF.
  • ..FCcc.ccCF..
  • ...fFF#FFf...
  • R=7:
  • ....fFF#FFf....
  • ..fFCcc.ccCFf..
  • .fFc.......cFf.
  • .Fc.........cF.
  • fC...........Cf
  • Fc...........cF
  • Fc...........cF
  • #.............#
  • Fc...........cF
  • Fc...........cF
  • fC...........Cf
  • .Fc.........cF.
  • .fFc.......cFf.
  • ..fFCcc.ccCFf..
  • ....fFF#FFf....
  • R=8:
  • ....ffFF#FFff....
  • ...fFCcc.ccCFf...
  • ..FCc.......cCF..
  • .fCc.........cCf.
  • fFc...........cFf
  • fC.............Cf
  • Fc.............cF
  • Fc.............cF
  • #...............#
  • Fc.............cF
  • Fc.............cF
  • fC.............Cf
  • fFc...........cFf
  • .fCc.........cCf.
  • ..FCc.......cCF..
  • ...fFCcc.ccCFf...
  • ....ffFF#FFff....
  • R=9:
  • .....fFFF#FFFf.....
  • ....FCCcc.ccCCF....
  • ..fFCc.......cCFf..
  • ..Fc...........cF..
  • .FC.............CF.
  • fCc.............cCf
  • FC...............CF
  • Fc...............cF
  • Fc...............cF
  • #.................#
  • Fc...............cF
  • Fc...............cF
  • FC...............CF
  • fCc.............cCf
  • .FC.............CF.
  • ..Fc...........cF..
  • ..fFCc.......cCFf..
  • ....FCCcc.ccCCF....
  • .....fFFF#FFFf.....
  • R=10:
  • ......fFFF#FFFf......
  • ....fFCccc.cccCFf....
  • ...f#c.........c#f...
  • ..fCc...........cCf..
  • .f#c.............c#f.
  • .Fc...............cF.
  • fC.................Cf
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • #...................#
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • fC.................Cf
  • .Fc...............cF.
  • .f#c.............c#f.
  • ..fCc...........cCf..
  • ...f#c.........c#f...
  • ....fFCccc.cccCFf....
  • ......fFFF#FFFf......
  • ```
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • Given a radius R, output a text representation of a circle.
  • ## Input
  • - A positive integer R
  • - You do not need to handle values of R greater than 32
  • ## Output
  • - A square of characters of side length 2R + 1
  • - You may choose any 2 distinct characters to represent the foreground (depicting the circle) and the background
  • - The centre of the circle is the centre of the square. That is, the location (R, R) if using zero indexed coordinates
  • - Each foreground character must have a distance from the centre that has either a floor or a ceiling of R. That is, R-1 < distance < R+1. You may use some of each
  • - The circle must not have gaps. Specifically, there must be no connected path of horizontally or vertically adjacent background characters joining the centre to any edge of the square. Equivalently, a flood fill from the centre will not reach any of the corners
  • ## Examples
  • These examples use the following characters to indicate the distance from the centre:
  • - `#` means the character is a distance of exactly R from the centre
  • - `.` means the distance is less than or equal to R-1 or greater than or equal to R+1
  • - `f` or `F` means the floor of the distance is R
  • - `c` or `C` means the ceiling of the distance is R
  • - upper case (`F` or `C`) means the distance rounded to the nearest integer is R
  • Using these characters, the rules are equivalent to:
  • - Every `#` must be included in the foreground
  • - Every `.` must be included in the background
  • - All other characters can be either foreground or background, provided there are no gaps between the foreground characters
  • This is intended to give the flexibility to allow various different circle drawing approaches to compete.
  • Examples of valid circles include:
  • - Every `#`, `f`, and `F` is foreground (every character with a floor of R is foreground)
  • - Every `#`, `c`, and `C` is foreground (every character with a ceiling of R is foreground)
  • - Every `#`, `F`, and `C` is foreground (every character that rounds to R is foreground)
  • - Every `#`, `f`, `F`, `c`, and `C` is foreground (every character with a floor or ceiling of R is foreground)
  • The potential character placements for radius 1 to 10:
  • ```text
  • R=1:
  • F#F
  • #.#
  • F#F
  • R=2:
  • fF#Ff
  • Fc.cF
  • #...#
  • Fc.cF
  • fF#Ff
  • R=3:
  • .fF#Ff.
  • fCc.cCf
  • Fc...cF
  • #.....#
  • Fc...cF
  • fCc.cCf
  • .fF#Ff.
  • R=4:
  • ..FF#FF..
  • .FCc.cCF.
  • FC.....CF
  • Fc.....cF
  • #.......#
  • Fc.....cF
  • FC.....CF
  • .FCc.cCF.
  • ..FF#FF..
  • R=5:
  • ..fFF#FFf..
  • .f#cc.cc#f.
  • f#c.....c#f
  • Fc.......cF
  • Fc.......cF
  • #.........#
  • Fc.......cF
  • Fc.......cF
  • f#c.....c#f
  • .f#cc.cc#f.
  • ..fFF#FFf..
  • R=6:
  • ...fFF#FFf...
  • ..FCcc.ccCF..
  • .FC.......CF.
  • fC.........Cf
  • Fc.........cF
  • Fc.........cF
  • #...........#
  • Fc.........cF
  • Fc.........cF
  • fC.........Cf
  • .FC.......CF.
  • ..FCcc.ccCF..
  • ...fFF#FFf...
  • R=7:
  • ....fFF#FFf....
  • ..fFCcc.ccCFf..
  • .fFc.......cFf.
  • .Fc.........cF.
  • fC...........Cf
  • Fc...........cF
  • Fc...........cF
  • #.............#
  • Fc...........cF
  • Fc...........cF
  • fC...........Cf
  • .Fc.........cF.
  • .fFc.......cFf.
  • ..fFCcc.ccCFf..
  • ....fFF#FFf....
  • R=8:
  • ....ffFF#FFff....
  • ...fFCcc.ccCFf...
  • ..FCc.......cCF..
  • .fCc.........cCf.
  • fFc...........cFf
  • fC.............Cf
  • Fc.............cF
  • Fc.............cF
  • #...............#
  • Fc.............cF
  • Fc.............cF
  • fC.............Cf
  • fFc...........cFf
  • .fCc.........cCf.
  • ..FCc.......cCF..
  • ...fFCcc.ccCFf...
  • ....ffFF#FFff....
  • R=9:
  • .....fFFF#FFFf.....
  • ....FCCcc.ccCCF....
  • ..fFCc.......cCFf..
  • ..Fc...........cF..
  • .FC.............CF.
  • fCc.............cCf
  • FC...............CF
  • Fc...............cF
  • Fc...............cF
  • #.................#
  • Fc...............cF
  • Fc...............cF
  • FC...............CF
  • fCc.............cCf
  • .FC.............CF.
  • ..Fc...........cF..
  • ..fFCc.......cCFf..
  • ....FCCcc.ccCCF....
  • .....fFFF#FFFf.....
  • R=10:
  • ......fFFF#FFFf......
  • ....fFCccc.cccCFf....
  • ...f#c.........c#f...
  • ..fCc...........cCf..
  • .f#c.............c#f.
  • .Fc...............cF.
  • fC.................Cf
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • #...................#
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • fC.................Cf
  • .Fc...............cF.
  • .f#c.............c#f.
  • ..fCc...........cCf..
  • ...f#c.........c#f...
  • ....fFCccc.cccCFf....
  • ......fFFF#FFFf......
  • ```
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
#8: Post edited by user avatar trichoplax‭ · 2022-10-25T10:33:04Z (over 1 year ago)
Simplify output section
  • Given a radius R, output a text representation of a circle.
  • ## Input
  • - A positive integer R
  • - You do not need to handle values of R greater than 32
  • ## Output
  • - A square of characters of side length 2R + 1
  • - You may choose any 2 distinct characters to represent the foreground (depicting the circle) and the background
  • - The centre of the circle is the centre of the square. That is, the location (R, R) if using zero indexed coordinates
  • - The foreground characters that make up the circle must satisfy the following:
  • - each foreground character must have a distance from the centre that has either a floor or a ceiling of R. That is, R-1 < distance < R+1
  • - each character that is at a distance from the centre of exactly R must be a foreground character
  • - The circle must not have gaps. Specifically, there must be no connected path of horizontally or vertically adjacent background characters joining the centre to any edge of the square. Equivalently, a flood fill from the centre will not reach any of the corners
  • ## Examples
  • These examples use the following characters to indicate the distance from the centre:
  • - `#` means the character is a distance of exactly R from the centre
  • - `.` means the distance is less than or equal to R-1 or greater than or equal to R+1
  • - `f` or `F` means the floor of the distance is R
  • - `c` or `C` means the ceiling of the distance is R
  • - upper case (`F` or `C`) means the distance rounded to the nearest integer is R
  • Using these characters, the rules are equivalent to:
  • - Every `#` must be included in the foreground
  • - Every `.` must be included in the background
  • - All other characters can be either foreground or background, provided there are no gaps between the foreground characters
  • This is intended to give the flexibility to allow various different circle drawing approaches to compete.
  • Examples of valid circles include:
  • - Every `#`, `f`, and `F` is foreground (every character with a floor of R is foreground)
  • - Every `#`, `c`, and `C` is foreground (every character with a ceiling of R is foreground)
  • - Every `#`, `F`, and `C` is foreground (every character that rounds to R is foreground)
  • - Every `#`, `f`, `F`, `c`, and `C` is foreground (every character with a floor or ceiling of R is foreground)
  • The potential character placements for radius 1 to 10:
  • ```text
  • R=1:
  • F#F
  • #.#
  • F#F
  • R=2:
  • fF#Ff
  • Fc.cF
  • #...#
  • Fc.cF
  • fF#Ff
  • R=3:
  • .fF#Ff.
  • fCc.cCf
  • Fc...cF
  • #.....#
  • Fc...cF
  • fCc.cCf
  • .fF#Ff.
  • R=4:
  • ..FF#FF..
  • .FCc.cCF.
  • FC.....CF
  • Fc.....cF
  • #.......#
  • Fc.....cF
  • FC.....CF
  • .FCc.cCF.
  • ..FF#FF..
  • R=5:
  • ..fFF#FFf..
  • .f#cc.cc#f.
  • f#c.....c#f
  • Fc.......cF
  • Fc.......cF
  • #.........#
  • Fc.......cF
  • Fc.......cF
  • f#c.....c#f
  • .f#cc.cc#f.
  • ..fFF#FFf..
  • R=6:
  • ...fFF#FFf...
  • ..FCcc.ccCF..
  • .FC.......CF.
  • fC.........Cf
  • Fc.........cF
  • Fc.........cF
  • #...........#
  • Fc.........cF
  • Fc.........cF
  • fC.........Cf
  • .FC.......CF.
  • ..FCcc.ccCF..
  • ...fFF#FFf...
  • R=7:
  • ....fFF#FFf....
  • ..fFCcc.ccCFf..
  • .fFc.......cFf.
  • .Fc.........cF.
  • fC...........Cf
  • Fc...........cF
  • Fc...........cF
  • #.............#
  • Fc...........cF
  • Fc...........cF
  • fC...........Cf
  • .Fc.........cF.
  • .fFc.......cFf.
  • ..fFCcc.ccCFf..
  • ....fFF#FFf....
  • R=8:
  • ....ffFF#FFff....
  • ...fFCcc.ccCFf...
  • ..FCc.......cCF..
  • .fCc.........cCf.
  • fFc...........cFf
  • fC.............Cf
  • Fc.............cF
  • Fc.............cF
  • #...............#
  • Fc.............cF
  • Fc.............cF
  • fC.............Cf
  • fFc...........cFf
  • .fCc.........cCf.
  • ..FCc.......cCF..
  • ...fFCcc.ccCFf...
  • ....ffFF#FFff....
  • R=9:
  • .....fFFF#FFFf.....
  • ....FCCcc.ccCCF....
  • ..fFCc.......cCFf..
  • ..Fc...........cF..
  • .FC.............CF.
  • fCc.............cCf
  • FC...............CF
  • Fc...............cF
  • Fc...............cF
  • #.................#
  • Fc...............cF
  • Fc...............cF
  • FC...............CF
  • fCc.............cCf
  • .FC.............CF.
  • ..Fc...........cF..
  • ..fFCc.......cCFf..
  • ....FCCcc.ccCCF....
  • .....fFFF#FFFf.....
  • R=10:
  • ......fFFF#FFFf......
  • ....fFCccc.cccCFf....
  • ...f#c.........c#f...
  • ..fCc...........cCf..
  • .f#c.............c#f.
  • .Fc...............cF.
  • fC.................Cf
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • #...................#
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • fC.................Cf
  • .Fc...............cF.
  • .f#c.............c#f.
  • ..fCc...........cCf..
  • ...f#c.........c#f...
  • ....fFCccc.cccCFf....
  • ......fFFF#FFFf......
  • ```
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • Given a radius R, output a text representation of a circle.
  • ## Input
  • - A positive integer R
  • - You do not need to handle values of R greater than 32
  • ## Output
  • - A square of characters of side length 2R + 1
  • - You may choose any 2 distinct characters to represent the foreground (depicting the circle) and the background
  • - The centre of the circle is the centre of the square. That is, the location (R, R) if using zero indexed coordinates
  • - Each foreground character must have a distance from the centre that has either a floor or a ceiling of R. That is, R-1 < distance < R+1
  • - The circle must not have gaps. Specifically, there must be no connected path of horizontally or vertically adjacent background characters joining the centre to any edge of the square. Equivalently, a flood fill from the centre will not reach any of the corners
  • ## Examples
  • These examples use the following characters to indicate the distance from the centre:
  • - `#` means the character is a distance of exactly R from the centre
  • - `.` means the distance is less than or equal to R-1 or greater than or equal to R+1
  • - `f` or `F` means the floor of the distance is R
  • - `c` or `C` means the ceiling of the distance is R
  • - upper case (`F` or `C`) means the distance rounded to the nearest integer is R
  • Using these characters, the rules are equivalent to:
  • - Every `#` must be included in the foreground
  • - Every `.` must be included in the background
  • - All other characters can be either foreground or background, provided there are no gaps between the foreground characters
  • This is intended to give the flexibility to allow various different circle drawing approaches to compete.
  • Examples of valid circles include:
  • - Every `#`, `f`, and `F` is foreground (every character with a floor of R is foreground)
  • - Every `#`, `c`, and `C` is foreground (every character with a ceiling of R is foreground)
  • - Every `#`, `F`, and `C` is foreground (every character that rounds to R is foreground)
  • - Every `#`, `f`, `F`, `c`, and `C` is foreground (every character with a floor or ceiling of R is foreground)
  • The potential character placements for radius 1 to 10:
  • ```text
  • R=1:
  • F#F
  • #.#
  • F#F
  • R=2:
  • fF#Ff
  • Fc.cF
  • #...#
  • Fc.cF
  • fF#Ff
  • R=3:
  • .fF#Ff.
  • fCc.cCf
  • Fc...cF
  • #.....#
  • Fc...cF
  • fCc.cCf
  • .fF#Ff.
  • R=4:
  • ..FF#FF..
  • .FCc.cCF.
  • FC.....CF
  • Fc.....cF
  • #.......#
  • Fc.....cF
  • FC.....CF
  • .FCc.cCF.
  • ..FF#FF..
  • R=5:
  • ..fFF#FFf..
  • .f#cc.cc#f.
  • f#c.....c#f
  • Fc.......cF
  • Fc.......cF
  • #.........#
  • Fc.......cF
  • Fc.......cF
  • f#c.....c#f
  • .f#cc.cc#f.
  • ..fFF#FFf..
  • R=6:
  • ...fFF#FFf...
  • ..FCcc.ccCF..
  • .FC.......CF.
  • fC.........Cf
  • Fc.........cF
  • Fc.........cF
  • #...........#
  • Fc.........cF
  • Fc.........cF
  • fC.........Cf
  • .FC.......CF.
  • ..FCcc.ccCF..
  • ...fFF#FFf...
  • R=7:
  • ....fFF#FFf....
  • ..fFCcc.ccCFf..
  • .fFc.......cFf.
  • .Fc.........cF.
  • fC...........Cf
  • Fc...........cF
  • Fc...........cF
  • #.............#
  • Fc...........cF
  • Fc...........cF
  • fC...........Cf
  • .Fc.........cF.
  • .fFc.......cFf.
  • ..fFCcc.ccCFf..
  • ....fFF#FFf....
  • R=8:
  • ....ffFF#FFff....
  • ...fFCcc.ccCFf...
  • ..FCc.......cCF..
  • .fCc.........cCf.
  • fFc...........cFf
  • fC.............Cf
  • Fc.............cF
  • Fc.............cF
  • #...............#
  • Fc.............cF
  • Fc.............cF
  • fC.............Cf
  • fFc...........cFf
  • .fCc.........cCf.
  • ..FCc.......cCF..
  • ...fFCcc.ccCFf...
  • ....ffFF#FFff....
  • R=9:
  • .....fFFF#FFFf.....
  • ....FCCcc.ccCCF....
  • ..fFCc.......cCFf..
  • ..Fc...........cF..
  • .FC.............CF.
  • fCc.............cCf
  • FC...............CF
  • Fc...............cF
  • Fc...............cF
  • #.................#
  • Fc...............cF
  • Fc...............cF
  • FC...............CF
  • fCc.............cCf
  • .FC.............CF.
  • ..Fc...........cF..
  • ..fFCc.......cCFf..
  • ....FCCcc.ccCCF....
  • .....fFFF#FFFf.....
  • R=10:
  • ......fFFF#FFFf......
  • ....fFCccc.cccCFf....
  • ...f#c.........c#f...
  • ..fCc...........cCf..
  • .f#c.............c#f.
  • .Fc...............cF.
  • fC.................Cf
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • #...................#
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • fC.................Cf
  • .Fc...............cF.
  • .f#c.............c#f.
  • ..fCc...........cCf..
  • ...f#c.........c#f...
  • ....fFCccc.cccCFf....
  • ......fFFF#FFFf......
  • ```
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
#7: Post edited by user avatar trichoplax‭ · 2022-10-25T09:39:29Z (over 1 year ago)
Fix validity criterion
  • Given a radius R, output a text representation of a circle.
  • ## Input
  • - A positive integer R
  • - You do not need to handle values of R greater than 32
  • ## Output
  • - A square of characters of side length 2R + 1
  • - You may choose any 2 distinct characters to represent the foreground (depicting the circle) and the background
  • - The centre of the circle is the centre of the square. That is, the location (R, R) if using zero indexed coordinates
  • - The foreground characters that make up the circle must satisfy the following:
  • - each foreground character must have a distance from the centre that has either a floor or a ceiling of R. That is, R-1 < distance < R+1
  • - each character that is at a distance from the centre of exactly R must be a foreground character
  • - The circle must not have gaps. Specifically, there must be no connected path of horizontally or vertically adjacent background characters joining the centre to any corner of the square. Equivalently, a flood fill from the centre will not reach any of the corners
  • ## Examples
  • These examples use the following characters to indicate the distance from the centre:
  • - `#` means the character is a distance of exactly R from the centre
  • - `.` means the distance is less than or equal to R-1 or greater than or equal to R+1
  • - `f` or `F` means the floor of the distance is R
  • - `c` or `C` means the ceiling of the distance is R
  • - upper case (`F` or `C`) means the distance rounded to the nearest integer is R
  • Using these characters, the rules are equivalent to:
  • - Every `#` must be included in the foreground
  • - Every `.` must be included in the background
  • - All other characters can be either foreground or background, provided there are no gaps between the foreground characters
  • This is intended to give the flexibility to allow various different circle drawing approaches to compete.
  • Examples of valid circles include:
  • - Every `#`, `f`, and `F` is foreground (every character with a floor of R is foreground)
  • - Every `#`, `c`, and `C` is foreground (every character with a ceiling of R is foreground)
  • - Every `#`, `F`, and `C` is foreground (every character that rounds to R is foreground)
  • - Every `#`, `f`, `F`, `c`, and `C` is foreground (every character with a floor or ceiling of R is foreground)
  • The potential character placements for radius 1 to 10:
  • ```text
  • R=1:
  • F#F
  • #.#
  • F#F
  • R=2:
  • fF#Ff
  • Fc.cF
  • #...#
  • Fc.cF
  • fF#Ff
  • R=3:
  • .fF#Ff.
  • fCc.cCf
  • Fc...cF
  • #.....#
  • Fc...cF
  • fCc.cCf
  • .fF#Ff.
  • R=4:
  • ..FF#FF..
  • .FCc.cCF.
  • FC.....CF
  • Fc.....cF
  • #.......#
  • Fc.....cF
  • FC.....CF
  • .FCc.cCF.
  • ..FF#FF..
  • R=5:
  • ..fFF#FFf..
  • .f#cc.cc#f.
  • f#c.....c#f
  • Fc.......cF
  • Fc.......cF
  • #.........#
  • Fc.......cF
  • Fc.......cF
  • f#c.....c#f
  • .f#cc.cc#f.
  • ..fFF#FFf..
  • R=6:
  • ...fFF#FFf...
  • ..FCcc.ccCF..
  • .FC.......CF.
  • fC.........Cf
  • Fc.........cF
  • Fc.........cF
  • #...........#
  • Fc.........cF
  • Fc.........cF
  • fC.........Cf
  • .FC.......CF.
  • ..FCcc.ccCF..
  • ...fFF#FFf...
  • R=7:
  • ....fFF#FFf....
  • ..fFCcc.ccCFf..
  • .fFc.......cFf.
  • .Fc.........cF.
  • fC...........Cf
  • Fc...........cF
  • Fc...........cF
  • #.............#
  • Fc...........cF
  • Fc...........cF
  • fC...........Cf
  • .Fc.........cF.
  • .fFc.......cFf.
  • ..fFCcc.ccCFf..
  • ....fFF#FFf....
  • R=8:
  • ....ffFF#FFff....
  • ...fFCcc.ccCFf...
  • ..FCc.......cCF..
  • .fCc.........cCf.
  • fFc...........cFf
  • fC.............Cf
  • Fc.............cF
  • Fc.............cF
  • #...............#
  • Fc.............cF
  • Fc.............cF
  • fC.............Cf
  • fFc...........cFf
  • .fCc.........cCf.
  • ..FCc.......cCF..
  • ...fFCcc.ccCFf...
  • ....ffFF#FFff....
  • R=9:
  • .....fFFF#FFFf.....
  • ....FCCcc.ccCCF....
  • ..fFCc.......cCFf..
  • ..Fc...........cF..
  • .FC.............CF.
  • fCc.............cCf
  • FC...............CF
  • Fc...............cF
  • Fc...............cF
  • #.................#
  • Fc...............cF
  • Fc...............cF
  • FC...............CF
  • fCc.............cCf
  • .FC.............CF.
  • ..Fc...........cF..
  • ..fFCc.......cCFf..
  • ....FCCcc.ccCCF....
  • .....fFFF#FFFf.....
  • R=10:
  • ......fFFF#FFFf......
  • ....fFCccc.cccCFf....
  • ...f#c.........c#f...
  • ..fCc...........cCf..
  • .f#c.............c#f.
  • .Fc...............cF.
  • fC.................Cf
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • #...................#
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • fC.................Cf
  • .Fc...............cF.
  • .f#c.............c#f.
  • ..fCc...........cCf..
  • ...f#c.........c#f...
  • ....fFCccc.cccCFf....
  • ......fFFF#FFFf......
  • ```
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
  • Given a radius R, output a text representation of a circle.
  • ## Input
  • - A positive integer R
  • - You do not need to handle values of R greater than 32
  • ## Output
  • - A square of characters of side length 2R + 1
  • - You may choose any 2 distinct characters to represent the foreground (depicting the circle) and the background
  • - The centre of the circle is the centre of the square. That is, the location (R, R) if using zero indexed coordinates
  • - The foreground characters that make up the circle must satisfy the following:
  • - each foreground character must have a distance from the centre that has either a floor or a ceiling of R. That is, R-1 < distance < R+1
  • - each character that is at a distance from the centre of exactly R must be a foreground character
  • - The circle must not have gaps. Specifically, there must be no connected path of horizontally or vertically adjacent background characters joining the centre to any edge of the square. Equivalently, a flood fill from the centre will not reach any of the corners
  • ## Examples
  • These examples use the following characters to indicate the distance from the centre:
  • - `#` means the character is a distance of exactly R from the centre
  • - `.` means the distance is less than or equal to R-1 or greater than or equal to R+1
  • - `f` or `F` means the floor of the distance is R
  • - `c` or `C` means the ceiling of the distance is R
  • - upper case (`F` or `C`) means the distance rounded to the nearest integer is R
  • Using these characters, the rules are equivalent to:
  • - Every `#` must be included in the foreground
  • - Every `.` must be included in the background
  • - All other characters can be either foreground or background, provided there are no gaps between the foreground characters
  • This is intended to give the flexibility to allow various different circle drawing approaches to compete.
  • Examples of valid circles include:
  • - Every `#`, `f`, and `F` is foreground (every character with a floor of R is foreground)
  • - Every `#`, `c`, and `C` is foreground (every character with a ceiling of R is foreground)
  • - Every `#`, `F`, and `C` is foreground (every character that rounds to R is foreground)
  • - Every `#`, `f`, `F`, `c`, and `C` is foreground (every character with a floor or ceiling of R is foreground)
  • The potential character placements for radius 1 to 10:
  • ```text
  • R=1:
  • F#F
  • #.#
  • F#F
  • R=2:
  • fF#Ff
  • Fc.cF
  • #...#
  • Fc.cF
  • fF#Ff
  • R=3:
  • .fF#Ff.
  • fCc.cCf
  • Fc...cF
  • #.....#
  • Fc...cF
  • fCc.cCf
  • .fF#Ff.
  • R=4:
  • ..FF#FF..
  • .FCc.cCF.
  • FC.....CF
  • Fc.....cF
  • #.......#
  • Fc.....cF
  • FC.....CF
  • .FCc.cCF.
  • ..FF#FF..
  • R=5:
  • ..fFF#FFf..
  • .f#cc.cc#f.
  • f#c.....c#f
  • Fc.......cF
  • Fc.......cF
  • #.........#
  • Fc.......cF
  • Fc.......cF
  • f#c.....c#f
  • .f#cc.cc#f.
  • ..fFF#FFf..
  • R=6:
  • ...fFF#FFf...
  • ..FCcc.ccCF..
  • .FC.......CF.
  • fC.........Cf
  • Fc.........cF
  • Fc.........cF
  • #...........#
  • Fc.........cF
  • Fc.........cF
  • fC.........Cf
  • .FC.......CF.
  • ..FCcc.ccCF..
  • ...fFF#FFf...
  • R=7:
  • ....fFF#FFf....
  • ..fFCcc.ccCFf..
  • .fFc.......cFf.
  • .Fc.........cF.
  • fC...........Cf
  • Fc...........cF
  • Fc...........cF
  • #.............#
  • Fc...........cF
  • Fc...........cF
  • fC...........Cf
  • .Fc.........cF.
  • .fFc.......cFf.
  • ..fFCcc.ccCFf..
  • ....fFF#FFf....
  • R=8:
  • ....ffFF#FFff....
  • ...fFCcc.ccCFf...
  • ..FCc.......cCF..
  • .fCc.........cCf.
  • fFc...........cFf
  • fC.............Cf
  • Fc.............cF
  • Fc.............cF
  • #...............#
  • Fc.............cF
  • Fc.............cF
  • fC.............Cf
  • fFc...........cFf
  • .fCc.........cCf.
  • ..FCc.......cCF..
  • ...fFCcc.ccCFf...
  • ....ffFF#FFff....
  • R=9:
  • .....fFFF#FFFf.....
  • ....FCCcc.ccCCF....
  • ..fFCc.......cCFf..
  • ..Fc...........cF..
  • .FC.............CF.
  • fCc.............cCf
  • FC...............CF
  • Fc...............cF
  • Fc...............cF
  • #.................#
  • Fc...............cF
  • Fc...............cF
  • FC...............CF
  • fCc.............cCf
  • .FC.............CF.
  • ..Fc...........cF..
  • ..fFCc.......cCFf..
  • ....FCCcc.ccCCF....
  • .....fFFF#FFFf.....
  • R=10:
  • ......fFFF#FFFf......
  • ....fFCccc.cccCFf....
  • ...f#c.........c#f...
  • ..fCc...........cCf..
  • .f#c.............c#f.
  • .Fc...............cF.
  • fC.................Cf
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • #...................#
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • fC.................Cf
  • .Fc...............cF.
  • .f#c.............c#f.
  • ..fCc...........cCf..
  • ...f#c.........c#f...
  • ....fFCccc.cccCFf....
  • ......fFFF#FFFf......
  • ```
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
#6: Post edited by user avatar trichoplax‭ · 2022-10-08T15:54:37Z (over 1 year ago)
Add an extra example of a valid circle
  • Given a radius R, output a text representation of a circle.
  • ## Input
  • - A positive integer R
  • - You do not need to handle values of R greater than 32
  • ## Output
  • - A square of characters of side length 2R + 1
  • - You may choose any 2 distinct characters to represent the foreground (depicting the circle) and the background
  • - The centre of the circle is the centre of the square. That is, the location (R, R) if using zero indexed coordinates
  • - The foreground characters that make up the circle must satisfy the following:
  • - each foreground character must have a distance from the centre that has either a floor or a ceiling of R. That is, R-1 < distance < R+1
  • - each character that is at a distance from the centre of exactly R must be a foreground character
  • - The circle must not have gaps. Specifically, there must be no connected path of horizontally or vertically adjacent background characters joining the centre to any corner of the square. Equivalently, a flood fill from the centre will not reach any of the corners
  • ## Examples
  • These examples use the following characters to indicate the distance from the centre:
  • - `#` means the character is a distance of exactly R from the centre
  • - `.` means the distance is less than or equal to R-1 or greater than or equal to R+1
  • - `f` or `F` means the floor of the distance is R
  • - `c` or `C` means the ceiling of the distance is R
  • - upper case (`F` or `C`) means the distance rounded to the nearest integer is R
  • Using these characters, the rules are equivalent to:
  • - Every `#` must be included in the foreground
  • - Every `.` must be included in the background
  • - All other characters can be either foreground or background, provided there are no gaps between the foreground characters
  • This is intended to give the flexibility to allow various different circle drawing approaches to compete.
  • Examples of valid circles include:
  • - Every `#`, `f`, and `F` is foreground (every character with a floor of R is foreground)
  • - Every `#`, `c`, and `C` is foreground (every character with a ceiling of R is foreground)
  • - Every `#`, `F`, and `C` is foreground (every character that rounds to R is foreground)
  • The potential character placements for radius 1 to 10:
  • ```text
  • R=1:
  • F#F
  • #.#
  • F#F
  • R=2:
  • fF#Ff
  • Fc.cF
  • #...#
  • Fc.cF
  • fF#Ff
  • R=3:
  • .fF#Ff.
  • fCc.cCf
  • Fc...cF
  • #.....#
  • Fc...cF
  • fCc.cCf
  • .fF#Ff.
  • R=4:
  • ..FF#FF..
  • .FCc.cCF.
  • FC.....CF
  • Fc.....cF
  • #.......#
  • Fc.....cF
  • FC.....CF
  • .FCc.cCF.
  • ..FF#FF..
  • R=5:
  • ..fFF#FFf..
  • .f#cc.cc#f.
  • f#c.....c#f
  • Fc.......cF
  • Fc.......cF
  • #.........#
  • Fc.......cF
  • Fc.......cF
  • f#c.....c#f
  • .f#cc.cc#f.
  • ..fFF#FFf..
  • R=6:
  • ...fFF#FFf...
  • ..FCcc.ccCF..
  • .FC.......CF.
  • fC.........Cf
  • Fc.........cF
  • Fc.........cF
  • #...........#
  • Fc.........cF
  • Fc.........cF
  • fC.........Cf
  • .FC.......CF.
  • ..FCcc.ccCF..
  • ...fFF#FFf...
  • R=7:
  • ....fFF#FFf....
  • ..fFCcc.ccCFf..
  • .fFc.......cFf.
  • .Fc.........cF.
  • fC...........Cf
  • Fc...........cF
  • Fc...........cF
  • #.............#
  • Fc...........cF
  • Fc...........cF
  • fC...........Cf
  • .Fc.........cF.
  • .fFc.......cFf.
  • ..fFCcc.ccCFf..
  • ....fFF#FFf....
  • R=8:
  • ....ffFF#FFff....
  • ...fFCcc.ccCFf...
  • ..FCc.......cCF..
  • .fCc.........cCf.
  • fFc...........cFf
  • fC.............Cf
  • Fc.............cF
  • Fc.............cF
  • #...............#
  • Fc.............cF
  • Fc.............cF
  • fC.............Cf
  • fFc...........cFf
  • .fCc.........cCf.
  • ..FCc.......cCF..
  • ...fFCcc.ccCFf...
  • ....ffFF#FFff....
  • R=9:
  • .....fFFF#FFFf.....
  • ....FCCcc.ccCCF....
  • ..fFCc.......cCFf..
  • ..Fc...........cF..
  • .FC.............CF.
  • fCc.............cCf
  • FC...............CF
  • Fc...............cF
  • Fc...............cF
  • #.................#
  • Fc...............cF
  • Fc...............cF
  • FC...............CF
  • fCc.............cCf
  • .FC.............CF.
  • ..Fc...........cF..
  • ..fFCc.......cCFf..
  • ....FCCcc.ccCCF....
  • .....fFFF#FFFf.....
  • R=10:
  • ......fFFF#FFFf......
  • ....fFCccc.cccCFf....
  • ...f#c.........c#f...
  • ..fCc...........cCf..
  • .f#c.............c#f.
  • .Fc...............cF.
  • fC.................Cf
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • #...................#
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • fC.................Cf
  • .Fc...............cF.
  • .f#c.............c#f.
  • ..fCc...........cCf..
  • ...f#c.........c#f...
  • ....fFCccc.cccCFf....
  • ......fFFF#FFFf......
  • ```
  • > Explanations in answers are optional, but I'm more likely to upvote answers that have one.
  • Given a radius R, output a text representation of a circle.
  • ## Input
  • - A positive integer R
  • - You do not need to handle values of R greater than 32
  • ## Output
  • - A square of characters of side length 2R + 1
  • - You may choose any 2 distinct characters to represent the foreground (depicting the circle) and the background
  • - The centre of the circle is the centre of the square. That is, the location (R, R) if using zero indexed coordinates
  • - The foreground characters that make up the circle must satisfy the following:
  • - each foreground character must have a distance from the centre that has either a floor or a ceiling of R. That is, R-1 < distance < R+1
  • - each character that is at a distance from the centre of exactly R must be a foreground character
  • - The circle must not have gaps. Specifically, there must be no connected path of horizontally or vertically adjacent background characters joining the centre to any corner of the square. Equivalently, a flood fill from the centre will not reach any of the corners
  • ## Examples
  • These examples use the following characters to indicate the distance from the centre:
  • - `#` means the character is a distance of exactly R from the centre
  • - `.` means the distance is less than or equal to R-1 or greater than or equal to R+1
  • - `f` or `F` means the floor of the distance is R
  • - `c` or `C` means the ceiling of the distance is R
  • - upper case (`F` or `C`) means the distance rounded to the nearest integer is R
  • Using these characters, the rules are equivalent to:
  • - Every `#` must be included in the foreground
  • - Every `.` must be included in the background
  • - All other characters can be either foreground or background, provided there are no gaps between the foreground characters
  • This is intended to give the flexibility to allow various different circle drawing approaches to compete.
  • Examples of valid circles include:
  • - Every `#`, `f`, and `F` is foreground (every character with a floor of R is foreground)
  • - Every `#`, `c`, and `C` is foreground (every character with a ceiling of R is foreground)
  • - Every `#`, `F`, and `C` is foreground (every character that rounds to R is foreground)
  • - Every `#`, `f`, `F`, `c`, and `C` is foreground (every character with a floor or ceiling of R is foreground)
  • The potential character placements for radius 1 to 10:
  • ```text
  • R=1:
  • F#F
  • #.#
  • F#F
  • R=2:
  • fF#Ff
  • Fc.cF
  • #...#
  • Fc.cF
  • fF#Ff
  • R=3:
  • .fF#Ff.
  • fCc.cCf
  • Fc...cF
  • #.....#
  • Fc...cF
  • fCc.cCf
  • .fF#Ff.
  • R=4:
  • ..FF#FF..
  • .FCc.cCF.
  • FC.....CF
  • Fc.....cF
  • #.......#
  • Fc.....cF
  • FC.....CF
  • .FCc.cCF.
  • ..FF#FF..
  • R=5:
  • ..fFF#FFf..
  • .f#cc.cc#f.
  • f#c.....c#f
  • Fc.......cF
  • Fc.......cF
  • #.........#
  • Fc.......cF
  • Fc.......cF
  • f#c.....c#f
  • .f#cc.cc#f.
  • ..fFF#FFf..
  • R=6:
  • ...fFF#FFf...
  • ..FCcc.ccCF..
  • .FC.......CF.
  • fC.........Cf
  • Fc.........cF
  • Fc.........cF
  • #...........#
  • Fc.........cF
  • Fc.........cF
  • fC.........Cf
  • .FC.......CF.
  • ..FCcc.ccCF..
  • ...fFF#FFf...
  • R=7:
  • ....fFF#FFf....
  • ..fFCcc.ccCFf..
  • .fFc.......cFf.
  • .Fc.........cF.
  • fC...........Cf
  • Fc...........cF
  • Fc...........cF
  • #.............#
  • Fc...........cF
  • Fc...........cF
  • fC...........Cf
  • .Fc.........cF.
  • .fFc.......cFf.
  • ..fFCcc.ccCFf..
  • ....fFF#FFf....
  • R=8:
  • ....ffFF#FFff....
  • ...fFCcc.ccCFf...
  • ..FCc.......cCF..
  • .fCc.........cCf.
  • fFc...........cFf
  • fC.............Cf
  • Fc.............cF
  • Fc.............cF
  • #...............#
  • Fc.............cF
  • Fc.............cF
  • fC.............Cf
  • fFc...........cFf
  • .fCc.........cCf.
  • ..FCc.......cCF..
  • ...fFCcc.ccCFf...
  • ....ffFF#FFff....
  • R=9:
  • .....fFFF#FFFf.....
  • ....FCCcc.ccCCF....
  • ..fFCc.......cCFf..
  • ..Fc...........cF..
  • .FC.............CF.
  • fCc.............cCf
  • FC...............CF
  • Fc...............cF
  • Fc...............cF
  • #.................#
  • Fc...............cF
  • Fc...............cF
  • FC...............CF
  • fCc.............cCf
  • .FC.............CF.
  • ..Fc...........cF..
  • ..fFCc.......cCFf..
  • ....FCCcc.ccCCF....
  • .....fFFF#FFFf.....
  • R=10:
  • ......fFFF#FFFf......
  • ....fFCccc.cccCFf....
  • ...f#c.........c#f...
  • ..fCc...........cCf..
  • .f#c.............c#f.
  • .Fc...............cF.
  • fC.................Cf
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • #...................#
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • fC.................Cf
  • .Fc...............cF.
  • .f#c.............c#f.
  • ..fCc...........cCf..
  • ...f#c.........c#f...
  • ....fFCccc.cccCFf....
  • ......fFFF#FFFf......
  • ```
  • > Explanations are optional, but I'm more likely to upvote answers that have one.
#5: Post edited by user avatar trichoplax‭ · 2022-10-07T08:23:36Z (over 1 year ago)
Invite explanations
  • Given a radius R, output a text representation of a circle.
  • ## Input
  • - A positive integer R
  • - You do not need to handle values of R greater than 32
  • ## Output
  • - A square of characters of side length 2R + 1
  • - You may choose any 2 distinct characters to represent the foreground (depicting the circle) and the background
  • - The centre of the circle is the centre of the square. That is, the location (R, R) if using zero indexed coordinates
  • - The foreground characters that make up the circle must satisfy the following:
  • - each foreground character must have a distance from the centre that has either a floor or a ceiling of R. That is, R-1 < distance < R+1
  • - each character that is at a distance from the centre of exactly R must be a foreground character
  • - The circle must not have gaps. Specifically, there must be no connected path of horizontally or vertically adjacent background characters joining the centre to any corner of the square. Equivalently, a flood fill from the centre will not reach any of the corners
  • ## Examples
  • These examples use the following characters to indicate the distance from the centre:
  • - `#` means the character is a distance of exactly R from the centre
  • - `.` means the distance is less than or equal to R-1 or greater than or equal to R+1
  • - `f` or `F` means the floor of the distance is R
  • - `c` or `C` means the ceiling of the distance is R
  • - upper case (`F` or `C`) means the distance rounded to the nearest integer is R
  • Using these characters, the rules are equivalent to:
  • - Every `#` must be included in the foreground
  • - Every `.` must be included in the background
  • - All other characters can be either foreground or background, provided there are no gaps between the foreground characters
  • This is intended to give the flexibility to allow various different circle drawing approaches to compete.
  • Examples of valid circles include:
  • - Every `#`, `f`, and `F` is foreground (every character with a floor of R is foreground)
  • - Every `#`, `c`, and `C` is foreground (every character with a ceiling of R is foreground)
  • - Every `#`, `F`, and `C` is foreground (every character that rounds to R is foreground)
  • The potential character placements for radius 1 to 10:
  • ```text
  • R=1:
  • F#F
  • #.#
  • F#F
  • R=2:
  • fF#Ff
  • Fc.cF
  • #...#
  • Fc.cF
  • fF#Ff
  • R=3:
  • .fF#Ff.
  • fCc.cCf
  • Fc...cF
  • #.....#
  • Fc...cF
  • fCc.cCf
  • .fF#Ff.
  • R=4:
  • ..FF#FF..
  • .FCc.cCF.
  • FC.....CF
  • Fc.....cF
  • #.......#
  • Fc.....cF
  • FC.....CF
  • .FCc.cCF.
  • ..FF#FF..
  • R=5:
  • ..fFF#FFf..
  • .f#cc.cc#f.
  • f#c.....c#f
  • Fc.......cF
  • Fc.......cF
  • #.........#
  • Fc.......cF
  • Fc.......cF
  • f#c.....c#f
  • .f#cc.cc#f.
  • ..fFF#FFf..
  • R=6:
  • ...fFF#FFf...
  • ..FCcc.ccCF..
  • .FC.......CF.
  • fC.........Cf
  • Fc.........cF
  • Fc.........cF
  • #...........#
  • Fc.........cF
  • Fc.........cF
  • fC.........Cf
  • .FC.......CF.
  • ..FCcc.ccCF..
  • ...fFF#FFf...
  • R=7:
  • ....fFF#FFf....
  • ..fFCcc.ccCFf..
  • .fFc.......cFf.
  • .Fc.........cF.
  • fC...........Cf
  • Fc...........cF
  • Fc...........cF
  • #.............#
  • Fc...........cF
  • Fc...........cF
  • fC...........Cf
  • .Fc.........cF.
  • .fFc.......cFf.
  • ..fFCcc.ccCFf..
  • ....fFF#FFf....
  • R=8:
  • ....ffFF#FFff....
  • ...fFCcc.ccCFf...
  • ..FCc.......cCF..
  • .fCc.........cCf.
  • fFc...........cFf
  • fC.............Cf
  • Fc.............cF
  • Fc.............cF
  • #...............#
  • Fc.............cF
  • Fc.............cF
  • fC.............Cf
  • fFc...........cFf
  • .fCc.........cCf.
  • ..FCc.......cCF..
  • ...fFCcc.ccCFf...
  • ....ffFF#FFff....
  • R=9:
  • .....fFFF#FFFf.....
  • ....FCCcc.ccCCF....
  • ..fFCc.......cCFf..
  • ..Fc...........cF..
  • .FC.............CF.
  • fCc.............cCf
  • FC...............CF
  • Fc...............cF
  • Fc...............cF
  • #.................#
  • Fc...............cF
  • Fc...............cF
  • FC...............CF
  • fCc.............cCf
  • .FC.............CF.
  • ..Fc...........cF..
  • ..fFCc.......cCFf..
  • ....FCCcc.ccCCF....
  • .....fFFF#FFFf.....
  • R=10:
  • ......fFFF#FFFf......
  • ....fFCccc.cccCFf....
  • ...f#c.........c#f...
  • ..fCc...........cCf..
  • .f#c.............c#f.
  • .Fc...............cF.
  • fC.................Cf
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • #...................#
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • fC.................Cf
  • .Fc...............cF.
  • .f#c.............c#f.
  • ..fCc...........cCf..
  • ...f#c.........c#f...
  • ....fFCccc.cccCFf....
  • ......fFFF#FFFf......
  • ```
  • Given a radius R, output a text representation of a circle.
  • ## Input
  • - A positive integer R
  • - You do not need to handle values of R greater than 32
  • ## Output
  • - A square of characters of side length 2R + 1
  • - You may choose any 2 distinct characters to represent the foreground (depicting the circle) and the background
  • - The centre of the circle is the centre of the square. That is, the location (R, R) if using zero indexed coordinates
  • - The foreground characters that make up the circle must satisfy the following:
  • - each foreground character must have a distance from the centre that has either a floor or a ceiling of R. That is, R-1 < distance < R+1
  • - each character that is at a distance from the centre of exactly R must be a foreground character
  • - The circle must not have gaps. Specifically, there must be no connected path of horizontally or vertically adjacent background characters joining the centre to any corner of the square. Equivalently, a flood fill from the centre will not reach any of the corners
  • ## Examples
  • These examples use the following characters to indicate the distance from the centre:
  • - `#` means the character is a distance of exactly R from the centre
  • - `.` means the distance is less than or equal to R-1 or greater than or equal to R+1
  • - `f` or `F` means the floor of the distance is R
  • - `c` or `C` means the ceiling of the distance is R
  • - upper case (`F` or `C`) means the distance rounded to the nearest integer is R
  • Using these characters, the rules are equivalent to:
  • - Every `#` must be included in the foreground
  • - Every `.` must be included in the background
  • - All other characters can be either foreground or background, provided there are no gaps between the foreground characters
  • This is intended to give the flexibility to allow various different circle drawing approaches to compete.
  • Examples of valid circles include:
  • - Every `#`, `f`, and `F` is foreground (every character with a floor of R is foreground)
  • - Every `#`, `c`, and `C` is foreground (every character with a ceiling of R is foreground)
  • - Every `#`, `F`, and `C` is foreground (every character that rounds to R is foreground)
  • The potential character placements for radius 1 to 10:
  • ```text
  • R=1:
  • F#F
  • #.#
  • F#F
  • R=2:
  • fF#Ff
  • Fc.cF
  • #...#
  • Fc.cF
  • fF#Ff
  • R=3:
  • .fF#Ff.
  • fCc.cCf
  • Fc...cF
  • #.....#
  • Fc...cF
  • fCc.cCf
  • .fF#Ff.
  • R=4:
  • ..FF#FF..
  • .FCc.cCF.
  • FC.....CF
  • Fc.....cF
  • #.......#
  • Fc.....cF
  • FC.....CF
  • .FCc.cCF.
  • ..FF#FF..
  • R=5:
  • ..fFF#FFf..
  • .f#cc.cc#f.
  • f#c.....c#f
  • Fc.......cF
  • Fc.......cF
  • #.........#
  • Fc.......cF
  • Fc.......cF
  • f#c.....c#f
  • .f#cc.cc#f.
  • ..fFF#FFf..
  • R=6:
  • ...fFF#FFf...
  • ..FCcc.ccCF..
  • .FC.......CF.
  • fC.........Cf
  • Fc.........cF
  • Fc.........cF
  • #...........#
  • Fc.........cF
  • Fc.........cF
  • fC.........Cf
  • .FC.......CF.
  • ..FCcc.ccCF..
  • ...fFF#FFf...
  • R=7:
  • ....fFF#FFf....
  • ..fFCcc.ccCFf..
  • .fFc.......cFf.
  • .Fc.........cF.
  • fC...........Cf
  • Fc...........cF
  • Fc...........cF
  • #.............#
  • Fc...........cF
  • Fc...........cF
  • fC...........Cf
  • .Fc.........cF.
  • .fFc.......cFf.
  • ..fFCcc.ccCFf..
  • ....fFF#FFf....
  • R=8:
  • ....ffFF#FFff....
  • ...fFCcc.ccCFf...
  • ..FCc.......cCF..
  • .fCc.........cCf.
  • fFc...........cFf
  • fC.............Cf
  • Fc.............cF
  • Fc.............cF
  • #...............#
  • Fc.............cF
  • Fc.............cF
  • fC.............Cf
  • fFc...........cFf
  • .fCc.........cCf.
  • ..FCc.......cCF..
  • ...fFCcc.ccCFf...
  • ....ffFF#FFff....
  • R=9:
  • .....fFFF#FFFf.....
  • ....FCCcc.ccCCF....
  • ..fFCc.......cCFf..
  • ..Fc...........cF..
  • .FC.............CF.
  • fCc.............cCf
  • FC...............CF
  • Fc...............cF
  • Fc...............cF
  • #.................#
  • Fc...............cF
  • Fc...............cF
  • FC...............CF
  • fCc.............cCf
  • .FC.............CF.
  • ..Fc...........cF..
  • ..fFCc.......cCFf..
  • ....FCCcc.ccCCF....
  • .....fFFF#FFFf.....
  • R=10:
  • ......fFFF#FFFf......
  • ....fFCccc.cccCFf....
  • ...f#c.........c#f...
  • ..fCc...........cCf..
  • .f#c.............c#f.
  • .Fc...............cF.
  • fC.................Cf
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • #...................#
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • fC.................Cf
  • .Fc...............cF.
  • .f#c.............c#f.
  • ..fCc...........cCf..
  • ...f#c.........c#f...
  • ....fFCccc.cccCFf....
  • ......fFFF#FFFf......
  • ```
  • > Explanations in answers are optional, but I'm more likely to upvote answers that have one.
#4: Post edited by user avatar trichoplax‭ · 2022-10-07T06:15:39Z (over 1 year ago)
Trim redundant example text
  • Given a radius R, output a text representation of a circle.
  • ## Input
  • - A positive integer R
  • - You do not need to handle values of R greater than 32
  • ## Output
  • - A square of characters of side length 2R + 1
  • - You may choose any 2 distinct characters to represent the foreground (depicting the circle) and the background
  • - The centre of the circle is the centre of the square. That is, the location (R, R) if using zero indexed coordinates
  • - The foreground characters that make up the circle must satisfy the following:
  • - each foreground character must have a distance from the centre that has either a floor or a ceiling of R. That is, R-1 < distance < R+1
  • - each character that is at a distance from the centre of exactly R must be a foreground character
  • - The circle must not have gaps. Specifically, there must be no connected path of horizontally or vertically adjacent background characters joining the centre to any corner of the square. Equivalently, a flood fill from the centre will not reach any of the corners
  • ## Examples
  • These examples use the following characters to indicate the distance from the centre:
  • - `#` means the character is a distance of exactly R from the centre
  • - `.` means the distance is less than or equal to R-1 or greater than or equal to R+1
  • - `f` or `F` means the floor of the distance is R
  • - `c` or `C` means the ceiling of the distance is R
  • - upper case (`F` or `C`) means the distance rounded to the nearest integer is R
  • Using these characters, the rules are equivalent to:
  • - Every `#` must be included in the foreground
  • - Every `.` must be included in the background
  • - All other characters can be either foreground or background, provided there are no gaps between the foreground characters
  • This is intended to give the flexibility to allow various different circle drawing approaches to compete.
  • Examples of valid circles include:
  • - Every `#`, `f`, and `F` is foreground, everything else is background (every character with a floor of R is foreground)
  • - Every `#`, `c`, and `C` is foreground, everything else is background (every character with a ceiling of R is foreground)
  • - Every `#`, `F`, and `C` is foreground, everything else is background (every character that rounds to R is foreground)
  • The potential character placements for radius 1 to 10:
  • ```text
  • R=1:
  • F#F
  • #.#
  • F#F
  • R=2:
  • fF#Ff
  • Fc.cF
  • #...#
  • Fc.cF
  • fF#Ff
  • R=3:
  • .fF#Ff.
  • fCc.cCf
  • Fc...cF
  • #.....#
  • Fc...cF
  • fCc.cCf
  • .fF#Ff.
  • R=4:
  • ..FF#FF..
  • .FCc.cCF.
  • FC.....CF
  • Fc.....cF
  • #.......#
  • Fc.....cF
  • FC.....CF
  • .FCc.cCF.
  • ..FF#FF..
  • R=5:
  • ..fFF#FFf..
  • .f#cc.cc#f.
  • f#c.....c#f
  • Fc.......cF
  • Fc.......cF
  • #.........#
  • Fc.......cF
  • Fc.......cF
  • f#c.....c#f
  • .f#cc.cc#f.
  • ..fFF#FFf..
  • R=6:
  • ...fFF#FFf...
  • ..FCcc.ccCF..
  • .FC.......CF.
  • fC.........Cf
  • Fc.........cF
  • Fc.........cF
  • #...........#
  • Fc.........cF
  • Fc.........cF
  • fC.........Cf
  • .FC.......CF.
  • ..FCcc.ccCF..
  • ...fFF#FFf...
  • R=7:
  • ....fFF#FFf....
  • ..fFCcc.ccCFf..
  • .fFc.......cFf.
  • .Fc.........cF.
  • fC...........Cf
  • Fc...........cF
  • Fc...........cF
  • #.............#
  • Fc...........cF
  • Fc...........cF
  • fC...........Cf
  • .Fc.........cF.
  • .fFc.......cFf.
  • ..fFCcc.ccCFf..
  • ....fFF#FFf....
  • R=8:
  • ....ffFF#FFff....
  • ...fFCcc.ccCFf...
  • ..FCc.......cCF..
  • .fCc.........cCf.
  • fFc...........cFf
  • fC.............Cf
  • Fc.............cF
  • Fc.............cF
  • #...............#
  • Fc.............cF
  • Fc.............cF
  • fC.............Cf
  • fFc...........cFf
  • .fCc.........cCf.
  • ..FCc.......cCF..
  • ...fFCcc.ccCFf...
  • ....ffFF#FFff....
  • R=9:
  • .....fFFF#FFFf.....
  • ....FCCcc.ccCCF....
  • ..fFCc.......cCFf..
  • ..Fc...........cF..
  • .FC.............CF.
  • fCc.............cCf
  • FC...............CF
  • Fc...............cF
  • Fc...............cF
  • #.................#
  • Fc...............cF
  • Fc...............cF
  • FC...............CF
  • fCc.............cCf
  • .FC.............CF.
  • ..Fc...........cF..
  • ..fFCc.......cCFf..
  • ....FCCcc.ccCCF....
  • .....fFFF#FFFf.....
  • R=10:
  • ......fFFF#FFFf......
  • ....fFCccc.cccCFf....
  • ...f#c.........c#f...
  • ..fCc...........cCf..
  • .f#c.............c#f.
  • .Fc...............cF.
  • fC.................Cf
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • #...................#
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • fC.................Cf
  • .Fc...............cF.
  • .f#c.............c#f.
  • ..fCc...........cCf..
  • ...f#c.........c#f...
  • ....fFCccc.cccCFf....
  • ......fFFF#FFFf......
  • ```
  • Given a radius R, output a text representation of a circle.
  • ## Input
  • - A positive integer R
  • - You do not need to handle values of R greater than 32
  • ## Output
  • - A square of characters of side length 2R + 1
  • - You may choose any 2 distinct characters to represent the foreground (depicting the circle) and the background
  • - The centre of the circle is the centre of the square. That is, the location (R, R) if using zero indexed coordinates
  • - The foreground characters that make up the circle must satisfy the following:
  • - each foreground character must have a distance from the centre that has either a floor or a ceiling of R. That is, R-1 < distance < R+1
  • - each character that is at a distance from the centre of exactly R must be a foreground character
  • - The circle must not have gaps. Specifically, there must be no connected path of horizontally or vertically adjacent background characters joining the centre to any corner of the square. Equivalently, a flood fill from the centre will not reach any of the corners
  • ## Examples
  • These examples use the following characters to indicate the distance from the centre:
  • - `#` means the character is a distance of exactly R from the centre
  • - `.` means the distance is less than or equal to R-1 or greater than or equal to R+1
  • - `f` or `F` means the floor of the distance is R
  • - `c` or `C` means the ceiling of the distance is R
  • - upper case (`F` or `C`) means the distance rounded to the nearest integer is R
  • Using these characters, the rules are equivalent to:
  • - Every `#` must be included in the foreground
  • - Every `.` must be included in the background
  • - All other characters can be either foreground or background, provided there are no gaps between the foreground characters
  • This is intended to give the flexibility to allow various different circle drawing approaches to compete.
  • Examples of valid circles include:
  • - Every `#`, `f`, and `F` is foreground (every character with a floor of R is foreground)
  • - Every `#`, `c`, and `C` is foreground (every character with a ceiling of R is foreground)
  • - Every `#`, `F`, and `C` is foreground (every character that rounds to R is foreground)
  • The potential character placements for radius 1 to 10:
  • ```text
  • R=1:
  • F#F
  • #.#
  • F#F
  • R=2:
  • fF#Ff
  • Fc.cF
  • #...#
  • Fc.cF
  • fF#Ff
  • R=3:
  • .fF#Ff.
  • fCc.cCf
  • Fc...cF
  • #.....#
  • Fc...cF
  • fCc.cCf
  • .fF#Ff.
  • R=4:
  • ..FF#FF..
  • .FCc.cCF.
  • FC.....CF
  • Fc.....cF
  • #.......#
  • Fc.....cF
  • FC.....CF
  • .FCc.cCF.
  • ..FF#FF..
  • R=5:
  • ..fFF#FFf..
  • .f#cc.cc#f.
  • f#c.....c#f
  • Fc.......cF
  • Fc.......cF
  • #.........#
  • Fc.......cF
  • Fc.......cF
  • f#c.....c#f
  • .f#cc.cc#f.
  • ..fFF#FFf..
  • R=6:
  • ...fFF#FFf...
  • ..FCcc.ccCF..
  • .FC.......CF.
  • fC.........Cf
  • Fc.........cF
  • Fc.........cF
  • #...........#
  • Fc.........cF
  • Fc.........cF
  • fC.........Cf
  • .FC.......CF.
  • ..FCcc.ccCF..
  • ...fFF#FFf...
  • R=7:
  • ....fFF#FFf....
  • ..fFCcc.ccCFf..
  • .fFc.......cFf.
  • .Fc.........cF.
  • fC...........Cf
  • Fc...........cF
  • Fc...........cF
  • #.............#
  • Fc...........cF
  • Fc...........cF
  • fC...........Cf
  • .Fc.........cF.
  • .fFc.......cFf.
  • ..fFCcc.ccCFf..
  • ....fFF#FFf....
  • R=8:
  • ....ffFF#FFff....
  • ...fFCcc.ccCFf...
  • ..FCc.......cCF..
  • .fCc.........cCf.
  • fFc...........cFf
  • fC.............Cf
  • Fc.............cF
  • Fc.............cF
  • #...............#
  • Fc.............cF
  • Fc.............cF
  • fC.............Cf
  • fFc...........cFf
  • .fCc.........cCf.
  • ..FCc.......cCF..
  • ...fFCcc.ccCFf...
  • ....ffFF#FFff....
  • R=9:
  • .....fFFF#FFFf.....
  • ....FCCcc.ccCCF....
  • ..fFCc.......cCFf..
  • ..Fc...........cF..
  • .FC.............CF.
  • fCc.............cCf
  • FC...............CF
  • Fc...............cF
  • Fc...............cF
  • #.................#
  • Fc...............cF
  • Fc...............cF
  • FC...............CF
  • fCc.............cCf
  • .FC.............CF.
  • ..Fc...........cF..
  • ..fFCc.......cCFf..
  • ....FCCcc.ccCCF....
  • .....fFFF#FFFf.....
  • R=10:
  • ......fFFF#FFFf......
  • ....fFCccc.cccCFf....
  • ...f#c.........c#f...
  • ..fCc...........cCf..
  • .f#c.............c#f.
  • .Fc...............cF.
  • fC.................Cf
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • #...................#
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • fC.................Cf
  • .Fc...............cF.
  • .f#c.............c#f.
  • ..fCc...........cCf..
  • ...f#c.........c#f...
  • ....fFCccc.cccCFf....
  • ......fFFF#FFFf......
  • ```
#3: Post edited by user avatar trichoplax‭ · 2022-10-07T06:12:40Z (over 1 year ago)
Add examples and explain flexibility
  • Given a radius R, output a text representation of a circle.
  • ## Input
  • - A positive integer R
  • - You do not need to handle values of R greater than 32
  • ## Output
  • - A square of characters of side length 2R + 1
  • - You may choose any 2 distinct characters to represent the circle and the background
  • - The centre of the circle is the centre of the square. That is, the location R, R if using zero indexed coordinates
  • - The characters that make up the circle must have a distance from the centre that has either a floor or a ceiling of R (you may choose only floor, or only ceiling, or both, or a mixture where some characters have a floor of R and some have a ceiling of R - you do not need to include all characters that have a floor or ceiling of R)
  • - The circle must not have gaps. Specifically, there must be no connected path of horizontally or vertically adjacent background characters joining the centre to any corner of the square.
  • ## Examples
  • These examples use `#` as the circle character and `.` as the background character.
  • For input 5:
  • ```text
  • TODO: Add list of valid circles for radius 5
  • TODO: Consider whether extending the permitted circle character distance to floor-1 to ceiling+1 would be better or worse
  • ```
  • Given a radius R, output a text representation of a circle.
  • ## Input
  • - A positive integer R
  • - You do not need to handle values of R greater than 32
  • ## Output
  • - A square of characters of side length 2R + 1
  • - You may choose any 2 distinct characters to represent the foreground (depicting the circle) and the background
  • - The centre of the circle is the centre of the square. That is, the location (R, R) if using zero indexed coordinates
  • - The foreground characters that make up the circle must satisfy the following:
  • - each foreground character must have a distance from the centre that has either a floor or a ceiling of R. That is, R-1 < distance < R+1
  • - each character that is at a distance from the centre of exactly R must be a foreground character
  • - The circle must not have gaps. Specifically, there must be no connected path of horizontally or vertically adjacent background characters joining the centre to any corner of the square. Equivalently, a flood fill from the centre will not reach any of the corners
  • ## Examples
  • These examples use the following characters to indicate the distance from the centre:
  • - `#` means the character is a distance of exactly R from the centre
  • - `.` means the distance is less than or equal to R-1 or greater than or equal to R+1
  • - `f` or `F` means the floor of the distance is R
  • - `c` or `C` means the ceiling of the distance is R
  • - upper case (`F` or `C`) means the distance rounded to the nearest integer is R
  • Using these characters, the rules are equivalent to:
  • - Every `#` must be included in the foreground
  • - Every `.` must be included in the background
  • - All other characters can be either foreground or background, provided there are no gaps between the foreground characters
  • This is intended to give the flexibility to allow various different circle drawing approaches to compete.
  • Examples of valid circles include:
  • - Every `#`, `f`, and `F` is foreground, everything else is background (every character with a floor of R is foreground)
  • - Every `#`, `c`, and `C` is foreground, everything else is background (every character with a ceiling of R is foreground)
  • - Every `#`, `F`, and `C` is foreground, everything else is background (every character that rounds to R is foreground)
  • The potential character placements for radius 1 to 10:
  • ```text
  • R=1:
  • F#F
  • #.#
  • F#F
  • R=2:
  • fF#Ff
  • Fc.cF
  • #...#
  • Fc.cF
  • fF#Ff
  • R=3:
  • .fF#Ff.
  • fCc.cCf
  • Fc...cF
  • #.....#
  • Fc...cF
  • fCc.cCf
  • .fF#Ff.
  • R=4:
  • ..FF#FF..
  • .FCc.cCF.
  • FC.....CF
  • Fc.....cF
  • #.......#
  • Fc.....cF
  • FC.....CF
  • .FCc.cCF.
  • ..FF#FF..
  • R=5:
  • ..fFF#FFf..
  • .f#cc.cc#f.
  • f#c.....c#f
  • Fc.......cF
  • Fc.......cF
  • #.........#
  • Fc.......cF
  • Fc.......cF
  • f#c.....c#f
  • .f#cc.cc#f.
  • ..fFF#FFf..
  • R=6:
  • ...fFF#FFf...
  • ..FCcc.ccCF..
  • .FC.......CF.
  • fC.........Cf
  • Fc.........cF
  • Fc.........cF
  • #...........#
  • Fc.........cF
  • Fc.........cF
  • fC.........Cf
  • .FC.......CF.
  • ..FCcc.ccCF..
  • ...fFF#FFf...
  • R=7:
  • ....fFF#FFf....
  • ..fFCcc.ccCFf..
  • .fFc.......cFf.
  • .Fc.........cF.
  • fC...........Cf
  • Fc...........cF
  • Fc...........cF
  • #.............#
  • Fc...........cF
  • Fc...........cF
  • fC...........Cf
  • .Fc.........cF.
  • .fFc.......cFf.
  • ..fFCcc.ccCFf..
  • ....fFF#FFf....
  • R=8:
  • ....ffFF#FFff....
  • ...fFCcc.ccCFf...
  • ..FCc.......cCF..
  • .fCc.........cCf.
  • fFc...........cFf
  • fC.............Cf
  • Fc.............cF
  • Fc.............cF
  • #...............#
  • Fc.............cF
  • Fc.............cF
  • fC.............Cf
  • fFc...........cFf
  • .fCc.........cCf.
  • ..FCc.......cCF..
  • ...fFCcc.ccCFf...
  • ....ffFF#FFff....
  • R=9:
  • .....fFFF#FFFf.....
  • ....FCCcc.ccCCF....
  • ..fFCc.......cCFf..
  • ..Fc...........cF..
  • .FC.............CF.
  • fCc.............cCf
  • FC...............CF
  • Fc...............cF
  • Fc...............cF
  • #.................#
  • Fc...............cF
  • Fc...............cF
  • FC...............CF
  • fCc.............cCf
  • .FC.............CF.
  • ..Fc...........cF..
  • ..fFCc.......cCFf..
  • ....FCCcc.ccCCF....
  • .....fFFF#FFFf.....
  • R=10:
  • ......fFFF#FFFf......
  • ....fFCccc.cccCFf....
  • ...f#c.........c#f...
  • ..fCc...........cCf..
  • .f#c.............c#f.
  • .Fc...............cF.
  • fC.................Cf
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • #...................#
  • Fc.................cF
  • Fc.................cF
  • Fc.................cF
  • fC.................Cf
  • .Fc...............cF.
  • .f#c.............c#f.
  • ..fCc...........cCf..
  • ...f#c.........c#f...
  • ....fFCccc.cccCFf....
  • ......fFFF#FFFf......
  • ```
#2: Post edited by user avatar trichoplax‭ · 2022-10-05T00:16:27Z (over 1 year ago)
Add a thought until I have time to look into it
  • Given a radius R, output a text representation of a circle.
  • ## Input
  • - A positive integer R
  • - You do not need to handle values of R greater than 32
  • ## Output
  • - A square of characters of side length 2R + 1
  • - You may choose any 2 distinct characters to represent the circle and the background
  • - The centre of the circle is the centre of the square. That is, the location R, R if using zero indexed coordinates
  • - The characters that make up the circle must have a distance from the centre that has either a floor or a ceiling of R (you may choose only floor, or only ceiling, or both, or a mixture where some characters have a floor of R and some have a ceiling of R - you do not need to include all characters that have a floor or ceiling of R)
  • - The circle must not have gaps. Specifically, there must be no connected path of horizontally or vertically adjacent background characters joining the centre to any corner of the square.
  • ## Examples
  • These examples use `#` as the circle character and `.` as the background character.
  • For input 5:
  • ```text
  • TODO: Add list of valid circles for radius 5
  • ```
  • Given a radius R, output a text representation of a circle.
  • ## Input
  • - A positive integer R
  • - You do not need to handle values of R greater than 32
  • ## Output
  • - A square of characters of side length 2R + 1
  • - You may choose any 2 distinct characters to represent the circle and the background
  • - The centre of the circle is the centre of the square. That is, the location R, R if using zero indexed coordinates
  • - The characters that make up the circle must have a distance from the centre that has either a floor or a ceiling of R (you may choose only floor, or only ceiling, or both, or a mixture where some characters have a floor of R and some have a ceiling of R - you do not need to include all characters that have a floor or ceiling of R)
  • - The circle must not have gaps. Specifically, there must be no connected path of horizontally or vertically adjacent background characters joining the centre to any corner of the square.
  • ## Examples
  • These examples use `#` as the circle character and `.` as the background character.
  • For input 5:
  • ```text
  • TODO: Add list of valid circles for radius 5
  • TODO: Consider whether extending the permitted circle character distance to floor-1 to ceiling+1 would be better or worse
  • ```
#1: Initial revision by user avatar trichoplax‭ · 2022-10-04T17:14:24Z (over 1 year ago)
Circle of text characters
Given a radius R, output a text representation of a circle.

## Input
- A positive integer R
- You do not need to handle values of R greater than 32

## Output
- A square of characters of side length 2R + 1
- You may choose any 2 distinct characters to represent the circle and the background
- The centre of the circle is the centre of the square. That is, the location R, R if using zero indexed coordinates
- The characters that make up the circle must have a distance from the centre that has either a floor or a ceiling of R (you may choose only floor, or only ceiling, or both, or a mixture where some characters have a floor of R and some have a ceiling of R - you do not need to include all characters that have a floor or ceiling of R)
- The circle must not have gaps. Specifically, there must be no connected path of horizontally or vertically adjacent background characters joining the centre to any corner of the square.

## Examples

These examples use `#` as the circle character and `.` as the background character.

For input 5:

```text
TODO: Add list of valid circles for radius 5
```