(re)format aiken sources in the repository.

This commit is contained in:
KtorZ 2024-09-07 18:25:21 +02:00
parent 28916c1ef9
commit 8db4a60986
No known key found for this signature in database
GPG Key ID: 33173CB6F77F4277
7 changed files with 45 additions and 351 deletions

View File

@ -88,42 +88,10 @@ const solution_100_6x6: Solution =
move_number: 36, move_number: 36,
start: Some((1, 1)), start: Some((1, 1)),
visited: [ visited: [
(3, 2), (3, 2), (5, 3), (6, 1), (4, 2), (3, 4), (2, 6), (4, 5), (6, 6), (5, 4),
(5, 3), (6, 2), (4, 1), (2, 2), (1, 4), (3, 3), (2, 1), (1, 3), (2, 5), (4, 6),
(6, 1), (6, 5), (4, 4), (5, 2), (6, 4), (5, 6), (3, 5), (1, 6), (2, 4), (1, 2),
(4, 2), (3, 1), (4, 3), (5, 1), (6, 3), (5, 5), (3, 6), (1, 5), (2, 3), (1, 1),
(3, 4),
(2, 6),
(4, 5),
(6, 6),
(5, 4),
(6, 2),
(4, 1),
(2, 2),
(1, 4),
(3, 3),
(2, 1),
(1, 3),
(2, 5),
(4, 6),
(6, 5),
(4, 4),
(5, 2),
(6, 4),
(5, 6),
(3, 5),
(1, 6),
(2, 4),
(1, 2),
(3, 1),
(4, 3),
(5, 1),
(6, 3),
(5, 5),
(3, 6),
(1, 5),
(2, 3),
(1, 1),
], ],
}, },
), ),
@ -134,42 +102,10 @@ const solution_100_6x6: Solution =
move_number: 36, move_number: 36,
start: Some((1, 1)), start: Some((1, 1)),
visited: [ visited: [
(3, 2), (3, 2), (5, 3), (6, 1), (4, 2), (3, 4), (2, 2), (4, 1), (6, 2), (5, 4),
(5, 3), (6, 6), (4, 5), (2, 6), (1, 4), (3, 3), (2, 1), (1, 3), (2, 5), (4, 6),
(6, 1), (6, 5), (4, 4), (5, 2), (6, 4), (5, 6), (3, 5), (1, 6), (2, 4), (1, 2),
(4, 2), (3, 1), (4, 3), (5, 1), (6, 3), (5, 5), (3, 6), (1, 5), (2, 3), (1, 1),
(3, 4),
(2, 2),
(4, 1),
(6, 2),
(5, 4),
(6, 6),
(4, 5),
(2, 6),
(1, 4),
(3, 3),
(2, 1),
(1, 3),
(2, 5),
(4, 6),
(6, 5),
(4, 4),
(5, 2),
(6, 4),
(5, 6),
(3, 5),
(1, 6),
(2, 4),
(1, 2),
(3, 1),
(4, 3),
(5, 1),
(6, 3),
(5, 5),
(3, 6),
(1, 5),
(2, 3),
(1, 1),
], ],
}, },
), ),
@ -180,42 +116,10 @@ const solution_100_6x6: Solution =
move_number: 36, move_number: 36,
start: Some((1, 1)), start: Some((1, 1)),
visited: [ visited: [
(3, 2), (3, 2), (5, 3), (6, 1), (4, 2), (3, 4), (2, 2), (1, 4), (2, 6), (4, 5),
(5, 3), (6, 6), (5, 4), (6, 2), (4, 1), (3, 3), (2, 1), (1, 3), (2, 5), (4, 6),
(6, 1), (6, 5), (4, 4), (5, 2), (6, 4), (5, 6), (3, 5), (1, 6), (2, 4), (1, 2),
(4, 2), (3, 1), (4, 3), (5, 1), (6, 3), (5, 5), (3, 6), (1, 5), (2, 3), (1, 1),
(3, 4),
(2, 2),
(1, 4),
(2, 6),
(4, 5),
(6, 6),
(5, 4),
(6, 2),
(4, 1),
(3, 3),
(2, 1),
(1, 3),
(2, 5),
(4, 6),
(6, 5),
(4, 4),
(5, 2),
(6, 4),
(5, 6),
(3, 5),
(1, 6),
(2, 4),
(1, 2),
(3, 1),
(4, 3),
(5, 1),
(6, 3),
(5, 5),
(3, 6),
(1, 5),
(2, 3),
(1, 1),
], ],
}, },
), ),
@ -226,48 +130,15 @@ const solution_100_6x6: Solution =
move_number: 36, move_number: 36,
start: Some((1, 1)), start: Some((1, 1)),
visited: [ visited: [
(3, 2), (3, 2), (5, 3), (6, 1), (4, 2), (3, 4), (2, 6), (1, 4), (2, 2), (4, 1),
(5, 3), (6, 2), (5, 4), (6, 6), (4, 5), (3, 3), (2, 1), (1, 3), (2, 5), (4, 6),
(6, 1), (6, 5), (4, 4), (5, 2), (6, 4), (5, 6), (3, 5), (1, 6), (2, 4), (1, 2),
(4, 2), (3, 1), (4, 3), (5, 1), (6, 3), (5, 5), (3, 6), (1, 5), (2, 3), (1, 1),
(3, 4),
(2, 6),
(1, 4),
(2, 2),
(4, 1),
(6, 2),
(5, 4),
(6, 6),
(4, 5),
(3, 3),
(2, 1),
(1, 3),
(2, 5),
(4, 6),
(6, 5),
(4, 4),
(5, 2),
(6, 4),
(5, 6),
(3, 5),
(1, 6),
(2, 4),
(1, 2),
(3, 1),
(4, 3),
(5, 1),
(6, 3),
(5, 5),
(3, 6),
(1, 5),
(2, 3),
(1, 1),
], ],
}, },
), ),
] ]
const solution_100_8x8: Solution = const solution_100_8x8: Solution =
[ [
( (
@ -277,69 +148,13 @@ const solution_100_8x8: Solution =
move_number: 64, move_number: 64,
start: Some((1, 1)), start: Some((1, 1)),
visited: [ visited: [
(3, 2), (3, 2), (4, 4), (5, 6), (6, 4), (8, 5), (7, 7), (6, 5), (8, 4), (7, 2),
(4, 4), (5, 3), (3, 4), (4, 6), (5, 8), (6, 6), (4, 5), (3, 7), (1, 8), (2, 6),
(5, 6), (4, 7), (5, 5), (6, 3), (5, 1), (4, 3), (3, 5), (5, 4), (7, 3), (8, 1),
(6, 4), (6, 2), (4, 1), (2, 2), (1, 4), (3, 3), (2, 5), (1, 3), (2, 1), (4, 2),
(8, 5), (6, 1), (8, 2), (7, 4), (8, 6), (7, 8), (5, 7), (3, 8), (1, 7), (3, 6),
(7, 7), (2, 8), (1, 6), (2, 4), (1, 2), (3, 1), (5, 2), (7, 1), (8, 3), (7, 5),
(6, 5), (8, 7), (6, 8), (7, 6), (8, 8), (6, 7), (4, 8), (2, 7), (1, 5), (2, 3),
(8, 4),
(7, 2),
(5, 3),
(3, 4),
(4, 6),
(5, 8),
(6, 6),
(4, 5),
(3, 7),
(1, 8),
(2, 6),
(4, 7),
(5, 5),
(6, 3),
(5, 1),
(4, 3),
(3, 5),
(5, 4),
(7, 3),
(8, 1),
(6, 2),
(4, 1),
(2, 2),
(1, 4),
(3, 3),
(2, 5),
(1, 3),
(2, 1),
(4, 2),
(6, 1),
(8, 2),
(7, 4),
(8, 6),
(7, 8),
(5, 7),
(3, 8),
(1, 7),
(3, 6),
(2, 8),
(1, 6),
(2, 4),
(1, 2),
(3, 1),
(5, 2),
(7, 1),
(8, 3),
(7, 5),
(8, 7),
(6, 8),
(7, 6),
(8, 8),
(6, 7),
(4, 8),
(2, 7),
(1, 5),
(2, 3),
(1, 1), (1, 1),
], ],
}, },
@ -351,69 +166,13 @@ const solution_100_8x8: Solution =
move_number: 64, move_number: 64,
start: Some((1, 1)), start: Some((1, 1)),
visited: [ visited: [
(3, 2), (3, 2), (4, 4), (5, 6), (7, 7), (8, 5), (6, 4), (7, 2), (8, 4), (6, 5),
(4, 4), (5, 3), (3, 4), (4, 6), (5, 8), (6, 6), (4, 5), (3, 7), (1, 8), (2, 6),
(5, 6), (4, 7), (5, 5), (6, 3), (5, 1), (4, 3), (3, 5), (5, 4), (7, 3), (8, 1),
(7, 7), (6, 2), (4, 1), (2, 2), (1, 4), (3, 3), (2, 5), (1, 3), (2, 1), (4, 2),
(8, 5), (6, 1), (8, 2), (7, 4), (8, 6), (7, 8), (5, 7), (3, 8), (1, 7), (3, 6),
(6, 4), (2, 8), (1, 6), (2, 4), (1, 2), (3, 1), (5, 2), (7, 1), (8, 3), (7, 5),
(7, 2), (8, 7), (6, 8), (7, 6), (8, 8), (6, 7), (4, 8), (2, 7), (1, 5), (2, 3),
(8, 4),
(6, 5),
(5, 3),
(3, 4),
(4, 6),
(5, 8),
(6, 6),
(4, 5),
(3, 7),
(1, 8),
(2, 6),
(4, 7),
(5, 5),
(6, 3),
(5, 1),
(4, 3),
(3, 5),
(5, 4),
(7, 3),
(8, 1),
(6, 2),
(4, 1),
(2, 2),
(1, 4),
(3, 3),
(2, 5),
(1, 3),
(2, 1),
(4, 2),
(6, 1),
(8, 2),
(7, 4),
(8, 6),
(7, 8),
(5, 7),
(3, 8),
(1, 7),
(3, 6),
(2, 8),
(1, 6),
(2, 4),
(1, 2),
(3, 1),
(5, 2),
(7, 1),
(8, 3),
(7, 5),
(8, 7),
(6, 8),
(7, 6),
(8, 8),
(6, 7),
(4, 8),
(2, 7),
(1, 5),
(2, 3),
(1, 1), (1, 1),
], ],
}, },
@ -425,69 +184,13 @@ const solution_100_8x8: Solution =
move_number: 64, move_number: 64,
start: Some((1, 1)), start: Some((1, 1)),
visited: [ visited: [
(3, 2), (3, 2), (4, 4), (6, 5), (8, 4), (7, 2), (5, 3), (3, 4), (4, 6), (5, 8),
(4, 4), (7, 7), (5, 6), (6, 4), (8, 5), (6, 6), (4, 5), (3, 7), (1, 8), (2, 6),
(6, 5), (4, 7), (5, 5), (6, 3), (5, 1), (4, 3), (3, 5), (5, 4), (7, 3), (8, 1),
(8, 4), (6, 2), (4, 1), (2, 2), (1, 4), (3, 3), (2, 5), (1, 3), (2, 1), (4, 2),
(7, 2), (6, 1), (8, 2), (7, 4), (8, 6), (7, 8), (5, 7), (3, 8), (1, 7), (3, 6),
(5, 3), (2, 8), (1, 6), (2, 4), (1, 2), (3, 1), (5, 2), (7, 1), (8, 3), (7, 5),
(3, 4), (8, 7), (6, 8), (7, 6), (8, 8), (6, 7), (4, 8), (2, 7), (1, 5), (2, 3),
(4, 6),
(5, 8),
(7, 7),
(5, 6),
(6, 4),
(8, 5),
(6, 6),
(4, 5),
(3, 7),
(1, 8),
(2, 6),
(4, 7),
(5, 5),
(6, 3),
(5, 1),
(4, 3),
(3, 5),
(5, 4),
(7, 3),
(8, 1),
(6, 2),
(4, 1),
(2, 2),
(1, 4),
(3, 3),
(2, 5),
(1, 3),
(2, 1),
(4, 2),
(6, 1),
(8, 2),
(7, 4),
(8, 6),
(7, 8),
(5, 7),
(3, 8),
(1, 7),
(3, 6),
(2, 8),
(1, 6),
(2, 4),
(1, 2),
(3, 1),
(5, 2),
(7, 1),
(8, 3),
(7, 5),
(8, 7),
(6, 8),
(7, 6),
(8, 8),
(6, 7),
(4, 8),
(2, 7),
(1, 5),
(2, 3),
(1, 1), (1, 1),
], ],
}, },

View File

@ -18,8 +18,7 @@ type Direction {
RD RD
} }
const direction_list = const direction_list = [UL, UR, DL, DR, LU, LD, RU, RD]
[UL, UR, DL, DR, LU, LD, RU, RD]
fn move(direction: Direction, tile: Tile) -> Tile { fn move(direction: Direction, tile: Tile) -> Tile {
let (x, y) = tile let (x, y) = tile

View File

@ -1,4 +1,5 @@
use aiken/collection/list use aiken/collection/list
use cardano/address.{Script, VerificationKey}
use cardano/certificate.{ use cardano/certificate.{
AlwaysAbstain, AlwaysNoConfidence, AuthorizeConstitutionalCommitteeProxy, AlwaysAbstain, AlwaysNoConfidence, AuthorizeConstitutionalCommitteeProxy,
Certificate, DelegateBlockProduction, DelegateBoth, DelegateCredential, Certificate, DelegateBlockProduction, DelegateBoth, DelegateCredential,
@ -7,7 +8,6 @@ use cardano/certificate.{
RetireFromConstitutionalCommittee, RetireStakePool, UnregisterCredential, RetireFromConstitutionalCommittee, RetireStakePool, UnregisterCredential,
UnregisterDelegateRepresentative, UpdateDelegateRepresentative, UnregisterDelegateRepresentative, UpdateDelegateRepresentative,
} }
use cardano/address.{Script, VerificationKey}
use cardano/transaction.{Transaction} use cardano/transaction.{Transaction}
const only0s = #"00000000000000000000000000000000000000000000000000000000" const only0s = #"00000000000000000000000000000000000000000000000000000000"
@ -20,11 +20,7 @@ const only9s =
#"9999999999999999999999999999999999999999999999999999999999999999" #"9999999999999999999999999999999999999999999999999999999999999999"
validator purposes { validator purposes {
publish( publish(_redeemer: Void, certificate: Certificate, transaction: Transaction) {
_redeemer: Void,
certificate: Certificate,
transaction: Transaction,
) -> Bool {
assert_script_info(certificate) assert_script_info(certificate)
let certificates = transaction.certificates let certificates = transaction.certificates

View File

@ -1,7 +1,7 @@
use aiken/collection/dict.{Dict} use aiken/collection/dict.{Dict}
use aiken/collection/list use aiken/collection/list
use cardano/assets.{PolicyId, Value}
use cardano/address use cardano/address
use cardano/assets.{PolicyId, Value}
use cardano/transaction.{ use cardano/transaction.{
DatumHash, Input, Mint, NoDatum, Output, OutputReference, ScriptPurpose, DatumHash, Input, Mint, NoDatum, Output, OutputReference, ScriptPurpose,
Transaction, Transaction,
@ -128,10 +128,10 @@ fn assert_mint(mint: Value, our_policy_id: PolicyId, other_policy_id: PolicyId)
// below is meant to generate a small-enough hash... If this test fails // below is meant to generate a small-enough hash... If this test fails
// after some code-gen changes, it's probably because the new hash is // after some code-gen changes, it's probably because the new hash is
// larger. // larger.
///
// How to fix? // How to fix?
// Change the traced string down below in hope to get a // Change the traced string down below in hope to get a
// smaller hash. // smaller hash.
///
validator test_2 { validator test_2 {
mint(_tmp2: Void, _policy_id: PolicyId, _transaction: Transaction) { mint(_tmp2: Void, _policy_id: PolicyId, _transaction: Transaction) {
trace @"slfhioer7w8yru" trace @"slfhioer7w8yru"

View File

@ -14,11 +14,7 @@ const null32 =
#"0000000000000000000000000000000000000000000000000000000000000000" #"0000000000000000000000000000000000000000000000000000000000000000"
validator guardrails { validator guardrails {
propose( propose(_redeemer: Void, _: ProposalProcedure, transaction: Transaction) {
_redeemer: Void,
_: ProposalProcedure,
transaction: Transaction,
) -> Bool {
let procedures = transaction.proposal_procedures let procedures = transaction.proposal_procedures
assert_redeemers(transaction.redeemers) assert_redeemers(transaction.redeemers)

View File

@ -24,7 +24,7 @@ validator guardrails {
_redeemer: Void, _redeemer: Void,
proposal: ProposalProcedure, proposal: ProposalProcedure,
_transaction: Transaction, _transaction: Transaction,
) -> Bool { ) {
expect ProposalProcedure { expect ProposalProcedure {
governance_action: ProtocolParameters { governance_action: ProtocolParameters {
ancestor: None, ancestor: None,

View File

@ -1,6 +1,6 @@
use aiken/collection/dict use aiken/collection/dict
use cardano/assets
use cardano/address.{Address, Script} use cardano/address.{Address, Script}
use cardano/assets
use cardano/transaction.{ use cardano/transaction.{
InlineDatum, Input, Output, OutputReference, ScriptPurpose, Spend, Transaction, InlineDatum, Input, Output, OutputReference, ScriptPurpose, Spend, Transaction,
} }