Rename std modules to be camelcased
(Have fun mergining your stuff with this.)
This commit is contained in:
parent
44c1621525
commit
a3ec0b1f64
100 changed files with 2150 additions and 2151 deletions
|
|
@ -3,8 +3,8 @@
|
|||
* http://99-bottles-of-beer.net/
|
||||
*/
|
||||
use std;
|
||||
import std._int;
|
||||
import std._str;
|
||||
import std.Int;
|
||||
import std.Str;
|
||||
|
||||
fn b1() -> str {
|
||||
ret "# of beer on the wall, # of beer.";
|
||||
|
|
@ -32,15 +32,15 @@ case (1) {
|
|||
ns = "1 bottle";
|
||||
}
|
||||
case (_) {
|
||||
ns = _int.to_str(n, 10u) + " bottles";
|
||||
ns = Int.to_str(n, 10u) + " bottles";
|
||||
}
|
||||
}
|
||||
while (i < _str.byte_len(t)) {
|
||||
while (i < Str.byte_len(t)) {
|
||||
if (t.(i) == ('#' as u8)) {
|
||||
b += ns;
|
||||
}
|
||||
else {
|
||||
_str.push_byte(b, t.(i));
|
||||
Str.push_byte(b, t.(i));
|
||||
}
|
||||
i += 1u;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
* http://99-bottles-of-beer.net/
|
||||
*/
|
||||
use std;
|
||||
import std._int;
|
||||
import std._str;
|
||||
import std.Int;
|
||||
import std.Str;
|
||||
|
||||
tag bottle { none; dual; single; multiple(int);}
|
||||
|
||||
|
|
@ -25,8 +25,8 @@ fn show(bottle b) {
|
|||
log "Take one down and pass it around, 1 bottle of beer on the wall.";
|
||||
}
|
||||
case (multiple(?n)) {
|
||||
let str nb = _int.to_str(n, 10u);
|
||||
let str mb = _int.to_str(n - 1, 10u);
|
||||
let str nb = Int.to_str(n, 10u);
|
||||
let str mb = Int.to_str(n - 1, 10u);
|
||||
log nb + " bottles of beer on the wall, " + nb + " bottles of beer,";
|
||||
log "Take one down and pass it around, "
|
||||
+ mb + " bottles of beer on the wall.";
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
* http://99-bottles-of-beer.net/
|
||||
*/
|
||||
use std;
|
||||
import std._int;
|
||||
import std._str;
|
||||
import std.Int;
|
||||
import std.Str;
|
||||
|
||||
fn b1() -> str {
|
||||
ret "# of beer on the wall, # of beer.";
|
||||
|
|
@ -31,15 +31,15 @@ case (1) {
|
|||
ns = "1 bottle";
|
||||
}
|
||||
case (_) {
|
||||
ns = _int.to_str(n, 10u) + " bottles";
|
||||
ns = Int.to_str(n, 10u) + " bottles";
|
||||
}
|
||||
}
|
||||
while (i < _str.byte_len(t)) {
|
||||
while (i < Str.byte_len(t)) {
|
||||
if (t.(i) == ('#' as u8)) {
|
||||
b += ns;
|
||||
}
|
||||
else {
|
||||
_str.push_byte(b, t.(i));
|
||||
Str.push_byte(b, t.(i));
|
||||
}
|
||||
i += 1u;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@
|
|||
* http://99-bottles-of-beer.net/
|
||||
*/
|
||||
use std;
|
||||
import std._int;
|
||||
import std._str;
|
||||
import std.Int;
|
||||
import std.Str;
|
||||
|
||||
fn main() {
|
||||
fn multiple(int n) {
|
||||
let str nb = _int.to_str(n, 10u);
|
||||
let str mb = _int.to_str(n - 1, 10u);
|
||||
let str nb = Int.to_str(n, 10u);
|
||||
let str mb = Int.to_str(n - 1, 10u);
|
||||
log nb + " bottles of beer on the wall, " + nb + " bottles of beer,";
|
||||
log "Take one down and pass it around, "
|
||||
+ mb + " bottles of beer on the wall.";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use std;
|
||||
|
||||
import std._int;
|
||||
import std.Int;
|
||||
|
||||
tag tree {
|
||||
nil;
|
||||
|
|
@ -49,7 +49,7 @@ fn main() {
|
|||
|
||||
auto depth = min_depth;
|
||||
while (depth <= max_depth) {
|
||||
auto iterations = _int.pow(2, (max_depth - depth + min_depth) as uint);
|
||||
auto iterations = Int.pow(2, (max_depth - depth + min_depth) as uint);
|
||||
auto chk = 0;
|
||||
|
||||
auto i = 1;
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
use std;
|
||||
|
||||
import std._int;
|
||||
import std._vec;
|
||||
import std.Int;
|
||||
import std.Vec;
|
||||
|
||||
fn fannkuch(int n) -> int {
|
||||
|
||||
|
|
@ -12,9 +12,9 @@ fn fannkuch(int n) -> int {
|
|||
}
|
||||
auto perm1init_ = perm1init; // Rustboot workaround
|
||||
|
||||
auto perm = _vec.init_elt[mutable int](0, n as uint);
|
||||
auto perm1 = _vec.init_fn[mutable int](perm1init_, n as uint);
|
||||
auto count = _vec.init_elt[mutable int](0, n as uint);
|
||||
auto perm = Vec.init_elt[mutable int](0, n as uint);
|
||||
auto perm1 = Vec.init_fn[mutable int](perm1init_, n as uint);
|
||||
auto count = Vec.init_elt[mutable int](0, n as uint);
|
||||
|
||||
auto f = 0;
|
||||
auto i = 0;
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@
|
|||
* http://shootout.alioth.debian.org/
|
||||
*/
|
||||
use std;
|
||||
import std._vec;
|
||||
import std._str;
|
||||
import std._uint;
|
||||
import std._int;
|
||||
import std.Vec;
|
||||
import std.Str;
|
||||
import std.UInt;
|
||||
import std.Int;
|
||||
|
||||
fn LINE_LENGTH() -> uint {
|
||||
ret 60u;
|
||||
|
|
@ -54,21 +54,21 @@ fn select_random(u32 r, vec[aminoacids] genelist) -> char {
|
|||
ret v.(hi)._0;
|
||||
}
|
||||
}
|
||||
ret bisect(genelist, 0u, _vec.len[aminoacids](genelist) - 1u, r);
|
||||
ret bisect(genelist, 0u, Vec.len[aminoacids](genelist) - 1u, r);
|
||||
}
|
||||
|
||||
fn make_random_fasta(str id, str desc, vec[aminoacids] genelist, int n) {
|
||||
log(">" + id + " " + desc);
|
||||
auto rng = myrandom(std.rand.mk_rng().next());
|
||||
auto rng = myrandom(std.Rand.mk_rng().next());
|
||||
let str op = "";
|
||||
for each (uint i in _uint.range(0u, n as uint)) {
|
||||
_str.push_byte(op, select_random(rng.next(100u32), genelist) as u8);
|
||||
if (_str.byte_len(op) >= LINE_LENGTH()) {
|
||||
for each (uint i in UInt.range(0u, n as uint)) {
|
||||
Str.push_byte(op, select_random(rng.next(100u32), genelist) as u8);
|
||||
if (Str.byte_len(op) >= LINE_LENGTH()) {
|
||||
log(op);
|
||||
op = "";
|
||||
}
|
||||
}
|
||||
if (_str.byte_len(op) > 0u) {
|
||||
if (Str.byte_len(op) > 0u) {
|
||||
log(op);
|
||||
}
|
||||
}
|
||||
|
|
@ -76,16 +76,16 @@ fn make_random_fasta(str id, str desc, vec[aminoacids] genelist, int n) {
|
|||
fn make_repeat_fasta(str id, str desc, str s, int n) {
|
||||
log(">" + id + " " + desc);
|
||||
let str op = "";
|
||||
let uint sl = _str.byte_len(s);
|
||||
for each (uint i in _uint.range(0u, n as uint)) {
|
||||
let uint sl = Str.byte_len(s);
|
||||
for each (uint i in UInt.range(0u, n as uint)) {
|
||||
|
||||
_str.push_byte(op, s.(i % sl));
|
||||
if (_str.byte_len(op) >= LINE_LENGTH()) {
|
||||
Str.push_byte(op, s.(i % sl));
|
||||
if (Str.byte_len(op) >= LINE_LENGTH()) {
|
||||
log(op);
|
||||
op = "";
|
||||
}
|
||||
}
|
||||
if (_str.byte_len(op) > 0u) {
|
||||
if (Str.byte_len(op) > 0u) {
|
||||
log(op);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue