Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1 @@
const laugh = "ha" ** 5;

View file

@ -0,0 +1,21 @@
const std = @import("std");
const warn = std.debug.warn;
const Allocator = std.mem.Allocator;
fn repeat(s: []const u8, times: u16, allocator: *Allocator) ![]u8 {
const repeated = try allocator.alloc(u8, s.len*times);
var i: usize = 0;
while (i < s.len*times) : (i += 1) {
repeated[i] = s[i % 2];
}
return repeated;
}
pub fn main() !void {
const allocator = std.debug.global_allocator;
const ex = try repeat("ha", 5, allocator);
defer allocator.free(ex);
}