finished adidas v1.0
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user