finished adidas v1.0

This commit is contained in:
Rens Pastoor
2025-06-05 15:19:10 +02:00
parent 8e5cfa974b
commit 34ebc83b3e
6 changed files with 81 additions and 37 deletions

View File

@@ -1,10 +1,16 @@
#include "channel.h"
#include <time.h>
// add here your implementation
void channel_init(){
#include <stdlib.h>
void channel_init(){
srand((unsigned int)time(NULL));
}
uint8_t channel_change_one_random_bit(uint8_t value){
// Generate random bit position (0-7)
uint8_t bit_position = rand() % 8;
uint8_t bit_mask = 1 << bit_position;
// XOR with the mask to flip the bit
// 01101010 with mask 00000100 becomes 01101110
return value ^ bit_mask;
}