Skip to content

Commit 767d2c0

Browse files
committed
test: De-export sudoku. rs=burningtree
1 parent 7d8ae44 commit 767d2c0

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/test/bench/sudoku.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,14 @@ use io::{ReaderUtil, WriterUtil};
2929
// If called without arguments, sudoku solves a built-in example sudoku
3030
//
3131

32-
export grid_t, read_grid, solve_grid, write_grid;
33-
3432
// internal type of sudoku grids
3533
type grid = ~[~[mut u8]];
3634

3735
// exported type of sudoku grids
38-
enum grid_t { grid_ctor(grid), }
36+
pub enum grid_t { grid_ctor(grid), }
3937

4038
// read a sudoku problem from file f
41-
fn read_grid(f: io::Reader) -> grid_t {
39+
pub fn read_grid(f: io::Reader) -> grid_t {
4240
assert f.read_line() == ~"9,9"; /* assert first line is exactly "9,9" */
4341

4442
let g = vec::from_fn(10u, {|_i|
@@ -56,7 +54,7 @@ fn read_grid(f: io::Reader) -> grid_t {
5654
}
5755

5856
// solve sudoku grid
59-
fn solve_grid(g: grid_t) {
57+
pub fn solve_grid(g: grid_t) {
6058
fn next_color(g: grid, row: u8, col: u8, start_color: u8) -> bool {
6159
if start_color < 10u8 {
6260
// colors not yet used
@@ -126,7 +124,7 @@ fn solve_grid(g: grid_t) {
126124
}
127125
}
128126

129-
fn write_grid(f: io::Writer, g: grid_t) {
127+
pub fn write_grid(f: io::Writer, g: grid_t) {
130128
for u8::range(0u8, 9u8) |row| {
131129
f.write_str(fmt!("%u", (*g)[row][0] as uint));
132130
for u8::range(1u8, 9u8) |col| {

0 commit comments

Comments
 (0)