11th of May, 2019
Last updated : 11th of May, 2019
Editors :
- Blokyk
using System; | |
using System.Collections.Generic; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
int initialPrice = Int32.Parse(Console.ReadLine()); | |
int numberOfPrices = Int32.Parse(Console.ReadLine()); | |
int[] prices = new int[numberOfPrices]; |
[ | |
2, | |
3, | |
5, | |
7, | |
11, | |
13, | |
17, | |
19, | |
23, |
public enum Colors { | |
AliceBlue, | |
AntiqueWhite, AntiqueWhite1, AntiqueWhite2, AntiqueWhite3, AntiqueWhite4, | |
Aqua, | |
AquaMarine, AquaMarine1, AquaMarine2, AquaMarin3, AquaMarine4, | |
Azure, Azure1, Azure2, Azure3, Azure4, |
[System.Flags] | |
public enum ValidOn { | |
Edge = 0, | |
EdgeNode = Edge & Node, | |
EdgeNodeGraph = EdgeNode & Graph, | |
EdgeNodeGraphSubgraph = EdgeNodeGraph & Subgraph, | |
EdgeNodeGraphSubgraphCluster = Edge & Node & Graph & Subgraph & Cluster, | |
EdgeNodeGraphCluster = EdgeNodeGraph & Cluster, | |
EdgeNodeSubgraph = EdgeNode & Subgraph, | |
EdgeNodeSubgraphCluster = EdgeNodeSubgraph & Cluster, |
// Pay attention to the scaling ! | |
// Some results might look boring or glitchy from afar (or close), but don't fret ! | |
// p.x and p.y are current coordinates | |
// v.x and v.y is a velocity at point p | |
// https://bit.ly/3bmvQ58 -- zoomed in | |
vec2 get_velocity(vec2 p) { | |
vec2 v = vec2(0., 0.); |
#!/bin/bash | |
function center_txt() { | |
txt=$1 | |
line_nb=$(wc -l <<< $txt) | |
available_lines=$(($(($LINES - $line_nb)) / 2)) | |
#echo $available_lines | |
#echo "$txt" | |
perl -E "say \"\n\" x $available_lines" | |
#echo $top | wc -l |
/* | |
* MIT License | |
* | |
* Copyright (c) 2022 blokyk | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
using System; | |
using System.Collections.Generic; | |
static class SpanExtensions | |
{ | |
// just a quick and dirty version, could be a lot faster | |
// by just using Vector<byte>.Shuffle if available | |
public static void Reverse4ByteEndianness(Span<byte> bytes) { | |
byte b0, b1, b2, b3; | |
for (int i = 3; i < bytes.Length; i += 4) { |
using System.Runtime.CompilerServices; | |
/// <summary> | |
/// Computes various properties of <typeparamref name="TEnum"/> | |
/// </summary> | |
/// <remarks>WARNING: This assumes that <typeparamref name="TEnum"/>'s underlying type is an <see langword="int"/></remarks> | |
public static class EnumInfo<TEnum> where TEnum : struct, Enum | |
{ | |
private static readonly Lazy<HashSet<TEnum>> _valuesSet = new(static () => new HashSet<TEnum>(EnumValues!)); |